1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

LibJS+LibLocale: Propagate OOM from CLDR NumberFormat Vector operations

This commit is contained in:
Timothy Flynn 2023-02-02 19:54:47 -05:00 committed by Linus Groh
parent 858126d236
commit 89da8de4ca
4 changed files with 13 additions and 13 deletions

View file

@ -1317,7 +1317,7 @@ ThrowCompletionOr<Optional<Variant<StringView, String>>> get_number_format_patte
// i. Let unit be "fallback".
// e. Let patterns be patterns.[[<unit>]].
// f. Let patterns be patterns.[[<unitDisplay>]].
auto formats = ::Locale::get_unit_formats(number_format.data_locale(), number_format.unit(), number_format.unit_display());
auto formats = TRY_OR_THROW_OOM(vm, ::Locale::get_unit_formats(number_format.data_locale(), number_format.unit(), number_format.unit_display()));
auto plurality = MUST_OR_THROW_OOM(resolve_plural(vm, number_format, ::Locale::PluralForm::Cardinal, number.to_value(vm)));
if (auto it = formats.find_if([&](auto& p) { return p.plurality == plurality.plural_category; }); it != formats.end())