Skip to content

Commit 9c090a6

Browse files
committed
use inherits module
Instead of inline code, use inherits module. Works better with browsers and provides es < 5 support.
1 parent 68337c9 commit 9c090a6

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"scripts": {
1919
"test": "node test/node/*.js"
2020
},
21+
"dependencies": {
22+
"inherits": "2.0.1"
23+
},
2124
"devDependencies": {
2225
"zuul": "~1.0.3"
2326
},

util.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -560,17 +560,7 @@ exports.log = function() {
560560
* prototype.
561561
* @param {function} superCtor Constructor function to inherit prototype from.
562562
*/
563-
exports.inherits = function(ctor, superCtor) {
564-
ctor.super_ = superCtor;
565-
ctor.prototype = Object.create(superCtor.prototype, {
566-
constructor: {
567-
value: ctor,
568-
enumerable: false,
569-
writable: true,
570-
configurable: true
571-
}
572-
});
573-
};
563+
exports.inherits = require('inherits');
574564

575565
exports._extend = function(origin, add) {
576566
// Don't do anything if add isn't an object

0 commit comments

Comments
 (0)