summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Interpreter.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-02-07 16:28:39 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-07 19:16:45 +0100
commit85cf80507f41b11167b95a8bb19083159543f6e5 (patch)
treef6f28e7a4dab5a997dec3e5240464ee61413d9a1 /Userland/Libraries/LibJS/Interpreter.cpp
parent6ee597369d950bd2835633ac3fe37d2da5ab4a56 (diff)
downloadserenity-85cf80507f41b11167b95a8bb19083159543f6e5.zip
LibJS: Make ScriptOrModule use WeakPtr instead of raw pointers
Diffstat (limited to 'Userland/Libraries/LibJS/Interpreter.cpp')
-rw-r--r--Userland/Libraries/LibJS/Interpreter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Interpreter.cpp b/Userland/Libraries/LibJS/Interpreter.cpp
index 8fda3bad4c..1e7bf35847 100644
--- a/Userland/Libraries/LibJS/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Interpreter.cpp
@@ -63,7 +63,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record)
script_context.realm = &script_record.realm();
// 5. Set the ScriptOrModule of scriptContext to scriptRecord.
- script_context.script_or_module = &script_record;
+ script_context.script_or_module = script_record.make_weak_ptr();
// 6. Set the VariableEnvironment of scriptContext to globalEnv.
script_context.variable_environment = &global_environment;