LibJS: Let bytecode instructions know whether they are in strict mode

This commits puts the strict mode flag in the header of every bytecode
instruction. This allows us to check for strict mode without looking at
the currently running execution context.
This commit is contained in:
Andreas Kling 2025-10-28 20:25:12 +01:00 committed by Andreas Kling
parent 3fb678b376
commit fb05063dde
Notes: github-actions[bot] 2025-10-29 20:22:27 +00:00
16 changed files with 183 additions and 227 deletions

View file

@ -810,6 +810,8 @@ void Parser::parse_script(Program& program, bool starts_in_strict_mode)
void Parser::parse_module(Program& program)
{
program.set_strict_mode();
TemporaryChange strict_mode_rollback(m_state.strict_mode, true);
TemporaryChange await_expression_valid_rollback(m_state.await_expression_is_valid, true);