js/src/jit-test/tests/debug/Object-defineProperty-05.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 // defineProperty can define accessor properties.
     3 var g = newGlobal();
     4 var dbg = new Debugger;
     5 var gw = dbg.addDebuggee(g);
     6 g.value = undefined;
     7 g.eval("function gf() { return 12; }\n" +
     8        "function sf(v) { value = v; }\n");
     9 var gfw = gw.getOwnPropertyDescriptor("gf").value;
    10 var sfw = gw.getOwnPropertyDescriptor("sf").value;
    11 gw.defineProperty("x", {configurable: true, get: gfw, set: sfw});
    12 assertEq(g.x, 12);
    13 g.x = 'ok';
    14 assertEq(g.value, 'ok');
    16 var desc = g.Object.getOwnPropertyDescriptor(g, "x");
    17 assertEq(desc.configurable, true);
    18 assertEq(desc.enumerable, false);
    19 assertEq(desc.get, g.gf);
    20 assertEq(desc.set, g.sf);

mercurial