summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/closures/set-outer-trace-1.js
blob: 034a0e1974388337214b8210905cdfe219dc0f4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
actual = '';
expected = '10,19,128,337,646,1055,1564,2173,2882,3691,4600,';

function f() {
  var x = 10;
  
  var g = function(p) {
    for (var i = 0; i < 10; ++i) {
      x = p + i;
    }
  }
  
  for (var i = 0; i < 10; ++i) {
    appendToActual(x);
    g(100 * i + x);
  }

  appendToActual(x);
}

f();


assertEq(actual, expected)