js/src/jit-test/tests/debug/Debugger-findScripts-04.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 // Within a series of evals and calls, all their frames' scripts appear in findScripts' result.
     2 var g = newGlobal();
     3 var dbg = new Debugger(g);
     4 var log;
     6 g.check = function () {
     7     log += 'c';
     8     var scripts = dbg.findScripts();
    10     var innerEvalFrame = dbg.getNewestFrame();
    11     assertEq(innerEvalFrame.type, "eval");
    12     assertEq(scripts.indexOf(innerEvalFrame.script) != -1, true);
    14     var callFrame = innerEvalFrame.older;
    15     assertEq(callFrame.type, "call");
    16     assertEq(scripts.indexOf(callFrame.script) != -1, true);
    18     var outerEvalFrame = callFrame.older;
    19     assertEq(outerEvalFrame.type, "eval");
    20     assertEq(scripts.indexOf(outerEvalFrame.script) != -1, true);
    21     assertEq(innerEvalFrame != outerEvalFrame, true);
    22 };
    24 g.eval('function f() { eval("check();") }');
    25 log = '';
    26 g.eval('f();');
    27 assertEq(log, 'c');

mercurial