-
Notifications
You must be signed in to change notification settings - Fork 130
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
Generator helper #2
Conversation
CC: @mhegazy, @vladima, @DanielRosenwasser, @sandersn, @yuit |
|
||
```ts | ||
// source: | ||
async function func(x) { |
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.
Why don't you just use a generator function instead of an async one? I think that it would simplify what exactly is going on.
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.
This is because we do not support down-level generators outside of async functions.
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.
Why exactly is that?
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.
There's a lot of additional complexity to fully supporting generators downlevel, specifically the following cases:
for..of
support for generators- spread support for generators
- destructuring support for generators
yield*
support for generatorsSymbol.iterator
(or__iterator__
, etc.) interop with third-party polyfill libraries.
I have written some support for these in another branch, but they are presently out of scope and are not included in the release plan.
I follow the document and it looks good 👍 . I think it will be great if we could add |
Closed in favor of #4. |
This change adds the
__generator
helper totslib.js
.