mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibJS: Convert GetIterator AO to ThrowCompletionOr
This commit is contained in:
parent
a3b3800cd4
commit
860a37640b
Notes:
sideshowbarker
2024-07-18 02:07:19 +09:00
Author: https://github.com/trflynn89
Commit: 860a37640b
Pull-request: https://github.com/SerenityOS/serenity/pull/10546
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg ✅
9 changed files with 56 additions and 48 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue