UNPKG

505 BJavaScriptView Raw
1var setPrototypeOf = require("./setPrototypeOf");
2
3function _inherits(subClass, superClass) {
4 if (typeof superClass !== "function" && superClass !== null) {
5 throw new TypeError("Super expression must either be null or a function");
6 }
7
8 subClass.prototype = Object.create(superClass && superClass.prototype, {
9 constructor: {
10 value: subClass,
11 writable: true,
12 configurable: true
13 }
14 });
15 if (superClass) setPrototypeOf(subClass, superClass);
16}
17
18module.exports = _inherits;
\No newline at end of file