mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibJS: Set DateTimeFormat's time zone when the CLDR download is disabled
We return early from the DateTimeFormat constructor to avoid crashing on
assertions when the CLDR is disabled. However, after commit 019211b
, the
spec now mandates we assert the time zone identifier is valid. The early
return resulted in this identifier being an empty string.
This commit is contained in:
parent
d382e77d38
commit
897c7f7cc2
Notes:
sideshowbarker
2024-07-17 03:13:27 +09:00
Author: https://github.com/trflynn89
Commit: 897c7f7cc2
Pull-request: https://github.com/SerenityOS/serenity/pull/16470
1 changed files with 3 additions and 1 deletions
|
@ -169,8 +169,10 @@ ThrowCompletionOr<DateTimeFormat*> initialize_date_time_format(VM& vm, DateTimeF
|
|||
auto default_hour_cycle = ::Locale::get_default_regional_hour_cycle(data_locale);
|
||||
|
||||
// Non-standard, default_hour_cycle will be empty if Unicode data generation is disabled.
|
||||
if (!default_hour_cycle.has_value())
|
||||
if (!default_hour_cycle.has_value()) {
|
||||
date_time_format.set_time_zone(default_time_zone());
|
||||
return &date_time_format;
|
||||
}
|
||||
|
||||
Optional<::Locale::HourCycle> hour_cycle_value;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue