summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-20 17:53:33 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-20 17:53:33 +0200
commit3ba17d8df7dff55069a79832bffe5c94a3b3159b (patch)
treecac8c2196b0ba929d231aa78ae83e1e165a71825 /Libraries
parent2fe4285693d4d98fb15eb8a4024afb299d25df4b (diff)
downloadserenity-3ba17d8df7dff55069a79832bffe5c94a3b3159b.zip
LibJS: Make Interpreter::construct() take a GlobalObject&
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibJS/Interpreter.cpp4
-rw-r--r--Libraries/LibJS/Interpreter.h2
-rw-r--r--Libraries/LibJS/Runtime/ReflectObject.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/Libraries/LibJS/Interpreter.cpp b/Libraries/LibJS/Interpreter.cpp
index abf18af759..de98858134 100644
--- a/Libraries/LibJS/Interpreter.cpp
+++ b/Libraries/LibJS/Interpreter.cpp
@@ -231,7 +231,7 @@ Value Interpreter::call(Function& function, Value this_value, Optional<MarkedVal
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();
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.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");
if (exception())
return {};
diff --git a/Libraries/LibJS/Interpreter.h b/Libraries/LibJS/Interpreter.h
index 6897b54018..00e4cacf79 100644
--- a/Libraries/LibJS/Interpreter.h
+++ b/Libraries/LibJS/Interpreter.h
@@ -117,7 +117,7 @@ public:
void exit_scope(const ScopeNode&);
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()
{
diff --git a/Libraries/LibJS/Runtime/ReflectObject.cpp b/Libraries/LibJS/Runtime/ReflectObject.cpp
index 284054e46c..2c3cfa251c 100644
--- a/Libraries/LibJS/Runtime/ReflectObject.cpp
+++ b/Libraries/LibJS/Runtime/ReflectObject.cpp
@@ -135,7 +135,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::construct)
}
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)