Use ReadableStreamPipeTo in Request constructor#959
Conversation
5741a2c to
2cd96ec
Compare
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.
| <a for=ReadableStream>locked</a> and <a for=ReadableStream>disturbed</a> immediately. | ||
| </li> | ||
|
|
||
| <li><p>Set <var>promise</var>.\[[PromiseIsHandled]]</var> to true. |
There was a problem hiding this comment.
Is there a way to avoid this? Manipulating internal state of promises seems problematic and especially doing so in a specification that isn't likely to be notified if ECMAScript is refactored in some fashion.
There was a problem hiding this comment.
I'm not aware of one other than calling then (or catch) explicitly. @domenic, do you have any recommendation?
There was a problem hiding this comment.
In my opinion this is an exceptional internal slot that it is OK for other standards to manipulate. (As an alternative to uselessly calling PerformPromiseThen() with a no-op catch handler.)
There was a problem hiding this comment.
What do you think of moving this into IDL somehow with other specifications having "Handle promise." or some such?
There was a problem hiding this comment.
That seems like a reasonable future cleanup, yeah. As-is right now we're still in the world where streams operates on ES promises directly.
Set the [[disturbed]] internal slot to true in ReadableStreamPipeTo. This is useful for the Fetch Standard. See whatwg/fetch#959 for the Fetch Standard change that requires this.
|
Remaining:
|
We have used an imprecise sentence for creating a ReadableStream "from which one can read the exactly same data as one could read" from the original ReadableStream, because transform streams and piping were not defined. Now they are available, so let's use them. Fixes #463.
4d4f0b9 to
81c5b23
Compare
Done.
Filed whatwg/webidl/issues/829.
I think we don't need tests. This is a kind of cleanup change. |
We have used an imprecise sentence for creating a ReadableStream "from which
one can read the exactly same data as one could read" from the original
ReadableStream, because transform streams and piping were not defined. Now they
are available, so let's use them.
Fixes #463.
Preview | Diff