Reviewed by Cameron Zwarich.
- fix layout test failure introduced by fix for 20849
(The failing test was fast/js/delete-then-put.html)
* kjs/JSObject.cpp:
(JSC::JSObject::removeDirect): Clear enumeration cache
in the dictionary case.
* kjs/JSObject.h:
(JSC::JSObject::putDirect): Ditto.
* kjs/StructureID.h:
(JSC::StructureID::clearEnumerationCache): Inline to handle the
clear.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36436
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-09-15 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ - fix layout test failure introduced by fix for 20849
+
+ (The failing test was fast/js/delete-then-put.html)
+
+ * kjs/JSObject.cpp:
+ (JSC::JSObject::removeDirect): Clear enumeration cache
+ in the dictionary case.
+ * kjs/JSObject.h:
+ (JSC::JSObject::putDirect): Ditto.
+ * kjs/StructureID.h:
+ (JSC::StructureID::clearEnumerationCache): Inline to handle the
+ clear.
+
2008-09-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Cameron Zwarich.
{
if (m_structureID->isDictionary()) {
m_structureID->propertyMap().remove(propertyName, m_propertyStorage);
+ m_structureID->clearEnumerationCache();
return;
}
if (m_structureID->propertyMap().storageSize() == inlineStorageCapacity)
allocatePropertyStorage(m_structureID->propertyMap().storageSize(), m_structureID->propertyMap().size());
m_structureID->propertyMap().put(propertyName, value, attributes, checkReadOnly, this, slot, m_propertyStorage);
+ m_structureID->clearEnumerationCache();
return;
}
static void transitionTo(StructureID* oldStructureID, StructureID* newStructureID, JSObject* slotBase);
+ void clearEnumerationCache() { m_cachedPropertyNameArray.clear(); }
+
private:
typedef std::pair<RefPtr<UString::Rep>, unsigned> TransitionTableKey;
typedef HashMap<TransitionTableKey, StructureID*, TransitionTableHash, TransitionTableHashTraits> TransitionTable;