Changeset 28777 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Dec 16, 2007, 2:53:51 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSVariableObject.cpp
r28527 r28777 34 34 namespace KJS { 35 35 36 UString::Rep* IdentifierRepHashTraits::nullRepPtr = &UString::Rep::null; // Didn't want to make a whole source file for just this. 37 36 38 bool JSVariableObject::deleteProperty(ExecState* exec, const Identifier& propertyName) 37 39 { … … 46 48 SymbolTable::const_iterator::Keys end = symbolTable().end().keys(); 47 49 for (SymbolTable::const_iterator::Keys it = symbolTable().begin().keys(); it != end; ++it) 48 propertyNames.add(Identifier( *it));50 propertyNames.add(Identifier(it->get())); 49 51 50 52 JSObject::getPropertyNames(exec, propertyNames); -
trunk/JavaScriptCore/kjs/SymbolTable.h
r27198 r28777 30 30 #define SymbolTable_h 31 31 32 #include " property_map.h"33 #include "AlwaysInline.h"32 #include "ustring.h" 33 #include <wtf/AlwaysInline.h> 34 34 35 35 namespace KJS { 36 36 37 class JSValue; 37 struct IdentifierRepHash { 38 static unsigned hash(const RefPtr<UString::Rep>& key) { return key->computedHash(); } 39 static bool equal(const RefPtr<UString::Rep>& a, const RefPtr<UString::Rep>& b) { return a == b; } 40 static const bool safeToCompareToEmptyOrDeleted = true; 41 }; 38 42 39 struct IdentifierRepHash { 40 static unsigned hash(const KJS::UString::Rep *key) { return key->computedHash(); } 41 static bool equal(const KJS::UString::Rep *a, const KJS::UString::Rep *b) { return a == b; } 42 static const bool safeToCompareToEmptyOrDeleted = true; 43 struct IdentifierRepHashTraits : HashTraits<RefPtr<UString::Rep> > { 44 static const RefPtr<UString::Rep>& deletedValue() 45 { 46 return *reinterpret_cast<RefPtr<UString::Rep>*>(&nullRepPtr); 47 } 48 49 private: 50 static UString::Rep* nullRepPtr; 43 51 }; 44 52 … … 54 62 }; 55 63 56 typedef HashMap< UString::Rep*, size_t, IdentifierRepHash, HashTraits<UString::Rep*>, SymbolTableIndexHashTraits> SymbolTable;64 typedef HashMap<RefPtr<UString::Rep>, size_t, IdentifierRepHash, IdentifierRepHashTraits, SymbolTableIndexHashTraits> SymbolTable; 57 65 58 66 } // namespace KJS
Note:
See TracChangeset
for help on using the changeset viewer.