Re: Prototype chain for objects that implement multiple interfaces

Cameron McCormack wrote:
> I wondered that myself, but it would help the case where script authors
> want to mess about with the prototypes of various objects.  Perhaps it
> doesn’t need to be specified exactly, but with enough fixed down such
> that you could reliably assign to HTMLElement.prototype.appendChild and
> expect it to affect your div element.

Agreed.  The fact that it doesn't in Gecko is not exactly desirable, and is not 
a purposeful decision; it's a side-effect of how the general system for 
reflecting C++ into ECMAScript handles multiple interfaces implemented on a 
single ECMA object.

>  How about for Mozilla,
> assuming something “sensible” was specified that allowed script authors
> to know in which prototype object methods from a particular interface
> are to be found so that they can overwrite them?

Basically, the only way this would change in Mozilla is if Mozilla completely 
changes how C++ objects are reflected into ECMAScript for DOM objects.

On the bright side, there are plans to do just that in the next several years, 
so I'd say that there's a good chance that a sensible spec here would get 
implemented in Gecko.  I can't commit to that on my own, though.  I'll ask the 
folks who might be able to to chime in.

-Boris

Received on Friday, 8 June 2007 21:21:25 UTC