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
yield for do expression #10101
yield for do expression #10101
Conversation
98c0957
to
7ecf6d5
Compare
I have rebased this PR on Currently we generate incorrect syntax for valid input function* iter(x) {
yield 1;
var y = do {
let temp = yield 2;
temp * temp;
}
} |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45040/ |
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 d0cd2cc:
|
@@ -0,0 +1,7 @@ | |||
async function* asyncGenerator(x) { | |||
const y = yield* await async function* () { |
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 don't think this await
is necessary, since yield
in async generators automatically awaits its argument.
Based on #10072, @nicolo-ribaudo maybe can share a bit more about the edge cases you mentioned in #10072 (comment) ?
Fixes #1, Fixes #2