-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fails to properly parse for..of loops with const bindings #2334
Comments
I think #2326 is sort of a blocker for this, but I've got a quick patch... 90% sure it just reverts something that was removed because |
Wow, that was quick! Thanks for taking this on. :) |
@jkrems it's still going to be broken because they're not correctly block-scoped, so you'll see a lot of "cont variable redeclared" errors until the other thing is fixed (unless you're very careful not to reuse the variable names) |
Thanks for the warning! Will keep that in mind. |
@caitp for (const { foo } of bar) {}
Nevermind..........it wasn't picking up the new version of the module due to one of my other deps depending on its own jshint as well. i.e. it works correctly in master, I just wasn't using that code. Carry on... |
The following is valid ES6 code that prevents accidental assignments to
x
inside of the loop body:Running with io.js 1.8:
But jshint doesn't seem to expect a
const
token in that position, interpreting it as an identifier:The same code does work as expected with
var
orlet
instead ofconst
.The text was updated successfully, but these errors were encountered: