浏览代码

LibJS: Make sure JS::Script visits its HostDefined object

This allows JS::Script to mark its corresponding HTML::Script, even if
it's a little roundabout looking. Fixes an issue where the JS::Script
was kept alive by the execution stack, but the HTML::Script was gone.

This was originally part of 8f9ed415a02dd62c46fce4f5d352ad51bc779a27
but got lost in a merging accident.
Andreas Kling 2 年之前
父节点
当前提交
d13d571844
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Libraries/LibJS/Script.cpp

+ 2 - 0
Userland/Libraries/LibJS/Script.cpp

@@ -43,6 +43,8 @@ void Script::visit_edges(Cell::Visitor& visitor)
 {
     Base::visit_edges(visitor);
     visitor.visit(m_realm);
+    if (m_host_defined)
+        m_host_defined->visit_host_defined_self(visitor);
 }
 
 }