| Index: LayoutTests/fast/encoding/api/end-of-file.html
|
| diff --git a/LayoutTests/fast/encoding/api/end-of-file.html b/LayoutTests/fast/encoding/api/end-of-file.html
|
| index ef4f7b81789b5e127aa6b01e1f43e4267d2685df..0e9615b23eed70fb98374ed2f4d876df768ec368 100644
|
| --- a/LayoutTests/fast/encoding/api/end-of-file.html
|
| +++ b/LayoutTests/fast/encoding/api/end-of-file.html
|
| @@ -7,21 +7,30 @@ description("Edge cases around non-fatal errors at EOF");
|
| shouldThrow("new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xff]))");
|
|
|
| debug("");
|
| -debug("Should not throw or hang:");
|
| -evalAndLog("new TextDecoder('utf-8').decode(new Uint8Array([0xff]))");
|
| +shouldBe("new TextDecoder('utf-8').decode(new Uint8Array([0xff]))", "'\uFFFD'");
|
|
|
| debug("");
|
| shouldThrow("new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00]))");
|
|
|
| debug("");
|
| -debug("Should not throw or hang:");
|
| -evalAndLog("new TextDecoder('utf-16le').decode(new Uint8Array([0x00]))");
|
| +shouldBe("new TextDecoder('utf-16le').decode(new Uint8Array([0x00]))", "'\uFFFD'");
|
|
|
| debug("");
|
| shouldThrow("new TextDecoder('utf-16be', {fatal: true}).decode(new Uint8Array([0x00]))");
|
|
|
| debug("");
|
| -debug("Should not throw or hang:");
|
| -evalAndLog("new TextDecoder('utf-16be').decode(new Uint8Array([0x00]));");
|
| +shouldBe("new TextDecoder('utf-16be').decode(new Uint8Array([0x00]))", "'\uFFFD'");
|
| +
|
| +debug("");
|
| +debug("Streaming cases:");
|
| +evalAndLog("decoder = new TextDecoder('utf-16le', {fatal: true})");
|
| +evalAndLog("odd = new Uint8Array([0x00])");
|
| +evalAndLog("even = new Uint8Array([0x00, 0x00])");
|
| +
|
| +debug("");
|
| +shouldNotThrow("decoder.decode(odd, {stream: true}); decoder.decode(odd)");
|
| +shouldThrow("decoder.decode(even, {stream: true}); decoder.decode(odd)");
|
| +shouldThrow("decoder.decode(odd, {stream: true}); decoder.decode(even)");
|
| +shouldNotThrow("decoder.decode(even, {stream: true}); decoder.decode(even)");
|
|
|
| </script>
|
|
|