js/src/jit-test/tests/debug/Frame-live-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 // |jit-test| debug
     2 // Debugger.Frame.prototype.live is false for frames that have thrown or been thrown through
     4 load(libdir + "asserts.js");
     6 var g = newGlobal();
     7 g.debuggeeGlobal = this;
     8 g.eval("var finalCheck;");
     9 g.eval("(" + function () {
    10         var a = [];
    11         var dbg = Debugger(debuggeeGlobal);
    12         dbg.onDebuggerStatement = function (frame) {
    13             a.push(frame);
    14             for (var i = 0; i < a.length; i++)
    15                 assertEq(a[i].live, true);
    16         };
    17         finalCheck = function (n) {
    18             assertEq(a.length, n);
    19             for (var i = 0; i < n; i++)
    20                 assertEq(a[i].live, false);
    21         };
    22     } + ")()");
    24 function f(n) {
    25     debugger;
    26     if (--n > 0)
    27         f(n);
    28     else
    29         throw "fit";
    30 }
    32 assertThrowsValue(function () { f(10); }, "fit");
    33 g.finalCheck(10);

mercurial