| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0d58bb9 commit f10f2c1
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -201,8 +201,13 @@ if (common.hasIntl) { | |||
| 201 | 201 | } | |
| 202 | 202 | ||
| 203 | 203 | if (common.hasIntl) { | |
| 204 | - const decoder = new TextDecoder('Shift_JIS'); | ||
| 205 | - const chunk = new Uint8Array([-1]); | ||
| 206 | - const str = decoder.decode(chunk); | ||
| 207 | - assert.strictEqual(str, '\ufffd'); | ||
| 204 | + try { | ||
| 205 | + const decoder = new TextDecoder('Shift_JIS'); | ||
| 206 | + const chunk = new Uint8Array([-1]); | ||
| 207 | + const str = decoder.decode(chunk); | ||
| 208 | + assert.strictEqual(str, '\ufffd'); | ||
| 209 | + } catch (e) { | ||
| 210 | + // Encoding may not be available, e.g. small-icu builds | ||
| 211 | + assert.strictEqual(e.code, 'ERR_ENCODING_NOT_SUPPORTED'); | ||
| 212 | + } | ||
| 208 | 213 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments