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

[Temporal] Add PlainDateTime.from

Also add AOs: ToTemporalDateTime, ParseTemporalDateTimeString,
InterpretTemporalDateTimeFields

Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.from
https://tc39.es/proposal-temporal/#sec-temporal-totemporaldatetime
https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldatetimestring
https://tc39.es/proposal-temporal/#sec-temporal-interprettemporaldatetimefields

Bug: v8:11544
Change-Id: I3cf5c7c0f876dd8f384d62a47d7b24d8780bf03f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3538667Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80240}
parent 10807c9f
...@@ -92,8 +92,6 @@ TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeToString) ...@@ -92,8 +92,6 @@ TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeToString)
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeToJSON) TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeToJSON)
/* Temporal.PlaneDateTime */ /* Temporal.PlaneDateTime */
/* Temporal #sec-temporal.plaindatetime.from */
TO_BE_IMPLEMENTED(TemporalPlainDateTimeFrom)
/* Temporal #sec-temporal.plaindatetime.compare */ /* Temporal #sec-temporal.plaindatetime.compare */
TO_BE_IMPLEMENTED(TemporalPlainDateTimeCompare) TO_BE_IMPLEMENTED(TemporalPlainDateTimeCompare)
/* Temporal #sec-temporal.plaindatetime.prototype.with */ /* Temporal #sec-temporal.plaindatetime.prototype.with */
...@@ -623,6 +621,7 @@ TEMPORAL_GET_SMI(PlainDateTime, Second, iso_second) ...@@ -623,6 +621,7 @@ TEMPORAL_GET_SMI(PlainDateTime, Second, iso_second)
TEMPORAL_GET_SMI(PlainDateTime, Millisecond, iso_millisecond) TEMPORAL_GET_SMI(PlainDateTime, Millisecond, iso_millisecond)
TEMPORAL_GET_SMI(PlainDateTime, Microsecond, iso_microsecond) TEMPORAL_GET_SMI(PlainDateTime, Microsecond, iso_microsecond)
TEMPORAL_GET_SMI(PlainDateTime, Nanosecond, iso_nanosecond) TEMPORAL_GET_SMI(PlainDateTime, Nanosecond, iso_nanosecond)
TEMPORAL_METHOD2(PlainDateTime, From)
TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, GetISOFields, getISOFields) TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, GetISOFields, getISOFields)
TEMPORAL_VALUE_OF(PlainDateTime) TEMPORAL_VALUE_OF(PlainDateTime)
......
This diff is collapsed.
...@@ -250,6 +250,10 @@ class JSTemporalPlainDateTime ...@@ -250,6 +250,10 @@ class JSTemporalPlainDateTime
WithCalendar(Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time, WithCalendar(Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time,
Handle<Object> calendar_like); Handle<Object> calendar_like);
// #sec-temporal.plaindatetime.from
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDateTime> From(
Isolate* isolate, Handle<Object> item, Handle<Object> options);
// #sec-temporal.plaindatetime.prototype.getisofields // #sec-temporal.plaindatetime.prototype.getisofields
V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields( V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields(
Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time); Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time);
......
...@@ -474,7 +474,6 @@ ...@@ -474,7 +474,6 @@
'built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day': [FAIL], 'built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day': [FAIL],
'built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day-need-constrain': [FAIL], 'built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day-need-constrain': [FAIL],
'built-ins/Temporal/Calendar/prototype/dateUntil/argument-plaindatetime': [FAIL], 'built-ins/Temporal/Calendar/prototype/dateUntil/argument-plaindatetime': [FAIL],
'built-ins/Temporal/Calendar/prototype/dateUntil/basic': [FAIL],
'built-ins/Temporal/Calendar/prototype/day/argument-string-with-utc-designator': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/argument-string-with-utc-designator': [FAIL],
'built-ins/Temporal/Calendar/prototype/day/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-non-integer': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-non-integer': [FAIL],
'built-ins/Temporal/Calendar/prototype/day/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-not-callable': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-not-callable': [FAIL],
...@@ -488,10 +487,6 @@ ...@@ -488,10 +487,6 @@
'built-ins/Temporal/Calendar/prototype/day/date-time': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/date-time': [FAIL],
'built-ins/Temporal/Calendar/prototype/day/infinity-throws-rangeerror': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/infinity-throws-rangeerror': [FAIL],
'built-ins/Temporal/Calendar/prototype/day/month-day': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/month-day': [FAIL],
'built-ins/Temporal/Calendar/prototype/dayOfWeek/basic': [FAIL],
'built-ins/Temporal/Calendar/prototype/dayOfYear/basic': [FAIL],
'built-ins/Temporal/Calendar/prototype/daysInMonth/basic': [FAIL],
'built-ins/Temporal/Calendar/prototype/daysInWeek/basic': [FAIL],
'built-ins/Temporal/Calendar/prototype/daysInYear/basic': [FAIL], 'built-ins/Temporal/Calendar/prototype/daysInYear/basic': [FAIL],
'built-ins/Temporal/Calendar/prototype/day/string': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/string': [FAIL],
'built-ins/Temporal/Calendar/prototype/day/throw-range-error-ToTemporalDate': [FAIL], 'built-ins/Temporal/Calendar/prototype/day/throw-range-error-ToTemporalDate': [FAIL],
...@@ -1062,23 +1057,13 @@ ...@@ -1062,23 +1057,13 @@
'built-ins/Temporal/PlainDateTime/compare/read-time-fields-before-datefromfields': [FAIL], 'built-ins/Temporal/PlainDateTime/compare/read-time-fields-before-datefromfields': [FAIL],
'built-ins/Temporal/PlainDateTime/compare/use-internal-slots': [FAIL], 'built-ins/Temporal/PlainDateTime/compare/use-internal-slots': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-plaindate': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-plaindate': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-with-utc-designator': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-balance-negative-time-units': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-balance-negative-time-units': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-negative-epochnanoseconds': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-negative-epochnanoseconds': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-non-integer': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-not-callable': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-out-of-range': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/from/calendar-fields-iterable': [FAIL],
'built-ins/Temporal/PlainDateTime/from/calendar-temporal-object': [FAIL],
'built-ins/Temporal/PlainDateTime/from/infinity-throws-rangeerror': [FAIL],
'built-ins/Temporal/PlainDateTime/from/options-undefined': [FAIL], 'built-ins/Temporal/PlainDateTime/from/options-undefined': [FAIL],
'built-ins/Temporal/PlainDateTime/from/order-of-operations': [FAIL], 'built-ins/Temporal/PlainDateTime/from/order-of-operations': [FAIL],
'built-ins/Temporal/PlainDateTime/from/overflow-invalid-string': [FAIL],
'built-ins/Temporal/PlainDateTime/from/overflow-undefined': [FAIL], 'built-ins/Temporal/PlainDateTime/from/overflow-undefined': [FAIL],
'built-ins/Temporal/PlainDateTime/from/overflow-wrong-type': [FAIL], 'built-ins/Temporal/PlainDateTime/from/overflow-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/from/parser': [FAIL], 'built-ins/Temporal/PlainDateTime/from/parser': [FAIL],
'built-ins/Temporal/PlainDateTime/from/read-time-fields-before-datefromfields': [FAIL],
'built-ins/Temporal/PlainDateTime/from/subclassing-ignored': [FAIL], 'built-ins/Temporal/PlainDateTime/from/subclassing-ignored': [FAIL],
'built-ins/Temporal/PlainDateTime/order-of-operations': [FAIL], 'built-ins/Temporal/PlainDateTime/order-of-operations': [FAIL],
'built-ins/Temporal/PlainDateTime/prototype/add/argument-not-object': [FAIL], 'built-ins/Temporal/PlainDateTime/prototype/add/argument-not-object': [FAIL],
...@@ -2206,7 +2191,6 @@ ...@@ -2206,7 +2191,6 @@
'intl402/Temporal/PlainDate/prototype/toLocaleString/timezone-getoffsetnanosecondsfor-not-callable': [FAIL], 'intl402/Temporal/PlainDate/prototype/toLocaleString/timezone-getoffsetnanosecondsfor-not-callable': [FAIL],
'intl402/Temporal/PlainDate/prototype/until/infinity-throws-rangeerror': [FAIL], 'intl402/Temporal/PlainDate/prototype/until/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/PlainDateTime/compare/infinity-throws-rangeerror': [FAIL], 'intl402/Temporal/PlainDateTime/compare/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/PlainDateTime/from/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/PlainDateTime/prototype/equals/infinity-throws-rangeerror': [FAIL], 'intl402/Temporal/PlainDateTime/prototype/equals/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/PlainDateTime/prototype/since/infinity-throws-rangeerror': [FAIL], 'intl402/Temporal/PlainDateTime/prototype/since/infinity-throws-rangeerror': [FAIL],
'intl402/Temporal/PlainDateTime/prototype/toLocaleString/locales-undefined': [FAIL], 'intl402/Temporal/PlainDateTime/prototype/toLocaleString/locales-undefined': [FAIL],
...@@ -2732,7 +2716,6 @@ ...@@ -2732,7 +2716,6 @@
'built-ins/Temporal/PlainDate/prototype/until/options-wrong-type': [FAIL], 'built-ins/Temporal/PlainDate/prototype/until/options-wrong-type': [FAIL],
'built-ins/Temporal/PlainDate/prototype/with/options-wrong-type': [FAIL], 'built-ins/Temporal/PlainDate/prototype/with/options-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/compare/calendar-ignored': [FAIL], 'built-ins/Temporal/PlainDateTime/compare/calendar-ignored': [FAIL],
'built-ins/Temporal/PlainDateTime/from/options-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/prototype/add/options-wrong-type': [FAIL], 'built-ins/Temporal/PlainDateTime/prototype/add/options-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/prototype/equals/calendar-checked': [FAIL], 'built-ins/Temporal/PlainDateTime/prototype/equals/calendar-checked': [FAIL],
'built-ins/Temporal/PlainDateTime/prototype/round/balance': [FAIL], 'built-ins/Temporal/PlainDateTime/prototype/round/balance': [FAIL],
...@@ -2977,21 +2960,17 @@ ...@@ -2977,21 +2960,17 @@
'built-ins/Temporal/PlainDateTime/compare/argument-wrong-type': [FAIL], 'built-ins/Temporal/PlainDateTime/compare/argument-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-number': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-number': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-object': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-object': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-object-month': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-plaindatetime': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-plaindatetime': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-number': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-number': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-wrong-type': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-comma-decimal-separator': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string-comma-decimal-separator': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-invalid': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-minus-sign': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string-minus-sign': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-offset': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string-offset': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-optional-data': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string-optional-data': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-out-of-range': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-subsecond': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string-subsecond': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-time-separators': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string-time-separators': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-string-timezone': [FAIL], 'built-ins/Temporal/PlainDateTime/from/argument-string-timezone': [FAIL],
'built-ins/Temporal/PlainDateTime/from/argument-wrong-type': [FAIL],
'built-ins/Temporal/PlainDateTime/from/leap-second': [FAIL], 'built-ins/Temporal/PlainDateTime/from/leap-second': [FAIL],
'built-ins/Temporal/PlainDateTime/from/limits': [FAIL], 'built-ins/Temporal/PlainDateTime/from/limits': [FAIL],
'built-ins/Temporal/PlainDateTime/from/overflow-default-constrain': [FAIL], 'built-ins/Temporal/PlainDateTime/from/overflow-default-constrain': [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