• barraclough@apple.com's avatar
    https://bugs.webkit.org/show_bug.cgi?id=119995 · 47d7ba89
    barraclough@apple.com authored
    Start removing custom implementations of getOwnPropertyDescriptor
    
    Reviewed by Sam Weinig.
    
    This can now typically implemented in terms of getOwnPropertySlot.
    Add a macro to PropertyDescriptor to define an implementation of GOPD in terms of GOPS.
    Switch over most classes in JSC & the WebCore bindings generator to use this.
    
    Source/JavaScriptCore: 
    
    * API/JSCallbackObjectFunctions.h:
    * debugger/DebuggerActivation.cpp:
    * runtime/Arguments.cpp:
    * runtime/ArrayConstructor.cpp:
    * runtime/ArrayPrototype.cpp:
    * runtime/BooleanPrototype.cpp:
    * runtime/DateConstructor.cpp:
    * runtime/DatePrototype.cpp:
    * runtime/ErrorPrototype.cpp:
    * runtime/JSActivation.cpp:
    * runtime/JSArray.cpp:
    * runtime/JSArrayBuffer.cpp:
    * runtime/JSArrayBufferView.cpp:
    * runtime/JSCell.cpp:
    * runtime/JSDataView.cpp:
    * runtime/JSDataViewPrototype.cpp:
    * runtime/JSFunction.cpp:
    * runtime/JSGenericTypedArrayViewInlines.h:
    * runtime/JSNotAnObject.cpp:
    * runtime/JSONObject.cpp:
    * runtime/JSObject.cpp:
    * runtime/NamePrototype.cpp:
    * runtime/NumberConstructor.cpp:
    * runtime/NumberPrototype.cpp:
    * runtime/ObjectConstructor.cpp:
        - Implement getOwnPropertySlot in terms of GET_OWN_PROPERTY_DESCRIPTOR_IMPL.
    * runtime/PropertyDescriptor.h:
        - Added GET_OWN_PROPERTY_DESCRIPTOR_IMPL macro.
    * runtime/PropertySlot.h:
    (JSC::PropertySlot::isValue):
    (JSC::PropertySlot::isGetter):
    (JSC::PropertySlot::isCustom):
    (JSC::PropertySlot::isCacheableValue):
    (JSC::PropertySlot::isCacheableGetter):
    (JSC::PropertySlot::isCacheableCustom):
    (JSC::PropertySlot::attributes):
    (JSC::PropertySlot::getterSetter):
        - Add accessors necessary to convert PropertySlot to descriptor.
    * runtime/RegExpConstructor.cpp:
    * runtime/RegExpMatchesArray.cpp:
    * runtime/RegExpMatchesArray.h:
    * runtime/RegExpObject.cpp:
    * runtime/RegExpPrototype.cpp:
    * runtime/StringConstructor.cpp:
    * runtime/StringObject.cpp:
        - Implement getOwnPropertySlot in terms of GET_OWN_PROPERTY_DESCRIPTOR_IMPL.
    
    Source/WebCore: 
    
    * bindings/js/JSCSSStyleDeclarationCustom.cpp:
    * bindings/js/JSHTMLAppletElementCustom.cpp:
    * bindings/js/JSHTMLEmbedElementCustom.cpp:
    * bindings/js/JSHTMLObjectElementCustom.cpp:
    * bindings/js/JSHistoryCustom.cpp:
    (WebCore::JSHistory::getOwnPropertySlotDelegate):
    * bindings/js/JSLocationCustom.cpp:
    (WebCore::JSLocation::getOwnPropertySlotDelegate):
    * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        - Remove getOwnPropertyDescriptorDelegate methods,
          Change attributes of cross-frame access properties in JSHistory/JSLocation to prevent properties from being redefined.
    * bindings/scripts/CodeGeneratorJS.pm:
    (GenerateHeader):
    (GenerateImplementation):
    (GenerateConstructorHelperMethods):
        - Implement getOwnPropertySlot in terms of GET_OWN_PROPERTY_DESCRIPTOR_IMPL.
    * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
    * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
    * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
    * bindings/scripts/test/JS/JSTestEventTarget.cpp:
    * bindings/scripts/test/JS/JSTestException.cpp:
    * bindings/scripts/test/JS/JSTestInterface.cpp:
    * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
    * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
    * bindings/scripts/test/JS/JSTestNode.cpp:
    * bindings/scripts/test/JS/JSTestObj.cpp:
    * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
    * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
    * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        - Update test expectations.
    
    LayoutTests: 
    
    * http/tests/security/xss-DENIED-defineProperty-expected.txt:
        - Remove erroneous error messages - cross frame access to reload is allowed - it's just read-only, non-configurable.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    47d7ba89
PropertyDescriptor.h 4.44 KB