Skip to content

Need to define the current Realm for pipeTo operations #845

@bzbarsky

Description

@bzbarsky

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions