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
exemple:
for let k in v when k ...
result:
var i$, ref$, len$; for (i$ = 0, len$ = (ref$ = v).length; i$ < len$; ++i$) { if (k) { (fn$.call(this, ref$[i$])); } } function fn$(k){ throw Error('unimplemented'); }
expected:
var i$, ref$, len$; for (i$ = 0, len$ = (ref$ = v).length; i$ < len$; ++i$) { var k = ref$[i$]; if (k) { (fn$.call(this, k)); } } function fn$(k){ throw Error('unimplemented'); }
The text was updated successfully, but these errors were encountered:
Turns out this is slightly narrower; the actual issue only occurs when the loop variable is the entirety of the when clause. for let k in v when k > 0 works as expected.
for let k in v when k > 0
Sorry, something went wrong.
Actually there's another bug underneath:
for let {}:k in v when k > 0 ...
gives
var i$, ref$, len$; for (i$ = 0, len$ = (ref$ = v).length; i$ < len$; ++i$) { if (k > 0) { (fn$.call(this, ref$[i$])); } } function fn$(){ throw Error('unimplemented'); }
Fix interactions of loop guards+let(+destructuring), closes gkz#992
ac3ab27
c4ac4ad
8b78163
rhendric
Successfully merging a pull request may close this issue.
exemple:
result:
expected:
The text was updated successfully, but these errors were encountered: