mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibJS: Add ArrayPrototype and implement Array.prototype.push()
This function is ultimately supposed to be generic and allow any |this| that has a length property, but for now it only works on our own Array object type.
This commit is contained in:
parent
8f7d4f67a4
commit
bceabd7c4b
9 changed files with 110 additions and 4 deletions
|
@ -97,6 +97,7 @@ public:
|
|||
|
||||
Object* string_prototype() { return m_string_prototype; }
|
||||
Object* object_prototype() { return m_object_prototype; }
|
||||
Object* array_prototype() { return m_array_prototype; }
|
||||
|
||||
private:
|
||||
Heap m_heap;
|
||||
|
@ -107,6 +108,7 @@ private:
|
|||
Object* m_global_object { nullptr };
|
||||
Object* m_string_prototype { nullptr };
|
||||
Object* m_object_prototype { nullptr };
|
||||
Object* m_array_prototype { nullptr };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue