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:
parent
f4fe9f09a1
commit
cd08515957
1 changed files with 5 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue