diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-20 20:51:59 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-20 21:56:40 +0100 |
commit | 8f7d4f67a4907297d60e0e2a5cc3cfdddfc69814 (patch) | |
tree | ec449493a624f99c527a9dc86bb93f2e47820014 /Libraries/LibJS/Runtime/Array.h | |
parent | a3d2e074466598598ce1b3b8dadbb7c22c54b0a8 (diff) | |
download | serenity-8f7d4f67a4907297d60e0e2a5cc3cfdddfc69814.zip |
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. :^)
Diffstat (limited to 'Libraries/LibJS/Runtime/Array.h')
-rw-r--r-- | Libraries/LibJS/Runtime/Array.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibJS/Runtime/Array.h b/Libraries/LibJS/Runtime/Array.h index 63baca7dfe..7cc3ac3c7a 100644 --- a/Libraries/LibJS/Runtime/Array.h +++ b/Libraries/LibJS/Runtime/Array.h @@ -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); |