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

[Temporal] Add Duration.prototype.with

Also add AO: ToPartialDuration
Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal-topartialduration
https://tc39.es/proposal-temporal/#sec-temporal.duration.prototype.with

Bug: v8:11544
Change-Id: I43282f5285a3c884229445547add6db2cde4fbe4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3380102Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80767}
parent 2c228055
......@@ -132,8 +132,6 @@ TO_BE_IMPLEMENTED(TemporalZonedDateTimePrototypeToPlainDateTime)
/* Temporal.Duration */
/* Temporal #sec-temporal.duration.compare */
TO_BE_IMPLEMENTED(TemporalDurationCompare)
/* Temporal #sec-temporal.duration.prototype.with */
TO_BE_IMPLEMENTED(TemporalDurationPrototypeWith)
/* Temporal #sec-temporal.duration.prototype.add */
TO_BE_IMPLEMENTED(TemporalDurationPrototypeAdd)
/* Temporal #sec-temporal.duration.prototype.subtract */
......@@ -655,6 +653,7 @@ TEMPORAL_GET(Duration, Seconds, seconds)
TEMPORAL_GET(Duration, Milliseconds, milliseconds)
TEMPORAL_GET(Duration, Microseconds, microseconds)
TEMPORAL_GET(Duration, Nanoseconds, nanoseconds)
TEMPORAL_PROTOTYPE_METHOD1(Duration, With, with)
TEMPORAL_PROTOTYPE_METHOD0(Duration, Sign, sign)
TEMPORAL_PROTOTYPE_METHOD0(Duration, Blank, blank)
TEMPORAL_PROTOTYPE_METHOD0(Duration, Negated, negated)
......
This diff is collapsed.
......@@ -197,6 +197,11 @@ class JSTemporalDuration
V8_WARN_UNUSED_RESULT static MaybeHandle<String> ToJSON(
Isolate* isolate, Handle<JSTemporalDuration> duration);
// #sec-temporal.duration.prototype.with
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> With(
Isolate* isolate, Handle<JSTemporalDuration> duration,
Handle<Object> temporal_duration_like);
DECL_PRINTER(JSTemporalDuration)
TQ_OBJECT_CONSTRUCTORS(JSTemporalDuration)
......
......@@ -48,7 +48,6 @@
'temporal/calendar-week-of-year': [FAIL],
'temporal/duration-add': [FAIL],
'temporal/duration-to-json': [FAIL],
'temporal/duration-with': [FAIL],
'temporal/instant-add': [FAIL],
'temporal/instant-compare': [FAIL],
'temporal/instant-constructor': [FAIL],
......
......@@ -402,10 +402,6 @@
'built-ins/Temporal/Duration/prototype/total/read-time-fields-before-datefromfields': [FAIL],
'built-ins/Temporal/Duration/prototype/total/relativeto-string-zoneddatetime': [SKIP],
'built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-negative-epochnanoseconds': [SKIP],
'built-ins/Temporal/Duration/prototype/with/infinity-throws-rangeerror': [FAIL],
'built-ins/Temporal/Duration/prototype/with/negative-infinity-throws-rangeerror': [FAIL],
'built-ins/Temporal/Duration/prototype/with/non-integer-throws-rangeerror': [FAIL],
'built-ins/Temporal/Duration/prototype/with/order-of-operations': [FAIL],
'built-ins/Temporal/Calendar/prototype/dateUntil/argument-plaindatetime': [FAIL],
'built-ins/Temporal/Calendar/prototype/weekOfYear/argument-string-with-utc-designator': [FAIL],
'built-ins/Temporal/Calendar/prototype/weekOfYear/argument-zoneddatetime-timezone-getoffsetnanosecondsfor-non-integer': [FAIL],
......@@ -550,8 +546,6 @@
'built-ins/Temporal/Duration/prototype/total/unit-plurals-accepted-string': [FAIL],
'built-ins/Temporal/Duration/prototype/total/unit-string-shorthand-string': [FAIL],
'built-ins/Temporal/Duration/prototype/total/unit-wrong-type': [FAIL],
'built-ins/Temporal/Duration/prototype/with/branding': [FAIL],
'built-ins/Temporal/Duration/prototype/with/subclassing-ignored': [FAIL],
'built-ins/Temporal/Instant/compare/argument-zoneddatetime': [FAIL],
'built-ins/Temporal/Instant/compare/instant-string': [FAIL],
'built-ins/Temporal/Instant/compare/instant-string-multiple-offsets': [FAIL],
......@@ -1688,7 +1682,6 @@
'built-ins/Temporal/Duration/prototype/toString/fractionalseconddigits-exact-number-of-digits': [FAIL],
'built-ins/Temporal/Duration/prototype/total/calendar-possibly-required': [FAIL],
'built-ins/Temporal/Duration/prototype/total/year-zero': [FAIL],
'built-ins/Temporal/Duration/prototype/with/copy-properties-not-undefined': [FAIL],
'built-ins/Temporal/Instant/compare/year-zero': [FAIL],
'built-ins/Temporal/Instant/prototype/add/argument-string-fractional-units-rounding-mode': [FAIL],
'built-ins/Temporal/Instant/prototype/equals/year-zero': [FAIL],
......@@ -1922,12 +1915,6 @@
'built-ins/Temporal/Duration/compare/twenty-five-hour-day': [FAIL],
'built-ins/Temporal/Duration/prototype/toJSON/basic': [FAIL],
'built-ins/Temporal/Duration/prototype/toString/balance': [FAIL],
'built-ins/Temporal/Duration/prototype/with/all-negative': [FAIL],
'built-ins/Temporal/Duration/prototype/with/all-positive': [FAIL],
'built-ins/Temporal/Duration/prototype/with/argument-object-wrong-shape': [FAIL],
'built-ins/Temporal/Duration/prototype/with/argument-wrong-type': [FAIL],
'built-ins/Temporal/Duration/prototype/with/partial-positive': [FAIL],
'built-ins/Temporal/Duration/prototype/with/sign-conflict-throws-rangeerror': [FAIL],
'built-ins/Temporal/Instant/prototype/add/basic': [FAIL],
'built-ins/Temporal/Instant/prototype/add/disallowed-duration-units': [FAIL],
'built-ins/Temporal/Instant/prototype/subtract/basic': [FAIL],
......@@ -2153,10 +2140,6 @@
'built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-wrong-type': [FAIL],
'built-ins/Temporal/Duration/prototype/total/relativeto-wrong-type': [FAIL],
'built-ins/Temporal/Duration/prototype/total/timezone-wrong-type': [FAIL],
'built-ins/Temporal/Duration/prototype/with/argument-invalid-prop': [FAIL],
'built-ins/Temporal/Duration/prototype/with/argument-mixed-sign': [FAIL],
'built-ins/Temporal/Duration/prototype/with/argument-sign-prop': [FAIL],
'built-ins/Temporal/Duration/prototype/with/sign-replace': [FAIL],
'built-ins/Temporal/Instant/compare/argument-object-tostring': [FAIL],
'built-ins/Temporal/Instant/compare/argument-wrong-type': [FAIL],
'built-ins/Temporal/Instant/compare/instant-string-sub-minute-offset': [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