"Not enough arguments" error should be TypeError
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Apr 2012 03:30:28 +0000 (03:30 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Apr 2012 03:30:28 +0000 (03:30 +0000)
commit4d61a726e3474c5953b50f4a0ad7c1074ecf1592
tree1455246c2fa760c61d47eadb4d4413f23b1837af
parentf2b994748ae86e1662cd9efffe18e554322855eb
"Not enough arguments" error should be TypeError
https://bugs.webkit.org/show_bug.cgi?id=84628

Reviewed by Darin Adler.

Source/WebCore:

Currently, some custom bindings implement "Not enough arguments"
error as SyntaxError. The Web IDL spec requires that it should be
TypeError: http://www.w3.org/TR/WebIDL/#dfn-overload-resolution-algorithm
Thus, this patch changes SyntaxError to TypeError.

Tests: http/tests/websocket/tests/hixie76/url-parsing.html:
       http/tests/websocket/tests/hybi/url-parsing.html:
       http/tests/xmlhttprequest/exceptions.html:
       svg/dom/SVGLength.html:
       webaudio/audionode.html:

* bindings/js/JSAudioContextCustom.cpp:
(WebCore::JSAudioContextConstructor::constructJSAudioContext):
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::convertToSpecifiedUnits):
* bindings/js/JSWebSocketCustom.cpp:
(WebCore::JSWebSocketConstructor::constructJSWebSocket):
(WebCore::JSWebSocket::send):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::open):
* bindings/v8/custom/V8AudioContextCustom.cpp:
(WebCore::V8AudioContext::constructorCallback):
* bindings/v8/custom/V8SVGLengthCustom.cpp:
(WebCore::V8SVGLength::convertToSpecifiedUnitsCallback):
* bindings/v8/custom/V8WebSocketCustom.cpp:
(WebCore::V8WebSocket::constructorCallback):
(WebCore::V8WebSocket::sendCallback):
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
(WebCore::V8XMLHttpRequest::openCallback):

LayoutTests:

Currently, some custom bindings implement "Not enough arguments"
error as SyntaxError. The Web IDL spec requires that it should be
TypeError: http://www.w3.org/TR/WebIDL/#dfn-overload-resolution-algorithm
Thus, this patch changes SyntaxError to TypeError, and adds test
cases for the exception.

* http/tests/websocket/tests/hixie76/send-empty-expected.txt:
* http/tests/websocket/tests/hixie76/url-parsing.html:
* http/tests/websocket/tests/hybi/send-empty-expected.txt:
* http/tests/websocket/tests/hybi/url-parsing.html:
* http/tests/xmlhttprequest/exceptions-expected.txt:
* http/tests/xmlhttprequest/exceptions.html:
* platform/chromium-linux/http/tests/websocket/tests/hixie76/url-parsing-expected.txt:
* platform/chromium/http/tests/websocket/tests/hybi/url-parsing-expected.txt:
* svg/dom/SVGLength-expected.txt:
* webaudio/audionode-expected.txt:
* webaudio/audionode.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/websocket/tests/hixie76/send-empty-expected.txt
LayoutTests/http/tests/websocket/tests/hixie76/url-parsing.html
LayoutTests/http/tests/websocket/tests/hybi/send-empty-expected.txt
LayoutTests/http/tests/websocket/tests/hybi/url-parsing.html
LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt
LayoutTests/http/tests/xmlhttprequest/exceptions.html
LayoutTests/platform/chromium-linux/http/tests/websocket/tests/hixie76/url-parsing-expected.txt
LayoutTests/platform/chromium/http/tests/websocket/tests/hybi/url-parsing-expected.txt
LayoutTests/svg/dom/SVGLength-expected.txt
LayoutTests/webaudio/audionode-expected.txt
LayoutTests/webaudio/audionode.html
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSAudioContextCustom.cpp
Source/WebCore/bindings/js/JSSVGLengthCustom.cpp
Source/WebCore/bindings/js/JSWebSocketCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp
Source/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp