tor-browser

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

Environment-getVariable-14.js (386B)


      1 // Debugger.Environment can reflect optimized out function scopes
      2 
      3 var g = newGlobal({newCompartment: true});
      4 var dbg = new Debugger;
      5 dbg.addDebuggee(g);
      6 
      7 g.eval("" + function f() {
      8  var x = 42;
      9  function g() { }
     10  g();
     11 });
     12 
     13 dbg.onEnterFrame = function (f) {
     14  if (f.callee && (f.callee.name === "g"))
     15    assertEq(f.environment.parent.getVariable("x").optimizedOut, true);
     16 }
     17 
     18 g.f();