- From: Domenic Denicola <d@domenic.me>
- Date: Fri, 17 Jul 2015 20:23:04 +0000
- To: Travis Leithead <travis.leithead@microsoft.com>, public-webapps <public-webapps@w3.org>
From: Travis Leithead [mailto:travis.leithead@microsoft.com] > if super() is absolutely required for a constructor in a class > that extends something, is there a requirement about when in the > constructor method it be invoked? Must it always be the first call? Can it be > later on, say at the end of the function? It must be before `this` is referenced. > Basically, like this (reverting to non-class syntax): Yeah, and at that point you might as well make it a method on the actual class, and give it a nice name, like, say, createdCallback ;). Or, make it a function that takes the element as a parameter, and keep it separate from the class, perhaps in a "hooks" object ;).
Received on Friday, 17 July 2015 20:23:35 UTC