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

Fix: yield* should throw if not iterable #636

Merged

Conversation

SuperSodaSea
Copy link
Contributor

yield* an non-iterable value should throw TypeError, rather than treating it as an iterator with no values.

Fixes #202.
See also: babel/babel#1648, babel/babel#15172

Copy link
Collaborator

@benjamn benjamn left a comment

Choose a reason for hiding this comment

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

Thanks for this fix + tests, and sorry for the long wait @SuperSodaSea!

@benjamn benjamn merged commit d3bac38 into facebook:main Aug 4, 2023
@SuperSodaSea SuperSodaSea deleted the fix/delegated-yield-non-iterable branch August 4, 2023 17:36
benjamn added a commit that referenced this pull request Aug 4, 2023
The minor version bump is due to the new ability of `yield*` to throw
when given a non-iterable argument, introduced by PR #636.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sandbox bug report - "yield* undefined" doesn't throw (or is caught inside and hidden)
3 participants