-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Async arrow functions generate broken code when targeting es5 #7706
Comments
The compiler also gives an error:
It's by design that the compiler may emit some output (which may be garbage) even if there's an error. If you don't want the compiler to emit on error then use Edit: And note that the error is somewhat misleading since the real reason is that async functions aren't supported when targeting ES5. |
I also reported this a month ago (#7334). It's not specific to async arrow functions, it's when the async function is an expression (e.g. RHS of assignment) rather than a declaration. @Arnavion that error |
TypeScript Version: Tested on 1.8.9 and Version 1.9.0-dev.20160327
Code
Compiles to the following (when
{"target": "es5"}
):The text was updated successfully, but these errors were encountered: