Ignore:
Timestamp:
Jul 24, 2006, 4:45:34 AM (19 years ago)
Author:
rwlbuis
Message:

Reviewed by Darin.

http://bugzilla.opendarwin.org/show_bug.cgi?id=5257
setYear() does not match FireFox/IE behavior

Make sure the right values end up in tm_year.

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

Legend:

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

    r14821 r15594  
    658658    break;
    659659  case SetYear:
    660     t.tm_year = args[0]->toInt32(exec) >= 1900 ? args[0]->toInt32(exec) - 1900 : args[0]->toInt32(exec);
     660    t.tm_year = (args[0]->toInt32(exec) > 99 || args[0]->toInt32(exec) < 0) ? args[0]->toInt32(exec) - 1900 : args[0]->toInt32(exec);
    661661    break;
    662662  }
Note: See TracChangeset for help on using the changeset viewer.