From 3e10462c9e368d4b9b8d35e33081f2e65ea2647a Mon Sep 17 00:00:00 2001 From: Ian Moody Date: Fri, 5 Apr 2019 11:31:01 +0000 Subject: [PATCH] Bug 1541024 - parser/ automated ESLint no-throw-literal fixes. r=hsivonen Result of running: $ mach eslint -funix parser/ | sed -Ee 's/:.+//' - | xargs sed -E \ -e 's/throw ((["`])[^"]+\2);/throw new Error(\1);/g' \ -e 's/throw ((["`])[^"]+\2 \+ [^ ";]+);/throw new Error(\1);/g' \ -e 's/throw \(/throw new Error(/g' -i Differential Revision: https://phabricator.services.mozilla.com/D25757 --HG-- extra : moz-landing-system : lando --- .eslintrc.js | 1 - parser/htmlparser/tests/mochitest/parser_datreader.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 091dabb3c6cc..f2aab9610478 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -87,7 +87,6 @@ module.exports = { }, { // TODO: Bug 1246594. Empty this list once the rule has landed for all dirs "files": [ - "parser/htmlparser/tests/mochitest/parser_datreader.js", "testing/marionette/event.js", "testing/mochitest/**", "testing/modules/tests/xpcshell/test_assert.js", diff --git a/parser/htmlparser/tests/mochitest/parser_datreader.js b/parser/htmlparser/tests/mochitest/parser_datreader.js index 5f610fcc80c3..97298208f913 100644 --- a/parser/htmlparser/tests/mochitest/parser_datreader.js +++ b/parser/htmlparser/tests/mochitest/parser_datreader.js @@ -43,7 +43,7 @@ function parseTestcase(testcase) { if (line == "#data") break; log(lines); - throw "Unknown test format."; + throw new Error("Unknown test format."); } var input = [];