Set [[disturbed]] synchronously in ReadableStreamPipeTo#1022
Set [[disturbed]] synchronously in ReadableStreamPipeTo#1022ricea merged 1 commit intowhatwg:masterfrom
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.
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
…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
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
stateinternal slot wasmistakenly italicised.
Preview | Diff