Bug 101502 - Wrong error type is thrown for type errors in callbacks
Summary: Wrong error type is thrown for type errors in callbacks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Erik Arvidsson
URL: http://www.w3.org/TR/WebIDL/#es-callb...
Keywords:
Depends on:
Blocks: 101604
  Show dependency treegraph
 
Reported: 2012-11-07 12:42 PST by Erik Arvidsson
Modified: 2012-11-08 12:34 PST (History)
10 users (show)

See Also:


Attachments
Patch (18.54 KB, patch)
2012-11-08 07:53 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch (25.91 KB, patch)
2012-11-08 10:20 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2012-11-07 12:42:30 PST
"4.2.21. Callback function types

IDL callback function types are represented by ECMAScript Function objects.

An ECMAScript value V is converted to an IDL callback function type value by running the following algorithm:

If V is not a Function object, then throw a TypeError.
Return the IDL callback function type value that represents a reference to that Function object.
The result of converting an IDL callback function type value to an ECMAScript value is a reference to the same object that the IDL callback function type value represents."

We throw a TYPE_MISMATCH_ERR DOMException instead.
Comment 1 Joshua Bell 2012-11-07 13:25:48 PST
Looks like this would be easy to fix in the code generators.

Watch out for overloads in addition to the normal case; we may do different checking for overloads.
Comment 2 Erik Arvidsson 2012-11-08 07:53:56 PST
Created attachment 173045 [details]
Patch
Comment 3 Joshua Bell 2012-11-08 09:22:10 PST
It doesn't look like run-bindings-tests --reset-results was run, so this will probably fail the bots.

LGTM otherwise; sad that our coverage is so poor, but at least it means this change is likely Web-compatible.
Comment 4 Erik Arvidsson 2012-11-08 10:20:19 PST
Created attachment 173061 [details]
Patch
Comment 5 Erik Arvidsson 2012-11-08 10:20:55 PST
(In reply to comment #3)
> It doesn't look like run-bindings-tests --reset-results was run, so this will probably fail the bots.

Oops. Done.
Comment 6 Adam Barth 2012-11-08 10:46:45 PST
Comment on attachment 173061 [details]
Patch

ok
Comment 7 WebKit Review Bot 2012-11-08 12:34:13 PST
Comment on attachment 173061 [details]
Patch

Clearing flags on attachment: 173061

Committed r133932: <http://trac.webkit.org/changeset/133932>
Comment 8 WebKit Review Bot 2012-11-08 12:34:17 PST
All reviewed patches have been landed.  Closing bug.