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
Created attachment 138422 [details] Patch
Comment on attachment 138422 [details] Patch Test coverage is insufficient. There are 5 call sites in JS bindings modified, but only three test results changing. We need a test that covers each affected call site.
Created attachment 138451 [details] Patch
(In reply to comment #2) > (From update of attachment 138422 [details]) > Test coverage is insufficient. There are 5 call sites in JS bindings modified, but only three test results changing. We need a test that covers each affected call site. darin: Thanks. Added test cases.
I believe that the current behavior is just due to mis-implementation of custom bindings, but let me confirm other browsers' behaviors.
I'm not particularly concerned about this change, because we've been already raising an exception, and sites hardly ever check for specific exception type. Checking other browsers is worth doing anyway.
Created attachment 138606 [details] test cases
Opera 11.62: WebSocket is not defined. WebSocket is not defined. XMLHttpRequest.open(): Error: WRONG_ARGUMENTS_ERR SVGLength.convertToSpecifiedUnits(): Error: WRONG_ARGUMENTS_ERR Firefox 11.0: new WebSocket(): [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "http://www.corp.google.com/~haraken/null/typeerror.html Line: 12"] WebSocket.send(): [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://www.corp.google.com/~haraken/null/typeerror.html :: :: line 23" data: no] XMLHttpRequest.open(): [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://www.corp.google.com/~haraken/null/typeerror.html :: :: line 34" data: no] SVGLength.convertToSpecifiedUnits(): [Exception... "Not enough arguments [nsIDOMSVGLength.convertToSpecifiedUnits]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://www.corp.google.com/~haraken/null/typeerror.html :: :: line 46" data: no]
darin, ap: review?
Comment on attachment 138451 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=138451&action=review > LayoutTests/ChangeLog:31 > +2012-04-23 Kentaro Hara <haraken@chromium.org> > + > + > + * http/tests/websocket/tests/hixie76/send-empty-expected.txt: > + * http/tests/websocket/tests/hybi/send-empty-expected.txt: > + * svg/dom/SVGLength-expected.txt: Extra stray change log here.
Created attachment 139324 [details] patch for landing
Comment on attachment 139324 [details] patch for landing Clearing flags on attachment: 139324 Committed r115533: <http://trac.webkit.org/changeset/115533>