Skip to content

Commit

Permalink
Upgrade: espree@next
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Jun 1, 2018
1 parent 400d4b5 commit 6bb5c3c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/rules/no-catch-shadow.js
Expand Up @@ -53,7 +53,7 @@ module.exports = {

return {

CatchClause(node) {
"CatchClause[param!=null]"(node) {
let scope = context.getScope();

/*
Expand Down
8 changes: 4 additions & 4 deletions lib/rules/no-shadow-restricted-names.js
Expand Up @@ -47,21 +47,21 @@ module.exports = {
checkForViolation(node.id);
},
ArrowFunctionExpression(node) {
[].map.call(node.params, checkForViolation);
node.params.forEach(checkForViolation);
},
FunctionExpression(node) {
if (node.id) {
checkForViolation(node.id);
}
[].map.call(node.params, checkForViolation);
node.params.forEach(checkForViolation);
},
FunctionDeclaration(node) {
if (node.id) {
checkForViolation(node.id);
[].map.call(node.params, checkForViolation);
}
node.params.forEach(checkForViolation);
},
CatchClause(node) {
"CatchClause[param!=null]"(node) {
checkForViolation(node.param);
}
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -42,7 +42,7 @@
"doctrine": "^2.1.0",
"eslint-scope": "^4.0.0-alpha.0",
"eslint-visitor-keys": "^1.0.0",
"espree": "^4.0.0-alpha.1",
"espree": "github:eslint/espree#upgrade-acorn-5.6",
"esquery": "^1.0.1",
"esutils": "^2.0.2",
"file-entry-cache": "^2.0.0",
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/rules/no-catch-shadow.js
Expand Up @@ -40,6 +40,10 @@ ruleTester.run("no-catch-shadow", rule, {
{
code: "try {} catch (error) {}",
env: { shelljs: false }
},
{
code: "try {} catch {}",
parserOptions: { ecmaVersion: 2019 }
}
],
invalid: [
Expand Down
6 changes: 5 additions & 1 deletion tests/lib/rules/no-shadow-restricted-names.js
Expand Up @@ -20,7 +20,11 @@ ruleTester.run("no-shadow-restricted-names", rule, {
"!function foo(bar){ var baz; }",
"!function(bar){ var baz; }",
"try {} catch(e) {}",
{ code: "export default function() {}", parserOptions: { sourceType: "module" } }
{ code: "export default function() {}", parserOptions: { sourceType: "module" } },
{
code: "try {} catch {}",
parserOptions: { ecmaVersion: 2019 }
}
],
invalid: [
{
Expand Down

0 comments on commit 6bb5c3c

Please sign in to comment.