UNPKG

391 BJavaScriptView Raw
1/**
2 * Make `SubClass` extend `SuperClass`.
3 *
4 * @param {Function} SubClass The sub class constructor.
5 * @param {Function} SuperClass The super class constructor.
6 */
7function inherits(SubClass, SuperClass) {
8 var F = function() {};
9
10 F.prototype = SuperClass.prototype;
11
12 SubClass.prototype = new F();
13 SubClass.prototype.constructor = SubClass;
14}
15
16module.exports = inherits;