summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-02.js
blob: c8c3d74addcf90c642f43c9c355dfac6868b1907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// onNewGlobalObject handlers fire, until they are removed.

var dbg = new Debugger;
var log;

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

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

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

log = '';
dbg.onNewGlobalObject = undefined;
newGlobal();
assertEq(log, '');