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

Kris Zyp kris at sitepen.com
Mon Aug 25 14:26:47 PDT 2008




  A lot of Ajax widgets, e.g. Dojo, use their own inheritance models, often based on copying properties (sometimes based on prototypes; in the case of Dojo's MI, both!). Copying is fine for a zero-inheritance classes-as-sugar proposal. The prototype stuff, as Kris points out, is different.

To be clear, we use prototype inheritance as the rule, copying is the exception, only done as needed to acheive MI. I don't think I would characterize prototypical inheritance as Dojo's own, where the inheritance model becomes more library specific is in how constructor calls, super calls, and inheritance trails are handled. However, almost every library I am aware of uses prototype-based inheritance for pseudo-classes, and consequently there is a level of compatibility. Dojo could create a class that extends a Prototype (the library) class, and vice versa (at least theoritically this should be viable without too much problem). This why I would like to ensure that class sugar also used a prototype-based model, so existing class structures are compatible with the new syntax.

Kris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080825/e65f83fc/attachment.html 


More information about the Es-discuss mailing list