js/src/jit-test/tests/debug/Frame-onPop-14.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 // A frame's onPop handler is called only once, even if it is for a function
     2 // called from a loop.
     3 var g = newGlobal();
     4 var dbg = new Debugger(g);
     5 var log;
     7 var count;
     8 dbg.onDebuggerStatement = function handleDebug(frame) {
     9     log += 'd';
    10     assertEq(frame.type, "call");
    11     count++;
    12     if (count == 10) {
    13         frame.onPop = function handlePop(c) {
    14             log += ')' + this.arguments[0];
    15             assertEq(c.return, "snifter");
    16         };
    17     }
    18 };
    20 g.eval("function f(n) { debugger; return 'snifter'; }");
    21 log = '';
    22 count = 0;
    23 g.eval("for (i = 0; i < 20; i++) f(i);");
    24 assertEq(count, 20);
    25 assertEq(log, "dddddddddd)9dddddddddd");

mercurial