LibJS: Convert to_length() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz
2021-10-17 23:57:37 +03:00
parent 750da61c0f
commit aad12b050b
Notes: sideshowbarker 2024-07-18 02:12:15 +09:00
8 changed files with 20 additions and 34 deletions

View File

@@ -212,9 +212,8 @@ ThrowCompletionOr<Vector<String>> canonicalize_locale_list(GlobalObject& global_
}
// 5. Let len be ? ToLength(? Get(O, "length")).
auto length = TRY(object->get(vm.names.length)).to_length(global_object);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
auto length_value = TRY(object->get(vm.names.length));
auto length = TRY(length_value.to_length(global_object));
// 6. Let k be 0.
// 7. Repeat, while k < len,