Small, fast, elegant, powerful, and cross platform JavaScript OOP library. Support main(), singleton, super call, private, mixins, plugins, AOP and more.
MIT License
301
stars
46
forks
source link
Super's constructor not getting called if sub class not defining constructor #13
When no constructor defined, an empty function is created instead, which however does not call super constructor. Expected behavior is if sub class has no constructor it automatically calls super class one.
Calling parent's constructor automatically may cause a lot of surprising issues. I would rather let sub-classes choose than forcing them to employ their parents' constructor.
When no constructor defined, an empty function is created instead, which however does not call super constructor. Expected behavior is if sub class has no constructor it automatically calls super class one.
Suggested fix:
A better way may be using the p found in later code, which require rearrange the code a little bit