Will any new features be tied to constructors?

Domenic Denicola d at domenic.me
Wed Jul 1 12:50:31 UTC 2015

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

> Fair, but it does depend on that not always being invoked at the same time as the constructor. So even if not being lexically part of the constructor was fine, you could still not depend on it being invoked at the same time.

Yeah, you're right. But only because this private state feature is for some reason tied to object allocation. So going back to your original question,

> To clarify, since this was not completely clear, the question is whether anything other than object allocation will be allowed only through a constructor?

I guess the answer is still no :).

The question is whether this private state feature design (1) really needs to be tied to allocation; (2) if it does, then will it even be usable for custom elements?

I.e., do you see any plausible world in which you're allowed to create a custom element with a custom allocator, instead of the browser-supplied HTMLElement one? 

More information about the es-discuss mailing list