LibJS: Make FunctionDeclaration return undefined

FunctionExpression returns a JS::Function, while FunctionDeclaration
declares one in the relevant scope.
This commit is contained in:
Andreas Kling 2020-03-26 12:27:15 +01:00
parent 6e6495fdf9
commit ad6ede7ee4
Notes: sideshowbarker 2024-07-19 08:07:05 +09:00

View file

@ -47,7 +47,7 @@ Value FunctionDeclaration::execute(Interpreter& interpreter) const
{
auto* function = interpreter.heap().allocate<ScriptFunction>(body(), parameters());
interpreter.set_variable(name(), function);
return function;
return {};
}
Value FunctionExpression::execute(Interpreter& interpreter) const