js/src/jit-test/tests/ion/bug703376.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 var global = 1;
     3 function test1(x) {
     4     global = 2;
     5     var k = global;
     6     global = x;
     7     global = x + 1;
     8     k = global + global;
     9     return k;
    10 }
    12 for (var i=0; i<60; i++) {
    13     assertEq(test1(i), i + 1 + i + 1);
    14 }
    16 function test2(x) {
    17     global = 2;
    18     var k = global;
    20     for (var i=0; i<10; i++) {
    21         k = global;
    22         global = i + x;
    23     }
    24     return k;
    25 }
    27 for (i=0; i<50; i++) {
    28     assertEq(test2(i), i + 8);
    29 }

mercurial