mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibJS: Avoid crashing when the Unicode data generators are disabled
The general idea when ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF has been that the Intl APIs will provide obviously incorrect results, but should not crash. This regressed a bit with NumberFormat and DateTimeFormat.
This commit is contained in:
committed by
Linus Groh
parent
48dc28996d
commit
9ce4ff4265
Notes:
sideshowbarker
2024-07-17 22:22:09 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/9ce4ff42656 Pull-request: https://github.com/SerenityOS/serenity/pull/11370 Reviewed-by: https://github.com/linusg ✅
@@ -437,7 +437,8 @@ ThrowCompletionOr<NumberFormat*> initialize_number_format(GlobalObject& global_o
|
||||
number_format.set_data_locale(move(result.data_locale));
|
||||
|
||||
// 13. Set numberFormat.[[NumberingSystem]] to r.[[nu]].
|
||||
number_format.set_numbering_system(result.nu.release_value());
|
||||
if (result.nu.has_value())
|
||||
number_format.set_numbering_system(result.nu.release_value());
|
||||
|
||||
// 14. Perform ? SetNumberFormatUnitOptions(numberFormat, options).
|
||||
TRY(set_number_format_unit_options(global_object, number_format, *options));
|
||||
|
||||
Reference in New Issue
Block a user