LibJS: Move scope stack from VM back to Interpreter

Okay, my vision here is improving. Interpreter should be a thing that
executes an AST. The scope stack is irrelevant to the VM proper,
so we can move that to the Interpreter. Same with execute_statement().
This commit is contained in:
Andreas Kling 2020-09-27 16:56:58 +02:00
parent 6861c619c6
commit be31805e8b
Notes: sideshowbarker 2024-07-19 02:10:40 +09:00
6 changed files with 124 additions and 119 deletions

View file

@ -130,7 +130,7 @@ Value ScriptFunction::call(Interpreter& interpreter)
arguments.append({ parameter.name, value });
interpreter.current_environment()->set(parameter.name, { value, DeclarationKind::Var });
}
return interpreter.vm().execute_statement(global_object(), m_body, arguments, ScopeType::Function);
return interpreter.execute_statement(global_object(), m_body, arguments, ScopeType::Function);
}
Value ScriptFunction::construct(Interpreter& interpreter, Function&)