js/src/jit-test/tests/ion/bug816786.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 g;
     2 function test(a, b) {
     4     g = 0;
     5     for(var i=0; i<100; i++) {
     6         g += i
     7     }
     9     var t = a*b;
    11     for(var i=0; i<100; i++) {
    12         t = x.y + t;
    13         return t;
    14     }
    16 }
    18 function negzero(x) {
    19   return x===0 && (1/x)===-Infinity;
    20 }
    23 var x = {y:0};
    24 var a = 0;
    25 var b = 0;
    26 for(var i=0; i<58; i++) {
    27     var o = test(a, b);
    29     // Test returns
    30     // * 0, if i < 50
    31     // * -0, if i >= 50
    32     assertEq(negzero(o), i>50);
    34     if (i == 50) {
    35         a = -1
    36         x.y = -0
    37     }
    38 }

mercurial