Will any new features be tied to constructors?

Domenic Denicola d at domenic.me
Wed Jul 1 08:56:33 UTC 2015


From: Anne van Kesteren [mailto:annevk at annevk.nl] 

> I don't see how this matters given that Dmitry's design depends on not executing JavaScript while constructing the element. Whereas if you put this[Element.init]() in the constructor it totally would.

Dmitry's design does *not* depend on that. In fact Dmitry's design includes this[Element.init]() in the constructor. See https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0230.html

The essence of Dmitry's design is to disallow custom allocation, while allowing custom initialization. This allows you to optionally decouple the two stages when necessary (upgrades, cloning, etc.) while also getting the goodness where author code doing `new MyElement(...)` calls both built-in allocation and custom initialization immediately.


More information about the es-discuss mailing list