mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibJS: Only allow TimeZone this value in Temporal.TimeZone#toJSON
This is a normative change in the Temporal spec.
See: 2644fc6
This commit is contained in:
parent
6c8c34ed6c
commit
7729598b5b
Notes:
sideshowbarker
2024-07-17 22:36:39 +09:00
Author: https://github.com/Lubrsi
Commit: 7729598b5b
Pull-request: https://github.com/SerenityOS/serenity/pull/11302
Reviewed-by: https://github.com/linusg ✅
2 changed files with 10 additions and 5 deletions
|
@ -230,10 +230,11 @@ JS_DEFINE_NATIVE_FUNCTION(TimeZonePrototype::to_string)
|
|||
JS_DEFINE_NATIVE_FUNCTION(TimeZonePrototype::to_json)
|
||||
{
|
||||
// 1. Let timeZone be the this value.
|
||||
auto time_zone = vm.this_value(global_object);
|
||||
// 2. Perform ? RequireInternalSlot(timeZone, [[InitializedTemporalTimeZone]]).
|
||||
auto* time_zone = TRY(typed_this_object(global_object));
|
||||
|
||||
// 2. Return ? ToString(timeZone).
|
||||
return js_string(vm, TRY(time_zone.to_string(global_object)));
|
||||
// 3. Return ? ToString(timeZone).
|
||||
return js_string(vm, TRY(Value(time_zone).to_string(global_object)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue