-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
for-of with const emits wrong JS code #10220
Comments
for reference run:
|
@jrieken That would be an error in the js runtime. AFAIK, a Run that same code in the latest chrome (and thus recent v8): |
for reference: for-of with |
wow - good to know |
TypeScript Version: Playground
http://www.typescriptlang.org/play/#src=for%20(const%20a%20of%20%5B1%2C%202%2C%203%2C%204%5D)%20%7B%20console.log(a)%3B%20%7D
When using a
for-of
and aconst
loop variable the generated code still assigns the variable (a
) which is counterconst
and different from nodejs running such code.Code
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: