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.

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

mercurial