mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibJS: Do not store iterated values in a plain vector
This commit is contained in:
parent
9949173fce
commit
108b4e7c15
|
|
@ -717,7 +717,7 @@ JS_DEFINE_NATIVE_FUNCTION(IteratorPrototype::to_array)
|
|||
auto iterated = TRY(get_iterator_direct(vm, object));
|
||||
|
||||
// 4. Let items be a new empty List.
|
||||
Vector<Value> items;
|
||||
MarkedVector<Value> items(realm.heap());
|
||||
|
||||
// 5. Repeat,
|
||||
while (true) {
|
||||
|
|
@ -729,7 +729,7 @@ JS_DEFINE_NATIVE_FUNCTION(IteratorPrototype::to_array)
|
|||
return Array::create_from(realm, items);
|
||||
|
||||
// c. Append value to items.
|
||||
TRY_OR_THROW_OOM(vm, items.try_append(*value));
|
||||
items.append(*value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user