mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
LibJS: Pass prototype to Function constructors
This commit is contained in:
parent
205ac0090d
commit
f6d57c82f6
21 changed files with 66 additions and 24 deletions
|
@ -48,14 +48,14 @@ Value ScopeNode::execute(Interpreter& interpreter) const
|
|||
|
||||
Value FunctionDeclaration::execute(Interpreter& interpreter) const
|
||||
{
|
||||
auto* function = interpreter.heap().allocate<ScriptFunction>(name(), body(), parameters(), interpreter.current_environment());
|
||||
auto* function = ScriptFunction::create(interpreter.global_object(), name(), body(), parameters(), interpreter.current_environment());
|
||||
interpreter.set_variable(name(), function);
|
||||
return js_undefined();
|
||||
}
|
||||
|
||||
Value FunctionExpression::execute(Interpreter& interpreter) const
|
||||
{
|
||||
return interpreter.heap().allocate<ScriptFunction>(name(), body(), parameters(), interpreter.current_environment());
|
||||
return ScriptFunction::create(interpreter.global_object(), name(), body(), parameters(), interpreter.current_environment());
|
||||
}
|
||||
|
||||
Value ExpressionStatement::execute(Interpreter& interpreter) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue