js/src/jit-test/tests/ion/bug729788.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 msPerDay = 86400000;
     2 function Day(t) {
     3     return Math.floor(t / msPerDay);
     4 }
     5 function YearFromTime(t) {
     6     sign = 1
     7     year = sign < 0
     8 }
     9 function MonthFromTime(t) {
    10     DayWithinYear(t)
    11     function DayWithinYear(t) Day(t) - YearFromTime()
    12     function WeekDay(t) {
    13         weekday = Day(t) + 4
    14         return (weekday < 0 ? weekday : weekday);
    15     }
    16     time = year
    17     for (var last_sunday = time; WeekDay(last_sunday) == 0;) {}
    18 }
    19 addTestCase(0, 946684800000);
    20 function addTestCase(startms, newms) {
    21     UTCDateFromTime(newms)
    22 }
    23 function UTCDateFromTime(t) {
    24     MonthFromTime(t)
    25 }

mercurial