Changeset 10744 in webkit for trunk/JavaScriptCore/kjs/property_map.cpp
- Timestamp:
- Oct 5, 2005, 1:05:44 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/property_map.cpp
r10701 r10744 26 26 #include "object.h" 27 27 #include "protect.h" 28 #include " reference_list.h"28 #include "IdentifierSequencedSet.h" 29 29 30 30 #include <algorithm> … … 75 75 76 76 // lastIndexUsed is an ever-increasing index used to identify the order items 77 // were inserted into the property map. It's vital that addEnumerablesToReferenceList77 // were inserted into the property map. It's vital that getEnumerablePropertyNames 78 78 // return the properties in the order they were added for compatibility with other 79 79 // browsers' JavaScript implementations. … … 567 567 } 568 568 569 void PropertyMap:: addEnumerablesToReferenceList(ReferenceList &list, ObjectImp *base) const569 void PropertyMap::getEnumerablePropertyNames(IdentifierSequencedSet& propertyNames) const 570 570 { 571 571 if (!_table) { … … 573 573 UString::Rep *key = _singleEntry.key; 574 574 if (key && !(_singleEntry.attributes & DontEnum)) 575 list.append(Reference(base, Identifier(key)));575 propertyNames.insert(Identifier(key)); 576 576 #endif 577 577 return; … … 599 599 qsort(sortedEnumerables, p - sortedEnumerables, sizeof(sortedEnumerables[0]), comparePropertyMapEntryIndices); 600 600 601 // Put the keys of the sorted entries into the referencelist.601 // Put the keys of the sorted entries into the list. 602 602 Entry **q = sortedEnumerables; 603 while (q != p) 604 list.append(Reference(base, Identifier((*q++)->key))); 603 while (q != p) { 604 propertyNames.insert(Identifier(q[0]->key)); 605 ++q; 606 } 605 607 606 608 // Deallocate the buffer. … … 609 611 } 610 612 611 void PropertyMap:: addSparseArrayPropertiesToReferenceList(ReferenceList &list, ObjectImp *base) const613 void PropertyMap::getSparseArrayPropertyNames(IdentifierSequencedSet& propertyNames) const 612 614 { 613 615 if (!_table) { … … 619 621 k.toUInt32(&fitsInUInt32); 620 622 if (fitsInUInt32) 621 list.append(Reference(base, Identifier(key)));623 propertyNames.insert(Identifier(key)); 622 624 } 623 625 #endif … … 634 636 k.toUInt32(&fitsInUInt32); 635 637 if (fitsInUInt32) 636 list.append(Reference(base, Identifier(key)));638 propertyNames.insert(Identifier(key)); 637 639 } 638 640 }
Note:
See TracChangeset
for help on using the changeset viewer.