Re: [whatwg/streams] In pipeTo spec, the order of checking for shuttingDown disagrees with ref. impl. (#934)

> You asked for a list of tests and my comments on them, should I just post that here in a comment or make a new issue or issues for those?

A new issue would be the easiest thing for us to manage.

> BTW: in order to get back into streams I developed a little further and made a polyfill for streams including a fetch adapter as the Response class is where most ReadableStreams in web apps are originated or end up.

That is so cool. Did you find a way to making streaming upload work? I don't think any browser does that yet, it would be great to have an implementation.

I just noticed that it's all typed using TypeScript. Also very cool.

Like the sd-streams README says, sometimes in polyfills it is better to be pragmatic than to aim for 100% conformance.

(from pipeThrough() implementation)
> // not sure why the spec is so pedantic about the authenticity of only this particular promise, but hey

pipeThrough() can operate on an object that is not a real ReadableStream and call a pipeTo() method that doesn't return a real Promise. Something like this:
```javascript
ReadableStream.prototype.pipeThrough.call({
  pipeTo() { 
    return { 
      then() { console.log('not a real Promise'); }
    }; 
  }
}, { readable: {}, writable: {} });
```
This is the only case where we set [[PromiseIsHandled]] to true on a Promise that we did not ourselves create, and so we need to be careful it actually is a real Promise before we start poking at its internals.



-- 
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/streams/issues/934#issuecomment-401777752

Received on Monday, 2 July 2018 11:44:54 UTC