summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-06 01:19:58 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-06 01:21:09 +0200
commitd13d571844bfa0efe200f8712fd23d9ab4bb29e9 (patch)
treec8776411715c4dcc9f1cb091926ce43c2cb386a3 /Userland
parent88f2f50c55e749a7b3ced7a9b13def3bfd88c9d6 (diff)
downloadserenity-d13d571844bfa0efe200f8712fd23d9ab4bb29e9.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Script.cpp2
1 files changed, 2 insertions, 0 deletions
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);
}
}