js/src/jit-test/tests/ion/bug909401.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 TZ_PST = -8;
     2 var TZ_DIFF = GetTimezoneOffset();
     3 var PST_DIFF = TZ_DIFF - TZ_PST;
     4 function GetTimezoneOffset() {}
     5 function adjustResultArray(ResultArray) {
     6     var t = ResultArray[TIME] - PST_DIFF;
     7     ResultArray[UTC_YEAR] = YearFromTime(t);
     8 }
     9 function TimeInYear( y ) {}
    10 function YearFromTime( t ) {
    11     var sign = ( t < 0 ) ? -1 : 1;
    12     var year = ( sign < 0 ) ? 1969 : 1970;
    13     for ( var timeToTimeZero = t; ;  ) {
    14 	timeToTimeZero -= sign * TimeInYear(year)
    15         break;
    16     }
    17     return ( year );
    18 }
    19 gczeal(4);
    20 evaluate("\
    21 var TIME        = 0;\
    22 var UTC_YEAR    = 1;\
    23 adjustResultArray([]);\
    24 adjustResultArray([946684800000-1]);\
    25 adjustResultArray([]);\
    26 ", { noScriptRval : true });

mercurial