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

Transpiling loop bodies to functions emits wrong code with aliased variables #80

Open
adrianheine opened this issue Dec 10, 2017 · 1 comment
Labels

Comments

@adrianheine
Copy link
Member

Example:

let i;
for(let i in { a:1, b:1 }) {
  (function(){ return i; })();
}

Generates:

var i;
var loop = function ( i ) {
  (function(){ return i$1; })();
};

for(var i$1 in { a:1, b:1 }) loop( i );
@nathancahill
Copy link
Collaborator

This looks similar to #86 and the fix might be similar to #94.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants