diff --git a/lib/sys.js b/lib/sys.js index f877dad117c..ac8b023c4bf 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -315,9 +315,11 @@ exports.pump = function (readStream, writeStream, callback) { * @param {function} superCtor Constructor function to inherit prototype from */ exports.inherits = function (ctor, superCtor) { - var tempCtor = function(){}; - tempCtor.prototype = superCtor.prototype; - ctor.super_ = superCtor; - ctor.prototype = new tempCtor(); - ctor.prototype.constructor = ctor; + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false + } + }); };