diff --git a/Libraries/LibJS/Bytecode/Interpreter.cpp b/Libraries/LibJS/Bytecode/Interpreter.cpp index f7a61ab0723..9f8f31bb05e 100644 --- a/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -250,7 +250,7 @@ ThrowCompletionOr Interpreter::run(Script& script_record, GC::Ptris_strict_mode = script_record.parse_node().is_strict_mode(); + script_context->is_strict_mode = script_record.is_strict_mode(); // 9. Suspend the currently running execution context. // 10. Push scriptContext onto the execution context stack; scriptContext is now the running execution context. diff --git a/Libraries/LibJS/Script.cpp b/Libraries/LibJS/Script.cpp index 99a80d43528..ab3851aba85 100644 --- a/Libraries/LibJS/Script.cpp +++ b/Libraries/LibJS/Script.cpp @@ -25,15 +25,18 @@ Result, Vector> Script::parse(StringView source_tex if (parser.has_errors()) return parser.errors(); + bool strict_mode = script->is_strict_mode(); + // 3. Return Script Record { [[Realm]]: realm, [[ECMAScriptCode]]: script, [[HostDefined]]: hostDefined }. - return realm.heap().allocate