mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:37:35 +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:
parent
4a30446999
commit
ca038c1a4e
2 changed files with 4 additions and 4 deletions
|
@ -73,8 +73,8 @@ JS_DEFINE_NATIVE_FUNCTION(CalendarPrototype::id_getter)
|
|||
// 2. Perform ? RequireInternalSlot(calendar, [[InitializedTemporalCalendar]]).
|
||||
auto* calendar = TRY(typed_this_object(vm));
|
||||
|
||||
// 3. Return ? ToString(calendar).
|
||||
return { js_string(vm, TRY(Value(calendar).to_string(vm))) };
|
||||
// 3. Return calendar.[[Identifier]].
|
||||
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
|
||||
|
|
|
@ -52,8 +52,8 @@ JS_DEFINE_NATIVE_FUNCTION(TimeZonePrototype::id_getter)
|
|||
// 2. Perform ? RequireInternalSlot(timeZone, [[InitializedTemporalTimeZone]]).
|
||||
auto* time_zone = TRY(typed_this_object(vm));
|
||||
|
||||
// 3. Return ? ToString(timeZone).
|
||||
return js_string(vm, TRY(Value(time_zone).to_string(vm)));
|
||||
// 3. Return timeZone.[[Identifier]].
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue