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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/closures/t009.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +actual = '';
     1.5 +expected = '4,';
     1.6 +
     1.7 +function k(f_arg) { 
     1.8 +  for (var i = 0; i < 5; ++i) {
     1.9 +    f_arg(i);
    1.10 +  }
    1.11 +}
    1.12 +
    1.13 +function t(x) {
    1.14 +  k(function (i) { x = i; });
    1.15 +  appendToActual(x);
    1.16 +}
    1.17 +
    1.18 +t(1);
    1.19 +
    1.20 +
    1.21 +assertEq(actual, expected)

mercurial