Skip to content
  • mhahnenberg@apple.com's avatar
    get_by_pname can become confused when iterating over objects with static properties · b27d608a
    mhahnenberg@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=113831
    
    Reviewed by Geoffrey Garen.
    
    get_by_pname doesn't take static properties into account when using a JSPropertyNameIterator to directly 
    access an object's backing store. One way to fix this is to not cache any properties when iterating over 
    objects with static properties. This patch fixes the bug that was originally reported on swisscom.ch.
    
    Source/JavaScriptCore: 
    
    * runtime/JSObject.cpp:
    (JSC::JSObject::getOwnNonIndexPropertyNames):
    * runtime/JSPropertyNameIterator.cpp:
    (JSC::JSPropertyNameIterator::create):
    * runtime/PropertyNameArray.h:
    (JSC::PropertyNameArray::PropertyNameArray):
    (JSC::PropertyNameArray::numCacheableSlots):
    (JSC::PropertyNameArray::setNumCacheableSlots):
    (PropertyNameArray):
    
    LayoutTests: 
    
    * fast/js/dom-static-property-for-in-iteration-expected.txt: Added.
    * fast/js/dom-static-property-for-in-iteration.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b27d608a