mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
LibJS: Make Interpreter::construct() take a GlobalObject&
This commit is contained in:
parent
2fe4285693
commit
3ba17d8df7
3 changed files with 4 additions and 4 deletions
|
@ -231,7 +231,7 @@ Value Interpreter::call(Function& function, Value this_value, Optional<MarkedVal
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Value Interpreter::construct(Function& function, Function& new_target, Optional<MarkedValueList> arguments)
|
Value Interpreter::construct(Function& function, Function& new_target, Optional<MarkedValueList> arguments, GlobalObject& global_object)
|
||||||
{
|
{
|
||||||
auto& call_frame = push_call_frame();
|
auto& call_frame = push_call_frame();
|
||||||
call_frame.function_name = function.name();
|
call_frame.function_name = function.name();
|
||||||
|
@ -239,7 +239,7 @@ Value Interpreter::construct(Function& function, Function& new_target, Optional<
|
||||||
call_frame.arguments = arguments.value().values();
|
call_frame.arguments = arguments.value().values();
|
||||||
call_frame.environment = function.create_environment();
|
call_frame.environment = function.create_environment();
|
||||||
|
|
||||||
auto* new_object = Object::create_empty(*this, global_object());
|
auto* new_object = Object::create_empty(*this, global_object);
|
||||||
auto prototype = new_target.get("prototype");
|
auto prototype = new_target.get("prototype");
|
||||||
if (exception())
|
if (exception())
|
||||||
return {};
|
return {};
|
||||||
|
|
|
@ -117,7 +117,7 @@ public:
|
||||||
void exit_scope(const ScopeNode&);
|
void exit_scope(const ScopeNode&);
|
||||||
|
|
||||||
Value call(Function&, Value this_value, Optional<MarkedValueList> arguments = {});
|
Value call(Function&, Value this_value, Optional<MarkedValueList> arguments = {});
|
||||||
Value construct(Function&, Function& new_target, Optional<MarkedValueList> arguments = {});
|
Value construct(Function&, Function& new_target, Optional<MarkedValueList> arguments, GlobalObject&);
|
||||||
|
|
||||||
CallFrame& push_call_frame()
|
CallFrame& push_call_frame()
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::construct)
|
||||||
}
|
}
|
||||||
new_target = &new_target_value.as_function();
|
new_target = &new_target_value.as_function();
|
||||||
}
|
}
|
||||||
return interpreter.construct(*target, *new_target, move(arguments));
|
return interpreter.construct(*target, *new_target, move(arguments), global_object);
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_DEFINE_NATIVE_FUNCTION(ReflectObject::define_property)
|
JS_DEFINE_NATIVE_FUNCTION(ReflectObject::define_property)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue