| OLD | NEW |
| 1 Edge cases around non-fatal errors at EOF | 1 Edge cases around non-fatal errors at EOF |
| 2 | 2 |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
| 4 | 4 |
| 5 | 5 |
| 6 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff])) thre
w exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The enco
ded data was not valid.. | 6 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff])) thre
w exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The enco
ded data was not valid.. |
| 7 | 7 |
| 8 Should not throw or hang: | 8 PASS new TextDecoder('utf-8').decode(new Uint8Array([0xff])) is '�' |
| 9 new TextDecoder('utf-8').decode(new Uint8Array([0xff])) | |
| 10 | 9 |
| 11 FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) s
hould throw an exception. Was . | 10 PASS new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) t
hrew exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The e
ncoded data was not valid.. |
| 12 | 11 |
| 13 Should not throw or hang: | 12 PASS new TextDecoder('utf-16le').decode(new Uint8Array([0x00])) is '�' |
| 14 new TextDecoder('utf-16le').decode(new Uint8Array([0x00])) | |
| 15 | 13 |
| 16 FAIL new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00])) s
hould throw an exception. Was . | 14 PASS new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00])) t
hrew exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The e
ncoded data was not valid.. |
| 17 | 15 |
| 18 Should not throw or hang: | 16 PASS new TextDecoder('utf-16be').decode(new Uint8Array([0x00])) is '�' |
| 19 new TextDecoder('utf-16be').decode(new Uint8Array([0x00])); | 17 |
| 18 Streaming cases: |
| 19 decoder = new TextDecoder('utf-16le', {fatal: true}) |
| 20 odd = new Uint8Array([0x00]) |
| 21 even = new Uint8Array([0x00, 0x00]) |
| 22 |
| 23 PASS decoder.decode(odd, {stream: true}); decoder.decode(odd) did not throw exce
ption. |
| 24 PASS decoder.decode(even, {stream: true}); decoder.decode(odd) threw exception E
ncodingError: Failed to execute 'decode' on 'TextDecoder': The encoded data was
not valid.. |
| 25 PASS decoder.decode(odd, {stream: true}); decoder.decode(even) threw exception E
ncodingError: Failed to execute 'decode' on 'TextDecoder': The encoded data was
not valid.. |
| 26 PASS decoder.decode(even, {stream: true}); decoder.decode(even) did not throw ex
ception. |
| 20 PASS successfullyParsed is true | 27 PASS successfullyParsed is true |
| 21 | 28 |
| 22 TEST COMPLETE | 29 TEST COMPLETE |
| 23 | 30 |
| OLD | NEW |