From 67f7763ab95e65a978bb6f7378706527482900a5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 6 Apr 2020 12:33:27 +0200 Subject: [PATCH] LibJS: Object needs to protect values in its storage Otherwise the garbage collector will eat them way too soon! This made it impossible to use "js -g" without crashing. --- Libraries/LibJS/Runtime/Object.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/LibJS/Runtime/Object.cpp b/Libraries/LibJS/Runtime/Object.cpp index 6598a3af76..18185cc116 100644 --- a/Libraries/LibJS/Runtime/Object.cpp +++ b/Libraries/LibJS/Runtime/Object.cpp @@ -171,6 +171,9 @@ void Object::visit_children(Cell::Visitor& visitor) { Cell::visit_children(visitor); visitor.visit(m_shape); + + for (auto& value : m_storage) + visitor.visit(value); } bool Object::has_own_property(const FlyString& property_name) const