mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibJS: Make FunctionDeclaration return undefined
FunctionExpression returns a JS::Function, while FunctionDeclaration declares one in the relevant scope.
This commit is contained in:
parent
6e6495fdf9
commit
ad6ede7ee4
Notes:
sideshowbarker
2024-07-19 08:07:05 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ad6ede7ee4a
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue