simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

inherits.js (661B)


      1 var setPrototypeOf = require("./setPrototypeOf.js");
      2 
      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 
      8   subClass.prototype = Object.create(superClass && superClass.prototype, {
      9     constructor: {
     10       value: subClass,
     11       writable: true,
     12       configurable: true
     13     }
     14   });
     15   Object.defineProperty(subClass, "prototype", {
     16     writable: false
     17   });
     18   if (superClass) setPrototypeOf(subClass, superClass);
     19 }
     20 
     21 module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;