tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Debugger-onNewGlobalObject-13.js (567B)


      1 // onNewGlobalObject handlers receive the correct Debugger.Object instances.
      2 
      3 var dbg = new Debugger;
      4 
      5 var gw = null;
      6 dbg.onNewGlobalObject = function (global) {
      7  assertEq(arguments.length, 1);
      8  assertEq(this, dbg);
      9  gw = global;
     10 };
     11 var g = newGlobal({newCompartment: true});
     12 assertEq(typeof gw, 'object');
     13 assertEq(dbg.addDebuggee(g), gw);
     14 
     15 // The Debugger.Objects passed to onNewGlobalObject are the global itself
     16 // without any cross-compartment wrappers.
     17 // NOTE: They also ignore any WindowProxy that may be associated with global.
     18 assertEq(gw.unwrap(), gw);