mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibJS: Convert to_length() to ThrowCompletionOr
This commit is contained in:
parent
750da61c0f
commit
aad12b050b
8 changed files with 20 additions and 34 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue