http://www.2ality.com/2015/02/es6-cl...structor_calls
Цитата:
|
In a derived class, you must call super() before you can use this.
Implicitly leaving a derived constructor without calling super() also causes an error.
|
http://www.2ality.com/2015/02/es6-cl...tanc e_object
Цитата:
|
In ES6, it [an instance] is created in the base constructor, the last in a chain of constructor calls.
this originally being uninitialized in derived constructors means that an error is thrown if they access this in any way before they have called super().
If a constructor returns implicitly (without a return statement), the result is this. If this is uninitialized, a ReferenceError is thrown. This protects you against forgetting to call super().
|
Да, так что я попутал - не вызывать super в ребенке тоже нельзя.
---
Посредством. По средствам только живут.
Этому форуму жутко не хватает тега hr, да.