From d13d571844bfa0efe200f8712fd23d9ab4bb29e9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 6 Sep 2022 01:19:58 +0200 Subject: [PATCH] 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. --- Userland/Libraries/LibJS/Script.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibJS/Script.cpp b/Userland/Libraries/LibJS/Script.cpp index 6c6c55fc5e..36f63acab5 100644 --- a/Userland/Libraries/LibJS/Script.cpp +++ b/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); } }