summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/closures/lambdafc.js
blob: 03fc5ed2c0db1a86cbe9404b7e1490ba286278b4 (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
25
actual = '';
expected = '99,';

function g(p) {
  appendToActual(p());
}

function d(k) {
  return function() { return k; }
}

function f(k) {
  var p;
  
  for (var i = 0; i < 1000; ++i) {
    p = d(k);
  }

  g(p);
}

f(99);


assertEq(actual, expected)