1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibJS: Convert GetIterator AO to ThrowCompletionOr

This commit is contained in:
Timothy Flynn 2021-10-20 08:24:54 -04:00 committed by Linus Groh
parent a3b3800cd4
commit 860a37640b
9 changed files with 56 additions and 48 deletions

View file

@ -116,10 +116,8 @@ JS_DEFINE_OLD_NATIVE_FUNCTION(ArrayConstructor::from)
} else {
array = Array::create(global_object, 0);
}
auto iterator = get_iterator(global_object, items, IteratorHint::Sync, using_iterator);
if (vm.exception())
return {};
auto iterator = TRY_OR_DISCARD(get_iterator(global_object, items, IteratorHint::Sync, using_iterator));
auto& array_object = array.as_object();
size_t k = 0;