Summary: prototypes as classes

Brendan Eich brendan at mozilla.com
Tue Jun 28 17:57:47 PDT 2011


On Jun 28, 2011, at 5:55 PM, Brendan Eich wrote:

> The prototypes-as-classes approach makes new C(a,b) invoke C.constructor(a, b) with extra rules for object return value, which is a complexity.

Sorry, that was unclear: I meant the indirection through .constructor was a complexity, not the substituted object return value which applies to both approaches.


> Especially for abstractions that want to be callable without 'new' to construct a new instance (Array, e.g.).

This is a crucial case. User-defined functions can be new'ed or invoked without new. They have .prototypes. None of this is going away.

/be



More information about the es-discuss mailing list