mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibJS: Make Function and CallFrame aware of their function name
This commit is contained in:
parent
4eceea7c62
commit
eece424694
11 changed files with 39 additions and 22 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue