summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Script-global-01.js
blob: fb2d131e35a54b29e6f6744e238c692a9cc639ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Debugger.Script.prototype.script returns the global the script runs in.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);

var log = '';
dbg.onDebuggerStatement = function (frame) {
  log += 'd';
  assertEq(frame.script.global, gw);
}

g.eval('debugger;');
assertEq(log, 'd');

g.eval('function f() { debugger; }');
g.f();
assertEq(log, 'dd');