mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibJS: Rework how native functions are called to improve |this| value
Native functions now only get the Interpreter& as an argument. They can then extract |this| along with any indexed arguments it wants from it. This forces functions that want |this| to actually deal with calling interpreter.this_value().to_object(), and dealing with the possibility of a non-object |this|. This is still not great but let's keep massaging it forward.
This commit is contained in:
parent
c209ea1985
commit
7c4e53f31e
Notes:
sideshowbarker
2024-07-19 08:05:16 +09:00
Author: https://github.com/awesomekling
Commit: 7c4e53f31e
25 changed files with 145 additions and 102 deletions
|
@ -41,8 +41,9 @@ ScriptFunction::~ScriptFunction()
|
|||
{
|
||||
}
|
||||
|
||||
Value ScriptFunction::call(Interpreter& interpreter, const Vector<Value>& argument_values)
|
||||
Value ScriptFunction::call(Interpreter& interpreter)
|
||||
{
|
||||
auto& argument_values = interpreter.call_frame().arguments;
|
||||
Vector<Argument> arguments;
|
||||
for (size_t i = 0; i < m_parameters.size(); ++i) {
|
||||
auto name = parameters()[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue