Ignore:
Timestamp:
Sep 20, 2005, 1:07:57 AM (20 years ago)
Author:
ggaren
Message:

Test cases added:

  • layout-tests/fast/js/date-big-constructor-expected.txt: Added.
  • layout-tests/fast/js/date-big-constructor.html: Added.

Reviewed by darin.

  • kjs/date_object.cpp: (KJS::fillStructuresUsingDateArgs): (KJS::makeTime):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r10483 r10571  
    466466  // months
    467467  if (maxArgs >= 2 && idx < numArgs) {
    468     int months = args[idx++]->toInt32(exec);
    469 
    470     // t->tm_year must hold the bulk of the data to avoid overflow when converting
    471     // to a CFGregorianDate. (CFGregorianDate.month is an SInt8; CFGregorianDate.year is an SInt32.)
    472     t->tm_year += months / 12;
    473     t->tm_mon = months % 12;
     468    t->tm_mon = args[idx++]->toInt32(exec);
    474469  }
    475470 
     
    10151010    int utcOffset;
    10161011    if (utc) {
    1017         time_t zero = 0;
     1012        time_t zero = 0;
    10181013#if defined BSD || defined(__linux__) || defined(__APPLE__)
    10191014        struct tm t3;
     
    10311026#endif
    10321027    } else {
    1033         utcOffset = 0;
    1034         t->tm_isdst = -1;
    1035     }
     1028        utcOffset = 0;
     1029        t->tm_isdst = -1;
     1030    }
     1031   
     1032    // t->tm_year must hold the bulk of the data to avoid overflow when converting
     1033    // to a CFGregorianDate. (CFGregorianDate.month is an SInt8; CFGregorianDate.year is an SInt32.)
     1034    t->tm_year += t->tm_mon / 12;
     1035    t->tm_mon %= 12;
     1036   
    10361037
    10371038    double yearOffset = 0.0;
Note: See TracChangeset for help on using the changeset viewer.