This is a perfect ES5 class extend module.
followings are a sample of how to use,
it will output these:
this data is from father
this msg is from father
__________________________
const {_extends}=require("./zhyextend.js");
var subcls=function(){
this._super.constructor.apply(this,arguments);//super()
}
subcls.prototype.foo=function(){
this._super.foo.apply(this,arguments); //super()
console.log(this.datacopy);
console.log(this.bar());
}
var cls=function(){
this.data="this data is from father";
}
cls.prototype.foo=function(){
this.datacopy=this.data;
}
cls.prototype.bar=function(){
return "this msg is from father";
}
_extends(subcls,cls);
new subcls("1").foo();