8000 Fix: `yield*` should throw if not iterable by SuperSodaSea · Pull Request #636 · facebook/regenerator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

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
Contributor
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
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
0