Skip to content

Commit

Permalink
LibJS: ArrayIterator needs to mark the array it's iterating
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Sep 8, 2020
1 parent 3143fea commit d467a0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Libraries/LibJS/Runtime/ArrayIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ ArrayIterator::~ArrayIterator()
{
}

void ArrayIterator::visit_children(Cell::Visitor & visitor)
{
Base::visit_children(visitor);
visitor.visit(m_array);
}

}
1 change: 1 addition & 0 deletions Libraries/LibJS/Runtime/ArrayIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ArrayIterator final : public Object {
friend class ArrayIteratorPrototype;

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

Value m_array;
Object::PropertyKind m_iteration_kind;
Expand Down

0 comments on commit d467a0f

Please sign in to comment.