Skip to content

Commit

Permalink
Fix: add test for a syntax error (fixes #6013)
Browse files Browse the repository at this point in the history
This syntax error came to be raised since Acorn 3.2.0.
This syntax error prevents a false positive of `no-undef` rule.
  • Loading branch information
mysticatea committed Jun 11, 2016
1 parent 20ab4f6 commit c9898c3
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit c9898c3

Please sign in to comment.