summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-09-12 12:02:20 +0100
committerAndreas Kling <kling@serenityos.org>2021-09-12 15:18:25 +0200
commit106f29591688bc7f430f58360a2f6171e37b01ba (patch)
tree0b91ee9b6b1e2a53800adf19360877e698e951fa /Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
parent673fc02ac5ab92f8fe93b4cd831ec65c00a76654 (diff)
downloadserenity-106f29591688bc7f430f58360a2f6171e37b01ba.zip
LibJS+LibWeb: Make JS::Script and Web::HTML::ClassicScript use Realms
The spec wants Script Records to have a Realm, not a GlobalObject.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
index 6d352f8b1d..4aa8f5d205 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
@@ -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;