[whatwg/streams] Need to define the current Realm for pipeTo operations (#845)

https://streams.spec.whatwg.org/#rs-pipe-to defines things like calling ReadableStreamReaderGenericRelease during shutdown.  ReadableStreamReaderGenericRelease step 4 needs to create a "promise rejected with", which means it needs to know what global to use for that.

Presumably the global is that of the current Realm.  But it's not clear to me that the current Realm is well-defined on all the paths that can lead to shutdown in the parallel section of pipeTo.  In particular, nothing really indicates that `if dest.[[state]] is or becomes "errored"` has to happen while there is a current Realm set up.

It would be good to make this clearer, ideally by explicitly saying what Realm should be used here or having a note explaining how the existence of a current Realm is guaranteed.

We should probably also have tests for this, if we don't already.

-- 
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/845

Received on Thursday, 19 October 2017 20:11:17 UTC