Re: [streams] explicity operate on underlying source and sink instead of public methods (#321)

OK, but then we need some way for ReadableStream.prototype.pipeTo to recognize that if `dest` is a `WritableByteStream`, it should not immediately reject (like it would for a `HTMLElement` or whatever). The solutions I can think of are:

- Duck type on public API (problematic as discussed above at length)
- Make `WritableByteStream` a subclass of `WritableStream`. This might be tricky because it means their internal models need to be similar enough for e.g. `WritableStream.prototype.write.call(wbs, chunk)` to work. (I think.)
- Hard code knowledge of `WritableByteStream` into `WritableStream`.
- Duck type on private API?? I guess this is workable in ES spec terms (check for an internal slot that both share). Although it's not terribly different than just hard coding the knowledge.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/321#issuecomment-91051015

Received on Wednesday, 8 April 2015 22:10:36 UTC