| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent aaea394 commit c7ed2ff
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,6 +20,7 @@ const { customInspect } = require('internal/webstreams/util'); | |||
| 20 | 20 | ||
| 21 | 21 | const { | |
| 22 | 22 | codes: { | |
| 23 | + ERR_INVALID_ARG_TYPE, | ||
| 23 | 24 | ERR_INVALID_THIS, | |
| 24 | 25 | }, | |
| 25 | 26 | } = require('internal/errors'); | |
@@ -133,6 +134,9 @@ class TextDecoderStream { | |||
| 133 | 134 | this.#handle = new TextDecoder(encoding, options); | |
| 134 | 135 | this.#transform = new TransformStream({ | |
| 135 | 136 | transform: (chunk, controller) => { | |
| 137 | + if (chunk === undefined) { | ||
| 138 | + throw new ERR_INVALID_ARG_TYPE('chunk', 'string', chunk); | ||
| 139 | + } | ||
| 136 | 140 | const value = this.#handle.decode(chunk, { stream: true }); | |
| 137 | 141 | if (value) | |
| 138 | 142 | controller.enqueue(value); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,13 +66,6 @@ | |||
| 66 | 66 | "streams/decode-utf8.any.js": { | |
| 67 | 67 | "requires": ["small-icu"] | |
| 68 | 68 | }, | |
| 69 | - "streams/decode-bad-chunks.any.js": { | ||
| 70 | - "fail": { | ||
| 71 | - "expected": [ | ||
| 72 | - "chunk of type undefined should error the stream" | ||
| 73 | - ] | ||
| 74 | - } | ||
| 75 | - }, | ||
| 76 | 69 | "streams/decode-non-utf8.any.js": { | |
| 77 | 70 | "requires": ["full-icu"] | |
| 78 | 71 | }, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments