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
False Positive Error with 'this' and object literal shorthand #6013
Comments
Thank you for this issue. let foo = {this}; This is a syntax error. https://tc39.github.io/ecma262/2016/#prod-ObjectLiteral PropertyDefinition -> IdentifierReference -> Identifier -> IdentifierName but not ReserevedWord I will open an issue on Acorn later. |
Interesting. I see it doesn't work in Chrome - either Node accepted it or I never hit that log condition, which seems unlikely. Thanks. |
This has been fixed in Acorn. |
Now Acorn v3.2.0 has been released: https://github.com/ternjs/acorn/releases/tag/3.2.0 |
This syntax error came to be raised since Acorn 3.2.0. This syntax error prevents a false positive of `no-undef` rule.
This syntax error came to be raised since Acorn 3.2.0. This syntax error prevents a false positive of `no-undef` rule.
What version of ESLint are you using?
2.9.0
What parser (default, Babel-ESLint, etc.) are you using?
Node v5.7.1, server side code, not using Babel
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
No error should be returned
What actually happened? Please include the actual, raw output from ESLint.
This code works as expected:
Probably a rare usecase, but in this case we wanted to log 'this' in our logger and have it appear as 'this'.
I think this is a regression, as I think this code has been in place for a while without throwing an error and with the same eslint config. We've just upgraded eslint.
The text was updated successfully, but these errors were encountered: