diff --git a/lib/internal/errors.js b/lib/internal/errors.js index dd30097c43cd15..dc8f4a13c4137d 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -192,7 +192,8 @@ E('ERR_V8BREAKITERATOR', 'full ICU data not installed. ' + function invalidArgType(name, expected, actual) { const assert = lazyAssert(); assert(name, 'name is required'); - var msg = `The "${name}" argument must be ${oneOf(expected, 'type')}`; + const type = name.includes('.') ? 'property' : 'argument'; + var msg = `The "${name}" ${type} must be ${oneOf(expected, 'type')}`; if (arguments.length >= 3) { msg += `. Received type ${actual !== null ? typeof actual : 'null'}`; } diff --git a/test/parallel/test-process-cpuUsage.js b/test/parallel/test-process-cpuUsage.js index 6f647a435827af..5f51f0ac839a8b 100644 --- a/test/parallel/test-process-cpuUsage.js +++ b/test/parallel/test-process-cpuUsage.js @@ -34,13 +34,13 @@ for (let i = 0; i < 10; i++) { const invalidUserArgument = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "preValue.user" argument must be of type Number' + message: 'The "preValue.user" property must be of type Number' }); const invalidSystemArgument = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "preValue.system" argument must be of type Number' + message: 'The "preValue.system" property must be of type Number' }); diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index 2cfd543ac9d6ba..31b7e6ad3d6b15 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -85,7 +85,7 @@ assert.throws(function() { }, common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "superCtor.prototype" argument must be of type function' + message: 'The "superCtor.prototype" property must be of type function' }) ); assert.throws(function() {