LibJS: Let JS::Script remember whether its code is strict mode

We don't want to rely on having the AST node just to answer the question
"is this script strict mode?"
This commit is contained in:
Andreas Kling 2025-10-26 12:33:54 +01:00 committed by Andreas Kling
parent b712caf855
commit 892c7d980e
Notes: github-actions[bot] 2025-10-27 20:15:42 +00:00
3 changed files with 11 additions and 4 deletions

View file

@ -250,7 +250,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record, GC::Ptr<Environ
// 8. Set the PrivateEnvironment of scriptContext to null.
// NOTE: This isn't in the spec, but we require it.
script_context->is_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.