Commit f5276225 authored by Frank Tang's avatar Frank Tang Committed by V8 LUCI CQ
parent e895b7af
......@@ -50,14 +50,6 @@ TO_BE_IMPLEMENTED(TemporalZonedDateTimePrototypeUntil)
/* Temporal #sec-temporal.zoneddatetime.prototype.since */
TO_BE_IMPLEMENTED(TemporalZonedDateTimePrototypeSince)
/* Temporal.Duration */
/* Temporal #sec-temporal.duration.compare */
TO_BE_IMPLEMENTED(TemporalDurationCompare)
/* Temporal #sec-temporal.duration.prototype.round */
TO_BE_IMPLEMENTED(TemporalDurationPrototypeRound)
/* Temporal #sec-temporal.duration.prototype.total */
TO_BE_IMPLEMENTED(TemporalDurationPrototypeTotal)
/* Temporal.Calendar */
/* Temporal #sec-temporal.calendar.prototype.weekofyear */
TO_BE_IMPLEMENTED(TemporalCalendarPrototypeWeekOfYear)
......@@ -562,6 +554,14 @@ BUILTIN(TemporalDurationConstructor) {
args.atOrUndefined(isolate, 9), // microseconds
args.atOrUndefined(isolate, 10))); // nanoseconds
}
BUILTIN(TemporalDurationCompare) {
HandleScope scope(isolate);
RETURN_RESULT_OR_FAILURE(isolate, JSTemporalDuration::Compare(
isolate, args.atOrUndefined(isolate, 1),
args.atOrUndefined(isolate, 2),
args.atOrUndefined(isolate, 3)));
}
TEMPORAL_METHOD1(Duration, From)
TEMPORAL_GET(Duration, Years, years)
TEMPORAL_GET(Duration, Months, months)
......@@ -573,6 +573,8 @@ TEMPORAL_GET(Duration, Seconds, seconds)
TEMPORAL_GET(Duration, Milliseconds, milliseconds)
TEMPORAL_GET(Duration, Microseconds, microseconds)
TEMPORAL_GET(Duration, Nanoseconds, nanoseconds)
TEMPORAL_PROTOTYPE_METHOD1(Duration, Round, round)
TEMPORAL_PROTOTYPE_METHOD1(Duration, Total, total)
TEMPORAL_PROTOTYPE_METHOD1(Duration, With, with)
TEMPORAL_PROTOTYPE_METHOD0(Duration, Sign, sign)
TEMPORAL_PROTOTYPE_METHOD0(Duration, Blank, blank)
......
This diff is collapsed.
......@@ -173,6 +173,12 @@ class JSTemporalDuration
Handle<Object> milliseconds, Handle<Object> microseconds,
Handle<Object> nanoseconds);
// #sec-temporal.duration.compare
V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> Compare(Isolate* isolate,
Handle<Object> one,
Handle<Object> two,
Handle<Object> options);
// #sec-temporal.duration.from
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> From(
Isolate* isolate, Handle<Object> item);
......@@ -203,6 +209,16 @@ class JSTemporalDuration
Isolate* isolate, Handle<JSTemporalDuration> duration,
Handle<Object> other, Handle<Object> options);
// #sec-temporal.duration.prototype.round
V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Round(
Isolate* isolate, Handle<JSTemporalDuration> duration,
Handle<Object> round_to_obj);
// #sec-temporal.duration.prototype.total
V8_WARN_UNUSED_RESULT static MaybeHandle<Object> Total(
Isolate* isolate, Handle<JSTemporalDuration> duration,
Handle<Object> total_of);
// #sec-temporal.duration.prototype.tojson
V8_WARN_UNUSED_RESULT static MaybeHandle<String> ToJSON(
Isolate* isolate, Handle<JSTemporalDuration> duration);
......
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