1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:07:45 +00:00

LibJS: Align Temporal.{Calendar,TimeZone} id getters with toString

This is a normative change in the Temporal spec.

See: 0bb391a
This commit is contained in:
Linus Groh 2022-12-01 15:17:05 +01:00
parent 4a30446999
commit ca038c1a4e
2 changed files with 4 additions and 4 deletions

View file

@ -73,8 +73,8 @@ JS_DEFINE_NATIVE_FUNCTION(CalendarPrototype::id_getter)
// 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]). // 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
auto* calendar = TRY(typed_this_object(vm)); auto* calendar = TRY(typed_this_object(vm));
// 3. Return ? ToString(calendar). // 3. Return calendar.[[Identifier]].
return { js_string(vm, TRY(Value(calendar).to_string(vm))) }; return { js_string(vm, calendar->identifier()) };
} }
// 12.4.4 Temporal.Calendar.prototype.dateFromFields ( fields [ , options ] ), https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.datefromfields // 12.4.4 Temporal.Calendar.prototype.dateFromFields ( fields [ , options ] ), https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.datefromfields

View file

@ -52,8 +52,8 @@ JS_DEFINE_NATIVE_FUNCTION(TimeZonePrototype::id_getter)
// 2. Perform ? RequireInternalSlot(timeZone, [[InitializedTemporalTimeZone]]). // 2. Perform ? RequireInternalSlot(timeZone, [[InitializedTemporalTimeZone]]).
auto* time_zone = TRY(typed_this_object(vm)); auto* time_zone = TRY(typed_this_object(vm));
// 3. Return ? ToString(timeZone). // 3. Return timeZone.[[Identifier]].
return js_string(vm, TRY(Value(time_zone).to_string(vm))); return js_string(vm, time_zone->identifier());
} }
// 11.4.4 Temporal.TimeZone.prototype.getOffsetNanosecondsFor ( instant ), https://tc39.es/proposal-temporal/#sec-temporal.timezone.prototype.getoffsetnanosecondsfor // 11.4.4 Temporal.TimeZone.prototype.getOffsetNanosecondsFor ( instant ), https://tc39.es/proposal-temporal/#sec-temporal.timezone.prototype.getoffsetnanosecondsfor