Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
stream: throw ERR_INVALID_ARG_TYPE instead of ERR_INVALID_THIS
  • Loading branch information
Nahee-Park committed Sep 29, 2024
commit cc89cf23dee8854c30ce5b5c3f464307057aad16
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