diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-08 16:20:13 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-08 16:20:34 +0200 |
commit | d467a0ffef85f525e3308c5ffdda151b64c736b5 (patch) | |
tree | 5f28db4159793080ebf743853899059b2a4db7ed /Libraries/LibJS | |
parent | 3143fea1ebbb527918a8b508641c8554c013efb1 (diff) | |
download | serenity-d467a0ffef85f525e3308c5ffdda151b64c736b5.zip |
LibJS: ArrayIterator needs to mark the array it's iterating
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r-- | Libraries/LibJS/Runtime/ArrayIterator.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibJS/Runtime/ArrayIterator.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Libraries/LibJS/Runtime/ArrayIterator.cpp b/Libraries/LibJS/Runtime/ArrayIterator.cpp index 501492b5ad..926495ef44 100644 --- a/Libraries/LibJS/Runtime/ArrayIterator.cpp +++ b/Libraries/LibJS/Runtime/ArrayIterator.cpp @@ -45,4 +45,10 @@ ArrayIterator::~ArrayIterator() { } +void ArrayIterator::visit_children(Cell::Visitor & visitor) +{ + Base::visit_children(visitor); + visitor.visit(m_array); +} + } diff --git a/Libraries/LibJS/Runtime/ArrayIterator.h b/Libraries/LibJS/Runtime/ArrayIterator.h index 408349f188..aefa1583a4 100644 --- a/Libraries/LibJS/Runtime/ArrayIterator.h +++ b/Libraries/LibJS/Runtime/ArrayIterator.h @@ -47,6 +47,7 @@ private: 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; |