New ES6 Constructor Semantics and Usage Examples

September 17, 2014 ยท View on GitHub

Auto super: Alternative Design where subclass constructors automatically call their superclass constructors

This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.

One of the characteristics of this proposal is that subclasses constructors automatically super invoke their superclass constructor's object allocation and initialization logic unless the derived constructor expliictly assigns to this.

An alternative version of this proposal eliminates from the design most implicit/automatic invocations of superclass constructors.

In addition to the material below, there is a seperate design rationale covering several key features that are common to both designs.