mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibJS: Move "strict mode" state to the call stack
Each call frame now knows whether it's executing in strict mode. It's no longer necessary to access the scope stack to find this mode.
This commit is contained in:
@@ -91,7 +91,7 @@ Value ScopeNode::execute(Interpreter& interpreter, GlobalObject& global_object)
|
||||
|
||||
Value Program::execute(Interpreter& interpreter, GlobalObject& global_object) const
|
||||
{
|
||||
return interpreter.execute_statement(global_object, *this, {}, ScopeType::Block, m_is_strict_mode);
|
||||
return interpreter.execute_statement(global_object, *this, {}, ScopeType::Block);
|
||||
}
|
||||
|
||||
Value FunctionDeclaration::execute(Interpreter&, GlobalObject&) const
|
||||
@@ -101,7 +101,7 @@ Value FunctionDeclaration::execute(Interpreter&, GlobalObject&) const
|
||||
|
||||
Value FunctionExpression::execute(Interpreter& interpreter, GlobalObject& global_object) const
|
||||
{
|
||||
return ScriptFunction::create(global_object, name(), body(), parameters(), function_length(), interpreter.current_environment(), is_strict_mode(), m_is_arrow_function);
|
||||
return ScriptFunction::create(global_object, name(), body(), parameters(), function_length(), interpreter.current_environment(), is_strict_mode() || interpreter.vm().in_strict_mode(), m_is_arrow_function);
|
||||
}
|
||||
|
||||
Value ExpressionStatement::execute(Interpreter& interpreter, GlobalObject& global_object) const
|
||||
|
||||
Reference in New Issue
Block a user