Bug 40057

Summary: IDL bindings should throw TypeError when called with too few arguments
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: benjamin, darin, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 39962    
Attachments:
Description Flags
Proposed patch sam: review-

Description Andreas Kling 2010-06-02 06:49:56 PDT
See Web IDL spec, 4.3.5 "Operations":
http://www.w3.org/TR/WebIDL/#es-operations

Essentially, functions should throw a TypeError if called with too few arguments.

This behavior is implemented by Gecko and Opera.
Comment 1 Andreas Kling 2010-06-02 06:57:09 PDT
Created attachment 57649 [details]
Proposed patch

First stab at a patch.
Comment 2 Sam Weinig 2010-06-02 08:22:12 PDT
Comment on attachment 57649 [details]
Proposed patch

We have made a conscious decision not throw for two few arguments and we should a much larger discussion if we want to change that behavior.  It is very likely that this will break a lot of webkit specific code paths on web. r-
Comment 3 Andreas Kling 2010-06-02 08:43:10 PDT
(In reply to comment #2)
> (From update of attachment 57649 [details])
> We have made a conscious decision not throw for two few arguments and we should a much larger discussion if we want to change that behavior.

I see. Where can I find the original discussion about this?
Comment 4 Darin Adler 2010-06-02 10:38:54 PDT

*** This bug has been marked as a duplicate of bug 21257 ***