Skip to content

Commit 89191c2

Browse files
committed
test: make mistakes test separate errors for Firefox
1 parent 2ed91f8 commit 89191c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/encoding/mistakes.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ describe('Common implementation mistakes', () => {
252252
// This one might be tricky to get into WPT, as two major impls ignore spec here
253253
// https://github.com/whatwg/encoding/issues/115
254254
test('Concatenating two ISO-2022-JP outputs is not always valid', (t) => {
255-
const fatal = new TextDecoder('iso-2022-jp', { fatal: true })
256255
const loose = new TextDecoder('iso-2022-jp')
257256

258257
// Roman, example from spec
259258
{
259+
const fatal = new TextDecoder('iso-2022-jp', { fatal: true }) // Fresh instance because of sticky state, which is a separate test
260260
const a = u(0x1b, 0x28, 0x4a, 0x5c, 0x1b, 0x28, 0x42) // switch to Roman, select char, switch to ascii
261261
t.assert.strictEqual(fatal.decode(a), '\xA5')
262262
t.assert.strictEqual(loose.decode(a), '\xA5')
@@ -266,6 +266,7 @@ describe('Common implementation mistakes', () => {
266266

267267
// jis
268268
{
269+
const fatal = new TextDecoder('iso-2022-jp', { fatal: true }) // Fresh instance because of sticky state, which is a separate test
269270
const a = u(0x1b, 0x24, 0x42, 0x30, 0x30, 0x1b, 0x28, 0x42) // switch to jis, select char, switch to ascii
270271
t.assert.strictEqual(fatal.decode(a), '\u65ED')
271272
t.assert.strictEqual(loose.decode(a), '\u65ED')

0 commit comments

Comments
 (0)