summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-04.js
blob: 096a2deadfe04466478b248499ba116ecbfd340b (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
// onNewGlobalObject handlers only fire on enabled Debuggers.

var dbg = new Debugger;
var log;

dbg.onNewGlobalObject = function (global) {
  log += 'n';
  assertEq(global.seen, undefined);
  global.seen = true;
};

log = '';
newGlobal();
assertEq(log, 'n');

log = '';
dbg.enabled = false;
newGlobal();
assertEq(log, '');

log = '';
dbg.enabled = true;
newGlobal();
assertEq(log, 'n');