mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +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:
parent
a7d458f76a
commit
f1715bbd5e
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue