1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +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:
Andreas Kling 2020-03-20 21:01:36 +01:00
parent 8f7d4f67a4
commit bceabd7c4b
9 changed files with 110 additions and 4 deletions

View file

@ -39,7 +39,7 @@ public:
const Vector<Value>& elements() const { return m_elements; }
Vector<Value>& elements() { return m_elements; }
void append(Value);
void push(Value);
private:
virtual const char* class_name() const override { return "Array"; }