• barraclough@apple.com's avatar
    https://bugs.webkit.org/show_bug.cgi?id=75429 · bfdffec8
    barraclough@apple.com authored
    ThrowTypeError should be a singleton object
    
    Reviewed by Sam Weinig.
    
    Source/JavaScriptCore: 
    
    Per section 13.2.3 of the spec.
    We could change setAccessorDescriptor to be able to share the global
    GetterSetter object, rather than storing the accessor functions and
    creating a new GetterSetter in defineProperty - but this won't be a
    small change to PropertyDescriptors (and would probably mean making
    GetterSetter objects immutable?) - so I'll leave that for another
    patch.
    
    * JavaScriptCore.exp:
        - don't export setAccessorDescriptor
    * runtime/Arguments.cpp:
    (JSC::Arguments::createStrictModeCallerIfNecessary):
    (JSC::Arguments::createStrictModeCalleeIfNecessary):
        - call throwTypeErrorGetterSetter instead of createTypeErrorFunction
    * runtime/Error.cpp:
    * runtime/Error.h:
        - remove createTypeErrorFunction
    * runtime/JSFunction.cpp:
    * runtime/JSFunction.h:
        - remove unused createDescriptorForThrowingProperty
    * runtime/JSGlobalObject.cpp:
    (JSC::JSGlobalObject::reset):
    (JSC::JSGlobalObject::visitChildren):
        - removed m_strictModeTypeErrorFunctionStructure.
    * runtime/JSGlobalObject.h:
    (JSC::JSGlobalObject::internalFunctionStructure):
        - removed m_strictModeTypeErrorFunctionStructure.
    * runtime/PropertyDescriptor.cpp:
    (JSC::PropertyDescriptor::setAccessorDescriptor):
        - changed to take a GetterSetter
    * runtime/PropertyDescriptor.h:
        - changed to take a GetterSetter
    
    LayoutTests: 
    
    Per section 13.2.3 of the spec.
    
    * fast/js/basic-strict-mode-expected.txt:
        - ThrowTypeError is a singleton, so cannot generate
          property-specific error messages.
    * fast/js/script-tests/strict-throw-type-error.js: Added.
    * fast/js/strict-throw-type-error-expected.txt: Added.
    * fast/js/strict-throw-type-error.html: Added.
        - added test case that ThrowTypeError is a singleton
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    bfdffec8
PropertyDescriptor.cpp 6.06 KB