mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:47:45 +00:00
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:
parent
ee5816b9c8
commit
2d7b495244
7 changed files with 23 additions and 12 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue