[Webkit-unassigned] [Bug 21257] JS bindings should throw when too few arguments are passed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 3 15:00:25 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=21257





--- Comment #16 from Ojan Vafai <ojan at chromium.org>  2010-06-03 15:00:20 PST ---
I really like the idea of enforcing that you pass the right number of arguments.

However, I also like that I can leave out the frequently unnecessary arguments. Can we make many of these optional via the IDL? That would maintain some of the benefits of not enforcing number of arguments and it would minimize the chance of introducing regressions in webkit-only codepaths.

For example, being able to leave out the third boolean parameter in addEventListener is great. We should maintain that.

Taking a quick look at the patch, the following all have arguments that should be optional: getComputedStyle, addEventListener, removeEventListener, setPosition, contiansNode, createDocumentType, collapse, extend, setProperty, setTimeout, setInterval, createDocument, createHTMLDocument, cloneNode, importNode, createTextNode, setCustomValidity, profile, profileEnd, evaluate, createNodeIterator, execCommand.

The tricky part is that the default value will need to be different for some of them, e.g. 
- "" for createHTMLDocument and createTextnode. 
- false for addEventListener and containsNode
- 0 for setTimeout, setInterval, setPosition, etc.
- null for getComputedStyle and evaluate

There are cases in this patch that I think are improvements and should not be optional, e.g., arc, createElement, alert, confirm, prompt, parseInt.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list