W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Re: Question about implements statements

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 17 Jun 2013 16:42:07 +1000
Message-ID: <51BEAFBF.1040300@mcc.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: Travis Leithead <travis.leithead@microsoft.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>
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.

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC