summaryrefslogtreecommitdiffstats
path: root/js/src/builtin/temporal/PlainTime.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/builtin/temporal/PlainTime.h
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-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/PlainTime.h')
-rw-r--r--js/src/builtin/temporal/PlainTime.h31
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 */