Bug 101502

Summary: Wrong error type is thrown for type errors in callbacks
Product: WebKit Reporter: Erik Arvidsson <arv>
Component: DOMAssignee: Erik Arvidsson <arv>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, adamk, eric.carlson, feature-media-reviews, haraken, hta, japhet, jsbell, tommyw, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://www.w3.org/TR/WebIDL/#es-callback-function
Bug Depends on:    
Bug Blocks: 101604    
Attachments:
Description Flags
Patch
none
Patch none

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.