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

[Temporal] Add TimeZone.prototype.getPossibleInstantsFor

Also add the basic version of GetIANATimeZoneEpochValue AO which only
implement UTC. Verison to support other TimeZone will come later w/ intl
work which depends on ICU.

Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.timezone.prototype.getpossibleinstantsfor
https://tc39.es/proposal-temporal/#sec-temporal-getianatimezoneepochvalue

Bug: v8:11544
Change-Id: Ib603530d1c70f7a2b85691860a815d44b48eece2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3624980
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80406}
parent 187ecb8b
......@@ -280,8 +280,6 @@ TO_BE_IMPLEMENTED(TemporalPlainMonthDayPrototypeToPlainDate)
TO_BE_IMPLEMENTED(TemporalTimeZonePrototypeGetOffsetNanosecondsFor)
/* Temporal #sec-temporal.timezone.prototype.getoffsetstringfor */
TO_BE_IMPLEMENTED(TemporalTimeZonePrototypeGetOffsetStringFor)
/* Temporal #sec-temporal.timezone.prototype.getpossibleinstantsfor */
TO_BE_IMPLEMENTED(TemporalTimeZonePrototypeGetPossibleInstantsFor)
/* Temporal.Calendar */
/* Temporal #sec-temporal.calendar.prototype.weekofyear */
......@@ -807,6 +805,8 @@ BUILTIN(TemporalCalendarFrom) {
// TimeZone
TEMPORAL_CONSTRUCTOR1(TimeZone)
TEMPORAL_PROTOTYPE_METHOD2(TimeZone, GetInstantFor, getInstantFor)
TEMPORAL_PROTOTYPE_METHOD1(TimeZone, GetPossibleInstantsFor,
getPossibleInstantFor)
// #sec-get-temporal.timezone.prototype.id
BUILTIN(TemporalTimeZonePrototypeId) {
......
This diff is collapsed.
......@@ -423,6 +423,11 @@ class JSTemporalTimeZone
Isolate* isolate, Handle<JSTemporalTimeZone> time_zone,
Handle<Object> starting_point);
// #sec-temporal.timezone.prototype.getpossibleinstantsfor
V8_WARN_UNUSED_RESULT static MaybeHandle<JSArray> GetPossibleInstantsFor(
Isolate* isolate, Handle<JSTemporalTimeZone> time_zone,
Handle<Object> date_time);
// #sec-temporal.timezone.prototype.tostring
static MaybeHandle<Object> ToString(Isolate* isolate,
Handle<JSTemporalTimeZone> time_zone,
......@@ -440,6 +445,8 @@ class JSTemporalTimeZone
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(offset_sub_milliseconds)
int32_t time_zone_index() const;
static constexpr uint32_t kUTCTimeZoneIndex = 0;
int64_t offset_nanoseconds() const;
void set_offset_nanoseconds(int64_t offset_nanoseconds);
......
......@@ -1542,16 +1542,11 @@
'built-ins/Temporal/PlainYearMonth/prototype/with/subclassing-ignored': [FAIL],
'built-ins/Temporal/TimeZone/from/timezone-string-datetime': [SKIP],
'built-ins/Temporal/TimeZone/from/timezone-string-multiple-offsets': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-plaindate': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-zoneddatetime-balance-negative-time-units': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-zoneddatetime-negative-epochnanoseconds': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/balance-negative-time-units': [SKIP],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/calendar-fields-iterable': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/calendar-temporal-object': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/disambiguation-undefined': [SKIP],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/disambiguation-wrong-type': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/options-undefined': [SKIP],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/read-time-fields-before-datefromfields': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/balance-negative-time-units': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/disambiguation-undefined': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/options-undefined': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/argument-not-absolute': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/argument-zoneddatetime': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/branding': [FAIL],
......@@ -1574,20 +1569,8 @@
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/instant-string': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/instant-string-multiple-offsets': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/pre-epoch': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-not-datetime': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-plaindate': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-string-with-utc-designator': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-zoneddatetime-balance-negative-time-units': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-zoneddatetime-negative-epochnanoseconds': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-non-integer': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-not-callable': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-out-of-range': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-wrong-type': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/branding': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/calendar-fields-iterable': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/calendar-temporal-object': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/infinity-throws-rangeerror': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/read-time-fields-before-datefromfields': [FAIL],
'built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-getoffsetnanosecondsfor-non-integer': [FAIL],
'built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-getoffsetnanosecondsfor-not-callable': [FAIL],
'built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-getoffsetnanosecondsfor-out-of-range': [FAIL],
......@@ -2061,7 +2044,6 @@
'intl402/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/instant-string': [FAIL],
'intl402/Temporal/TimeZone/prototype/getOffsetStringFor/instant-string': [FAIL],
'intl402/Temporal/TimeZone/prototype/getPlainDateTimeFor/instant-string': [FAIL],
'intl402/Temporal/TimeZone/prototype/getPossibleInstantsFor/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/ZonedDateTime/compare/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/ZonedDateTime/from/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/ZonedDateTime/prototype/equals/infinity-throws-rangeerror': [FAIL],
......@@ -2795,17 +2777,13 @@
'built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-number': [FAIL],
'built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-wrong-type': [FAIL],
'built-ins/Temporal/PlainYearMonth/prototype/until/argument-wrong-type': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-number': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-number': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/argument-object-tostring': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/argument-wrong-type': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-number': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/instant-string-sub-minute-offset': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/limits': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-number': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-number': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-wrong-type': [FAIL],
'built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-wrong-type': [FAIL],
'built-ins/Temporal/ZonedDateTime/calendar-number': [FAIL],
'built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-number': [FAIL],
'built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-wrong-type': [FAIL],
......
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