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
Await promises from sync iterators with for-await
#13824
Conversation
if (method == null) throw new TypeError("Object is not async iterable"); | ||
return method.call(iterable); | ||
} | ||
|
||
function AsyncFromSyncIterator(s) { |
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.
The spec for this is at https://tc39.es/ecma262/#sec-async-from-sync-iterator-objects
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/49101/ |
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:
|
@@ -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")` |
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.
Q: why should we bump helper minimum version here?
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.
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>
This PR can be easily reviewed commit-by-commit.