From e6b5232381836b38e88feb0a5bb6a68b739eb2fc Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 26 Dec 2018 21:05:21 -0500 Subject: [PATCH] tools: enable no-useless-catch lint rule This commit enables ESLint's no-useless-catch rule. PR-URL: https://github.com/nodejs/node/pull/25236 Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- .eslintrc.js | 1 + lib/vm.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index e793f8567455c1..5f336754776815 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,