Skip to content

Commit cc89cf2

Browse files
committed
stream: throw ERR_INVALID_ARG_TYPE instead of ERR_INVALID_THIS
1 parent 1ac2e8b commit cc89cf2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/webstreams/encoding.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const { customInspect } = require('internal/webstreams/util');
2020

2121
const {
2222
codes: {
23+
ERR_INVALID_ARG_TYPE,
2324
ERR_INVALID_THIS,
2425
},
2526
} = require('internal/errors');
@@ -134,7 +135,7 @@ class TextDecoderStream {
134135
this.#transform = new TransformStream({
135136
transform: (chunk, controller) => {
136137
if (chunk === undefined) {
137-
throw new ERR_INVALID_THIS('TextDecoderStream');
138+
throw new ERR_INVALID_ARG_TYPE('chunk', 'string', chunk);
138139
}
139140
const value = this.#handle.decode(chunk, { stream: true });
140141
if (value)

0 commit comments

Comments
 (0)