1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:57:44 +00:00

LibJS: Support reading/writing elements in an Array via Object get/put

I'm not completely thrilled about Object::get() and Object::put() doing
special-case stuff for arrays, and we should probably come up with a
better abstraction for it.

But at least it works for now, which is really nice. :^)
This commit is contained in:
Andreas Kling 2020-03-20 20:51:59 +01:00
parent a3d2e07446
commit 8f7d4f67a4
3 changed files with 23 additions and 3 deletions

View file

@ -37,6 +37,7 @@ public:
i32 length() const { return static_cast<i32>(m_elements.size()); }
const Vector<Value>& elements() const { return m_elements; }
Vector<Value>& elements() { return m_elements; }
void append(Value);