[Webkit-unassigned] [Bug 21257] New: JS bindings should throw when too few arguments are passed
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 30 15:49:24 PDT 2008
https://bugs.webkit.org/show_bug.cgi?id=21257
Summary: JS bindings should throw when too few arguments are
passed
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: Mac OS X 10.5
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: JavaScriptGlue
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: aa at chromium.org
The JS bindings in WebKit generally do not throw when too few arguments are
passed. For example "document.createElement()" throws in IE and Firefox because
it is spec'd to take one argument, but not in WebKit.
Throwing for invalid function calls is important to developers because it
allows them to catch problems in their code as early as possible. In the case
of document.createElement(), it means that they will clearly see the error
'createElement expects 1 argument', instead of some confusing error later in
their code where they tried to use the undefined return value of createElement.
We can easily make this change all at once for all generated bindings. However,
a concern with this is that there may be special cases where other browsers do
not follow the spec and allow fewer arguments. This would be a problem for
compat. We can probably generate code to find these cases using the IDL.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list