summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/warp/function-var-environment-inlined.js
blob: f3b9c9b3b70e7127c2465433f6da18917a961597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function defaultValue() { return 3; }

function testCallee(p = defaultValue()) {
    var q = p + 1;
    return () => q + p;
}
function test() {
    var res = 0;
    for (var i = 0; i < 2000; i++) {
        res += testCallee()();
        res += testCallee(1)();
    }
    assertEq(res, 20000);
}
test();