[encoding] Streaming should be a flag on the decoder instead of being a flag on the decode() call (#13)

Making the streaming mode a flag on the `decode()` call is rather strange API design. In Gecko's implementation, performing a streaming `decode()`, followed by a non-streaming `decode()` followed by a streaming `decode()` yields potentially surprising results. I don't blame the Gecko implementation: it's weird API design that the API makes this possible.

I'd have expected the streaming mode to be a flag on the `TextDecoder` object set at the time of instantiation--i.e. a flag passed to the constructor. Is there a chance to make it so without breaking the Web at this point? If not, the spec could use some text explicitly calling out this oddity and explaining its implications.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/13

Received on Monday, 2 November 2015 17:17:40 UTC