js/src/jit-test/tests/debug/Script-source-01.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 /*
     2  * Script.prototype.source should be an object. Moreover, it should be the
     3  * same object for each child script within the same debugger.
     4  */
     5 let g = newGlobal();
     6 let dbg = new Debugger(g);
     8 let count = 0;
     9 dbg.onNewScript = function (script) {
    10     assertEq(typeof script.source, "object");
    11     function traverse(script) {
    12         ++count;
    13         script.getChildScripts().forEach(function (child) {
    14             assertEq(child.source, script.source);
    15             traverse(child);
    16         });
    17     }
    18     traverse(script);
    19 }
    21 g.eval("2 * 3");
    22 g.eval("function f() {}");
    23 g.eval("function f() { function g() {} }");
    24 g.eval("eval('2 * 3')");
    25 g.eval("new Function('2 * 3')");
    26 assertEq(count, 10);

mercurial