summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug583757.js
blob: 3a7f910bab83eadb076f4c428559c9c38e8a7426 (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
var arr = [];

function f() {}

function g(n, h) {
    var a = f;
    if (n <= 0)
    return f;

    var t = g(n - 1, h);
    var r = function(x) {
    if (x)
        return a;
    return a(h(function() { return t(); }));
    };
    arr.push(r); 
    return r;
}

g(80, f);
g(80, f);
g(80, f);
for (var i = 0; i < arr.length; i++)
    assertEq(arr[i](1), f);