diff options
author | Linus Groh <mail@linusgroh.de> | 2022-03-10 16:52:25 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-03-10 23:20:39 +0100 |
commit | a496868ee52fbec42659bc62179364151b740ad4 (patch) | |
tree | 4c4debf2e1f5b85e8e156bf5224a70e7a19b47bb /Userland/Libraries/LibJS/Runtime/Temporal/Duration.h | |
parent | 64e43c89bcddbada8f3103398aa0a79b07abc8af (diff) | |
download | serenity-a496868ee52fbec42659bc62179364151b740ad4.zip |
LibJS: Create Duration Records with their own abstract operations
This is an editorial change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/387c405
- https://github.com/tc39/proposal-temporal/commit/b203e26
- https://github.com/tc39/proposal-temporal/commit/387c405
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/Duration.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/Duration.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h index 207bdb1dc7..620237bf3b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.h @@ -133,6 +133,12 @@ auto temporal_duration_like_properties = [](VM& vm) { }; }; +DurationRecord create_duration_record(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds); +ThrowCompletionOr<DurationRecord> create_duration_record(GlobalObject&, double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds); +DateDurationRecord create_date_duration_record(double years, double months, double weeks, double days); +ThrowCompletionOr<DateDurationRecord> create_date_duration_record(GlobalObject&, double years, double months, double weeks, double days); +TimeDurationRecord create_time_duration_record(double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds); +ThrowCompletionOr<TimeDurationRecord> create_time_duration_record(GlobalObject&, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds); ThrowCompletionOr<Duration*> to_temporal_duration(GlobalObject&, Value item); ThrowCompletionOr<DurationRecord> to_temporal_duration_record(GlobalObject&, Object const& temporal_duration_like); i8 duration_sign(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds); @@ -154,7 +160,7 @@ ThrowCompletionOr<DurationRecord> adjust_rounded_duration_days(GlobalObject& glo ThrowCompletionOr<DurationRecord> to_limited_temporal_duration(GlobalObject&, Value temporal_duration_like, Vector<StringView> const& disallowed_fields); String temporal_duration_to_string(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds, double nanoseconds, Variant<StringView, u8> const& precision); -// 7.5.19 DaysUntil ( earlier, later ), https://tc39.es/proposal-temporal/#sec-temporal-daysuntil +// 7.5.22 DaysUntil ( earlier, later ), https://tc39.es/proposal-temporal/#sec-temporal-daysuntil template<typename EarlierObjectType, typename LaterObjectType> double days_until(GlobalObject& global_object, EarlierObjectType& earlier, LaterObjectType& later) { |