diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/basic/densify-elements.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/densify-elements.js b/js/src/jit-test/tests/basic/densify-elements.js new file mode 100644 index 0000000000..f2944c0e55 --- /dev/null +++ b/js/src/jit-test/tests/basic/densify-elements.js @@ -0,0 +1,15 @@ +function f(o) { + for (var i = 1; i <= 5; i += 4) { + var start = i * 4000; + var end = (start * 1.4)|0; + for (var j = end; j > start; j--) { + o[j] = j; + } + } + assertEq(Object.keys(o).length, 9600); +} +f({}); +f([]); +let obj = newObjectWithManyReservedSlots(); +f(obj); +checkObjectWithManyReservedSlots(obj); |