js/src/jit-test/tests/debug/Debugger-debuggees-26.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 // Ion can bail in-place when throwing exceptions with debug mode toggled on.
     3 load(libdir + "jitopts.js");
     5 if (!jitTogglesMatch(Opts_Ion2NoParallelCompilation))
     6   quit();
     8 withJitOptions(Opts_Ion2NoParallelCompilation, function () {
     9   var g = newGlobal();
    10   var dbg = new Debugger;
    12   g.toggle = function toggle(x, d) {
    13     if (d) {
    14       dbg.addDebuggee(g);
    15       var frame = dbg.getNewestFrame().older;
    16       assertEq(frame.callee.name, "f");
    17       assertEq(frame.implementation, "ion");
    18       throw 42;
    19     }
    20   };
    22   g.eval("" + function f(x, d) { g(x, d); });
    23   g.eval("" + function g(x, d) { toggle(x, d); });
    25   try {
    26     g.eval("(" + function test() {
    27       for (var i = 0; i < 5; i++)
    28         f(42, false);
    29       f(42, true);
    30     } + ")();");
    31   } catch (exc) {
    32     assertEq(exc, 42);
    33   }
    34 });

mercurial