mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
LibJS: Pass JS::Function around by reference more
This commit is contained in:
parent
97382677bd
commit
aaf35112a4
8 changed files with 22 additions and 22 deletions
|
@ -195,15 +195,15 @@ void Interpreter::gather_roots(Badge<Heap>, HashTable<Cell*>& roots)
|
|||
}
|
||||
}
|
||||
|
||||
Value Interpreter::call(Function* function, Value this_value, Optional<MarkedValueList> arguments)
|
||||
Value Interpreter::call(Function& function, Value this_value, Optional<MarkedValueList> arguments)
|
||||
{
|
||||
auto& call_frame = push_call_frame();
|
||||
call_frame.function_name = function->name();
|
||||
call_frame.function_name = function.name();
|
||||
call_frame.this_value = this_value;
|
||||
if (arguments.has_value())
|
||||
call_frame.arguments = arguments.value().values();
|
||||
call_frame.environment = function->create_environment();
|
||||
auto result = function->call(*this);
|
||||
call_frame.environment = function.create_environment();
|
||||
auto result = function.call(*this);
|
||||
pop_call_frame();
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue