summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/closures/setname-1.js
blob: 63e3be3f4a51c720cd0ecd497fada1bdeccc7542 (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
26
actual = '';
expected = '4,4,4,4,4,';

function f() {
  var k = 0;

  function g() {
    for (var i = 0; i < 5; ++i) {
      k = i;
    }
  }

  function h() {
    for (var i = 0; i < 5; ++i) {
      appendToActual(k);
    }
  }

  g();
  h();
}

f();


assertEq(actual, expected)