From 8020ad2862dca194cf1620f38c1f8045ec6a8a52 Mon Sep 17 00:00:00 2001 From: Nahee-Park Date: Sun, 29 Sep 2024 19:07:21 +0900 Subject: [PATCH] stream: throw ERR_INVALID_ARG_TYPE instead of ERR_INVALID_THIS --- lib/internal/webstreams/encoding.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/webstreams/encoding.js b/lib/internal/webstreams/encoding.js index 9cfea36989a228..afb06c786d6f7a 100644 --- a/lib/internal/webstreams/encoding.js +++ b/lib/internal/webstreams/encoding.js @@ -21,6 +21,7 @@ const { customInspect } = require('internal/webstreams/util'); const { codes: { ERR_INVALID_THIS, + ERR_INVALID_ARG_TYPE, }, } = require('internal/errors'); @@ -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)