diff --git a/.eslintrc.js b/.eslintrc.js index 6311c7bb5b670f..7333382fe38923 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -234,6 +234,7 @@ module.exports = { variables: false, }], 'no-useless-call': 'error', + 'no-useless-catch': 'error', 'no-useless-concat': 'error', 'no-useless-constructor': 'error', 'no-useless-escape': 'error', diff --git a/lib/vm.js b/lib/vm.js index 12c4efa1a29d4f..464724071a49ca 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -80,7 +80,7 @@ class Script extends ContextifyScript { // Calling `ReThrow()` on a native TryCatch does not generate a new // abort-on-uncaught-exception check. A dummy try/catch in JS land // protects against that. - try { + try { // eslint-disable-line no-useless-catch super(code, filename, lineOffset, diff --git a/tools/node_modules/eslint/lib/rules/no-useless-catch.js b/tools/node_modules/eslint/lib/rules/no-useless-catch.js index 3211ed2c736489..e4284cfb4f4307 100644 --- a/tools/node_modules/eslint/lib/rules/no-useless-catch.js +++ b/tools/node_modules/eslint/lib/rules/no-useless-catch.js @@ -27,6 +27,7 @@ module.exports = { return { CatchClause(node) { if ( + node.param && node.param.type === "Identifier" && node.body.body.length && node.body.body[0].type === "ThrowStatement" && diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index c19f06c8166831..0be3a7073abefc 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -134,5 +134,5 @@ "publish-release": "node Makefile.js publishRelease", "test": "node Makefile.js test" }, - "version": "5.11.0" + "version": "5.11.1" } \ No newline at end of file