diff --git a/Userland/Libraries/LibJS/Runtime/Set.cpp b/Userland/Libraries/LibJS/Runtime/Set.cpp index f0cc7be8031..4cb42f215ff 100644 --- a/Userland/Libraries/LibJS/Runtime/Set.cpp +++ b/Userland/Libraries/LibJS/Runtime/Set.cpp @@ -34,4 +34,11 @@ Set* Set::typed_this(VM& vm, GlobalObject& global_object) return static_cast(this_object); } +void Set::visit_edges(Cell::Visitor& visitor) +{ + Object::visit_edges(visitor); + for (auto& value : m_values) + visitor.visit(value); +} + } diff --git a/Userland/Libraries/LibJS/Runtime/Set.h b/Userland/Libraries/LibJS/Runtime/Set.h index 289d361c036..59ac8ace4cf 100644 --- a/Userland/Libraries/LibJS/Runtime/Set.h +++ b/Userland/Libraries/LibJS/Runtime/Set.h @@ -47,6 +47,8 @@ public: HashTable& values() { return m_values; }; private: + virtual void visit_edges(Visitor& visitor) override; + HashTable m_values; // FIXME: Replace with a HashTable that maintains a linked list of insertion order for correct iteration order };