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
This commit is contained in:
Ian Moody 2019-04-05 11:31:01 +00:00
parent 82dcbf9648
commit 3e10462c9e
2 changed files with 1 additions and 2 deletions

View File

@ -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",

View File

@ -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 = [];