diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-26 12:27:15 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-26 12:27:15 +0100 |
commit | ad6ede7ee4aa796eeb0af1218d958b8f9de405b0 (patch) | |
tree | b3fe6e7c181bbae722914c421ed445a73dc983f0 /Libraries | |
parent | 6e6495fdf9534f160216603ed2112fe1cbed9926 (diff) | |
download | serenity-ad6ede7ee4aa796eeb0af1218d958b8f9de405b0.zip |
LibJS: Make FunctionDeclaration return undefined
FunctionExpression returns a JS::Function, while FunctionDeclaration
declares one in the relevant scope.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibJS/AST.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index d8af41531c..c451014084 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -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 |