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

emit generators when targeting es5 #14903

Closed
marzelin opened this issue Mar 28, 2017 · 2 comments
Closed

emit generators when targeting es5 #14903

marzelin opened this issue Mar 28, 2017 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@marzelin
Copy link

TypeScript Version: 2.2.1

When I use generators in my code while targeting es5, the following error appears:
'Generators are only available when targeting ECMAScript 2015 or higher.'
but tslib already provides a generator helper (it's used when converting async functions).
It would be nice if typescript was able to emit bare generators as well.

@mhegazy
Copy link
Contributor

mhegazy commented Mar 28, 2017

This should be coming in TS 2.3 under ---downlevelIteration flag. You should be able to try it out in typescript@next today.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Mar 28, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Mar 28, 2017

Duplicate of #1564. Fixed by #12346

@mhegazy mhegazy closed this as completed Apr 19, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants