summaryrefslogtreecommitdiff
path: root/lib/internal/encoding.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/encoding.js')
-rw-r--r--lib/internal/encoding.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js
index 9cd47f861f..ae874c530c 100644
--- a/lib/internal/encoding.js
+++ b/lib/internal/encoding.js
@@ -51,7 +51,7 @@ function validateDecoder(obj) {
function validateArgument(prop, expected, propName, expectedName) {
if (typeof prop !== expected)
- throw new ERR_INVALID_ARG_TYPE(propName, expectedName);
+ throw new ERR_INVALID_ARG_TYPE(propName, expectedName, prop);
}
const CONVERTER_FLAGS_FLUSH = 0x1;
@@ -391,7 +391,8 @@ function makeTextDecoderICU() {
input = lazyBuffer().from(input);
} else if (!isArrayBufferView(input)) {
throw new ERR_INVALID_ARG_TYPE('input',
- ['ArrayBuffer', 'ArrayBufferView']);
+ ['ArrayBuffer', 'ArrayBufferView'],
+ input);
}
validateArgument(options, 'object', 'options', 'Object');
@@ -460,7 +461,8 @@ function makeTextDecoderJS() {
input.byteLength);
} else {
throw new ERR_INVALID_ARG_TYPE('input',
- ['ArrayBuffer', 'ArrayBufferView']);
+ ['ArrayBuffer', 'ArrayBufferView'],
+ input);
}
validateArgument(options, 'object', 'options', 'Object');