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

mercurial