Details
-
Bug
-
Status: Resolved
-
P4
-
Resolution: Fixed
-
8
-
b85
-
generic
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142298 | emb-9 | Hannes Wallnoefer | P4 | Resolved | Fixed | team |
JDK-8141008 | 8u91 | Hannes Wallnoefer | P4 | Resolved | Fixed | b01 |
JDK-8138770 | 8u72 | Hannes Wallnoefer | P4 | Resolved | Fixed | b01 |
JDK-8147377 | emb-8u91 | Hannes Wallnoefer | P4 | Resolved | Fixed | b01 |
Description
When an element is set in a sparse array that is stored in the underlying dense array and causes the dense array to grow, the elements between the old dense array length and the new index are not deleted.
var x = [];
x[10000000] = 1;
x[10] = 1;
x[20] = 1;
print(Object.keys(x));
Expected output:
10,20,10000000
Actual output:
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,10000000
The fix is to add functionality similar to that in ScriptObject.doesNotHaveEnsureDelete in SparseArrayData.set.
var x = [];
x[10000000] = 1;
x[10] = 1;
x[20] = 1;
print(Object.keys(x));
Expected output:
10,20,10000000
Actual output:
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,10000000
The fix is to add functionality similar to that in ScriptObject.doesNotHaveEnsureDelete in SparseArrayData.set.
Attachments
Issue Links
- backported by
-
JDK-8138770 Sparse array does not handle growth of underlying dense array
-
- Resolved
-
-
JDK-8141008 Sparse array does not handle growth of underlying dense array
-
- Resolved
-
-
JDK-8142298 Sparse array does not handle growth of underlying dense array
-
- Resolved
-
-
JDK-8147377 Sparse array does not handle growth of underlying dense array
-
- Resolved
-