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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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