From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- js/src/builtin/temporal/Calendar.h | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'js/src/builtin/temporal/Calendar.h') diff --git a/js/src/builtin/temporal/Calendar.h b/js/src/builtin/temporal/Calendar.h index f80f528d83..dd06c11923 100644 --- a/js/src/builtin/temporal/Calendar.h +++ b/js/src/builtin/temporal/Calendar.h @@ -8,6 +8,7 @@ #define builtin_temporal_Calendar_h #include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" #include "mozilla/EnumSet.h" #include @@ -49,7 +50,7 @@ class CalendarObject : public NativeObject { * Calendar value, which is either a string containing a canonical calendar * identifier or an object. */ -class CalendarValue final { +class MOZ_STACK_CLASS CalendarValue final { JS::Value value_{}; public: @@ -126,7 +127,7 @@ enum class CalendarMethod { YearMonthFromFields, }; -class CalendarRecord { +class MOZ_STACK_CLASS CalendarRecord final { CalendarValue receiver_; // Null unless non-builtin calendar methods are used. @@ -190,6 +191,7 @@ class CalendarRecord { void trace(JSTracer* trc); }; +struct DateDuration; struct Duration; struct PlainDate; struct PlainDateTime; @@ -199,6 +201,7 @@ class PlainDateTimeObject; class PlainMonthDayObject; class PlainYearMonthObject; enum class CalendarOption; +enum class TemporalOverflow; enum class TemporalUnit; /** @@ -305,7 +308,7 @@ JSObject* CalendarMergeFields(JSContext* cx, */ Wrapped CalendarDateAdd( JSContext* cx, JS::Handle calendar, - JS::Handle> date, const Duration& duration); + JS::Handle> date, const DateDuration& duration); /** * CalendarDateAdd ( calendarRec, date, duration [ , options ] ) @@ -336,14 +339,14 @@ Wrapped CalendarDateAdd( * CalendarDateAdd ( calendarRec, date, duration [ , options ] ) */ bool CalendarDateAdd(JSContext* cx, JS::Handle calendar, - const PlainDate& date, const Duration& duration, + const PlainDate& date, const DateDuration& duration, PlainDate* result); /** * CalendarDateAdd ( calendarRec, date, duration [ , options ] ) */ bool CalendarDateAdd(JSContext* cx, JS::Handle calendar, - const PlainDate& date, const Duration& duration, + const PlainDate& date, const DateDuration& duration, JS::Handle options, PlainDate* result); /** @@ -351,7 +354,22 @@ bool CalendarDateAdd(JSContext* cx, JS::Handle calendar, */ bool CalendarDateAdd(JSContext* cx, JS::Handle calendar, JS::Handle> date, - const Duration& duration, PlainDate* result); + const DateDuration& duration, PlainDate* result); + +/** + * CalendarDateUntil ( calendarRec, one, two, options ) + */ +bool CalendarDateUntil(JSContext* cx, JS::Handle calendar, + const PlainDate& one, const PlainDate& two, + TemporalUnit largestUnit, DateDuration* result); + +/** + * CalendarDateUntil ( calendarRec, one, two, options ) + */ +bool CalendarDateUntil(JSContext* cx, JS::Handle calendar, + const PlainDate& one, const PlainDate& two, + TemporalUnit largestUnit, + JS::Handle options, DateDuration* result); /** * CalendarDateUntil ( calendarRec, one, two, options ) @@ -359,7 +377,7 @@ bool CalendarDateAdd(JSContext* cx, JS::Handle calendar, bool CalendarDateUntil(JSContext* cx, JS::Handle calendar, JS::Handle> one, JS::Handle> two, - JS::Handle options, Duration* result); + TemporalUnit largestUnit, DateDuration* result); /** * CalendarDateUntil ( calendarRec, one, two, options ) @@ -367,7 +385,8 @@ bool CalendarDateUntil(JSContext* cx, JS::Handle calendar, bool CalendarDateUntil(JSContext* cx, JS::Handle calendar, JS::Handle> one, JS::Handle> two, - TemporalUnit largestUnit, Duration* result); + TemporalUnit largestUnit, + JS::Handle options, DateDuration* result); /** * CalendarYear ( calendar, dateLike ) -- cgit v1.2.3