1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibJS/Bytecode: Support named evaluation of anonymous functions

This commit is contained in:
Andreas Kling 2023-06-22 16:08:23 +02:00
parent f4fe9f09a1
commit cd08515957

View file

@ -295,6 +295,11 @@ ThrowCompletionOr<Value> VM::named_evaluation_if_anonymous_function(ASTNode cons
}
}
if (auto* bytecode_interpreter = bytecode_interpreter_if_exists()) {
auto executable = TRY(Bytecode::compile(*this, expression, FunctionKind::Normal, name));
return TRY(bytecode_interpreter->run(*current_realm(), *executable));
}
return TRY(expression.execute(interpreter())).release_value();
}