js/src/jit-test/tests/debug/Frame-onStep-08.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 // frame.onStep can coexist with breakpoints.
     3 var g = newGlobal();
     4 var dbg = Debugger(g);
     5 var log = '';
     6 dbg.onEnterFrame = function (frame) {
     7     var handler = {hit: function () { log += 'B'; }};
     8     var lines = frame.script.getAllOffsets();
     9     for (var line in lines) {
    10         line = Number(line);
    11         var offs = lines[line];
    12         for (var i = 0; i < offs.length; i++)
    13             frame.script.setBreakpoint(offs[i], handler);
    14     }
    16     frame.onStep = function () { log += 's'; };
    17 };
    19 g.eval("one = 1;\n" +
    20        "two = 2;\n" +
    21        "three = 3;\n" +
    22        "four = 4;\n");
    23 assertEq(g.four, 4);
    25 // Breakpoints hit on all four lines.
    26 assertEq(log.replace(/[^B]/g, ''), 'BBBB');
    28 // onStep was called between each pair of breakpoints.
    29 assertEq(/BB/.exec(log), null);

mercurial