diff --git a/lib/util.js b/lib/util.js index 624f4dfb7d032b..82c92ad0be47cf 100644 --- a/lib/util.js +++ b/lib/util.js @@ -303,7 +303,7 @@ function inherits(ctor, superCtor) { if (superCtor.prototype === undefined) { throw new ERR_INVALID_ARG_TYPE('superCtor.prototype', - 'Function', superCtor.prototype); + 'Object', superCtor.prototype); } Object.defineProperty(ctor, 'super_', { value: superCtor, diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index 9bbb4352dc3853..ed0800c33cec42 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -88,7 +88,7 @@ common.expectsError(function() { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "superCtor.prototype" property must be of type Function. ' + + message: 'The "superCtor.prototype" property must be of type Object. ' + 'Received type undefined' });