mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
LibJS: Convert supported_locales() to ThrowCompletionOr
This commit is contained in:
parent
de9785b71b
commit
d0e5fc4576
5 changed files with 6 additions and 6 deletions
|
@ -568,7 +568,7 @@ Vector<String> best_fit_supported_locales(Vector<String> const& requested_locale
|
|||
}
|
||||
|
||||
// 9.2.10 SupportedLocales ( availableLocales, requestedLocales, options ), https://tc39.es/ecma402/#sec-supportedlocales
|
||||
Array* supported_locales(GlobalObject& global_object, Vector<String> const& requested_locales, Value options)
|
||||
ThrowCompletionOr<Array*> supported_locales(GlobalObject& global_object, Vector<String> const& requested_locales, Value options)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
|
@ -578,7 +578,7 @@ Array* supported_locales(GlobalObject& global_object, Vector<String> const& requ
|
|||
return {};
|
||||
|
||||
// 2. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
|
||||
auto matcher = TRY_OR_DISCARD(get_option(global_object, *options_object, vm.names.localeMatcher, Value::Type::String, { "lookup"sv, "best fit"sv }, "best fit"sv));
|
||||
auto matcher = TRY(get_option(global_object, *options_object, vm.names.localeMatcher, Value::Type::String, { "lookup"sv, "best fit"sv }, "best fit"sv));
|
||||
|
||||
Vector<String> supported_locales;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue