"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