summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/WeakSet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/WeakSet.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/WeakSet.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/WeakSet.cpp b/Userland/Libraries/LibJS/Runtime/WeakSet.cpp
index 50bf41c0ba..ff64c0858d 100644
--- a/Userland/Libraries/LibJS/Runtime/WeakSet.cpp
+++ b/Userland/Libraries/LibJS/Runtime/WeakSet.cpp
@@ -16,10 +16,18 @@ WeakSet* WeakSet::create(GlobalObject& global_object)
WeakSet::WeakSet(Object& prototype)
: Object(prototype)
{
+ heap().did_create_weak_set({}, *this);
}
WeakSet::~WeakSet()
{
+ heap().did_destroy_weak_set({}, *this);
+}
+
+void WeakSet::remove_sweeped_cells(Badge<Heap>, Vector<Cell*>& cells)
+{
+ for (auto* cell : cells)
+ m_values.remove(cell);
}
}