Look Ma, no "this" (was: ECMAScript Harmony)

Brendan Eich brendan at mozilla.org
Mon Aug 25 19:15:36 PDT 2008

On Aug 25, 2008, at 7:07 PM, Erik Arvidsson wrote:

> I've been quiet on these threads for a long time but i just wanted  
> to emphasize Kris's point. Whatever we decide to desugar the class  
> syntax into I think it is very important to get this right. We need  
> to make classes work with existing prototype based inheritance  
> chains. I would consider it a failure if I cannot create a class  
> that inherits from dijit.TabPane or from a Prototype UI component  
> for that matter.

Can you define "inherit" more precisely? If it's a matter of giving  
classes .prototype objects, perhaps this could be done (it's  
attractive since the built-ins, Object, Date, etc., are classes as  
well as constructor functions, which have prototype objects).

> I would also like to know more about the arguments why people seem  
> to be set on a zero inheritance class model? Does that imply that  
> one can still achieve inheritance using prototypes or does it mean  
> that inheritance is not desired at all?

No, prototypes are here to stay. There's even Object.create to  
relieve prototypers from having to write constructor functions.

The desire to explore ZI is two-fold:

1. It may help the committee to see the smallest possible proposal,  
and work up from there to SI and MI.

2. It may help the language to avoid adding another kind of  
inheritance than prototype-based delegation.


More information about the Es-discuss mailing list