for (let i = 0; i < 10; i++) {
const i = ...;
...
}
Buble incorrectly threw an error due to the 'i' in 'i++' being
incorrectly identified as a constant.
This commits makes it so for, for in and for of loops have their
own scope.
The way the variable declarations are handled to calculate shouldRewriteAsFunction is not ideal. It only got the bare minimum changes to pass the existing tests, so current limitations still apply.
This fixes an issue encountered when compiling:
Buble incorrectly threw an error due to the 'i' in 'i++' being incorrectly identified as a constant. This commits makes it so for, for in and for of loops have their own scope.
The way the variable declarations are handled to calculate
shouldRewriteAsFunction
is not ideal. It only got the bare minimum changes to pass the existing tests, so current limitations still apply.