You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
487 B

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