util: fixes type in argument type validation error

PR-URL: https://github.com/nodejs/node/pull/25103
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Ankur Oberoi 2018-12-17 17:18:55 -08:00 committed by Myles Borins
parent 0a80e61e0f
commit 65392be665
No known key found for this signature in database
GPG Key ID: 933B01F40B5CA946
2 changed files with 2 additions and 2 deletions

View File

@ -281,7 +281,7 @@ function inherits(ctor, superCtor) {
if (superCtor.prototype === undefined) { if (superCtor.prototype === undefined) {
throw new ERR_INVALID_ARG_TYPE('superCtor.prototype', throw new ERR_INVALID_ARG_TYPE('superCtor.prototype',
'Function', superCtor.prototype); 'Object', superCtor.prototype);
} }
ctor.super_ = superCtor; ctor.super_ = superCtor;
Object.setPrototypeOf(ctor.prototype, superCtor.prototype); Object.setPrototypeOf(ctor.prototype, superCtor.prototype);

View File

@ -80,7 +80,7 @@ common.expectsError(function() {
}, { }, {
code: 'ERR_INVALID_ARG_TYPE', code: 'ERR_INVALID_ARG_TYPE',
type: TypeError, 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' 'Received type undefined'
}); });