summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testNewArrayCount.js
blob: cb7e6d9843cdbf050c62d9a025edc97e81c8c168 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function testNewArrayCount()
{
  function count(a) { var n = 0; for (var p in a) n++; return n; }
  var a = [];
  for (var i = 0; i < 5; i++)
    a = [0];
  assertEq(count(a), 1);
  for (var i = 0; i < 5; i++)
    a = [0, , 2];
  assertEq(count(a), 2);
}
testNewArrayCount();