mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00: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:
parent
48dc28996d
commit
9ce4ff4265
2 changed files with 8 additions and 4 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue