js/src/jit-test/tests/debug/Frame-onStep-10.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 // Throwing and catching an error in an onStep handler shouldn't interfere
     2 // with throwing and catching in the debuggee.
     4 var g = newGlobal();
     5 g.eval("function f() { debugger; throw 'mud'; }");
     7 var dbg = Debugger(g);
     8 var stepped = false;
     9 dbg.onDebuggerStatement = function (frame) {
    10     frame.older.onStep = function () {
    11         stepped = true;
    12         try {
    13             throw 'snow';
    14         } catch (x) {
    15             assertEq(x, 'snow');
    16         }
    17     };
    18 };
    20 stepped = false;
    21 g.eval("var caught;\n" +
    22        "try {\n" +
    23        "    f();\n" +
    24        "} catch (x) {\n" +
    25        "    caught = x;\n" +
    26        "}\n");
    27 assertEq(stepped, true);
    28 assertEq(g.caught, 'mud');

mercurial