1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:57:45 +00:00

LibJS: Make class definition evaluation work in bytecode mode

Instead of assuming that there's an active AST interpreter, this code
now takes VM& everywhere and invokes the appropriate interpreter.

92 new passes on test262. :^)
This commit is contained in:
Andreas Kling 2023-06-25 17:33:17 +02:00
parent 66936a0d61
commit 8450948458
4 changed files with 38 additions and 39 deletions

View file

@ -291,7 +291,7 @@ ThrowCompletionOr<Value> VM::named_evaluation_if_anonymous_function(ASTNode cons
} else if (is<ClassExpression>(expression)) {
auto& class_expression = static_cast<ClassExpression const&>(expression);
if (!class_expression.has_name()) {
return TRY(class_expression.class_definition_evaluation(interpreter(), {}, name));
return TRY(class_expression.class_definition_evaluation(*this, {}, name));
}
}