LibJS: Add basic Array constructor

We only support Array() with 0 or 1 parameters so far.
This commit is contained in:
Andreas Kling 2020-04-04 22:28:21 +02:00
commit d155491122
Notes: sideshowbarker 2024-07-19 07:55:44 +09:00
6 changed files with 132 additions and 0 deletions

View file

@ -2,6 +2,7 @@
#include <AK/String.h>
#include <LibJS/Heap/Heap.h>
#include <LibJS/Interpreter.h>
#include <LibJS/Runtime/ArrayConstructor.h>
#include <LibJS/Runtime/ConsoleObject.h>
#include <LibJS/Runtime/DateConstructor.h>
#include <LibJS/Runtime/ErrorConstructor.h>
@ -30,6 +31,7 @@ GlobalObject::GlobalObject()
put("Function", heap().allocate<FunctionConstructor>());
put("Math", heap().allocate<MathObject>());
put("Object", heap().allocate<ObjectConstructor>());
put("Array", heap().allocate<ArrayConstructor>());
}
GlobalObject::~GlobalObject()