Claude Pache (2013-12-27T14:17:55.000Z)
domenic at domenicdenicola.com (2014-01-06T16:26:57.703Z)
I agree that `constructor(...args){ return super(...args); }` is better (i.e. less surprising) when the super-class's constructor returns an other object than `this`. However, under the current state of the specification, there is at least one exception: the `Object` constructor ignores its `this` value and creates a fresh object, which is unwanted in the theoretical case you define a class extending explicitly `Object`. I guess that this case could be normalised by using a similar mechanism as `Array` and its [[ArrayInitialisationState]] internal slot? > > Additionally, since DefineMethod is going to be exposed, does it make sense to expose ReferencesSuper too? > > Otherwise there is no way to detect, at runtime, if a default constructor function is a top-level constructor (without a super), or a subclass with a super. One of them can use toMethod but not the other. > Since I haven't yet seen any formal definition of `toMethod`, I don't what is its intended behaviour on methods that don't reference `super`. I think that the most reasonable behaviour, in that case, is to just clone the function: for it would allow to refactor transparently methods, removing or re-adding references to `super` without needing to adapt the code around them.