inherits.js 565 B

1234567891011121314151617181920
  1. var _Object$create = require("../core-js/object/create");
  2. var setPrototypeOf = require("./setPrototypeOf");
  3. function _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. subClass.prototype = _Object$create(superClass && superClass.prototype, {
  8. constructor: {
  9. value: subClass,
  10. writable: true,
  11. configurable: true
  12. }
  13. });
  14. if (superClass) setPrototypeOf(subClass, superClass);
  15. }
  16. module.exports = _inherits;