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

LibJS: Make Function and CallFrame aware of their function name

This commit is contained in:
Linus Groh 2020-04-11 12:56:20 +01:00 committed by Andreas Kling
parent 4eceea7c62
commit eece424694
11 changed files with 39 additions and 22 deletions

View file

@ -48,14 +48,14 @@ Value ScopeNode::execute(Interpreter& interpreter) const
Value FunctionDeclaration::execute(Interpreter& interpreter) const
{
auto* function = interpreter.heap().allocate<ScriptFunction>(body(), parameters());
auto* function = interpreter.heap().allocate<ScriptFunction>(name(), body(), parameters());
interpreter.set_variable(name(), function);
return js_undefined();
}
Value FunctionExpression::execute(Interpreter& interpreter) const
{
return interpreter.heap().allocate<ScriptFunction>(body(), parameters());
return interpreter.heap().allocate<ScriptFunction>(name(), body(), parameters());
}
Value ExpressionStatement::execute(Interpreter& interpreter) const
@ -117,6 +117,7 @@ Value CallExpression::execute(Interpreter& interpreter) const
}
auto& call_frame = interpreter.push_call_frame();
call_frame.function_name = function.name();
call_frame.arguments = move(arguments);
Object* new_object = nullptr;