mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
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:
parent
ae9d64e544
commit
b27d90db1f
Notes:
sideshowbarker
2024-07-19 02:56:15 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/b27d90db1f4 Pull-request: https://github.com/SerenityOS/serenity/pull/3383 Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue