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 8020ad2
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 @@ -21,6 +21,7 @@ const { customInspect } = require('internal/webstreams/util');
const {
codes: {
ERR_INVALID_THIS,
ERR_INVALID_ARG_TYPE,

Check failure on line 24 in lib/internal/webstreams/encoding.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Out of ASCIIbetical order - ERR_INVALID_THIS >= ERR_INVALID_ARG_TYPE
},
} = 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 8020ad2

Please sign in to comment.