LibJS: Convert to_string() to ThrowCompletionOr

Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
This commit is contained in:
Linus Groh 2021-10-12 17:49:01 +01:00
commit 4d8912a92b
Notes: sideshowbarker 2024-07-18 02:47:45 +09:00
48 changed files with 171 additions and 415 deletions

View file

@ -246,9 +246,7 @@ ThrowCompletionOr<Vector<String>> canonicalize_locale_list(GlobalObject& global_
// iv. Else,
else {
// 1. Let tag be ? ToString(kValue).
tag = key_value.to_string(global_object);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
tag = TRY(key_value.to_string(global_object));
}
// v. If IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception.