From 659acadf77fdbeef8579a37839a464feb408437a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E6=B8=A1?= Date: Tue, 2 Apr 2019 01:05:19 +0800 Subject: Improve new TextDecoder().toString() (#2032) --- js/text_encoding_test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/text_encoding_test.ts') diff --git a/js/text_encoding_test.ts b/js/text_encoding_test.ts index 0799b1c3e..d33537b4f 100644 --- a/js/text_encoding_test.ts +++ b/js/text_encoding_test.ts @@ -91,3 +91,11 @@ test(function textDecoderSharedInt32Array() { const actual = decoder.decode(i32); assertEquals(actual, "ABCDEFGH"); }); + +test(function toStringShouldBeWebCompatibility() { + const encoder = new TextEncoder(); + assertEquals(encoder.toString(), "[object TextEncoder]"); + + const decoder = new TextDecoder(); + assertEquals(decoder.toString(), "[object TextDecoder]"); +}); -- cgit v1.2.3