tor-browser

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

Environment-names-01.js (634B)


      1 // env.names() lists nonenumerable names in with-statement environments.
      2 
      3 var g = newGlobal({newCompartment: true});
      4 var dbg = Debugger(g);
      5 var hits = 0;
      6 g.h = function () {
      7    var env = dbg.getNewestFrame().environment;
      8    var names = env.names();
      9    assertEq(names.indexOf("a") !== -1, true);
     10 
     11    // FIXME: Bug 748592 - proxies don't correctly propagate JSITER_HIDDEN
     12    //assertEq(names.indexOf("b") !== -1, true);
     13    //assertEq(names.indexOf("isPrototypeOf") !== -1, true);
     14    hits++;
     15 };
     16 g.eval("var obj = {a: 1};\n" +
     17       "Object.defineProperty(obj, 'b', {value: 2});\n" +
     18       "with (obj) h();");
     19 assertEq(hits, 1);