diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-18 13:18:06 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-18 13:24:45 +0200 |
commit | fca08bd000e613459baf62fa8d37552ef11f3fe6 (patch) | |
tree | f20e36879896fb150a6031b4383b53296de6ca45 /Libraries/LibJS/Runtime/ArrayConstructor.cpp | |
parent | cbcf317e760c3370d10cfc525f0f528abd44e820 (diff) | |
download | serenity-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.cpp | 5 |
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)); } |