On Apr 3, 2011, at 1:29 AM, David Bruant wrote:

> Le 03/04/2011 10:12, David Bruant a écrit :
>> Le 03/04/2011 02:11, Brendan Eich a écrit :
>>> On Apr 2, 2011, at 4:19 PM, David Bruant wrote:
>>> 
>>>> I have the feeling that none of these can help out with multiple 
>>>> inheritance. This is the problem I want to address.
>>> Why? I mean, given the WebIDL and DOM changes.
>> Because people want it; Node+EventTarget wasn't the only use case. I'll
>> take the number of article that pop up when typing "multiple inheritance
>> javascript" on Google as a proof.
>> Basically, people all do mixins which prevents them from using
>> instanceof. They often acknowledge that it is the only limitation [1]
>> [2] [3]. I have even seen people implementing an isInstanceOf function
>> [2] [3].
> With the ability to trap all prototype-climbing traps, proxies will be
> used to implement multiple inheritance [4]. Yet, instanceof won't be of
> any help to detect the multiple inheritance.

It's possible we want to trap instanceof too. We definitely discussed it, and 
prior to the WebIDL/DOM changes, Andreas Gal proposed we trap it precisely for 
those former DOM use-cases.

People use "swiss inheritance" (copying non-initial superclass or mixin 
properties) today in JS and instanceof is no help, so they need a method 
specific to their class/mixin system.

This does not argue for multiple inheritance in JS, though. Self has multiple 
prototypes (parents) and can do strictly more than JS, but no one is proposing 
adding multiple prototype chain links per object to JS.

So this seems more like a proxy issue than a general one, for now. Curious to 
hear from Tom if he has thoughts.

/be

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to