Re: Question about implements statements

interface A {
   void f();
};

interface B { };
B implements A;

interface C { };
C implements A;


Without seeing any good use cases for having B.prototype.f be able to be 
applied to a C (or an A that doesn't implement B), I've clarified that 
these Function objects are all distinct and can only be applied to 
objects that implement the interface that corresponds to the interface 
prototype object the property is on.

That means:

   * A.prototype.f != B.prototype.f &&
     A.prototype.f != C.prototype.f &&
     B.prototype.f != C.prototype.f
   * A.prototype.f.call(b) succeeds
   * B.prototype.f.call(a) throws
   * B.prototype.f.call(c) throws

That's slightly different from my last mail on the topic, where I 
thought it would make sense to have A.prototype.f.call(b) throw too, but 
looking at this issue afresh leads me to believe that the interface you 
grab the Function from should indicate the set of objects that it can be 
applied to.

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/v1.xml.diff?r1=1.73;r2=1.74;f=h
http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.623;r2=1.624;f=h

Received on Monday, 17 June 2013 06:45:48 UTC