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.
|