summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/ArrayConstructor.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-18 13:18:06 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-18 13:24:45 +0200
commitfca08bd000e613459baf62fa8d37552ef11f3fe6 (patch)
treef20e36879896fb150a6031b4383b53296de6ca45 /Libraries/LibJS/Runtime/ArrayConstructor.cpp
parentcbcf317e760c3370d10cfc525f0f528abd44e820 (diff)
downloadserenity-fca08bd000e613459baf62fa8d37552ef11f3fe6.zip
LibJS: Move builtin prototypes to the global object
This moves us towards being able to run JavaScript in different global objects without allocating a separate GC heap.
Diffstat (limited to 'Libraries/LibJS/Runtime/ArrayConstructor.cpp')
-rw-r--r--Libraries/LibJS/Runtime/ArrayConstructor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Libraries/LibJS/Runtime/ArrayConstructor.cpp
index 2fd7162f33..0c9d2ea12f 100644
--- a/Libraries/LibJS/Runtime/ArrayConstructor.cpp
+++ b/Libraries/LibJS/Runtime/ArrayConstructor.cpp
@@ -29,14 +29,15 @@
#include <LibJS/Interpreter.h>
#include <LibJS/Runtime/Array.h>
#include <LibJS/Runtime/ArrayConstructor.h>
+#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Shape.h>
namespace JS {
ArrayConstructor::ArrayConstructor()
- : NativeFunction("Array", *interpreter().function_prototype())
+ : NativeFunction("Array", *interpreter().global_object().function_prototype())
{
- put("prototype", interpreter().array_prototype());
+ put("prototype", interpreter().global_object().array_prototype());
put("length", Value(1));
}