mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +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
Notes:
sideshowbarker
2024-07-19 08:12:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f1715bbd5e3
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
Reference in a new issue