diff options
author | Weijia Wang <381152119@qq.com> | 2017-10-28 12:39:55 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-11-12 22:04:06 +0300 |
commit | e22b8d0c46728ebdaf64176191ffa2bdd0f56be9 (patch) | |
tree | 7b5c9624490d67fc0c8bff2413e7a27e9f93bbbc /lib/internal/encoding.js | |
parent | e0113ab5e0e2b329668fa7d744fac3bfe8b95935 (diff) |
lib: improve the usage of TypeError[INVALID_ARG_TYPE]
The initials of expected in TypeError[ERR_INVALID_ARG_TYPE]
are inconsistent. This change is to unify them.
PR-URL: https://github.com/nodejs/node/pull/16401
Fixes: https://github.com/nodejs/node/issues/16383
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib/internal/encoding.js')
-rw-r--r-- | lib/internal/encoding.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 09242be8dcf..763ee42426b 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -345,7 +345,7 @@ function makeTextDecoderICU() { constructor(encoding = 'utf-8', options = {}) { encoding = `${encoding}`; if (typeof options !== 'object') - throw new errors.Error('ERR_INVALID_ARG_TYPE', 'options', 'object'); + throw new errors.Error('ERR_INVALID_ARG_TYPE', 'options', 'Object'); const enc = getEncodingFromLabel(encoding); if (enc === undefined) @@ -378,7 +378,7 @@ function makeTextDecoderICU() { ['ArrayBuffer', 'ArrayBufferView']); } if (typeof options !== 'object') { - throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'options', 'object'); + throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'options', 'Object'); } var flags = 0; @@ -417,7 +417,7 @@ function makeTextDecoderJS() { constructor(encoding = 'utf-8', options = {}) { encoding = `${encoding}`; if (typeof options !== 'object') - throw new errors.Error('ERR_INVALID_ARG_TYPE', 'options', 'object'); + throw new errors.Error('ERR_INVALID_ARG_TYPE', 'options', 'Object'); const enc = getEncodingFromLabel(encoding); if (enc === undefined || !hasConverter(enc)) @@ -452,7 +452,7 @@ function makeTextDecoderJS() { ['ArrayBuffer', 'ArrayBufferView']); } if (typeof options !== 'object') { - throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'options', 'object'); + throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'options', 'Object'); } if (this[kFlags] & CONVERTER_FLAGS_FLUSH) { |