diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-01 15:17:05 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-12-02 02:04:13 +0100 |
commit | ca038c1a4ebbd6bc3cc5d6cb2dcac87f0254afe9 (patch) | |
tree | 9e0cb3b236979c231ff74c6a946f82452b3999fc /Userland/Libraries/LibJS | |
parent | 4a30446999588cf9bf0feace9ebc4eb29b3eb73a (diff) | |
download | serenity-ca038c1a4ebbd6bc3cc5d6cb2dcac87f0254afe9.zip |
LibJS: Align Temporal.{Calendar,TimeZone} id getters with toString
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/0bb391a
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp index c7dc2b72a9..2ed6a5208d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp @@ -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 diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp index 46ff650a44..2a3c1fce57 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp @@ -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 |