summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/ErrorConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/Runtime/ErrorConstructor.cpp')
-rw-r--r--Libraries/LibJS/Runtime/ErrorConstructor.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Libraries/LibJS/Runtime/ErrorConstructor.cpp
index 0973ed37be..b3213798ef 100644
--- a/Libraries/LibJS/Runtime/ErrorConstructor.cpp
+++ b/Libraries/LibJS/Runtime/ErrorConstructor.cpp
@@ -31,10 +31,14 @@
namespace JS {
-ErrorConstructor::ErrorConstructor()
- : NativeFunction("Error", *interpreter().global_object().function_prototype())
+ErrorConstructor::ErrorConstructor(GlobalObject& global_object)
+ : NativeFunction("Error", *global_object.function_prototype())
{
- define_property("prototype", interpreter().global_object().error_prototype(), 0);
+}
+
+void ErrorConstructor::initialize(Interpreter&, GlobalObject& global_object)
+{
+ define_property("prototype", global_object.error_prototype(), 0);
define_property("length", Value(1), Attribute::Configurable);
}
@@ -59,10 +63,13 @@ Value ErrorConstructor::construct(Interpreter& interpreter)
}
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
- ConstructorName::ConstructorName() \
- : NativeFunction(*interpreter().global_object().function_prototype()) \
+ ConstructorName::ConstructorName(GlobalObject& global_object) \
+ : NativeFunction(*global_object.function_prototype()) \
+ { \
+ } \
+ void ConstructorName::initialize(Interpreter&, GlobalObject& global_object) \
{ \
- define_property("prototype", interpreter().global_object().snake_name##_prototype(), 0); \
+ define_property("prototype", global_object.snake_name##_prototype(), 0); \
define_property("length", Value(1), Attribute::Configurable); \
} \
ConstructorName::~ConstructorName() { } \