Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pipeThough() non-generic? #961

Closed
ricea opened this issue Nov 7, 2018 · 1 comment
Closed

Make pipeThough() non-generic? #961

ricea opened this issue Nov 7, 2018 · 1 comment

Comments

@ricea
Copy link
Collaborator

ricea commented Nov 7, 2018

Currently pipeThrough() operates generically on this. It performs no brand check, and will attempt to call this.pipeTo() regardless of whether this is a ReadableStream or not.

Blink is currently changing its streams implementation to use IDL, and there's no way to directly express this in IDL. We will need some workaround to pass the tests.

Having pipeThrough() be generic complicates the standard (because we have to check if the return value of pipeTo() is a Promise), and complicates IDL-based implementations. I think it doesn't provide much value, and the easiest thing to do would be to add a brand check and make it call an abstract PipeTo operation internally.

@domenic, what do you think?

@domenic
Copy link
Member

domenic commented Nov 7, 2018

I'm fine with this, because I've generally come to regret all these gratuitous differences with most web-based specs. See #963 for the larger discussion there.

If we do pursue #963, implementations may want to bundle this change in with the many other small tweaks that would be involved, so as to minimize any transition pain from web sites depending on the current semantics. But, we could also do this independently ahead of time.

ricea added a commit to ricea/streams that referenced this issue Nov 22, 2018
Require pipeThrough() to be called on a ReadableStream. Stop delegating to
this.pipeTo().

Also throw exceptions if *this* or _writable_ are not streams or they are
locked, or if *signal* is not an AbortSignal. Also require _readable_ to be a
ReadableStream.

Add a new abstract operation, ReadableStreamPipeTo(), which is used internally
by pipeTo() and pipeThrough() and also can be referenced from other
standards.

Closes whatwg#961.
ricea added a commit to ricea/streams that referenced this issue Nov 27, 2018
Require pipeThrough() to be called on a ReadableStream. Stop delegating
to this.pipeTo().

Also throw exceptions if *this* or _writable_ are not streams or they
are locked, or if *signal* is not an AbortSignal. Also require
_readable_ to be a ReadableStream.

Add a new abstract operation, ReadableStreamPipeTo(), which is used
internally by pipeTo() and pipeThrough() and also can be referenced from
other standards.

Closes whatwg#961.
ricea added a commit that referenced this issue Nov 27, 2018
Require pipeThrough() to be called on a ReadableStream. Stop delegating
to this.pipeTo().

Also throw exceptions if *this* or _writable_ are not streams or they
are locked, or if *signal* is not an AbortSignal. Also require
_readable_ to be a ReadableStream.

Add a new abstract operation, ReadableStreamPipeTo(), which is used
internally by pipeTo() and pipeThrough() and also can be referenced from
other standards.

Closes #961.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants