Commit 5bc20acb authored by Frank Tang's avatar Frank Tang Committed by V8 LUCI CQ

[Temporal] Add since/until to PlainDateTime and ZonedDateTime

Also add AOs: DifferenceTemporalPlainDateTime, DifferenceTemporalZonedDateTime,

Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.since
https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.until
https://tc39.es/proposal-temporal/#sec-temporal.zoneddatetime.prototype.since
https://tc39.es/proposal-temporal/#sec-temporal.zoneddatetime.prototype.until
https://tc39.es/proposal-temporal/#sec-temporal-differencetemporalplaindatetime
https://tc39.es/proposal-temporal/#sec-temporal-differencetemporalzoneddatetime

split from cl/3750098

Bug: v8:11544
Change-Id: I326d91a897fcd7e39de2fb2bfecfc5bfd920eb44
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3827313Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82447}
parent 6587dec0
......@@ -38,18 +38,6 @@ namespace internal {
JSTemporal##T::NowISO(isolate, args.atOrUndefined(isolate, 1))); \
}
/* Temporal.PlaneDateTime */
/* Temporal #sec-temporal.plaindatetime.prototype.until */
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeUntil)
/* Temporal #sec-temporal.plaindatetime.prototype.since */
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeSince)
/* Temporal.ZonedDateTime */
/* Temporal #sec-temporal.zoneddatetime.prototype.until */
TO_BE_IMPLEMENTED(TemporalZonedDateTimePrototypeUntil)
/* Temporal #sec-temporal.zoneddatetime.prototype.since */
TO_BE_IMPLEMENTED(TemporalZonedDateTimePrototypeSince)
/* Temporal.Calendar */
/* Temporal #sec-temporal.calendar.prototype.weekofyear */
TO_BE_IMPLEMENTED(TemporalCalendarPrototypeWeekOfYear)
......@@ -358,12 +346,14 @@ TEMPORAL_PROTOTYPE_METHOD1(PlainDateTime, WithPlainDate, withPlainDate)
TEMPORAL_PROTOTYPE_METHOD2(PlainDateTime, With, with)
TEMPORAL_PROTOTYPE_METHOD2(PlainDateTime, Add, add)
TEMPORAL_PROTOTYPE_METHOD1(PlainDateTime, Round, round)
TEMPORAL_PROTOTYPE_METHOD2(PlainDateTime, Since, since)
TEMPORAL_PROTOTYPE_METHOD2(PlainDateTime, Subtract, subtract)
TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, ToPlainDate, toPlainDate)
TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, ToPlainTime, toPlainTime)
TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, ToJSON, toJSON)
TEMPORAL_PROTOTYPE_METHOD2(PlainDateTime, ToLocaleString, toLocaleString)
TEMPORAL_PROTOTYPE_METHOD1(PlainDateTime, ToString, toString)
TEMPORAL_PROTOTYPE_METHOD2(PlainDateTime, Until, until)
TEMPORAL_VALUE_OF(PlainDateTime)
// PlainYearMonth
......@@ -527,6 +517,7 @@ TEMPORAL_PROTOTYPE_METHOD2(ZonedDateTime, Subtract, subtract)
TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, GetISOFields, getISOFields)
TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, OffsetNanoseconds, offsetNanoseconds)
TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, Offset, offset)
TEMPORAL_PROTOTYPE_METHOD2(ZonedDateTime, Since, since)
TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, StartOfDay, startOfDay)
TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, ToInstant, toInstant)
TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, ToJSON, toJSON)
......@@ -535,6 +526,7 @@ TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, ToPlainTime, toPlainTime)
TEMPORAL_PROTOTYPE_METHOD0(ZonedDateTime, ToPlainDateTime, toPlainDateTime)
TEMPORAL_PROTOTYPE_METHOD2(ZonedDateTime, ToLocaleString, toLocaleString)
TEMPORAL_PROTOTYPE_METHOD1(ZonedDateTime, ToString, toString)
TEMPORAL_PROTOTYPE_METHOD2(ZonedDateTime, Until, until)
TEMPORAL_VALUE_OF(ZonedDateTime)
// Duration
......
This diff is collapsed.
......@@ -531,6 +531,16 @@ class JSTemporalPlainDateTime
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
Handle<Object> round_to);
// #sec-temporal.plaindatetime.prototype.until
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Until(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
Handle<Object> other, Handle<Object> options);
// #sec-temporal.plaindatetime.prototype.since
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Since(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
Handle<Object> other, Handle<Object> options);
// #sec-temporal.plaindatetime.prototype.add
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDateTime> Add(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
......@@ -943,6 +953,16 @@ class JSTemporalZonedDateTime
Isolate* isolate, Handle<JSTemporalZonedDateTime> zoned_date_time,
Handle<Object> round_to);
// #sec-temporal.zoneddatetime.prototype.until
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Until(
Isolate* isolate, Handle<JSTemporalZonedDateTime> date_time,
Handle<Object> other, Handle<Object> options);
// #sec-temporal.zoneddatetime.prototype.since
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Since(
Isolate* isolate, Handle<JSTemporalZonedDateTime> date_time,
Handle<Object> other, Handle<Object> options);
// #sec-temporal.zoneddatetime.prototype.add
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalZonedDateTime> Add(
Isolate* isolate, Handle<JSTemporalZonedDateTime> zoned_date_time,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment