summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/bug1397049.js
blob: 484fc2a1788e12a1dd51b244b50fe993cbd81de9 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Run debugger in its own global
let g = newGlobal({newCompartment: true});
g.target = this;
g.evaluate(`
    let d = new Debugger;
    let gw = d.addDebuggee(target);

    d.onDebuggerStatement = function(frame)
    {
        frame = frame.older;

        let res = frame.eval("this");
        assertEq(res.return, frame.this);

        res = frame.evalWithBindings("this", {x:42});
        assertEq(res.return, frame.this);
    }
`);

// Debugger statement affects parse so hide in another function
function brk() { debugger; }

function f1() {
    var temp = "string";
    brk();
}

function f2() {
    let temp = "string";
    brk();
}

function f3() {
    const temp = "string";
    brk();
}

f1.call({});
f2.call({});
f3.call({});