1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:17:43 +00:00

LibJS: Implement time zone identifier AOs centrally within Date

This is an editorial change in the ECMA-262 spec. See:
73926a5

The idea here is to reduce duplication of these AOs between ECMA-262,
ECMA-402, and Temporal. This patch contains only the ECMA-262 changes.
This commit is contained in:
Timothy Flynn 2023-10-03 12:14:59 -04:00 committed by Andreas Kling
parent 0bc401a1d6
commit f31540e419
5 changed files with 88 additions and 33 deletions

View file

@ -170,7 +170,7 @@ ThrowCompletionOr<NonnullGCPtr<DateTimeFormat>> create_date_time_format(VM& vm,
// Non-standard, default_hour_cycle will be empty if Unicode data generation is disabled.
if (!default_hour_cycle.has_value()) {
date_time_format->set_time_zone(MUST(String::from_utf8(default_time_zone())));
date_time_format->set_time_zone(MUST(String::from_utf8(system_time_zone_identifier())));
return date_time_format;
}
@ -217,7 +217,7 @@ ThrowCompletionOr<NonnullGCPtr<DateTimeFormat>> create_date_time_format(VM& vm,
// 31. If timeZone is undefined, then
if (time_zone_value.is_undefined()) {
// a. Set timeZone to DefaultTimeZone().
time_zone = MUST(String::from_utf8(default_time_zone()));
time_zone = MUST(String::from_utf8(system_time_zone_identifier()));
}
// 32. Else,
else {