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

Await promises from sync iterators with for-await #13824

Merged
merged 4 commits into from Oct 7, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 6, 2021

Q                       A
Fixed Issues? Fixes #13811
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This PR can be easily reviewed commit-by-commit.

@nicolo-ribaudo nicolo-ribaudo added PR: Spec Compliance 👓 A type of pull request used for our changelog categories Spec: Async Generators labels Oct 6, 2021
if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
}

function AsyncFromSyncIterator(s) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@babel-bot
Copy link
Collaborator

babel-bot commented Oct 6, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/49101/

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 6, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 34b58f0:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@@ -16,18 +16,60 @@ const helper = (minVersion: string) => (tpl: TemplateStringsArray) => ({
ast: () => template.program.ast(tpl),
});

helpers.asyncIterator = helper("7.0.0-beta.0")`
helpers.asyncIterator = helper("7.15.9")`
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: why should we bump helper minimum version here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Uh probably it's not needed. It's always a choice between "updating the plugin and @babel/core is enough to get the bugfix" vs "you also need to update @babel/runtime".

Co-authored-by: Mickey Rose <lightmare@users.noreply.github.com>
@nicolo-ribaudo nicolo-ribaudo merged commit b9ea196 into babel:main Oct 7, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the async-from-sync-iterator branch October 7, 2021 21:57
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 7, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Spec Compliance 👓 A type of pull request used for our changelog categories Spec: Async Generators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Regression in for await transform, is not awaiting iterator values
5 participants