mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibLocale+LibJS: Make locale data APIs infallible
These APIs only perform small allocations, and are only used by LibJS. Callers which could only have failed from these APIs are also made to be infallible here.
This commit is contained in:
committed by
Andreas Kling
parent
a98201f889
commit
cd526813e6
@@ -482,7 +482,7 @@ ThrowCompletionOr<Vector<PatternPartition>> partition_duration_format_pattern(VM
|
||||
// c. If nextValue is not 0 or nextDisplay is not "auto", then
|
||||
if (next_value != 0.0 || next_display != DurationFormat::Display::Auto) {
|
||||
// i. Let separator be dataLocaleData.[[formats]].[[digital]].[[separator]].
|
||||
auto separator = TRY_OR_THROW_OOM(vm, ::Locale::get_number_system_symbol(data_locale, duration_format.numbering_system(), ::Locale::NumericSymbol::TimeSeparator)).value_or(":"sv);
|
||||
auto separator = ::Locale::get_number_system_symbol(data_locale, duration_format.numbering_system(), ::Locale::NumericSymbol::TimeSeparator).value_or(":"sv);
|
||||
|
||||
// ii. Append the new Record { [[Type]]: "literal", [[Value]]: separator} to the end of result.
|
||||
TRY_OR_THROW_OOM(vm, result.try_append({ "literal"sv, TRY_OR_THROW_OOM(vm, String::from_utf8(separator)) }));
|
||||
|
||||
Reference in New Issue
Block a user