mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:57:35 +00:00
LibWeb+LibJS: Let JS::Realm::HostDefined objects mark things during GC
This allows us to mark the HTML::Window from our window environment settings object.
This commit is contained in:
parent
2ff7e37048
commit
abfb73f2e7
4 changed files with 18 additions and 3 deletions
|
@ -115,9 +115,12 @@ void Realm::set_global_object(Object* global_object, Object* this_value)
|
|||
|
||||
void Realm::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_intrinsics);
|
||||
visitor.visit(m_global_object);
|
||||
visitor.visit(m_global_environment);
|
||||
if (m_host_defined)
|
||||
m_host_defined->visit_edges(visitor);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ class Realm final
|
|||
public:
|
||||
struct HostDefined {
|
||||
virtual ~HostDefined() = default;
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) { }
|
||||
};
|
||||
|
||||
static Realm* create(VM&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue