|
@@ -95,7 +95,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::calendar_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return zonedDateTime.[[Calendar]].
|
|
|
return Value(&zoned_date_time->calendar());
|
|
@@ -106,7 +106,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::time_zone_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return zonedDateTime.[[TimeZone]].
|
|
|
return Value(&zoned_date_time->time_zone());
|
|
@@ -117,7 +117,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::year_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -140,7 +140,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::month_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -163,7 +163,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::month_code_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -186,7 +186,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::day_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -209,7 +209,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::hour_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -232,7 +232,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::minute_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -255,7 +255,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::second_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -278,7 +278,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::millisecond_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -301,7 +301,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::microsecond_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -324,7 +324,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::nanosecond_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -347,7 +347,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::epoch_seconds_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let ns be zonedDateTime.[[Nanoseconds]].
|
|
|
auto& ns = zoned_date_time->nanoseconds();
|
|
@@ -364,7 +364,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::epoch_milliseconds_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let ns be zonedDateTime.[[Nanoseconds]].
|
|
|
auto& ns = zoned_date_time->nanoseconds();
|
|
@@ -381,7 +381,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::epoch_microseconds_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let ns be zonedDateTime.[[Nanoseconds]].
|
|
|
auto& ns = zoned_date_time->nanoseconds();
|
|
@@ -398,7 +398,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::epoch_nanoseconds_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return zonedDateTime.[[Nanoseconds]].
|
|
|
return &zoned_date_time->nanoseconds();
|
|
@@ -409,7 +409,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::day_of_week_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -432,7 +432,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::day_of_year_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -455,7 +455,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::week_of_year_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -478,7 +478,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::hours_in_day_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -529,7 +529,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::days_in_week_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -552,7 +552,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::days_in_month_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -575,7 +575,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::days_in_year_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -598,7 +598,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::months_in_year_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -621,7 +621,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::in_leap_year_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -644,7 +644,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::offset_nanoseconds_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -661,7 +661,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::offset_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let instant be ! CreateTemporalInstant(zonedDateTime.[[Nanoseconds]]).
|
|
|
auto* instant = MUST(create_temporal_instant(vm, zoned_date_time->nanoseconds()));
|
|
@@ -676,7 +676,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::era_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -699,7 +699,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::era_year_getter)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -724,7 +724,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with)
|
|
|
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. If Type(temporalZonedDateTimeLike) is not Object, then
|
|
|
if (!temporal_zoned_date_time_like.is_object()) {
|
|
@@ -795,7 +795,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with_plain_time)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
PlainTime* plain_time = nullptr;
|
|
|
|
|
@@ -837,7 +837,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with_plain_date)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let plainDate be ? ToTemporalDate(plainDateLike).
|
|
|
auto* plain_date = TRY(to_temporal_date(vm, vm.argument(0)));
|
|
@@ -869,7 +869,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with_time_zone)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be ? ToTemporalTimeZone(timeZoneLike).
|
|
|
auto* time_zone = TRY(to_temporal_time_zone(vm, vm.argument(0)));
|
|
@@ -883,7 +883,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with_calendar)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let calendar be ? ToTemporalCalendar(calendarLike).
|
|
|
auto* calendar = TRY(to_temporal_calendar(vm, vm.argument(0)));
|
|
@@ -900,7 +900,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::add)
|
|
|
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return ? AddDurationToOrSubtractDurationFromZonedDateTime(add, zonedDateTime, temporalDurationLike, options).
|
|
|
return TRY(add_duration_to_or_subtract_duration_from_zoned_date_time(vm, ArithmeticOperation::Add, *zoned_date_time, temporal_duration_like, options));
|
|
@@ -914,7 +914,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::subtract)
|
|
|
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return ? AddDurationToOrSubtractDurationFromZonedDateTime(subtract, zonedDateTime, temporalDurationLike, options).
|
|
|
return TRY(add_duration_to_or_subtract_duration_from_zoned_date_time(vm, ArithmeticOperation::Subtract, *zoned_date_time, temporal_duration_like, options));
|
|
@@ -928,7 +928,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::until)
|
|
|
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return ? DifferenceTemporalZonedDateTime(until, zonedDateTime, other, options).
|
|
|
return TRY(difference_temporal_zoned_date_time(vm, DifferenceOperation::Until, *zoned_date_time, other, options));
|
|
@@ -942,7 +942,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::since)
|
|
|
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return ? DifferenceTemporalZonedDateTime(since, zonedDateTime, other, options).
|
|
|
return TRY(difference_temporal_zoned_date_time(vm, DifferenceOperation::Since, *zoned_date_time, other, options));
|
|
@@ -955,7 +955,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::round)
|
|
|
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. If roundTo is undefined, then
|
|
|
if (vm.argument(0).is_undefined()) {
|
|
@@ -1044,7 +1044,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::equals)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Set other to ? ToTemporalZonedDateTime(other).
|
|
|
auto* other = TRY(to_temporal_zoned_date_time(vm, vm.argument(0)));
|
|
@@ -1066,7 +1066,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_string)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Set options to ? GetOptionsObject(options).
|
|
|
auto* options = TRY(get_options_object(vm, vm.argument(0)));
|
|
@@ -1096,7 +1096,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_locale_string)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return ? TemporalZonedDateTimeToString(zonedDateTime, "auto", "auto", "auto", "auto").
|
|
|
return js_string(vm, TRY(temporal_zoned_date_time_to_string(vm, *zoned_date_time, "auto"sv, "auto"sv, "auto"sv, "auto"sv)));
|
|
@@ -1107,7 +1107,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_json)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return ? TemporalZonedDateTimeToString(zonedDateTime, "auto", "auto", "auto", "auto").
|
|
|
return js_string(vm, TRY(temporal_zoned_date_time_to_string(vm, *zoned_date_time, "auto"sv, "auto"sv, "auto"sv, "auto"sv)));
|
|
@@ -1125,7 +1125,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::start_of_day)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -1154,7 +1154,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_instant)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Return ! CreateTemporalInstant(zonedDateTime.[[Nanoseconds]]).
|
|
|
return MUST(create_temporal_instant(vm, zoned_date_time->nanoseconds()));
|
|
@@ -1165,7 +1165,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_plain_date)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -1188,7 +1188,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_plain_time)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -1211,7 +1211,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_plain_date_time)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -1228,7 +1228,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_plain_year_month)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -1257,7 +1257,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_plain_month_day)
|
|
|
{
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let timeZone be zonedDateTime.[[TimeZone]].
|
|
|
auto& time_zone = zoned_date_time->time_zone();
|
|
@@ -1288,7 +1288,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::get_iso_fields)
|
|
|
|
|
|
// 1. Let zonedDateTime be the this value.
|
|
|
// 2. Perform ? RequireInternalSlot(zonedDateTime, [[InitializedTemporalZonedDateTime]]).
|
|
|
- auto* zoned_date_time = TRY(typed_this_object(global_object));
|
|
|
+ auto* zoned_date_time = TRY(typed_this_object(vm));
|
|
|
|
|
|
// 3. Let fields be OrdinaryObjectCreate(%Object.prototype%).
|
|
|
auto* fields = Object::create(realm, global_object.object_prototype());
|