tor-browser

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

Script-selfhosted-builtins.js (580B)


      1 // The script of self-hosted builtins is not exposed to the debugger and
      2 // instead is reported as |undefined| just like native builtins.
      3 
      4 let g = newGlobal({newCompartment: true});
      5 
      6 let dbg = new Debugger();
      7 let gw = dbg.addDebuggee(g);
      8 
      9 // Array is a known native builtin function.
     10 let nativeBuiltin = gw.makeDebuggeeValue(g.Array);
     11 assertEq(nativeBuiltin.script, undefined);
     12 
     13 // Array.prototype[@@iterator] is a known self-hosted builtin function.
     14 let selfhostedBuiltin = gw.makeDebuggeeValue(g.Array.prototype[Symbol.iterator]);
     15 assertEq(selfhostedBuiltin.script, undefined);