diff --git a/.eslintrc.js b/.eslintrc.js index f1ab25172b85..091dabb3c6cc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -87,9 +87,6 @@ module.exports = { }, { // TODO: Bug 1246594. Empty this list once the rule has landed for all dirs "files": [ - "netwerk/protocol/http/WellKnownOpportunisticUtils.jsm", - "netwerk/test/httpserver/httpd.js", - "netwerk/test/httpserver/test/**", "parser/htmlparser/tests/mochitest/parser_datreader.js", "testing/marionette/event.js", "testing/mochitest/**", diff --git a/netwerk/test/httpserver/test/head_utils.js b/netwerk/test/httpserver/test/head_utils.js index 4b207ac045f0..8f8db44dc04e 100644 --- a/netwerk/test/httpserver/test/head_utils.js +++ b/netwerk/test/httpserver/test/head_utils.js @@ -98,25 +98,25 @@ function* LineIterator(data) { * an Iterator which returns lines of text * @param expectedLines : [string] * an array of the expected lines of text - * @throws string - * an error message if iter doesn't agree with expectedLines + * @throws an error message if iter doesn't agree with expectedLines */ function expectLines(iter, expectedLines) { var index = 0; for (var line of iter) { if (expectedLines.length == index) - throw "Error: got more than " + expectedLines.length + " expected lines!"; + throw new Error(`Error: got more than ${expectedLines.length} expected lines!`); var expected = expectedLines[index++]; if (expected !== line) - throw "Error on line " + index + "!\n" + - " actual: '" + line + "',\n" + - " expect: '" + expected + "'"; + throw new Error(`Error on line ${index}! + actual: '${line}', + expect: '${expected}'`); } if (expectedLines.length !== index) { - throw "Expected more lines! Got " + index + - ", expected " + expectedLines.length; + throw new Error( + `Expected more lines! Got ${index}, expected ${expectedLines.length}` + ); } } diff --git a/netwerk/test/httpserver/test/test_headers.js b/netwerk/test/httpserver/test/test_headers.js index 45bfa57ce1b4..e9f350754147 100644 --- a/netwerk/test/httpserver/test/test_headers.js +++ b/netwerk/test/httpserver/test/test_headers.js @@ -40,8 +40,7 @@ function assertValidHeader(fieldName, fieldValue, headers) { function assertInvalidHeader(fieldName, fieldValue, headers) { try { headers.setHeader(fieldName, fieldValue, false); - throw "Setting (" + fieldName + ", " + - fieldValue + ") as header succeeded!"; + throw new Error(`Setting (${fieldName}, ${fieldValue}) as header succeeded!`); } catch (e) { if (e.result !== Cr.NS_ERROR_INVALID_ARG) do_throw("Unexpected exception thrown: " + e);