15 lines
295 B
JavaScript
15 lines
295 B
JavaScript
export default function inherits(ctor, superCtor) {
|
|
if (!superCtor) {
|
|
return;
|
|
}
|
|
ctor.super_ = superCtor;
|
|
ctor.prototype = Object.create(superCtor.prototype, {
|
|
constructor: {
|
|
value: ctor,
|
|
enumerable: false,
|
|
writable: true,
|
|
configurable: true
|
|
}
|
|
});
|
|
}
|