Debian Codegraph @

js/src/jit-test/tests/debug/bug1397049.js

raw
1 // Run debugger in its own global
2 let g = newGlobal({newCompartment: true});
3 g.target = this;
4 g.evaluate(`
5 let d = new Debugger;
6 let gw = d.addDebuggee(target);
7
8 d.onDebuggerStatement = function(frame)
9 {
10 frame = frame.older;
11
12 let res = frame.eval("this");
13 assertEq(res.return, frame.this);
14
15 res = frame.evalWithBindings("this", {x:42});
16 assertEq(res.return, frame.this);
17 }
18 `);
19
20 // Debugger statement affects parse so hide in another function
21 function brk() { debugger; }
22
23 function f1() {
24 var temp = "string";
25 brk();
26 }
27
28 function f2() {
29 let temp = "string";
30 brk();
31 }
32
33 function f3() {
34 const temp = "string";
35 brk();
36 }
37
38 f1.call({});
39 f2.call({});
40 f3.call({});