Skip to content
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

Fix: add test for a syntax error (fixes #6013) #6378

Merged
merged 1 commit into from Jun 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -42,7 +42,7 @@
"doctrine": "^1.2.2",
"es6-map": "^0.1.3",
"escope": "^3.6.0",
"espree": "3.1.4",
"espree": "^3.1.6",
"estraverse": "^4.2.0",
"esutils": "^2.0.2",
"file-entry-cache": "^1.1.1",
Expand Down
7 changes: 7 additions & 0 deletions tests/lib/eslint.js
Expand Up @@ -3685,6 +3685,13 @@ describe("eslint", function() {
eslint.verify("var { a='a' } = {};", { parserOptions: { ecmaVersion: 6 }});
});

it("should report syntax error when a keyword exists in object property shorthand", function() {
var messages = eslint.verify("let a = {this}", { parserOptions: { ecmaVersion: 6 }});

assert.equal(messages.length, 1);
assert.equal(messages[0].fatal, true);
});

it("should not rewrite env setting in core (https://github.com/eslint/eslint/issues/4814)", function() {

// This test focuses on the instance of https://github.com/eslint/eslint/blob/v2.0.0-alpha-2/conf/environments.js#L26-L28
Expand Down