js/src/jit-test/tests/debug/resumption-03.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 // |jit-test| debug
     2 // Returning and throwing objects.
     4 load(libdir + "asserts.js");
     6 var g = newGlobal();
     7 g.debuggeeGlobal = this;
     8 g.eval("(" + function () {
     9         var how, what;
    10         var dbg = new Debugger(debuggeeGlobal);
    11         dbg.onDebuggerStatement = function (frame) {
    12             if (frame.callee.name === "configure") {
    13                 how = frame.arguments[0];
    14                 what = frame.arguments[1];
    15             } else {
    16                 var resume = {};
    17                 resume[how] = what;
    18                 return resume;
    19             }
    20         };
    21     } + ")();");
    23 function configure(how, what) { debugger; }
    24 function fire() { debugger; }
    26 var d = new Date;
    27 configure('return', d);
    28 assertEq(fire(), d);
    29 configure('return', Math);
    30 assertEq(fire(), Math);
    32 var x = new Error('oh no what are you doing');
    33 configure('throw', x);
    34 assertThrowsValue(fire, x);
    35 configure('throw', parseInt);
    36 assertThrowsValue(fire, parseInt);

mercurial