summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/Error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/Runtime/Error.cpp')
-rw-r--r--Libraries/LibJS/Runtime/Error.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Libraries/LibJS/Runtime/Error.cpp b/Libraries/LibJS/Runtime/Error.cpp
index d6ea45cf4f..c41e87854f 100644
--- a/Libraries/LibJS/Runtime/Error.cpp
+++ b/Libraries/LibJS/Runtime/Error.cpp
@@ -33,7 +33,7 @@ namespace JS {
Error* Error::create(GlobalObject& global_object, const FlyString& name, const String& message)
{
auto& interpreter = global_object.interpreter();
- return interpreter.heap().allocate<Error>(name, message, *interpreter.error_prototype());
+ return interpreter.heap().allocate<Error>(name, message, *global_object.error_prototype());
}
Error::Error(const FlyString& name, const String& message, Object& prototype)
@@ -51,8 +51,7 @@ Error::~Error()
#define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
ClassName* ClassName::create(GlobalObject& global_object, const String& message) \
{ \
- auto& interpreter = global_object.interpreter(); \
- return interpreter.heap().allocate<ClassName>(message, *interpreter.snake_name##_prototype()); \
+ return global_object.heap().allocate<ClassName>(message, *global_object.snake_name##_prototype()); \
} \
ClassName::ClassName(const String& message, Object& prototype) \
: Error(#ClassName, message, prototype) \