Skip to content
  • barraclough@apple.com's avatar
    [[Put]] should throw if prototype chain contains a readonly property. · 7f154b83
    barraclough@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=79069
    
    Reviewed by Oliver Hunt.
    
    Currently we only check the base of the put, not the prototype chain.
    Fold this check in with the test for accessors.
    
    Source/JavaScriptCore: 
    
    * runtime/JSObject.cpp:
    (JSC::JSObject::put):
        - Updated to test all objects in the propotype chain for readonly properties.
    (JSC::JSObject::putDirectAccessor):
    (JSC::putDescriptor):
        - Record the presence of readonly properties on the structure.
    * runtime/Structure.cpp:
    (JSC::Structure::Structure):
        - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto.
    * runtime/Structure.h:
    (JSC::Structure::hasReadOnlyOrGetterSetterPropertiesExcludingProto):
    (JSC::Structure::setHasGetterSetterProperties):
        - hasGetterSetterPropertiesExcludingProto expanded to hasReadOnlyOrGetterSetterPropertiesExcludingProto.
    (JSC::Structure::setContainsReadOnlyProperties):
        - Added.
    
    LayoutTests: 
    
    * fast/js/Object-defineProperty-expected.txt:
    * fast/js/script-tests/Object-defineProperty.js:
    (get shouldBeTrue):
        - Added test case.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    7f154b83