js/src/jit-test/tests/debug/Frame-eval-20.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 // Eval-in-frame with different type on non-youngest Ion frame.
     3 load(libdir + "jitopts.js");
     5 if (!jitTogglesMatch(Opts_Ion2NoParallelCompilation))
     6   quit(0);
     8 withJitOptions(Opts_Ion2NoParallelCompilation, function () {
     9   function test(shadow) {
    10     var g = newGlobal();
    11     var dbg = new Debugger;
    13     // Note that we depend on CCW scripted functions being opaque to Ion
    14     // optimization for this test.
    15     g.h = function h(d) {
    16       if (d) {
    17         dbg.addDebuggee(g);
    18         var f = dbg.getNewestFrame().older;
    19         assertEq(f.implementation, "ion");
    20         assertEq(f.environment.getVariable("foo"), 42);
    22         // EIF of a different type too.
    23         f.eval((shadow ? "var " : "") + "foo = 'string of 42'");
    24         g.expected = shadow ? 42 : "string of 42";
    25       }
    26     }
    28     g.eval("" + function f(d) {
    29       var foo = 42;
    30       g(d);
    31       return foo;
    32     });
    33     g.eval("" + function g(d) {
    34       h(d);
    35     });
    37     g.eval("(" + function () {
    38       for (i = 0; i < 5; i++)
    39         f(false);
    40       assertEq(f(true), "string of 42");
    41     } + ")();");
    42   }
    44   test(false);
    45   test(true);
    46 });

mercurial