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
Issue with block-scoped declarations #306
Comments
Thanks for the report. Any other examples where we don't create new block scope, that we should know about? |
Re-declaring |
Sorry, what? I'm asking for other similar examples where we shouldn't throw an error on seeing a declaration, but we do. |
My bad. Another one: const a = 1;
{
const a = 2;
} |
Thanks. |
Other examples with ES2015 section numbers: function foo() {
if (aaa) {
const a = 1;
}
// 13.2.13
{
const a = 1;
}
// 13.7.4.7, 13.2.13
for (const a = 0; a < 10; a++) {
const a = 1;
}
// 13.7.5.12, 13.2.13
for (const a in aaa) {
const a = 1;
}
// 13.7.5.12, 13.2.13
for (const a of aaa) {
const a = 1;
}
// 13.12.11
switch (aaa) {
case 0:
const a = 1;
}
// 13.15.7
try {
} catch (e) {
const a = 1;
}
} |
Hey @jacksonrayhamilton, You had fixed the examples above before, but only with Firefox doesn't seem to mind (most of) them even without |
At some point in time I believed that |
Thanks everyone, this seems to fix all the examples above. |
With the following code:
js2-mode declares error on the second declaration of
a
withTypeError: redeclaration of const a.
The text was updated successfully, but these errors were encountered: