mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
committed by
Andreas Kling
parent
521e730df1
commit
394e4c04cd
@@ -708,9 +708,8 @@ Value instance_of(Interpreter& interpreter, Value lhs, Value rhs)
|
||||
interpreter.throw_exception<TypeError>(ErrorType::NotAFunction, has_instance_method.to_string_without_side_effects().characters());
|
||||
return {};
|
||||
}
|
||||
MarkedValueList arguments(interpreter.heap());
|
||||
arguments.append(lhs);
|
||||
return Value(interpreter.call(has_instance_method.as_function(), rhs, move(arguments)).to_boolean());
|
||||
|
||||
return Value(interpreter.call(has_instance_method.as_function(), rhs, lhs).to_boolean());
|
||||
}
|
||||
|
||||
if (!rhs.is_function()) {
|
||||
|
||||
Reference in New Issue
Block a user