stream: update TextEncoderStream to align with the latest spec
This PR updated TextEncoderStream
implementation to align with the latest WHATWG spec.
-
transform()
: https://encoding.spec.whatwg.org/#encode-and-enqueue-a-chunk -
flush
: https://encoding.spec.whatwg.org/#encode-and-flush
Test cases of /test/fixtures/wpt/encoding/streams/encode-utf8.any.js
(WPT for TextEncoderStream
) are all passed now. (The previous implementation didn't support surrogate pairs.)