js/src/jit-test/tests/auto-regress/bug687099.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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