Preventing instance extension

Axel Rauschmayer axel at rauschma.de
Fri Nov 11 13:44:09 PST 2011


> And why can't you call the superconstructor at the end?
> It'd work the exact same except it could overwrite some of the
> properties you wrote... but since those things would more likely be in
> prototype, it's not much of an issue.


That is definitely a possibility! It does have one drawback, though: Normally methods in sub-instances expect the super-instance to be completely initialized. So performing the super-initialization last is a bit more risky than performing it first.

-- 
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/20111111/59f2ad7b/attachment-0001.html>


More information about the es-discuss mailing list