js/src/jit-test/tests/debug/Object-defineProperty-09.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't re-define non-configurable properties.
     2 // Also: when defineProperty throws, the exception is native to the debugger
     3 // compartment, not a wrapper.
     5 var g = newGlobal();
     6 var dbg = new Debugger;
     7 var gw = dbg.addDebuggee(g);
     8 gw.defineProperty("p", {value: 1});
     9 g.p = 4;
    10 assertEq(g.p, 1);
    12 var threw;
    13 try {
    14     gw.defineProperty("p", {value: 2});
    15     threw = false;
    16 } catch (exc) {
    17     threw = true;
    18     assertEq(exc instanceof TypeError, true);
    19     assertEq(typeof exc.message, "string");
    20     assertEq(typeof exc.stack, "string");
    21 }
    22 assertEq(threw, true);
    24 assertEq(g.p, 1);

mercurial