summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/bug1397385.js
blob: eea2c0c01eb994807042594c242ec33cee2620be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var g = newGlobal({newCompartment: true});

g.evaluate(`
    function testInnerFun(defaultArg = 1) {
        function innerFun(expectedThis) { return this; }
        h();
        return innerFun; // To prevent the JIT from optimizing out innerFun.
    }
`);

g.h = function () {
    var res = (new Debugger(g)).getNewestFrame().eval('assertEq(innerFun(), this)');
    assertEq("return" in res, true);
}

g.testInnerFun();