Improve new TextDecoder().toString() (#2032)

This commit is contained in:
迷渡 2019-04-02 01:05:19 +08:00 committed by Ryan Dahl
parent ada5ffa610
commit 659acadf77
2 changed files with 14 additions and 0 deletions

View file

@ -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]");
});