Changeset 67494 in webkit for trunk/JavaScriptCore
- Timestamp:
- Sep 14, 2010, 2:06:01 PM (15 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r67482 r67494 1 2010-09-14 Darin Adler <[email protected]> 2 3 Reviewed by Geoffrey Garen. 4 5 Sort with non-numeric custom sort function fails on array with length but no values 6 https://bugs.webkit.org/show_bug.cgi?id=45781 7 8 * runtime/JSArray.cpp: 9 (JSC::JSArray::sort): Replaced early exit for an array of length zero to instead 10 exit for any array without values, even if it has a non-0 length. 11 1 12 2010-09-14 Steve Falkenburg <[email protected]> 2 13 -
trunk/JavaScriptCore/runtime/JSArray.cpp
r66004 r67494 1061 1061 return; 1062 1062 1063 if (!storage->m_length)1064 return;1065 1066 1063 unsigned usedVectorLength = min(storage->m_length, m_vectorLength); 1064 unsigned nodeCount = usedVectorLength + (storage->m_sparseValueMap ? storage->m_sparseValueMap->size() : 0); 1065 1066 if (!nodeCount) 1067 return; 1067 1068 1068 1069 AVLTree<AVLTreeAbstractorForArrayCompare, 44> tree; // Depth 44 is enough for 2^31 items … … 1072 1073 tree.abstractor().m_compareCallData = &callData; 1073 1074 tree.abstractor().m_globalThisValue = exec->globalThisValue(); 1074 tree.abstractor().m_nodes. resize(usedVectorLength + (storage->m_sparseValueMap ? storage->m_sparseValueMap->size() : 0));1075 tree.abstractor().m_nodes.grow(nodeCount); 1075 1076 1076 1077 if (callType == CallTypeJS)
Note:
See TracChangeset
for help on using the changeset viewer.