extendStatics=(function (Son,Parent) {
function getStaticExtendsWithForIn(Son,Parent) {
for (let key in Parent) {
if(Object.prototype.hasOwnProperty.call(Parent,key)){
Son[key]=Parent[key]
}
}
}
function getStaticExtendsWithObjectkeys(Son,Parent) {
Object.keys(Parent).forEach(key=>{
Son[key]=Parent[key]
})
}
function getStaticExtendsWithProto (Son,Parent) {
Son.__proto__=Parent
}
return function (Son,Parent) {
let MyextendStatics= Object.setPrototypeOf || getStaticExtendsWithForIn || getStaticExtendsWithObjectkeys || getStaticExtendsWithProto
return MyextendStatics (Son,Parent)
}
}())
function People (name, sex, phone) {
this.name = name;
this.sex = sex;
this.phone = phone;
}
People.count = 300;
function ChinesePeople (name, sex, phone, national) {
People.call(this, name, sex, phone)
this.national = national;
}
extendStatics(ChinesePeople, People)
console.log("ChinesePeople.count:", ChinesePeople.count)