mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
LibJS: Convert GetIterator AO to ThrowCompletionOr
This commit is contained in:
parent
a3b3800cd4
commit
860a37640b
9 changed files with 56 additions and 48 deletions
|
@ -41,9 +41,7 @@ ThrowCompletionOr<MarkedValueList> iterable_to_list_of_type(GlobalObject& global
|
|||
auto& heap = global_object.heap();
|
||||
|
||||
// 1. Let iteratorRecord be ? GetIterator(items, sync).
|
||||
auto iterator_record = get_iterator(global_object, items, IteratorHint::Sync);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto iterator_record = TRY(get_iterator(global_object, items, IteratorHint::Sync));
|
||||
|
||||
// 2. Let values be a new empty List.
|
||||
MarkedValueList values(heap);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue