mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibJS: Port iterator_next() to NonnullGCPtr
This commit is contained in:
parent
b110258848
commit
e54536421a
4 changed files with 12 additions and 12 deletions
|
@ -277,16 +277,16 @@ ThrowCompletionOr<void> IteratorToArray::execute_impl(Bytecode::Interpreter& int
|
|||
size_t index = 0;
|
||||
|
||||
while (true) {
|
||||
auto* iterator_result = TRY(iterator_next(vm, iterator));
|
||||
auto iterator_result = TRY(iterator_next(vm, iterator));
|
||||
|
||||
auto complete = TRY(iterator_complete(vm, *iterator_result));
|
||||
auto complete = TRY(iterator_complete(vm, iterator_result));
|
||||
|
||||
if (complete) {
|
||||
interpreter.accumulator() = array;
|
||||
return {};
|
||||
}
|
||||
|
||||
auto value = TRY(iterator_value(vm, *iterator_result));
|
||||
auto value = TRY(iterator_value(vm, iterator_result));
|
||||
|
||||
MUST(array->create_data_property_or_throw(index, value));
|
||||
index++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue