-
Notifications
You must be signed in to change notification settings - Fork 367
Use ReadableStreamPipeTo in Request constructor #959
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
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.
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
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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