summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/closure-02.js
blob: 902c8f5ae78e333bbb8110b35bee62aa95a4a50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

/* Non-reentrant closure used in an invoke session. */

var last = null;

var a = [1,2,3,4,5,6,7,8];
var b = a.map(function(x) {
    x++;
    var res = last ? last() : 0;
    last = function() { return x; };
    return res;
  });

assertEq("" + b, "0,2,3,4,5,6,7,8");