js/src/jit-test/tests/closures/t031.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:7a4f9a8950e0
1 actual = '';
2 expected = '4,4,4,';
3
4 function k(f_arg) {
5 for (var i = 0; i < 5; ++i) {
6 f_arg(i);
7 }
8 }
9
10 function t() {
11 var x = 1;
12 k(function (i) { x = i; });
13 appendToActual(x);
14 }
15
16 t();
17 t();
18 t();
19
20
21 assertEq(actual, expected)

mercurial