mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:47:35 +00:00
LibJS: Add a helper for calling JS::Function's with arguments
The fact that a `MarkedValueList` had to be created was just annoying, so here's an alternative. This patchset also removes some (now) unneeded MarkedValueList.h includes.
This commit is contained in:
parent
521e730df1
commit
394e4c04cd
15 changed files with 72 additions and 113 deletions
|
@ -72,13 +72,10 @@ Object* iterator_next(Object& iterator, Value value)
|
|||
}
|
||||
|
||||
Value result;
|
||||
if (value.is_empty()) {
|
||||
if (value.is_empty())
|
||||
result = interpreter.call(next_method.as_function(), &iterator);
|
||||
} else {
|
||||
MarkedValueList arguments(iterator.heap());
|
||||
arguments.append(value);
|
||||
result = interpreter.call(next_method.as_function(), &iterator, move(arguments));
|
||||
}
|
||||
else
|
||||
result = interpreter.call(next_method.as_function(), &iterator, value);
|
||||
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue