https://bugs.webkit.org/show_bug.cgi?id=75429
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jan 2012 21:05:46 +0000 (21:05 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jan 2012 21:05:46 +0000 (21:05 +0000)
commitb4f313f762b26cc407adea0ad187b08d15286022
tree0983e82232a22e6e39a1148085999555e16d20a4
parent5819e7877cc27a8fa564af980f245f89ef9338dd
https://bugs.webkit.org/show_bug.cgi?id=75429
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: https://svn.webkit.org/repository/webkit/trunk@103958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/js/basic-strict-mode-expected.txt
LayoutTests/fast/js/script-tests/strict-throw-type-error.js [new file with mode: 0644]
LayoutTests/fast/js/strict-throw-type-error-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/strict-throw-type-error.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/runtime/Arguments.cpp
Source/JavaScriptCore/runtime/Error.cpp
Source/JavaScriptCore/runtime/Error.h
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/PropertyDescriptor.cpp
Source/JavaScriptCore/runtime/PropertyDescriptor.h