mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17: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
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/Function.h>
|
||||
#include <LibJS/Runtime/MarkedValueList.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
|
@ -63,10 +62,8 @@ public:
|
|||
{
|
||||
if (!m_setter)
|
||||
return;
|
||||
MarkedValueList arguments(interpreter().heap());
|
||||
arguments.append(setter_value);
|
||||
// FIXME: It might be nice if we had a way to communicate to our caller if an exception happened after this.
|
||||
(void)interpreter().call(*m_setter, this_value, move(arguments));
|
||||
(void)interpreter().call(*m_setter, this_value, setter_value);
|
||||
}
|
||||
|
||||
void visit_children(Cell::Visitor& visitor) override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue