Bug 16098 - callback interfaces with constants should have no interface prototype object
callback interfaces with constants should have no interface prototype object
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL
unspecified
All All
: P2 normal
: ---
Assigned To: Cameron McCormack
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-24 03:27 UTC by Cameron McCormack
Modified: 2012-03-01 05:38 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack 2012-02-24 03:27:22 UTC
Since there will never be instances of call back interfaces, there's no need for a .prototype property on their interface object (which exists only when there are constants on the call back interface).
Comment 1 Anne 2012-02-24 08:00:42 UTC
Is the method not exposed on the prototype?
Comment 2 Boris Zbarsky 2012-02-24 08:32:08 UTC
Exposed in what sense?
Comment 3 Travis Leithead [MSFT] 2012-02-24 19:50:40 UTC
This is 100% inline with IE9's behavior, so I'm happy to see this minor change. (At the time, we created an extended attribute to control this, but with 'callback' it's not necessary :)

// Introduced in DOM Level 2:
[msInterfaceObjectOnly]
interface NodeFilter 
{ /* ... */ };
Comment 4 Cameron McCormack 2012-03-01 05:16:39 UTC
Turns out this was already required.  The second paragraph in http://dev.w3.org/2006/webapi/WebIDL/#interface-object says "The interface object for non-callback interfaces must also have a property named “prototype” ...".
Comment 5 Boris Zbarsky 2012-03-01 05:28:56 UTC
That line doesn't say that callback interfaces _can't_ have such a property (jus that non-callback ones have to), and other places in the spec are written as if that property is never null....

I think it would be good to explicitly clarify this.
Comment 6 Cameron McCormack 2012-03-01 05:37:59 UTC
Fair enough, added this sentence below that paragraph:

  The interface object for a callback interface MUST NOT have a “prototype”
  property.