mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
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:
parent
0a80e61e0f
commit
65392be665
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user