LibJS: Make Array constructor take its prototype

Let's start moving towards native JS objects taking their prototype as
a constructor argument.

This will eventually allow us to move prototypes off of Interpreter and
into GlobalObject.
This commit is contained in:
Andreas Kling 2020-04-17 18:24:01 +02:00
commit 2d7b495244
Notes: sideshowbarker 2024-07-19 07:31:46 +09:00
7 changed files with 23 additions and 12 deletions

View file

@ -32,7 +32,9 @@ namespace JS {
class Array final : public Object {
public:
Array();
static Array* create(GlobalObject&);
explicit Array(Object& prototype);
virtual ~Array() override;
i32 length() const { return static_cast<i32>(elements().size()); }
@ -45,4 +47,5 @@ private:
static void length_setter(Interpreter&, Value);
};
}