Re: [whatwg/encoding] Make TextEncoder and TextDecoder be transform streams (#127)

Yay! Comments in random order:

Since it's a common enough request, would it be possible to include an example in the spec itself showing how to use streams to encode into an existing ArrayBuffer?

Can the tests be upgraded to use `async`/`await` ?

In the tests, stream-properties.html should probably just be an idlharness test. (I don't know how well that plays with p(r)ollyfills, though.)

What's the behavior for split surrogate pairs when encoding? We basically pretend that's not a problem in the non-streaming API, by making the input is a USVString and thus not needing a `{stream}` flag. In other words, we assume that the input is always a complete text, not just a randomly partitioned sequence of code units. In this patch, the text reads _Let input be the result of converting chunk to a USVString...._ which sounds like it might introduce problems when chunk sizes cross surrogate boundaries. This worries me. Also, needs test cases.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/pull/127#issuecomment-350812147

Received on Monday, 11 December 2017 18:23:36 UTC