blob: 0b0a0eacf58913e3048a00ea18d4e09b1e0cacf4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import setPrototypeOf from "./setPrototypeOf.js";
export default function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) setPrototypeOf(subClass, superClass);
}
|