1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

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
8 changed files with 20 additions and 34 deletions

View file

@ -79,10 +79,7 @@ ThrowCompletionOr<size_t> length_of_array_like(GlobalObject& global_object, Obje
{
auto& vm = global_object.vm();
auto result = TRY(object.get(vm.names.length));
auto length = result.to_length(global_object);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
return length;
return result.to_length(global_object);
}
// 7.3.19 CreateListFromArrayLike ( obj [ , elementTypes ] ), https://tc39.es/ecma262/#sec-createlistfromarraylike