summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/loops/hoist-07.js
blob: a409f70559133f2b48e2421421382819953cd74e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var res = 0;

function foo(x, n, y) {
  for (var j = 0; j < n; j++) {
    x[j];
    y.f;
  }
}

var x = [1,2,3,4,5];
var y = {};
Object.defineProperty(y, 'f', {get:function() { res++; x.length = 2; }});

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

assertEq(res, 5);