Re: Question about implements statements

Boris Zbarsky wrote:
> On 6/17/13 2:42 AM, Cameron McCormack wrote:
>> * A.prototype.f.call(b) succeeds
>
> What are the use cases for this?

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.

> In fact, what are the use cases for having an interface that appears on
> the RHS of "implements" but also has an interface object and prototype
> object at all?

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.  We could just 
disallow it.  I fear at some point we might want to do "A implements 
EventTarget", if A already inherits from some other interface.  Though 
we could get around that with:

   [NoInterfaceObject]
   interface EventTargetUtils { ... };

   interface EventTarget { };
   EventTarget implements EventTargetUtils;

   interface Node : EventTarget { ... };

   interface A : SomeOtherInterface { ... };
   A implements EventTargetUtils;

Received on Monday, 17 June 2013 13:04:01 UTC