Re: Question about implements statements

On 6/17/13 9:00 AM, Cameron McCormack wrote:
> None particularly, but it seemed simpler to me to describe whether
> X.prototype.f.call(y) should succeed based on whether y implements X,
> rather than whether y implements an interface that directly inherits
> from X.

Ah, ok.  Well, it's way easier to implement the other.  ;)

> I don't think we have any current uses of "A implements B" where B is
> not [NoInterfaceObject], though correct me if I'm wrong.

You're not wrong, but my restriction was stronger: B is 
[NoInterfaceObject] _and_ does not need a prototype object.  As in, 
there are no objects that have B as a non-supplemental interface.  In 
this situation, the methods "on B" are simply non-observable, so their 
behavior doesn't need defining, since they don't actually need to insist.

> I fear at some point we might want to do "A implements
> EventTarget"

That would indeed require defining how 
EventTarget.prototype.addEventListener and company behave on instances 
of A....

I guess I'll just disallow this in Gecko's WebIDL parser for now and if 
it ever happens we'll need to significantly change how we implement 
EventTarget.  :(

-Boris

Received on Monday, 17 June 2013 13:28:29 UTC