Skip to content

Commit

Permalink
Fix: "var let" should be allowed (fixes eslint#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamund Ferguson committed Aug 12, 2015
1 parent 7843287 commit 3579a42
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = {
return (id === "if") || (id === "in") || (id === "do");
case 3:
return (id === "var") || (id === "for") || (id === "new") ||
(id === "try") || (id === "let");
(id === "try");
case 4:
return (id === "this") || (id === "else") || (id === "case") ||
(id === "void") || (id === "with") || (id === "enum");
Expand Down
56 changes: 56 additions & 0 deletions tests/fixtures/ast/Variable-Statement.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,62 @@
}
}
},
"var let": {
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "let",
"range": [
4,
5
],
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
}
}
},
"init": null,
"range": [
4,
5
],
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
}
}
}
],
"kind": "var",
"range": [
0,
5
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
}
},
"var implements, interface, package": {
"type": "VariableDeclaration",
"declarations": [
Expand Down

0 comments on commit 3579a42

Please sign in to comment.