LibJS: Actually change size in generic storage's set_array_like_size()

Looks like an oversight to me - we were not actually setting a new value
for m_array_size, which would cause arrays created with generic storage
to report a .length of 0.
This commit is contained in:
Linus Groh 2020-09-01 19:47:50 +01:00 committed by Andreas Kling
parent ae9d64e544
commit b27d90db1f
Notes: sideshowbarker 2024-07-19 02:56:15 +09:00

View file

@ -208,6 +208,7 @@ ValueAndAttributes GenericIndexedPropertyStorage::take_last()
void GenericIndexedPropertyStorage::set_array_like_size(size_t new_size)
{
m_array_size = new_size;
if (new_size < SPARSE_ARRAY_THRESHOLD) {
m_packed_elements.resize(new_size);
m_sparse_elements.clear();