js/src/jit-test/tests/debug/resumption-05.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 // |jit-test| debug
     2 // null resumption value means terminate the debuggee
     4 var g = newGlobal();
     5 g.debuggeeGlobal = this;
     6 g.eval("(" + function () { 
     7         var dbg = new Debugger(debuggeeGlobal);
     8         dbg.onDebuggerStatement = function (frame) {
     9             if (frame.callee === null) {
    10                 // The first debugger statement below.
    11                 debuggeeGlobal.log += "1";
    12                 var cv = frame.eval("f();");
    13                 assertEq(cv, null);
    14                 debuggeeGlobal.log += "2";
    15             } else {
    16                 // The second debugger statement.
    17                 debuggeeGlobal.log += "3";
    18                 assertEq(frame.callee.name, "f");
    19                 return null;
    20             }
    21         };
    22     } + ")()");
    24 var log = "";
    25 debugger;
    27 function f() {
    28     log += "4";
    29     try {
    30         debugger;  // the debugger terminates us here
    31     } finally {
    32         log += "5";  // this should not execute
    33     }
    34 }
    36 assertEq(log, "1432");

mercurial