mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibJS: Convert canonicalize_locale_list() to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 03:42:50 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/3758e652937 Pull-request: https://github.com/SerenityOS/serenity/pull/10121 Reviewed-by: https://github.com/linusg ✅
@@ -57,9 +57,7 @@ Value DisplayNamesConstructor::construct(FunctionObject& new_target)
|
||||
auto* display_names = TRY_OR_DISCARD(ordinary_create_from_constructor<DisplayNames>(global_object, new_target, &GlobalObject::intl_display_names_prototype));
|
||||
|
||||
// 3. Let requestedLocales be ? CanonicalizeLocaleList(locales).
|
||||
auto requested_locales = canonicalize_locale_list(global_object, locale_value);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto requested_locales = TRY_OR_DISCARD(canonicalize_locale_list(global_object, locale_value));
|
||||
|
||||
// 4. If options is undefined, throw a TypeError exception.
|
||||
if (options_value.is_undefined()) {
|
||||
@@ -136,7 +134,7 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesConstructor::supported_locales_of)
|
||||
// No-op, availability of each requested locale is checked via Unicode::is_locale_available()
|
||||
|
||||
// 2. Let requestedLocales be ? CanonicalizeLocaleList(locales).
|
||||
auto requested_locales = canonicalize_locale_list(global_object, locales);
|
||||
auto requested_locales = TRY_OR_DISCARD(canonicalize_locale_list(global_object, locales));
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user