js/src/jit-test/tests/auto-regress/bug687099.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 // Binary: cache/js-dbg-64-94ceb173baed-linux
     2 // Flags: -m -n -a
     3 //
     5 gczeal(2);
     6 function iso(d) {
     7   return new Date(d).toISOString();
     8 }
     9 function check(s, millis){
    10   description = "Date.parse('"+s+"') == '"+iso(millis)+"'";
    11 }
    12 function dd(year, month, day, hour, minute, second, millis){
    13   return Date.UTC(year, month-1, day, hour, minute, second, millis);
    14 }
    15 function TZAtDate(d){
    16   return d.getTimezoneOffset() * 60000;
    17 }
    18 function TZInMonth(month){
    19   return TZAtDate(new Date(dd(2009,month,1,0,0,0,0)));
    20 }
    21 JulTZ = TZInMonth(7);
    22 check("2009-07-23T19:53:21.001+12:00", dd(2009,7,23,7,53,21,1));
    23 check("2009-07-23T19:53:21+12:00",     dd(2009,7,23,7,53,21,0));
    24 check("2009-07-23T19:53+12:00",        dd(2009,7,23,7,53,0,0));
    25 check("2009-07T19:53:21.001",          dd(2009,0Xe ,1,19,53,21,1)+JulTZ);
    26 check("2009-07T19:53:21",              dd(2009,7,1,19,53,21,0)+JulTZ);
    27 check("2009-07T19:53",                 dd(2009,7,1,19,53,0,0)+JulTZ);
    28 check("2009-07-23T19:53:21.001+12:00", dd(2009,7,23,7,53,21,1));
    29 check("2009-07-23T00:00:00.000-07:00", dd(2009,7,23,7,0,0,0));
    30 check("2009-07-23T24:00:00.000-07:00", dd(2009,7,24,7,0,0,0));

mercurial