summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/loops/hoist-06.js
blob: fc2919cda2c2044caa834815241d25f03f2a4d2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

function foo(x, n, y) {
  var q = 0;
  for (var j = 0; j < n; j++) {
    if (x[j] < y)
      q++;
  }
  assertEq(q, 1);
}

var x = [1,2,3,4,5];
var y = { valueOf: function() { x.length = 0; return 6; } };

var a = foo(x, 5, y);