From ac18aebd7264cab10b07c2fa5c5739d4ed3d08d9 Mon Sep 17 00:00:00 2001 From: Ian Moody Date: Tue, 16 Apr 2019 15:02:10 +0000 Subject: [PATCH] Bug 1544286 - xpcom/ manual ESLint no-throw-literal fixes. r=erahm Differential Revision: https://phabricator.services.mozilla.com/D27451 --HG-- extra : moz-landing-system : lando --- .eslintrc.js | 8 -------- xpcom/tests/unit/test_iniParser.js | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a5da4d702d34..d8099a4349ce 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -84,14 +84,6 @@ module.exports = { "rules": { "no-undef": "off", } - }, { - // TODO: Bug 1246594. Empty this list once the rule has landed for all dirs - "files": [ - "xpcom/tests/unit/test_iniParser.js", - ], - "rules": { - "no-throw-literal": "off", - } }, { ...removeOverrides(xpcshellTestConfig), "files": xpcshellTestPaths.map(path => `${path}**`), diff --git a/xpcom/tests/unit/test_iniParser.js b/xpcom/tests/unit/test_iniParser.js index a22ddc43708a..562d7264336d 100644 --- a/xpcom/tests/unit/test_iniParser.js +++ b/xpcom/tests/unit/test_iniParser.js @@ -300,6 +300,6 @@ try { parser.setString("ok", "ok", "good="); } catch (e) { caughtError = e; } Assert.ok(!caughtError); caughtError = null; } catch (e) { - throw "FAILED in test #" + testnum + " -- " + e; + throw new Error(`FAILED in test #${testnum} -- ${e}`); } }