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

var g = newGlobal();
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');

assertEq(gw.getOwnPropertyDescriptor('f').value.global, gw);