[Temporal] Implement Temporal int getters
get Temporal.Plain*Time.prototype.(hour|minute|*second) Bug: v8:11544 Change-Id: I6de1304c1a920f8047d499e4e6dcedbd72ba07f7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3374073 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/main@{#78967}
This commit is contained in:
parent
c705272afe
commit
1288650e4e
@ -73,18 +73,6 @@ TO_BE_IMPLEMENTED(TemporalPlainDatePrototypeToJSON)
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimeFrom)
|
||||
/* Temporal #sec-temporal.plaintime.compare */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimeCompare)
|
||||
/* Temporal #sec-get-temporal.plaintime.prototype.hour */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeHour)
|
||||
/* Temporal #sec-get-temporal.plaintime.prototype.minute */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeMinute)
|
||||
/* Temporal #sec-get-temporal.plaintime.prototype.second */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeSecond)
|
||||
/* Temporal #sec-get-temporal.plaintime.prototype.millisecond */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeMillisecond)
|
||||
/* Temporal #sec-get-temporal.plaintime.prototype.microsecond */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeMicrosecond)
|
||||
/* Temporal #sec-get-temporal.plaintime.prototype.nanoseond */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeNanosecond)
|
||||
/* Temporal #sec-temporal.plaintime.prototype.add */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeAdd)
|
||||
/* Temporal #sec-temporal.plaintime.prototype.subtract */
|
||||
@ -113,18 +101,6 @@ TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeToJSON)
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimeFrom)
|
||||
/* Temporal #sec-temporal.plaindatetime.compare */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimeCompare)
|
||||
/* Temporal #sec-get-temporal.plaindatetime.prototype.hour */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeHour)
|
||||
/* Temporal #sec-get-temporal.plaindatetime.prototype.minute */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeMinute)
|
||||
/* Temporal #sec-get-temporal.plaindatetime.prototype.second */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeSecond)
|
||||
/* Temporal #sec-get-temporal.plaindatetime.prototype.millisecond */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeMillisecond)
|
||||
/* Temporal #sec-get-temporal.plaindatetime.prototype.microsecond */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeMicrosecond)
|
||||
/* Temporal #sec-get-temporal.plaindatetime.prototype.nanosecond */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeNanosecond)
|
||||
/* Temporal #sec-temporal.plaindatetime.prototype.with */
|
||||
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeWith)
|
||||
/* Temporal #sec-temporal.plaindatetime.prototype.withplainTime */
|
||||
@ -495,6 +471,14 @@ TO_BE_IMPLEMENTED(TemporalZonedDateTimePrototypeToLocaleString)
|
||||
".prototype.compare for comparison."))); \
|
||||
}
|
||||
|
||||
#define TEMPORAL_GET_SMI(T, METHOD, field) \
|
||||
BUILTIN(Temporal##T##Prototype##METHOD) { \
|
||||
HandleScope scope(isolate); \
|
||||
const char* method = "get Temporal." #T ".prototype." #field; \
|
||||
CHECK_RECEIVER(JSTemporal##T, obj, method); \
|
||||
return Smi::FromInt(obj->field()); \
|
||||
}
|
||||
|
||||
#define TEMPORAL_GET(T, METHOD, field) \
|
||||
BUILTIN(Temporal##T##Prototype##METHOD) { \
|
||||
HandleScope scope(isolate); \
|
||||
@ -599,6 +583,12 @@ BUILTIN(TemporalPlainTimeConstructor) {
|
||||
args.atOrUndefined(isolate, 6))); // nanosecond
|
||||
}
|
||||
TEMPORAL_GET(PlainTime, Calendar, calendar)
|
||||
TEMPORAL_GET_SMI(PlainTime, Hour, iso_hour)
|
||||
TEMPORAL_GET_SMI(PlainTime, Minute, iso_minute)
|
||||
TEMPORAL_GET_SMI(PlainTime, Second, iso_second)
|
||||
TEMPORAL_GET_SMI(PlainTime, Millisecond, iso_millisecond)
|
||||
TEMPORAL_GET_SMI(PlainTime, Microsecond, iso_microsecond)
|
||||
TEMPORAL_GET_SMI(PlainTime, Nanosecond, iso_nanosecond)
|
||||
TEMPORAL_PROTOTYPE_METHOD0(PlainTime, GetISOFields, getISOFields)
|
||||
TEMPORAL_VALUE_OF(PlainTime)
|
||||
|
||||
@ -634,6 +624,12 @@ TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD(PlainDateTime, MonthsInYear,
|
||||
monthsInYear)
|
||||
TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD(PlainDateTime, InLeapYear, inLeapYear)
|
||||
TEMPORAL_PROTOTYPE_METHOD1(PlainDateTime, WithCalendar, withCalendar)
|
||||
TEMPORAL_GET_SMI(PlainDateTime, Hour, iso_hour)
|
||||
TEMPORAL_GET_SMI(PlainDateTime, Minute, iso_minute)
|
||||
TEMPORAL_GET_SMI(PlainDateTime, Second, iso_second)
|
||||
TEMPORAL_GET_SMI(PlainDateTime, Millisecond, iso_millisecond)
|
||||
TEMPORAL_GET_SMI(PlainDateTime, Microsecond, iso_microsecond)
|
||||
TEMPORAL_GET_SMI(PlainDateTime, Nanosecond, iso_nanosecond)
|
||||
TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, GetISOFields, getISOFields)
|
||||
TEMPORAL_VALUE_OF(PlainDateTime)
|
||||
|
||||
|
@ -89,12 +89,6 @@
|
||||
'temporal/plain-date-time-compare': [FAIL],
|
||||
'temporal/plain-date-time-equals': [FAIL],
|
||||
'temporal/plain-date-time-from': [FAIL],
|
||||
'temporal/plain-date-time-get-hour': [FAIL],
|
||||
'temporal/plain-date-time-get-microsecond': [FAIL],
|
||||
'temporal/plain-date-time-get-millisecond': [FAIL],
|
||||
'temporal/plain-date-time-get-minute': [FAIL],
|
||||
'temporal/plain-date-time-get-nanosecond': [FAIL],
|
||||
'temporal/plain-date-time-get-second': [FAIL],
|
||||
'temporal/plain-date-time-subtract': [FAIL],
|
||||
'temporal/plain-date-time-to-json': [FAIL],
|
||||
'temporal/plain-date-time-to-plain-date': [FAIL],
|
||||
|
@ -1305,11 +1305,6 @@
|
||||
'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/hour-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/microsecond-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/millisecond-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/minute-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/nanosecond-undefined': [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-string': [FAIL],
|
||||
@ -1339,11 +1334,6 @@
|
||||
'built-ins/Temporal/PlainDateTime/prototype/equals/calendar-temporal-object': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/equals/infinity-throws-rangeerror': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/equals/read-time-fields-before-datefromfields': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/hour/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/microsecond/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/millisecond/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/minute/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/nanosecond/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/round/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/round/roundingincrement-nan': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/round/roundingincrement-non-integer': [FAIL],
|
||||
@ -1359,7 +1349,6 @@
|
||||
'built-ins/Temporal/PlainDateTime/prototype/round/smallestunit-string-shorthand': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/round/smallestunit-wrong-type': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/round/subclassing-ignored': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/second/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/since/argument-plaindate': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/since/argument-string-with-utc-designator': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/since/argument-zoneddatetime-balance-negative-time-units': [FAIL],
|
||||
@ -1498,7 +1487,6 @@
|
||||
'built-ins/Temporal/PlainDateTime/prototype/with/calendar-fields-iterable': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/with/calendar-merge-fields-returns-primitive': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/withCalendar/missing-argument': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/withCalendar/subclassing-ignored': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/with/copies-merge-fields-object': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/with/infinity-throws-rangeerror': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/with/options-undefined': [FAIL],
|
||||
@ -1531,7 +1519,6 @@
|
||||
'built-ins/Temporal/PlainDateTime/prototype/withPlainTime/time-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/with/read-time-fields-before-datefromfields': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/prototype/with/subclassing-ignored': [FAIL],
|
||||
'built-ins/Temporal/PlainDateTime/second-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainMonthDay/basic': [FAIL],
|
||||
'built-ins/Temporal/PlainMonthDay/from/argument-string-with-utc-designator': [FAIL],
|
||||
'built-ins/Temporal/PlainMonthDay/from/calendar-fields-iterable': [FAIL],
|
||||
@ -1595,7 +1582,6 @@
|
||||
'built-ins/Temporal/PlainMonthDay/prototype/with/overflow-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainMonthDay/prototype/with/overflow-wrong-type': [FAIL],
|
||||
'built-ins/Temporal/PlainMonthDay/prototype/with/subclassing-ignored': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/basic': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/compare/argument-string-with-utc-designator': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/compare/argument-zoneddatetime-negative-epochnanoseconds': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/compare/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-non-integer': [FAIL],
|
||||
@ -1621,11 +1607,6 @@
|
||||
'built-ins/Temporal/PlainTime/from/overflow-wrong-type': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/from/plaintime-propertybag-no-time-units': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/from/subclassing-ignored': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/hour-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/microsecond-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/millisecond-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/minute-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/nanosecond-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/add/argument-not-object': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/add/argument-string': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/add/argument-string-negative-fractional-units': [FAIL],
|
||||
@ -1647,11 +1628,6 @@
|
||||
'built-ins/Temporal/PlainTime/prototype/equals/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/equals/calendar-temporal-object': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/equals/plaintime-propertybag-no-time-units': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/hour/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/microsecond/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/millisecond/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/minute/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/nanosecond/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/round/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/round/roundingincrement-nan': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/round/roundingincrement-non-integer': [FAIL],
|
||||
@ -1667,7 +1643,6 @@
|
||||
'built-ins/Temporal/PlainTime/prototype/round/smallestunit-string-shorthand': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/round/smallestunit-wrong-type': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/round/subclassing-ignored': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/second/branding': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/since/argument-string-with-utc-designator': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/since/argument-zoneddatetime-balance-negative-time-units': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/since/argument-zoneddatetime-negative-epochnanoseconds': [FAIL],
|
||||
@ -1797,7 +1772,6 @@
|
||||
'built-ins/Temporal/PlainTime/prototype/with/overflow-wrong-type': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/with/plaintimelike-invalid': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/prototype/with/subclassing-ignored': [FAIL],
|
||||
'built-ins/Temporal/PlainTime/second-undefined': [FAIL],
|
||||
'built-ins/Temporal/PlainYearMonth/compare/argument-string-with-utc-designator': [FAIL],
|
||||
'built-ins/Temporal/PlainYearMonth/compare/calendar-fields-iterable': [FAIL],
|
||||
'built-ins/Temporal/PlainYearMonth/compare/calendar-temporal-object': [FAIL],
|
||||
|
Loading…
Reference in New Issue
Block a user