mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Pass JS::Function around by reference more
This commit is contained in:
parent
97382677bd
commit
aaf35112a4
Notes:
sideshowbarker
2024-07-19 07:11:39 +09:00
Author: https://github.com/awesomekling
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