Ignore:
Timestamp:
Oct 25, 2002, 10:49:57 PM (23 years ago)
Author:
darin
Message:
  • fixed 3038011 -- drop-down menu hierarchy broken at yahoo new acct page
  • kjs/array_object.cpp: (ArrayProtoFuncImp::call): Fix bug calling concat on an empty array. The old code tried to optimize in a way that would prevent appending any arrays until at least one element was in the destination array. So if you were concatenating a non-empty array into an empty array, you got an empty array.
File:
1 edited

Legend:

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

    r2262 r2475  
    291291          curObj.inherits(&ArrayInstanceImp::info)) {
    292292        unsigned int k = 0;
    293         if (n > 0)
    294           length = curObj.get(exec,lengthPropertyName).toUInt32(exec);
     293        // Older versions tried to optimize out getting the length of thisObj
     294        // by checking for n != 0, but that doesn't work if thisObj is an empty array.
     295        length = curObj.get(exec,lengthPropertyName).toUInt32(exec);
    295296        while (k < length) {
    296297          if (curObj.hasProperty(exec,k))
Note: See TracChangeset for help on using the changeset viewer.