diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /js/src/builtin/temporal/PlainTime.h | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/builtin/temporal/PlainTime.h')
-rw-r--r-- | js/src/builtin/temporal/PlainTime.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/js/src/builtin/temporal/PlainTime.h b/js/src/builtin/temporal/PlainTime.h index b6da469913..0614430e46 100644 --- a/js/src/builtin/temporal/PlainTime.h +++ b/js/src/builtin/temporal/PlainTime.h @@ -112,19 +112,24 @@ PlainTimeObject* CreateTemporalTime(JSContext* cx, const PlainTime& time); bool ToTemporalTime(JSContext* cx, JS::Handle<JS::Value> item, PlainTime* result); +struct AddedTime { + int32_t days = 0; + PlainTime time; +}; + /** - * AddTime ( hour, minute, second, millisecond, microsecond, nanosecond, hours, - * minutes, seconds, milliseconds, microseconds, nanoseconds ) + * AddTime ( hour, minute, second, millisecond, microsecond, nanosecond, norm ) */ -bool AddTime(JSContext* cx, const PlainTime& time, const Duration& duration, - PlainTime* result, double* daysResult); +AddedTime AddTime(const PlainTime& time, + const NormalizedTimeDuration& duration); /** * DifferenceTime ( h1, min1, s1, ms1, mus1, ns1, h2, min2, s2, ms2, mus2, ns2 ) */ -TimeDuration DifferenceTime(const PlainTime& time1, const PlainTime& time2); +NormalizedTimeDuration DifferenceTime(const PlainTime& time1, + const PlainTime& time2); -struct TimeRecord final { +struct TemporalTimeLike final { double hour = 0; double minute = 0; double second = 0; @@ -137,13 +142,13 @@ struct TimeRecord final { * ToTemporalTimeRecord ( temporalTimeLike [ , completeness ] ) */ bool ToTemporalTimeRecord(JSContext* cx, JS::Handle<JSObject*> temporalTimeLike, - TimeRecord* result); + TemporalTimeLike* result); /** * RegulateTime ( hour, minute, second, millisecond, microsecond, nanosecond, * overflow ) */ -bool RegulateTime(JSContext* cx, const TimeRecord& time, +bool RegulateTime(JSContext* cx, const TemporalTimeLike& time, TemporalOverflow overflow, PlainTime* result); /** @@ -169,19 +174,11 @@ struct RoundedTime final { /** * RoundTime ( hour, minute, second, millisecond, microsecond, nanosecond, - * increment, unit, roundingMode [ , dayLengthNs ] ) + * increment, unit, roundingMode ) */ RoundedTime RoundTime(const PlainTime& time, Increment increment, TemporalUnit unit, TemporalRoundingMode roundingMode); -/** - * RoundTime ( hour, minute, second, millisecond, microsecond, nanosecond, - * increment, unit, roundingMode [ , dayLengthNs ] ) - */ -RoundedTime RoundTime(const PlainTime& time, Increment increment, - TemporalUnit unit, TemporalRoundingMode roundingMode, - const InstantSpan& dayLengthNs); - } /* namespace js::temporal */ #endif /* builtin_temporal_PlainTime_h */ |