Changeset 2846 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp


Ignore:
Timestamp:
Nov 23, 2002, 11:49:26 PM (23 years ago)
Author:
mjs
Message:
  • completed Darin's mostly-fix for 3037795 - Resource use increases when accessing very high index value in array

The two missing pieces were handling sparse properties when
shrinking the array, and when sorting. Thse are now both taken
care of.

  • kjs/array_instance.h:
  • kjs/array_object.cpp: (ArrayInstanceImp::put): (ArrayInstanceImp::deleteProperty): (ArrayInstanceImp::resizeStorage): (ArrayInstanceImp::setLength): (ArrayInstanceImp::sort): (ArrayInstanceImp::pushUndefinedObjectsToEnd):
  • kjs/identifier.h:
  • kjs/object.h:
  • kjs/property_map.cpp:
  • kjs/property_map.h:
  • kjs/reference_list.cpp: (ReferenceList::append): (ReferenceList::length):
  • kjs/reference_list.h:
  • kjs/ustring.cpp: (UString::toUInt32):
  • kjs/ustring.h:
File:
1 edited

Legend:

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

    r2800 r2846  
    552552}
    553553
     554uint32_t UString::toUInt32(bool *ok) const
     555{
     556  double d = toDouble();
     557  bool b = true;
     558
     559  if (isNaN(d) || d != static_cast<uint32_t>(d)) {
     560    b = false;
     561    d = 0;
     562  }
     563
     564  if (ok)
     565    *ok = b;
     566
     567  return static_cast<uint32_t>(d);
     568}
     569
    554570int UString::find(const UString &f, int pos) const
    555571{
Note: See TracChangeset for help on using the changeset viewer.