LibJS: Remove Interpreter::declare_variable()

Since declarations are now hoisted and handled on scope entry, the job
of a VariableDeclaration becomes to actually initialize variables.

As such, we can remove the part where we insert variables into the
nearest relevant scope. Less work == more speed! :^)
This commit is contained in:
Andreas Kling 2020-04-13 16:45:51 +02:00
commit 062d6af16e
Notes: sideshowbarker 2024-07-19 07:37:48 +09:00
3 changed files with 0 additions and 23 deletions

View file

@ -828,7 +828,6 @@ void UpdateExpression::dump(int indent) const
Value VariableDeclaration::execute(Interpreter& interpreter) const
{
for (auto& declarator : m_declarations) {
interpreter.declare_variable(declarator.id().string(), m_declaration_kind);
if (auto* init = declarator.init()) {
auto initalizer_result = init->execute(interpreter);
if (interpreter.exception())