mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-13 11:16:53 +00:00
LibWeb: Make the "document" global a native property
This defers construction of the document wrapper until actually needed.
This commit is contained in:
@@ -348,7 +348,12 @@ JS::Interpreter& Document::interpreter()
|
||||
return JS::js_undefined();
|
||||
});
|
||||
|
||||
m_interpreter->global_object().put("document", wrap(m_interpreter->heap(), *this));
|
||||
m_interpreter->global_object().put_native_property(
|
||||
"document",
|
||||
[this](JS::Object*) {
|
||||
return wrap(m_interpreter->heap(), *this);
|
||||
},
|
||||
nullptr);
|
||||
}
|
||||
return *m_interpreter;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user