mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +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
@@ -719,7 +719,7 @@ ThrowCompletionOr<Vector<PatternPartition>> format_date_time_pattern(VM& vm, Dat
|
||||
// Non-standard, TR-35 requires the decimal separator before injected {fractionalSecondDigits} partitions
|
||||
// to adhere to the selected locale. This depends on other generated data, so it is deferred to here.
|
||||
else if (part == "decimal"sv) {
|
||||
auto decimal_symbol = TRY_OR_THROW_OOM(vm, ::Locale::get_number_system_symbol(data_locale, date_time_format.numbering_system(), ::Locale::NumericSymbol::Decimal)).value_or("."sv);
|
||||
auto decimal_symbol = ::Locale::get_number_system_symbol(data_locale, date_time_format.numbering_system(), ::Locale::NumericSymbol::Decimal).value_or("."sv);
|
||||
TRY_OR_THROW_OOM(vm, result.try_append({ "literal"sv, TRY_OR_THROW_OOM(vm, String::from_utf8(decimal_symbol)) }));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user