ソースを参照

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.
Andreas Kling 5 年 前
コミット
67f7763ab9
1 ファイル変更3 行追加0 行削除
  1. 3 0
      Libraries/LibJS/Runtime/Object.cpp

+ 3 - 0
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