Skip to content

Correctly delegate .return() in async generator#10422

Merged
nicolo-ribaudo merged 4 commits intobabel:masterfrom
nicolo-ribaudo:issue-9905
Nov 4, 2019
Merged

Correctly delegate .return() in async generator#10422
nicolo-ribaudo merged 4 commits intobabel:masterfrom
nicolo-ribaudo:issue-9905

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo commented Sep 9, 2019

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

(rant) Debugging this thing was really painful. When working with async code and generators, node was trying to be helpful by stepping into code in the next tick and it missed a lot of stack frames.

Disclaimer: I'm only 80% sure that this PR is correct.

cc @zenparsing "Git blame" attributes this code to only you. If you have time to review this code it would be really appreciated, since propbably you are one of the only persons which fully understand how it works 😅

@nicolo-ribaudo nicolo-ribaudo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Async Generators labels Sep 9, 2019
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Sep 9, 2019

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

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

I think that the tests are failing on node 6 because of a generator bug in that version.

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

✔️

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: Bug Fix 🐛 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.

Async generator with yield* in inner loop cannot manually return as expected Async Iteration Bug - yield* for await break

3 participants