1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

LibJS: Remove GlobalObject& argument from VM::construct()

We can just get the global object from the constructor function.
This commit is contained in:
Andreas Kling 2021-06-10 23:17:29 +02:00
parent f5feb1d2cd
commit 93a07ba962
6 changed files with 9 additions and 8 deletions

View file

@ -378,15 +378,16 @@ Reference VM::get_reference(const FlyString& name)
return { Reference::GlobalVariable, name };
}
Value VM::construct(Function& function, Function& new_target, Optional<MarkedValueList> arguments, GlobalObject& global_object)
Value VM::construct(Function& function, Function& new_target, Optional<MarkedValueList> arguments)
{
auto& global_object = function.global_object();
CallFrame call_frame;
call_frame.callee = &function;
if (auto* interpreter = interpreter_if_exists())
call_frame.current_node = interpreter->current_node();
call_frame.is_strict_mode = function.is_strict_mode();
push_call_frame(call_frame, function.global_object());
push_call_frame(call_frame, global_object);
if (exception())
return {};
ArmedScopeGuard call_frame_popper = [&] {