Ignore:
Timestamp:
Jan 15, 2003, 8:42:41 AM (22 years ago)
Author:
darin
Message:

Reviewed by Ken.

  • rolled in a change from the KJS folks

Fixes a bug where the date functions would not accept non-strings.
And provides a bit of a speedup.

  • kjs/date_object.h: Change parameter type for parseDate.
  • kjs/date_object.cpp: (DateObjectFuncImp::call): Always call toString, don't check the type. (KJS::parseDate): Take a UString parameter, not a String parameter.
File:
1 edited

Legend:

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

    r3245 r3327  
    675675{
    676676  if (id == Parse) {
    677     if (args[0].type() == StringType)
    678       return parseDate(args[0].toString(exec));
    679     else
    680       return Number(NaN);
     677    return parseDate(args[0].toString(exec));
    681678  }
    682679  else { // UTC
     
    711708
    712709
    713 Value KJS::parseDate(const String &s)
    714 {
    715   UString u = s.value();
     710Value KJS::parseDate(const UString &u)
     711{
    716712#ifdef KJS_VERBOSE
    717713  fprintf(stderr,"KJS::parseDate %s\n",u.ascii());
Note: See TracChangeset for help on using the changeset viewer.