diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/builtin/temporal/Instant.h | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/builtin/temporal/Instant.h')
-rw-r--r-- | js/src/builtin/temporal/Instant.h | 42 |
1 files changed, 13 insertions, 29 deletions
diff --git a/js/src/builtin/temporal/Instant.h b/js/src/builtin/temporal/Instant.h index edce677d10..9ad7f159db 100644 --- a/js/src/builtin/temporal/Instant.h +++ b/js/src/builtin/temporal/Instant.h @@ -69,15 +69,12 @@ bool IsValidEpochNanoseconds(const JS::BigInt* epochNanoseconds); */ bool IsValidEpochInstant(const Instant& instant); +#ifdef DEBUG /** * Return true if the input is within the valid instant span limits. */ bool IsValidInstantSpan(const InstantSpan& span); - -/** - * Return true if the input is within the valid instant span limits. - */ -bool IsValidInstantSpan(const JS::BigInt* nanoseconds); +#endif /** * Convert a BigInt to an instant. The input must be a valid epoch nanoseconds @@ -86,22 +83,11 @@ bool IsValidInstantSpan(const JS::BigInt* nanoseconds); Instant ToInstant(const JS::BigInt* epochNanoseconds); /** - * Convert a BigInt to an instant span. The input must be a valid epoch - * nanoseconds span value. - */ -InstantSpan ToInstantSpan(const JS::BigInt* nanoseconds); - -/** * Convert an instant to a BigInt. The input must be a valid epoch instant. */ JS::BigInt* ToEpochNanoseconds(JSContext* cx, const Instant& instant); /** - * Convert an instant span to a BigInt. The input must be a valid instant span. - */ -JS::BigInt* ToEpochNanoseconds(JSContext* cx, const InstantSpan& instant); - -/** * ToTemporalInstant ( item ) */ Wrapped<InstantObject*> ToTemporalInstant(JSContext* cx, @@ -134,25 +120,23 @@ Instant GetUTCEpochNanoseconds(const PlainDateTime& dateTime, /** * RoundTemporalInstant ( ns, increment, unit, roundingMode ) */ -bool RoundTemporalInstant(JSContext* cx, const Instant& ns, Increment increment, - TemporalUnit unit, TemporalRoundingMode roundingMode, - Instant* result); +Instant RoundTemporalInstant(const Instant& ns, Increment increment, + TemporalUnit unit, + TemporalRoundingMode roundingMode); /** - * AddInstant ( epochNanoseconds, hours, minutes, seconds, milliseconds, - * microseconds, nanoseconds ) + * AddInstant ( epochNanoseconds, norm ) */ -bool AddInstant(JSContext* cx, const Instant& instant, const Duration& duration, - Instant* result); +bool AddInstant(JSContext* cx, const Instant& instant, + const NormalizedTimeDuration& duration, Instant* result); /** - * DifferenceInstant ( ns1, ns2, roundingIncrement, smallestUnit, largestUnit, - * roundingMode ) + * DifferenceInstant ( ns1, ns2, roundingIncrement, smallestUnit, roundingMode ) */ -bool DifferenceInstant(JSContext* cx, const Instant& ns1, const Instant& ns2, - Increment roundingIncrement, TemporalUnit smallestUnit, - TemporalUnit largestUnit, - TemporalRoundingMode roundingMode, Duration* result); +NormalizedTimeDuration DifferenceInstant(const Instant& ns1, const Instant& ns2, + Increment roundingIncrement, + TemporalUnit smallestUnit, + TemporalRoundingMode roundingMode); } /* namespace js::temporal */ |