mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibJS: Convert to_length() to ThrowCompletionOr
This commit is contained in:
parent
750da61c0f
commit
aad12b050b
Notes:
sideshowbarker
2024-07-18 02:12:15 +09:00
Author: https://github.com/IdanHo
Commit: aad12b050b
Pull-request: https://github.com/SerenityOS/serenity/pull/10522
Reviewed-by: https://github.com/linusg ✅
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