Skip to content
  • barraclough@apple.com's avatar
    Should be able to reconfigure a non-configurable property as read-only · 2f2c38e7
    barraclough@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=79170
    
    Reviewed by Sam Weinig.
    
    See ES5.1 8.12.9 10.a.i - the spec prohibits making a read-only property writable,
    but does not inhibit making a writable property read-only.
    
    Source/JavaScriptCore: 
    
    * runtime/JSGlobalData.cpp:
    (JSC::JSGlobalData::JSGlobalData):
    * runtime/JSGlobalData.h:
    (JSC::JSGlobalData::setInDefineOwnProperty):
    (JSGlobalData):
    (JSC::JSGlobalData::isInDefineOwnProperty):
        - Added flag, tracking whether we are in JSObject::defineOwnProperty.
    * runtime/JSObject.cpp:
    (JSC::JSObject::deleteProperty):
    (DefineOwnPropertyScope):
        - Always allow properties to be deleted by DefineOwnProperty - assume it knows what it is doing!
    (JSC::DefineOwnPropertyScope::DefineOwnPropertyScope):
    (JSC::DefineOwnPropertyScope::~DefineOwnPropertyScope):
        - Added RAII helper.
    (JSC::JSObject::defineOwnProperty):
        - Track on the globalData when we are in this method.
    
    LayoutTests: 
    
    * fast/js/Object-defineProperty-expected.txt:
    * fast/js/script-tests/Object-defineProperty.js:
        - Update test result (this was enforcing incorrect behaviour).
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    2f2c38e7