1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-07 21:17:07 +09:00

LibJS: Add missing update for holes count in IndexedPropertyStorage

This one is required to cover the case when new empty elements are
introduced by assigning to element with index > length, like:
```js
var x = [];
x[0] = 1;
x[2] = 2;
```
This commit is contained in:
Aliaksandr Kalenik 2025-06-03 19:06:56 +02:00 committed by Alexander Kalenik
parent 3781c132aa
commit 22e0b732db
Notes: github-actions[bot] 2025-06-03 21:19:45 +00:00

View file

@ -48,6 +48,7 @@ void SimpleIndexedPropertyStorage::put(u32 index, Value value, PropertyAttribute
VERIFY(attributes == default_attributes);
if (index >= m_array_size) {
m_number_of_empty_elements += index - m_array_size;
m_array_size = index + 1;
grow_storage_if_needed();
} else {