diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-02-02 21:37:08 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-08 18:32:37 +0000 |
commit | 8670526f2af3392f2809f2729882ba48aadbbda4 (patch) | |
tree | 26dbfc536e27efa66643756a3c412e63464c2cf0 /Meta | |
parent | 340434ce0967f0d38540c6d4eaa6fe0eb548415c (diff) | |
download | serenity-8670526f2af3392f2809f2729882ba48aadbbda4.zip |
LibJS+LibLocale: Propagate OOM from CLDR RelativeTime Vector operations
Diffstat (limited to 'Meta')
-rw-r--r-- | Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp index c4cb741117..0ec821c8a6 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibLocale/GenerateRelativeTimeFormatData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org> + * Copyright (c) 2022-2023, Tim Flynn <trflynn89@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -247,7 +247,7 @@ static constexpr Array<@relative_time_format_index_type@, @size@> @name@ { {)~~~ generate_mapping(generator, cldr.locales, cldr.unique_formats.type_that_fits(), "s_locale_relative_time_formats"sv, "s_number_systems_digits_{}"sv, nullptr, [&](auto const& name, auto const& value) { append_list(name, value.time_units); }); generator.append(R"~~~( -Vector<RelativeTimeFormat> get_relative_time_format_patterns(StringView locale, TimeUnit time_unit, StringView tense_or_number, Style style) +ErrorOr<Vector<RelativeTimeFormat>> get_relative_time_format_patterns(StringView locale, TimeUnit time_unit, StringView tense_or_number, Style style) { Vector<RelativeTimeFormat> formats; @@ -268,7 +268,7 @@ Vector<RelativeTimeFormat> get_relative_time_format_patterns(StringView locale, if (decode_string(locale_format.tense_or_number) != tense_or_number) continue; - formats.append(locale_format.to_relative_time_format()); + TRY(formats.try_append(locale_format.to_relative_time_format())); } return formats; |