Open Henry-Diasa opened 1 year ago
寄生组合式继承 + setPrototypeOf实现静态属性的继承
function selfClass(Child, Parent) { Child.prototype = Object.create(Parent.prototype, { constructor: { enumerable: false, configurable: false, writable: true, value: Child } }) Object.setPrototypeOf(Child, Parent); }
寄生组合式继承 + setPrototypeOf实现静态属性的继承