mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibJS+LibWeb: Make JS::Script and Web::HTML::ClassicScript use Realms
The spec wants Script Records to have a Realm, not a GlobalObject.
This commit is contained in:
parent
673fc02ac5
commit
106f295916
Notes:
sideshowbarker
2024-07-18 04:09:49 +09:00
Author: https://github.com/linusg
Commit: 106f295916
Pull-request: https://github.com/SerenityOS/serenity/pull/9988
Reviewed-by: https://github.com/alimpfard
5 changed files with 17 additions and 16 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Parser.h>
|
||||
#include <LibTextCodec/Decoder.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
|
@ -303,7 +304,7 @@ void HTMLScriptElement::prepare_script()
|
|||
document().interpreter();
|
||||
|
||||
// FIXME: This is all ad-hoc and needs work.
|
||||
auto script = ClassicScript::create(url.to_string(), data, *document().window().wrapper(), URL());
|
||||
auto script = ClassicScript::create(url.to_string(), data, document().interpreter().realm(), URL());
|
||||
|
||||
// When the chosen algorithm asynchronously completes, set the script's script to the result. At that time, the script is ready.
|
||||
m_script = script;
|
||||
|
@ -330,7 +331,7 @@ void HTMLScriptElement::prepare_script()
|
|||
document().interpreter();
|
||||
|
||||
// FIXME: Pass settings, base URL and options.
|
||||
auto script = ClassicScript::create(m_document->url().to_string(), source_text, *document().window().wrapper(), URL());
|
||||
auto script = ClassicScript::create(m_document->url().to_string(), source_text, document().interpreter().realm(), URL());
|
||||
|
||||
// 2. Set the script's script to script.
|
||||
m_script = script;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue