Skip to content

Commit

Permalink
stream: throw ERR_INVALID_ARG_TYPE instead of ERR_INVALID_THIS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nahee-Park committed Sep 29, 2024
1 parent 1ac2e8b commit cc89cf2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/webstreams/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const { customInspect } = require('internal/webstreams/util');

const {
codes: {
ERR_INVALID_ARG_TYPE,
ERR_INVALID_THIS,
},
} = require('internal/errors');
Expand Down Expand Up @@ -134,7 +135,7 @@ class TextDecoderStream {
this.#transform = new TransformStream({
transform: (chunk, controller) => {
if (chunk === undefined) {
throw new ERR_INVALID_THIS('TextDecoderStream');
throw new ERR_INVALID_ARG_TYPE('chunk', 'string', chunk);
}
const value = this.#handle.decode(chunk, { stream: true });
if (value)
Expand Down

0 comments on commit cc89cf2

Please sign in to comment.