js/src/jit-test/tests/debug/Environment-names-01.js

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 // env.names() lists nonenumerable names in with-statement environments.
     3 var g = newGlobal();
     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);
    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);

mercurial