Comments on “Making Built-in Objects Subclassable”

Axel Rauschmayer axel at rauschma.de
Mon Mar 18 04:33:46 PDT 2013


A few more thoughts:

- This marks the end of prototypal inheritance in JavaScript (not complaining, just stating a fact). Putting @@create in constructors C makes a lot of sense, but it could, in principle, also be put into instance prototypes C.prototype. Then Object.create(proto) could use @@create to create the instance whose prototype is proto.

- I would love to have a @@postConstruct method (similar to @@create) that is invoked after all constructors are done with initialization. Use case: freeze an instance or make it non-extensible.

- Slide 24: marking objects as initialized in the root of a class hierarchy looks suspicious to me (the constructors are not done initializing, yet!). Doing it in something like @@postCreate might make more sense.

Axel

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130318/f4c3ad4b/attachment-0001.html>


More information about the es-discuss mailing list