-
Notifications
You must be signed in to change notification settings - Fork 155
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
Set [[disturbed]] synchronously in ReadableStreamPipeTo #1022
Conversation
Set the [[disturbed]] internal slot to true in ReadableStreamPipeTo. This is useful for the Fetch Standard. It is not visible to user code. See whatwg/fetch#959 for the Fetch Standard change that requires this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Isn't it visible if someone does something like response.body.pipeTo(...)
console.log(response.bodyUsed); ? |
My original thought was that this depends on the implementation of pipeTo (ie. whether or not it does the first read synchronously). But I think you can make the difference detectable in any implementation by doing response.body.pipeTo(new WritableStream({}, { highWaterMark: 0 });
console.log(response.bodyUsed); So actually implementations will have to explicitly apply this change. Or maybe this standard is the wrong place to make this change, and it should go in Fetch instead. |
Once |
Yeah, I am +1 on this change, I just think we may want to accompany it with some web platform tests. |
Please see the test at web-platform-tests/wpt#20205. |
whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour.
whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour.
…sly, a=testonly Automatic update from web-platform-tests Verify piping disturbs stream synchronously (#20205) whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour. -- wpt-commits: 760485a4f652813d1f195ee28042c391cf2fdc02 wpt-pr: 20205
…sly, a=testonly Automatic update from web-platform-tests Verify piping disturbs stream synchronously (#20205) whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour. -- wpt-commits: 760485a4f652813d1f195ee28042c391cf2fdc02 wpt-pr: 20205
…sly, a=testonly Automatic update from web-platform-tests Verify piping disturbs stream synchronously (#20205) whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour. -- wpt-commits: 760485a4f652813d1f195ee28042c391cf2fdc02 wpt-pr: 20205 UltraBlame original commit: fcba8dc0552eb96c10b6997d7313972e5177ac93
…sly, a=testonly Automatic update from web-platform-tests Verify piping disturbs stream synchronously (#20205) whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour. -- wpt-commits: 760485a4f652813d1f195ee28042c391cf2fdc02 wpt-pr: 20205 UltraBlame original commit: fcba8dc0552eb96c10b6997d7313972e5177ac93
…sly, a=testonly Automatic update from web-platform-tests Verify piping disturbs stream synchronously (#20205) whatwg/streams#1022 changes pipeTo and pipeThrough to always set the [[disturbed]] slot of the Response's body to true synchronously. This test verifies that behaviour. -- wpt-commits: 760485a4f652813d1f195ee28042c391cf2fdc02 wpt-pr: 20205 UltraBlame original commit: fcba8dc0552eb96c10b6997d7313972e5177ac93
Set the [[disturbed]] internal slot to true in ReadableStreamPipeTo.
This is useful for the Fetch Standard. It is not visible to user code.
See whatwg/fetch#959 for the Fetch Standard
change that requires this.
Also fix two places where the name of the
state
internal slot wasmistakenly italicised.
Preview | Diff