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.

if (method == null) throw new TypeError("Object is not async iterable");
return method.call(iterable);
}
function AsyncFromSyncIterator(s) {
Copy link
Member Author

@nicolo-ribaudo nicolo-ribaudo Oct 6, 2021

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 babel-bot commented Oct 6, 2021

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

@codesandbox
Copy link

@codesandbox codesandbox 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

@JLHwung JLHwung Oct 7, 2021

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

@nicolo-ribaudo nicolo-ribaudo Oct 7, 2021

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".

JLHwung
JLHwung approved these changes Oct 7, 2021
Co-authored-by: Mickey Rose <lightmare@users.noreply.github.com>
@nicolo-ribaudo nicolo-ribaudo merged commit b9ea196 into babel:main Oct 7, 2021
26 of 28 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the async-from-sync-iterator branch Oct 7, 2021
@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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants