summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-15.js
blob: 16431a4061e099cf4419fc755394dbd8d7a2f826 (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
// Globals marked as invisibleToDebugger behave appropriately.

load(libdir + "asserts.js");

var dbg = new Debugger;
var log = '';
dbg.onNewGlobalObject = function (global) {
  log += 'n';
}

assertEq(typeof newGlobal(), "object");
assertEq(typeof newGlobal({invisibleToDebugger: false}), "object");
assertEq(log, 'nn');

log = '';
assertEq(typeof newGlobal({invisibleToDebugger: true}), "object");
assertEq(log, '');

assertThrowsInstanceOf(() => dbg.addDebuggee(newGlobal({invisibleToDebugger: true})), Error);

var glob = newGlobal({invisibleToDebugger: true});
dbg.addAllGlobalsAsDebuggees();
dbg.onDebuggerStatement = function (frame) { assertEq(true, false); };
glob.eval('debugger');