mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:37:35 +00:00
LibJS: Remove Interpreter& argument to Function::construct()
This is no longer needed, we can get everything we need from the VM.
This commit is contained in:
parent
340a115dfe
commit
f79d4c7347
36 changed files with 73 additions and 61 deletions
|
@ -492,7 +492,7 @@ Value ProxyObject::call()
|
|||
return vm().call(trap.as_function(), Value(&m_handler), move(arguments));
|
||||
}
|
||||
|
||||
Value ProxyObject::construct(Interpreter& interpreter, Function& new_target)
|
||||
Value ProxyObject::construct(Function& new_target)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
if (!is_function()) {
|
||||
|
@ -507,7 +507,7 @@ Value ProxyObject::construct(Interpreter& interpreter, Function& new_target)
|
|||
if (vm.exception())
|
||||
return {};
|
||||
if (trap.is_empty() || trap.is_undefined() || trap.is_null())
|
||||
return static_cast<Function&>(m_target).construct(interpreter, new_target);
|
||||
return static_cast<Function&>(m_target).construct(new_target);
|
||||
if (!trap.is_function()) {
|
||||
vm.throw_exception<TypeError>(global_object(), ErrorType::ProxyInvalidTrap, "construct");
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue