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

[Temporal] Add PlainDate(Time)?.(compare|prototype.equals)

Also add AO CalendarEquals, CompareISODateTime

Remove Isolate from CompareISODate argument
Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal.plaindate.compare
https://tc39.es/proposal-temporal/#sec-temporal.plaindate.prototype.equals
https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.compare
https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.equals
https://tc39.es/proposal-temporal/#sec-temporal-calendarequals
https://tc39.es/proposal-temporal/#sec-temporal-compareisodatetime

Bug: v8:11544
Change-Id: I5505c7923e3c1f76d44e292135b489ea20fbf13c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3534458Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80787}
parent 978506c3
......@@ -38,8 +38,6 @@ namespace internal {
JSTemporal##T::NowISO(isolate, args.atOrUndefined(isolate, 1))); \
}
/* Temporal #sec-temporal.plaindate.compare */
TO_BE_IMPLEMENTED(TemporalPlainDateCompare)
/* Temporal #sec-temporal.plaindate.prototype.add */
TO_BE_IMPLEMENTED(TemporalPlainDatePrototypeAdd)
/* Temporal #sec-temporal.plaindate.prototype.substract */
......@@ -48,8 +46,6 @@ TO_BE_IMPLEMENTED(TemporalPlainDatePrototypeSubtract)
TO_BE_IMPLEMENTED(TemporalPlainDatePrototypeUntil)
/* Temporal #sec-temporal.plaindate.prototype.since */
TO_BE_IMPLEMENTED(TemporalPlainDatePrototypeSince)
/* Temporal #sec-temporal.plaindate.prototype.equals */
TO_BE_IMPLEMENTED(TemporalPlainDatePrototypeEquals)
/* Temporal.PlaneTime */
/* Temporal #sec-temporal.plaintime.prototype.add */
......@@ -68,8 +64,6 @@ TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeToLocaleString)
TO_BE_IMPLEMENTED(TemporalPlainTimePrototypeToString)
/* Temporal.PlaneDateTime */
/* Temporal #sec-temporal.plaindatetime.compare */
TO_BE_IMPLEMENTED(TemporalPlainDateTimeCompare)
/* Temporal #sec-temporal.plaindatetime.prototype.add */
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeAdd)
/* Temporal #sec-temporal.plaindatetime.prototype.subtract */
......@@ -80,8 +74,6 @@ TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeUntil)
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeSince)
/* Temporal #sec-temporal.plaindatetime.prototype.round */
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeRound)
/* Temporal #sec-temporal.plaindatetime.prototype.equals */
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeEquals)
/* Temporal #sec-temporal.plaindatetime.prototype.tolocalestring */
TO_BE_IMPLEMENTED(TemporalPlainDateTimePrototypeToLocaleString)
/* Temporal #sec-temporal.plaindatetime.prototype.tostring */
......@@ -368,6 +360,7 @@ BUILTIN(TemporalPlainDateConstructor) {
args.atOrUndefined(isolate, 4))); // calendar_like
}
TEMPORAL_METHOD2(PlainDate, From)
TEMPORAL_METHOD2(PlainDate, Compare)
TEMPORAL_GET(PlainDate, Calendar, calendar)
TEMPORAL_GET_BY_FORWARD_CALENDAR(PlainDate, Year, year)
TEMPORAL_GET_BY_FORWARD_CALENDAR(PlainDate, Month, month)
......@@ -388,6 +381,7 @@ TEMPORAL_PROTOTYPE_METHOD2(PlainDate, With, with)
TEMPORAL_PROTOTYPE_METHOD0(PlainDate, GetISOFields, getISOFields)
TEMPORAL_PROTOTYPE_METHOD1(PlainDate, ToPlainDateTime, toPlainDateTime)
TEMPORAL_PROTOTYPE_METHOD1(PlainDate, ToZonedDateTime, toZonedDateTime)
TEMPORAL_PROTOTYPE_METHOD1(PlainDate, Equals, equals)
TEMPORAL_VALUE_OF(PlainDate)
TEMPORAL_PROTOTYPE_METHOD0(PlainDate, ToJSON, toJSON)
TEMPORAL_PROTOTYPE_METHOD2(PlainDate, ToLocaleString, toLocaleString)
......@@ -463,6 +457,8 @@ TEMPORAL_GET_SMI(PlainDateTime, Millisecond, iso_millisecond)
TEMPORAL_GET_SMI(PlainDateTime, Microsecond, iso_microsecond)
TEMPORAL_GET_SMI(PlainDateTime, Nanosecond, iso_nanosecond)
TEMPORAL_METHOD2(PlainDateTime, From)
TEMPORAL_METHOD2(PlainDateTime, Compare)
TEMPORAL_PROTOTYPE_METHOD1(PlainDateTime, Equals, equals)
TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, ToPlainYearMonth, toPlainYearMonth)
TEMPORAL_PROTOTYPE_METHOD0(PlainDateTime, ToPlainMonthDay, toPlainMonthDay)
TEMPORAL_PROTOTYPE_METHOD2(PlainDateTime, ToZonedDateTime, toZonedDateTime)
......
This diff is collapsed.
......@@ -261,6 +261,16 @@ class JSTemporalPlainDate
Handle<Object> iso_month, Handle<Object> iso_day,
Handle<Object> calendar_like);
// #sec-temporal.plaindate.compare
V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> Compare(Isolate* isolate,
Handle<Object> one,
Handle<Object> two);
// #sec-temporal.plaindate.prototype.equals
V8_WARN_UNUSED_RESULT static MaybeHandle<Oddball> Equals(
Isolate* isolate, Handle<JSTemporalPlainDate> plain_date,
Handle<Object> other);
// #sec-temporal.plaindate.prototype.withcalendar
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDate> WithCalendar(
Isolate* isolate, Handle<JSTemporalPlainDate> plain_date,
......@@ -356,6 +366,16 @@ class JSTemporalPlainDateTime
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDateTime> From(
Isolate* isolate, Handle<Object> item, Handle<Object> options);
// #sec-temporal.plaindatetime.compare
V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> Compare(Isolate* isolate,
Handle<Object> one,
Handle<Object> two);
// #sec-temporal.plaindatetime.prototype.equals
V8_WARN_UNUSED_RESULT static MaybeHandle<Oddball> Equals(
Isolate* isolate, Handle<JSTemporalPlainDateTime> plain_date,
Handle<Object> other);
// #sec-temporal.plaindatetime.prototype.toplainyearmonth
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainYearMonth>
ToPlainYearMonth(Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time);
......
......@@ -60,11 +60,7 @@
'temporal/instant-to-json': [FAIL],
'temporal/instant-toJSON': [FAIL],
'temporal/plain-date-add': [FAIL],
'temporal/plain-date-compare': [FAIL],
'temporal/plain-date-equals': [FAIL],
'temporal/plain-date-time-add': [FAIL],
'temporal/plain-date-time-compare': [FAIL],
'temporal/plain-date-time-equals': [FAIL],
'temporal/plain-date-time-subtract': [FAIL],
'temporal/plain-date-time-to-json': [FAIL],
'temporal/plain-date-to-plain-date-time': [FAIL],
......
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