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:
parent
3781c132aa
commit
22e0b732db
Notes:
github-actions[bot]
2025-06-03 21:19:45 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 22e0b732db
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4985
1 changed files with 1 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue