Skip to content

Commit d467a0f

Browse files
committed
LibJS: ArrayIterator needs to mark the array it's iterating
1 parent 3143fea commit d467a0f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Libraries/LibJS/Runtime/ArrayIterator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,10 @@ ArrayIterator::~ArrayIterator()
4545
{
4646
}
4747

48+
void ArrayIterator::visit_children(Cell::Visitor & visitor)
49+
{
50+
Base::visit_children(visitor);
51+
visitor.visit(m_array);
52+
}
53+
4854
}

Libraries/LibJS/Runtime/ArrayIterator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class ArrayIterator final : public Object {
4747
friend class ArrayIteratorPrototype;
4848

4949
virtual bool is_array_iterator_object() const override { return true; }
50+
virtual void visit_children(Cell::Visitor&) override;
5051

5152
Value m_array;
5253
Object::PropertyKind m_iteration_kind;

0 commit comments

Comments
 (0)