js/src/jit-test/tests/debug/Frame-onStep-02.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 // Setting frame.onStep to undefined turns off single-stepping.
     3 var g = newGlobal();
     4 g.a = 0;
     5 g.eval("function f() {\n" +
     6        "    a++;\n" +
     7        "    a++;\n" +
     8        "    a++;\n" +
     9        "    a++;\n" +
    10        "    return a;\n" +
    11        "}\n");
    13 var dbg = Debugger(g);
    14 var seen = [0, 0, 0, 0, 0];
    15 dbg.onEnterFrame = function (frame) {
    16     seen[g.a] = 1;
    17     frame.onStep = function () {
    18         seen[g.a] = 1;
    19         if (g.a === 2) {
    20             frame.onStep = undefined;
    21             assertEq(frame.onStep, undefined);
    22         }
    23     };
    24 }
    26 g.f();
    27 assertEq(seen.join(","), "1,1,1,0,0");

mercurial