mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
The m_result Variant can hold a GC::Ref<ImportMapParseResult> when the script element has type="importmap", but visit_edges only traced the GC::Ref<Script> arm. This left the ImportMapParseResult unvisited, allowing the GC to collect it while the element still held a reference. ImportMapParseResult inherited from JS::Script::HostDefined, but no JS::Script or JS::Module ever stored it as host_defined data, so visit_host_defined_self was dead code. This removes the HostDefined inheritance entirely and switches m_result visitation to Variant::visit with a lambda that catches all GC::Ref arms.