-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Can't assign let variables inside of closures #102
Comments
Any progress on this? IMHO this is a rather serious issue. Here's a more elaborated test case: for (let x = 0; true;) {
(function() {
x = 1;
}());
(function() {
assert.equal(x, 1);
x = 2;
}());
assert.equal(x, 2);
break;
} |
It's a current limitation of the current let scoping transformer (not being able to reassign let variables inside of closures). I haven't gotten around to rewriting it because I've been busy with a code generator rewrite. |
Thanks for the amazingly quick reply. |
Just curious, but what are the plans for this (if any)? Use try/catch, or a state machine like Traceur's? |
Definently not |
Traceur's generated code looks quite horrible considering |
Fixed when 287cbbb is merged. |
yay, nice! |
Fixed as of 1.11.0 |
Awesome, thanks! |
Completed generator should throw correct error after it had error inside.
Not really a closure, but this most clearly demonstrates the issue:
Compiles to:
Should be more like:
The text was updated successfully, but these errors were encountered: