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

Editorial: stop using "promise-calling" #937

Merged
merged 2 commits into from
Sep 13, 2019
Merged

Conversation

annevk
Copy link
Member

@annevk annevk commented Sep 12, 2019

See whatwg/webidl#795 for context.


Preview | Diff

@annevk annevk requested a review from domenic September 12, 2019 12:41
@annevk
Copy link
Member Author

annevk commented Sep 12, 2019

cc @Ms2ger

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be much simpler. CreateReadableStream accepts algorithms. You have created an algorithm which promise-calls a function but that function is really just an algorithm.

Instead, you should just pass the algorithms (pull and cancel) to CreateReadableStream semi-directly.

I say "semi-directly" because CreateReadableStream expects the algorithms to return promises. As far as I can tell nothing in the fetch spec needs that. So you need a small wrapper algorithm that returns "a promise resolved with undefined".

But you shouldn't need promise-calling at all, or to go through Web IDL, for this.

@annevk
Copy link
Member Author

annevk commented Sep 13, 2019

Thanks! I think it's good now.

@annevk annevk merged commit ce287b0 into master Sep 13, 2019
@annevk annevk deleted the annevk/promise-calling branch September 13, 2019 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants