Bug 1504323 - P2 Enable ESLint for netwerk/test/httpserver/ (manual changes) r=Standard8,dragana
authorJunior Hsu <juhsu@mozilla.com>
Fri, 09 Nov 2018 11:28:32 +0000
changeset 505084 c52a3f7f06ad32032bf355cc4a3ac698832112a5
parent 505083 2a943fb3c3ac81b161e08764a64bb91dbd2a6f47
child 505085 7e613710a9e121e1b903866148b3513ef312a47b
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, dragana
bugs1504323
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1504323 - P2 Enable ESLint for netwerk/test/httpserver/ (manual changes) r=Standard8,dragana Differential Revision: https://phabricator.services.mozilla.com/D10986
.eslintignore
netwerk/test/httpserver/httpd.js
netwerk/test/httpserver/test/head_utils.js
netwerk/test/httpserver/test/test_async_response_sending.js
netwerk/test/httpserver/test/test_basic_functionality.js
netwerk/test/httpserver/test/test_default_index_handler.js
netwerk/test/httpserver/test/test_errorhandler_exception.js
netwerk/test/httpserver/test/test_headers.js
netwerk/test/httpserver/test/test_host.js
netwerk/test/httpserver/test/test_processasync.js
netwerk/test/httpserver/test/test_qi.js
netwerk/test/httpserver/test/test_request_line_split_in_two_packets.js
netwerk/test/httpserver/test/test_sjs_object_state.js
tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -25,17 +25,16 @@ gfx/tests/browser/**
 gfx/tests/chrome/**
 gfx/tests/mochitest/**
 image/**
 layout/**
 memory/replace/dmd/test/**
 modules/**
 netwerk/cookie/test/browser/**
 netwerk/test/browser/**
-netwerk/test/httpserver/**
 netwerk/test/mochitests/**
 netwerk/test/unit*/**
 parser/**
 tools/update-packaging/**
 uriloader/exthandler/**
 uriloader/exthandler/tests/mochitest/**
 widget/headless/tests/**
 widget/tests/**
--- a/netwerk/test/httpserver/httpd.js
+++ b/netwerk/test/httpserver/httpd.js
@@ -45,16 +45,18 @@ const PR_UINT32_MAX = Math.pow(2, 32) - 
 /** True if debugging output is enabled, false otherwise. */
 var DEBUG = false; // non-const *only* so tweakable in server tests
 
 /** True if debugging output should be timestamped. */
 var DEBUG_TIMESTAMP = false; // non-const so tweakable in server tests
 
 var gGlobalObject = Cu.getGlobalForObject(this);
 
+ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 /**
  * Asserts that the given condition holds.  If it doesn't, the given message is
  * dumped, a stack trace is printed, and an exception is thrown to attempt to
  * stop execution (which unfortunately must rely upon the exception not being
  * accidentally swallowed by the code that uses it).
  */
 function NS_ASSERT(cond, msg) {
   if (DEBUG && !cond) {
@@ -180,26 +182,16 @@ function dumpStack() {
   var stack = new Error().stack.split(/\n/).slice(2);
   stack.forEach(dumpn);
 }
 
 
 /** The XPCOM thread manager. */
 var gThreadManager = null;
 
-/** The XPCOM prefs service. */
-var gRootPrefBranch = null;
-function getRootPrefBranch() {
-  if (!gRootPrefBranch) {
-    gRootPrefBranch = Cc["@mozilla.org/preferences-service;1"]
-                        .getService(Ci.nsIPrefBranch);
-  }
-  return gRootPrefBranch;
-}
-
 /**
  * JavaScript constructors for commonly-used classes; precreating these is a
  * speedup over doing the same from base principles.  See the docs at
  * http://developer.mozilla.org/en/docs/Components.Constructor for details.
  */
 const ServerSocket = CC("@mozilla.org/network/server-socket;1",
                         "nsIServerSocket",
                         "init");
@@ -482,41 +474,38 @@ nsHttpServer.prototype =
 
     this._host = host;
 
     // The listen queue needs to be long enough to handle
     // network.http.max-persistent-connections-per-server or
     // network.http.max-persistent-connections-per-proxy concurrent
     // connections, plus a safety margin in case some other process is
     // talking to the server as well.
-    var prefs = getRootPrefBranch();
     var maxConnections = 5 + Math.max(
-      prefs.getIntPref("network.http.max-persistent-connections-per-server"),
-      prefs.getIntPref("network.http.max-persistent-connections-per-proxy"));
+      Services.prefs.getIntPref("network.http.max-persistent-connections-per-server"),
+      Services.prefs.getIntPref("network.http.max-persistent-connections-per-proxy"));
 
     try {
       var loopback = true;
       if (this._host != "127.0.0.1" && this._host != "localhost") {
-        var loopback = false;
+        loopback = false;
       }
 
       // When automatically selecting a port, sometimes the chosen port is
       // "blocked" from clients. We don't want to use these ports because
       // tests will intermittently fail. So, we simply keep trying to to
       // get a server socket until a valid port is obtained. We limit
       // ourselves to finite attempts just so we don't loop forever.
-      var ios = Cc["@mozilla.org/network/io-service;1"]
-                  .getService(Ci.nsIIOService);
       var socket;
       for (var i = 100; i; i--) {
         var temp = new ServerSocket(this._port,
                                     loopback, // true = localhost, false = everybody
                                     maxConnections);
 
-        var allowed = ios.allowPort(temp.port, "http");
+        var allowed = Services.io.allowPort(temp.port, "http");
         if (!allowed) {
           dumpn(">>>Warning: obtained ServerSocket listens on a blocked " +
                 "port: " + temp.port);
         }
 
         if (!allowed && this._port == -1) {
           dumpn(">>>Throwing away ServerSocket with bad port.");
           temp.close();
@@ -1596,19 +1585,17 @@ RequestReader.prototype =
     if (fullPath.charAt(0) != "/") {
       // No absolute paths in the request line in HTTP prior to 1.1
       if (!metadata._httpVersion.atLeast(nsHttpVersion.HTTP_1_1)) {
         dumpn("*** Metadata version too low");
         throw HTTP_400;
       }
 
       try {
-        var uri = Cc["@mozilla.org/network/io-service;1"]
-                    .getService(Ci.nsIIOService)
-                    .newURI(fullPath);
+        var uri = Services.io.newURI(fullPath);
         fullPath = uri.pathQueryRef;
         scheme = uri.scheme;
         host = metadata._host = uri.asciiHost;
         port = uri.port;
         if (port === -1) {
           if (scheme === "http") {
             port = 80;
           } else if (scheme === "https") {
@@ -1894,29 +1881,29 @@ function defaultIndexHandler(metadata, r
 
   var directory = metadata.getProperty("directory");
   NS_ASSERT(directory && directory.isDirectory());
 
   var fileList = [];
   var files = directory.directoryEntries;
   while (files.hasMoreElements()) {
     var f = files.nextFile;
-    var name = f.leafName;
+    let name = f.leafName;
     if (!f.isHidden() &&
         (name.charAt(name.length - 1) != HIDDEN_CHAR ||
          name.charAt(name.length - 2) == HIDDEN_CHAR))
       fileList.push(f);
   }
 
   fileList.sort(fileSort);
 
   for (var i = 0; i < fileList.length; i++) {
     var file = fileList[i];
     try {
-      var name = file.leafName;
+      let name = file.leafName;
       if (name.charAt(name.length - 1) == HIDDEN_CHAR)
         name = name.substring(0, name.length - 1);
       var sep = file.isDirectory() ? "/" : "";
 
       // Note: using " to delimit the attribute here because encodeURIComponent
       //       passes through '.
       var item = '<li><a href="' + encodeURIComponent(name) + sep + '">' +
                    htmlEscape(name) + sep +
@@ -2472,21 +2459,20 @@ ServerHandler.prototype =
    * @param count: uint
    *   the number of bytes to write
    */
   _writeFileResponse(metadata, file, response, offset, count) {
     const PR_RDONLY = 0x01;
 
     var type = this._getTypeFromFile(file);
     if (type === SJS_TYPE) {
-      var fis = new FileInputStream(file, PR_RDONLY, PERMS_READONLY,
+      let fis = new FileInputStream(file, PR_RDONLY, PERMS_READONLY,
                                     Ci.nsIFileInputStream.CLOSE_ON_EOF);
 
       try {
-        var sis = new ScriptableInputStream(fis);
         var s = Cu.Sandbox(gGlobalObject);
         s.importFunction(dump, "dump");
         s.importFunction(atob, "atob");
         s.importFunction(btoa, "btoa");
 
         // Define a basic key-value state-preservation API across requests, with
         // keys initially corresponding to the empty string.
         var self = this;
@@ -2518,22 +2504,18 @@ ServerHandler.prototype =
 
         try {
           // Alas, the line number in errors dumped to console when calling the
           // request handler is simply an offset from where we load the SJS file.
           // Work around this in a reasonably non-fragile way by dynamically
           // getting the line number where we evaluate the SJS file.  Don't
           // separate these two lines!
           var line = new Error().lineNumber;
-          let uri = Cc["@mozilla.org/network/io-service;1"]
-                      .getService(Ci.nsIIOService)
-                      .newFileURI(file);
-          let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-                               .getService(Ci.mozIJSSubScriptLoader);
-          scriptLoader.loadSubScript(uri.spec, s);
+          let uri = Services.io.newFileURI(file);
+          Services.scriptloader.loadSubScript(uri.spec, s);
         } catch (e) {
           dumpn("*** syntax error in SJS at " + file.path + ": " + e);
           throw HTTP_500;
         }
 
         try {
           s.handleRequest(metadata, response);
         } catch (e) {
@@ -2553,17 +2535,17 @@ ServerHandler.prototype =
                            toDateString(file.lastModifiedTime),
                            false);
       } catch (e) { /* lastModifiedTime threw, ignore */ }
 
       response.setHeader("Content-Type", type, false);
       maybeAddHeaders(file, metadata, response);
       response.setHeader("Content-Length", "" + count, false);
 
-      var fis = new FileInputStream(file, PR_RDONLY, PERMS_READONLY,
+      let fis = new FileInputStream(file, PR_RDONLY, PERMS_READONLY,
                                     Ci.nsIFileInputStream.CLOSE_ON_EOF);
 
       offset = offset || 0;
       count  = count || file.fileSize;
       NS_ASSERT(offset === 0 || offset < file.fileSize, "bad offset");
       NS_ASSERT(count >= 0, "bad count");
       NS_ASSERT(offset + count <= file.fileSize, "bad total data size");
 
@@ -3721,17 +3703,17 @@ Response.prototype =
           } else {
             response._sendBody();
           }
         },
 
         QueryInterface: ChromeUtils.generateQI(["nsIRequestObserver"]),
       };
 
-    var headerCopier = this._asyncCopier =
+    this._asyncCopier =
       new WriteThroughCopier(responseHeadPipe.inputStream,
                              this._connection.output,
                              copyObserver, null);
 
     responseHeadPipe.outputStream.close();
 
     // Forbid setting any more headers or modifying the request line.
     this._headers = null;
@@ -3938,25 +3920,26 @@ WriteThroughCopier.prototype =
 
       dumpn("*** " + bytesConsumed + " bytes read");
 
       // Handle the zero-data edge case in the same place as all other edge
       // cases are handled.
       if (bytesWanted === 0)
         throw Components.Exception("", Cr.NS_BASE_STREAM_CLOSED);
     } catch (e) {
+      let rv;
       if (streamClosed(e)) {
         dumpn("*** input stream closed");
-        e = bytesWanted === 0 ? Cr.NS_OK : Cr.NS_ERROR_UNEXPECTED;
+        rv = bytesWanted === 0 ? Cr.NS_OK : Cr.NS_ERROR_UNEXPECTED;
       } else {
         dumpn("!!! unexpected error reading from input, canceling: " + e);
-        e = Cr.NS_ERROR_UNEXPECTED;
+        rv = Cr.NS_ERROR_UNEXPECTED;
       }
 
-      this._doneReadingSource(e);
+      this._doneReadingSource(rv);
       return;
     }
 
     var pendingData = this._pendingData;
 
     NS_ASSERT(bytesConsumed > 0);
     NS_ASSERT(pendingData.length > 0, "no pending data somehow?");
     NS_ASSERT(pendingData[pendingData.length - 1].length > 0,
@@ -4519,19 +4502,19 @@ nsHttpHeaders.prototype =
       this._headers[name] = [value];
     }
   },
 
   setHeaderNoCheck(fieldName, fieldValue) {
     var name = headerUtils.normalizeFieldName(fieldName);
     var value = headerUtils.normalizeFieldValue(fieldValue);
     if (name in this._headers) {
-      this._headers[name].push(fieldValue);
+      this._headers[name].push(value);
     } else {
-      this._headers[name] = [fieldValue];
+      this._headers[name] = [value];
     }
   },
 
   /**
    * Returns the value for the header specified by this.
    *
    * @throws NS_ERROR_INVALID_ARG
    *   if fieldName does not constitute a valid header field name
--- a/netwerk/test/httpserver/test/head_utils.js
+++ b/netwerk/test/httpserver/test/head_utils.js
@@ -1,20 +1,22 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/* global __LOCATION__ */
+/* import-globals-from ../httpd.js */
 
 var _HTTPD_JS_PATH = __LOCATION__.parent;
 _HTTPD_JS_PATH.append("httpd.js");
 load(_HTTPD_JS_PATH.path);
 
 // if these tests fail, we'll want the debug output
-DEBUG = true;
+var linDEBUG = true;
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 
 /**
  * Constructs a new nsHttpServer instance.  This function is intended to
  * encapsulate construction of a server so that at some point in the future it
  * is possible to run these tests (with at most slight modifications) against
@@ -70,17 +72,17 @@ function fileContents(file) {
  *
  * @param data : string
  *   a string consisting of lines of data separated by CRLFs
  * @returns Iterator
  *   an Iterator which returns each line from data in turn; note that this
  *   includes a final empty line if data ended with a CRLF
  */
 function* LineIterator(data) {
-  var start = 0, index = 0;
+  var index = 0;
   do {
     index = data.indexOf("\r\n");
     if (index >= 0)
       yield data.substring(0, index);
     else
       yield data;
 
     data = data.substring(index + 2);
@@ -248,17 +250,17 @@ function runHttpTests(testArray, done) {
 
     var test = testArray[testIndex];
     var ch = makeChannel(test.path);
     try {
       test.initChannel(ch);
     } catch (e) {
       try {
         do_report_unexpected_exception(e, "testArray[" + testIndex + "].initChannel(ch)");
-      } catch (e) {
+      } catch (x) {
         /* swallow and let tests continue */
       }
     }
 
     listener._channel = ch;
     ch.asyncOpen2(listener);
   }
 
@@ -349,16 +351,18 @@ function runHttpTests(testArray, done) {
  */
 function RawTest(host, port, data, responseCheck) {
   if (0 > port || 65535 < port || port % 1 !== 0)
     throw "bad port";
   if (!(data instanceof Array))
     data = [data];
   if (data.length <= 0)
     throw "bad data length";
+
+  // eslint-disable-next-line no-control-regex
   if (!data.every(function(v) { return /^[\x00-\xff]*$/.test(v); }))
     throw "bad data contained non-byte-valued character";
 
   this.host = host;
   this.port = port;
   this.data = data;
   this.responseCheck = responseCheck;
 }
--- a/netwerk/test/httpserver/test/test_async_response_sending.js
+++ b/netwerk/test/httpserver/test/test_async_response_sending.js
@@ -1,14 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+
 /*
  * Ensures that data a request handler writes out in response is sent only as
  * quickly as the client can receive it, without racing ahead and being forced
  * to block while writing that data.
  *
  * NB: These tests are extremely tied to the current implementation, in terms of
  * when and how stream-ready notifications occur, the amount of data which will
  * be read or written at each notification, and so on.  If the implementation
@@ -318,20 +319,20 @@ function sinkAndSourceClosedWithPendingD
 
 
 /** ***********
  * UTILITIES *
  *************/
 
 /** Returns the sum of the elements in arr. */
 function sum(arr) {
-  var sum = 0;
+  var s = 0;
   for (var i = 0, sz = arr.length; i < sz; i++)
-    sum += arr[i];
-  return sum;
+    s += arr[i];
+  return s;
 }
 
 /**
  * Returns a constructor for an input or output stream callback that will wrap
  * the one provided to it as an argument.
  *
  * @param wrapperCallback : (nsIInputStreamCallback | nsIOutputStreamCallback) : void
  *   the original callback object (not a function!) being wrapped
@@ -1442,17 +1443,16 @@ CopyTest.prototype =
     dumpn("*** CopyTest(" + this.name + ")._stageNextTask()");
 
     if (this._currentTask === this._tasks.length) {
       dumpn("*** CopyTest(" + this.name + ") tasks complete!");
       return;
     }
 
     var task = this._tasks[this._currentTask++];
-    var self = this;
     var event =
       {
         run: function run() {
           try {
             task();
           } catch (e) {
             do_throw("exception thrown running task: " + e);
           }
--- a/netwerk/test/httpserver/test/test_basic_functionality.js
+++ b/netwerk/test/httpserver/test/test_basic_functionality.js
@@ -3,16 +3,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Basic functionality test, from the client programmer's POV.
  */
 
+ChromeUtils.import("resource://gre/modules/Services.jsm");
+
 XPCOMUtils.defineLazyGetter(this, "port", function() {
   return srv.identity.primaryPort;
 });
 
 XPCOMUtils.defineLazyGetter(this, "tests", function() {
   return [
     new Test("http://localhost:" + port + "/objHandler",
           null, start_objHandler, null),
@@ -27,19 +29,17 @@ XPCOMUtils.defineLazyGetter(this, "tests
 
 var srv;
 
 function run_test() {
   srv = createServer();
 
   // base path
   // XXX should actually test this works with a file by comparing streams!
-  var dirServ = Cc["@mozilla.org/file/directory_service;1"]
-                  .getService(Ci.nsIProperties);
-  var path = dirServ.get("CurWorkD", Ci.nsIFile);
+  var path = Services.dirsvc.get("CurWorkD", Ci.nsIFile);
   srv.registerDirectory("/", path);
 
   // register a few test paths
   srv.registerPathHandler("/objHandler", objHandler);
   srv.registerPathHandler("/functionHandler", functionHandler);
   srv.registerPathHandler("/lotsOfHeaders", lotsOfHeadersHandler);
 
   srv.start(-1);
--- a/netwerk/test/httpserver/test/test_default_index_handler.js
+++ b/netwerk/test/httpserver/test/test_default_index_handler.js
@@ -3,17 +3,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // checks for correct output with the default index handler, mostly to do
 // escaping checks -- highly dependent on the default index handler output
 // format
 
-var srv, dir, dirEntries;
+ChromeUtils.import("resource://gre/modules/Services.jsm");
+
+var srv, dir, gDirEntries;
 
 XPCOMUtils.defineLazyGetter(this, "BASE_URL", function() {
   return "http://localhost:" + srv.identity.primaryPort + "/";
 });
 
 Cu.importGlobalProperties(["DOMParser"]);
 
 function run_test() {
@@ -32,19 +34,17 @@ function run_test() {
     destroyTestDirectory();
     srv.stop(function() { do_test_finished(); });
   }
 
   runHttpTests(tests, done);
 }
 
 function createTestDirectory() {
-  dir = Cc["@mozilla.org/file/directory_service;1"]
-          .getService(Ci.nsIProperties)
-          .get("TmpD", Ci.nsIFile);
+  dir = Services.dirsvc.get("TmpD", Ci.nsIFile);
   dir.append("index_handler_test_" + Math.random());
   dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o744);
 
   // populate with test directories, files, etc.
   // Files must be in expected order of display on the index page!
 
   var files = [];
 
@@ -57,29 +57,29 @@ function createTestDirectory() {
   makeFile("za'z", false, dir, files);
   makeFile("zb&z", false, dir, files);
   makeFile("zc<q", false, dir, files);
   makeFile('zd"q', false, dir, files);
   makeFile("ze%g", false, dir, files);
   makeFile("zf%200h", false, dir, files);
   makeFile("zg>m", false, dir, files);
 
-  dirEntries = [files];
+  gDirEntries = [files];
 
   var subdir = dir.clone();
   subdir.append("foo");
 
   files = [];
 
   makeFile("aa_dir", true, subdir, files);
   makeFile("b_dir", true, subdir, files);
   makeFile("AA_file.txt", false, subdir, files);
   makeFile("test.txt", false, subdir, files);
 
-  dirEntries.push(files);
+  gDirEntries.push(files);
 }
 
 function destroyTestDirectory() {
   dir.remove(true);
 }
 
 
 /** ***********
@@ -111,34 +111,31 @@ function hiddenDataCheck(bytes, uri, pat
 
   Assert.equal(header[0].textContent, path);
 
   // files
   var lst = body.getElementsByTagName("ol");
   Assert.equal(lst.length, 1);
   var items = lst[0].getElementsByTagName("li");
 
-  var ios = Cc["@mozilla.org/network/io-service;1"]
-              .getService(Ci.nsIIOService);
-
-  var top = ios.newURI(uri);
+  var top = Services.io.newURI(uri);
 
   // N.B. No ERROR_IF_SEE_THIS.txt^ file!
   var dirEntries = [{name: "file.txt", isDirectory: false},
                     {name: "SHOULD_SEE_THIS.txt^", isDirectory: false}];
 
   for (var i = 0; i < items.length; i++) {
     var link = items[i].childNodes[0];
     var f = dirEntries[i];
 
     var sep = f.isDirectory ? "/" : "";
 
     Assert.equal(link.textContent, f.name + sep);
 
-    uri = ios.newURI(link.getAttribute("href"), null, top);
+    uri = Services.io.newURI(link.getAttribute("href"), null, top);
     Assert.equal(decodeURIComponent(uri.pathQueryRef), path + f.name + sep);
   }
 }
 
 /**
  * Verifies data in bytes (an array of bytes) represents an index page for the
  * given URI and path, which should be a page listing the given directory
  * entries, in order.
@@ -179,30 +176,25 @@ function dataCheck(bytes, uri, path, dir
 
   Assert.equal(header[0].textContent, path);
 
   // files
   var lst = body.getElementsByTagName("ol");
   Assert.equal(lst.length, 1);
   var items = lst[0].getElementsByTagName("li");
 
-  var ios = Cc["@mozilla.org/network/io-service;1"]
-              .getService(Ci.nsIIOService);
-
-  var dirURI = ios.newURI(uri);
-
   for (var i = 0; i < items.length; i++) {
     var link = items[i].childNodes[0];
     var f = dirEntries[i];
 
     var sep = f.isDirectory ? "/" : "";
 
     Assert.equal(link.textContent, f.name + sep);
 
-    uri = ios.newURI(link.getAttribute("href"), null, top);
+    uri = Services.io.newURI(link.getAttribute("href"), null, top);
     Assert.equal(decodeURIComponent(uri.pathQueryRef), path + f.name + sep);
   }
 }
 
 /**
  * Create a file/directory with the given name underneath parentDir, and
  * append an object with name/isDirectory properties to lst corresponding
  * to it if the file/directory could be created.
@@ -230,20 +222,20 @@ XPCOMUtils.defineLazyGetter(this, "tests
   ];
 });
 
 // check top-level directory listing
 function start(ch) {
   Assert.equal(ch.getResponseHeader("Content-Type"), "text/html;charset=utf-8");
 }
 function stopRootDirectory(ch, cx, status, data) {
-  dataCheck(data, BASE_URL, "/", dirEntries[0]);
+  dataCheck(data, BASE_URL, "/", gDirEntries[0]);
 }
 
 // check non-top-level, too
 function stopFooDirectory(ch, cx, status, data) {
-  dataCheck(data, BASE_URL + "foo/", "/foo/", dirEntries[1]);
+  dataCheck(data, BASE_URL + "foo/", "/foo/", gDirEntries[1]);
 }
 
 // trailing-caret leaf with hidden files
 function stopTrailingCaretDirectory(ch, cx, status, data) {
   hiddenDataCheck(data, BASE_URL + "bar/folder^/", "/bar/folder^/");
 }
--- a/netwerk/test/httpserver/test/test_errorhandler_exception.js
+++ b/netwerk/test/httpserver/test/test_errorhandler_exception.js
@@ -67,10 +67,10 @@ function register400Handler(ch) {
 }
 
 
 // PATH HANDLERS
 
 // /throws/exception (and also a 404 and 400 error handler)
 function throwsException(metadata, response) {
   throw "this shouldn't cause an exit...";
-  do_throw("Not reached!");
+  do_throw("Not reached!"); // eslint-disable-line no-unreachable
 }
--- a/netwerk/test/httpserver/test/test_headers.js
+++ b/netwerk/test/httpserver/test/test_headers.js
@@ -95,17 +95,17 @@ function testHeaderValidity() {
 function testGetHeader() {
   var headers = new nsHttpHeaders();
 
   headers.setHeader("Content-Type", "text/html", false);
   var c = headers.getHeader("content-type");
   Assert.equal(c, "text/html");
 
   headers.setHeader("test", "FOO", false);
-  var c = headers.getHeader("test");
+  c = headers.getHeader("test");
   Assert.equal(c, "FOO");
 
   try {
     headers.getHeader(":");
     throw "Failed to throw for invalid header";
   } catch (e) {
     if (e.result !== Cr.NS_ERROR_INVALID_ARG)
       do_throw("headers.getHeader(':') must throw invalid arg");
@@ -135,19 +135,19 @@ function testHeaderEnumerator() {
 
   var en = headers.enumerator;
   while (en.hasMoreElements()) {
     var it = en.getNext().QueryInterface(Ci.nsISupportsString).data;
     Assert.ok(it.toLowerCase() in heads);
     delete heads[it.toLowerCase()];
   }
 
-  for (var i in heads)
+  if (Object.keys(heads).length != 0) {
     do_throw("still have properties in heads!?!?");
-
+  }
 }
 
 function testHasHeader() {
   var headers = new nsHttpHeaders();
 
   headers.setHeader("foo", "bar", false);
   Assert.ok(headers.hasHeader("foo"));
   Assert.ok(headers.hasHeader("fOo"));
--- a/netwerk/test/httpserver/test/test_host.js
+++ b/netwerk/test/httpserver/test/test_host.js
@@ -204,50 +204,50 @@ function run_test_3() {
 /** *******************
  * UTILITY FUNCTIONS *
  *********************/
 
 /**
  * Verifies that all .primary* getters on a server identity correctly throw
  * NS_ERROR_NOT_INITIALIZED.
  *
- * @param id : nsIHttpServerIdentity
+ * @param aId : nsIHttpServerIdentity
  *   the server identity to test
  */
-function checkPrimariesThrow(id) {
+function checkPrimariesThrow(aId) {
   var threw = false;
   try {
-    id.primaryScheme;
+    aId.primaryScheme;
   } catch (e) {
     threw = e.result === Cr.NS_ERROR_NOT_INITIALIZED;
   }
   Assert.ok(threw);
 
   threw = false;
   try {
-    id.primaryHost;
+    aId.primaryHost;
   } catch (e) {
     threw = e.result === Cr.NS_ERROR_NOT_INITIALIZED;
   }
   Assert.ok(threw);
 
   threw = false;
   try {
-    id.primaryPort;
+    aId.primaryPort;
   } catch (e) {
     threw = e.result === Cr.NS_ERROR_NOT_INITIALIZED;
   }
   Assert.ok(threw);
 }
 
 /**
  * Utility function to check for a 400 response.
  */
-function check400(data) {
-  var iter = LineIterator(data);
+function check400(aData) {
+  var iter = LineIterator(aData);
 
   // Status-Line
   var { value: firstLine } = iter.next();
   Assert.equal(firstLine.substring(0, HTTP_400_LEADER_LENGTH), HTTP_400_LEADER);
 }
 
 
 /** *************
@@ -263,18 +263,18 @@ var tests = [];
 // HTTP/1.0 request, to ensure we see our default scheme/host/port
 
 function http10Request(request, response) {
   writeDetails(request, response);
   response.setStatusLine("1.0", 200, "TEST PASSED");
 }
 data = "GET /http/1.0-request HTTP/1.0\r\n" +
        "\r\n";
-function check10(data) {
-  var iter = LineIterator(data);
+function check10(aData) {
+  var iter = LineIterator(aData);
 
   // Status-Line
   Assert.equal(iter.next().value, "HTTP/1.0 200 TEST PASSED");
 
   skipHeaders(iter);
 
   // Okay, next line must be the data we expected to be written
   var body =
@@ -285,93 +285,93 @@ function check10(data) {
      "Version: 1.0",
      "Scheme:  http",
      "Host:    localhost",
      "Port:    4444",
     ];
 
   expectLines(iter, body);
 }
-test = new RawTest("localhost", PORT, data, check10),
+test = new RawTest("localhost", PORT, data, check10);
 tests.push(test);
 
 
 // HTTP/1.1 request, no Host header, expect a 400 response
 
 data = "GET /http/1.1-request HTTP/1.1\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, wrong host, expect a 400 response
 
 data = "GET /http/1.1-request HTTP/1.1\r\n" +
        "Host: not-localhost\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, wrong host/right port, expect a 400 response
 
 data = "GET /http/1.1-request HTTP/1.1\r\n" +
        "Host: not-localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, Host header has host but no port, expect a 400 response
 
 data = "GET /http/1.1-request HTTP/1.1\r\n" +
        "Host: 127.0.0.1\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, Request-URI has wrong port, expect a 400 response
 
 data = "GET http://127.0.0.1/http/1.1-request HTTP/1.1\r\n" +
        "Host: 127.0.0.1\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, Request-URI has wrong port, expect a 400 response
 
 data = "GET http://localhost:31337/http/1.1-request HTTP/1.1\r\n" +
        "Host: localhost:31337\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, Request-URI has wrong scheme, expect a 400 response
 
 data = "GET https://localhost:4444/http/1.1-request HTTP/1.1\r\n" +
        "Host: localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, correct Host header, expect handler's response
 
 function http11goodHost(request, response) {
   writeDetails(request, response);
   response.setStatusLine("1.1", 200, "TEST PASSED");
 }
 data = "GET /http/1.1-good-host HTTP/1.1\r\n" +
        "Host: localhost:4444\r\n" +
        "\r\n";
-function check11goodHost(data) {
-  var iter = LineIterator(data);
+function check11goodHost(aData) {
+  var iter = LineIterator(aData);
 
   // Status-Line
   Assert.equal(iter.next().value, "HTTP/1.1 200 TEST PASSED");
 
   skipHeaders(iter);
 
   // Okay, next line must be the data we expected to be written
   var body =
@@ -382,31 +382,31 @@ function check11goodHost(data) {
      "Version: 1.1",
      "Scheme:  http",
      "Host:    localhost",
      "Port:    4444",
     ];
 
   expectLines(iter, body);
 }
-test = new RawTest("localhost", PORT, data, check11goodHost),
+test = new RawTest("localhost", PORT, data, check11goodHost);
 tests.push(test);
 
 
 // HTTP/1.1 request, Host header is secondary identity
 
 function http11ipHost(request, response) {
   writeDetails(request, response);
   response.setStatusLine("1.1", 200, "TEST PASSED");
 }
 data = "GET /http/1.1-ip-host HTTP/1.1\r\n" +
        "Host: 127.0.0.1:4444\r\n" +
        "\r\n";
-function check11ipHost(data) {
-  var iter = LineIterator(data);
+function check11ipHost(aData) {
+  var iter = LineIterator(aData);
 
   // Status-Line
   Assert.equal(iter.next().value, "HTTP/1.1 200 TEST PASSED");
 
   skipHeaders(iter);
 
   // Okay, next line must be the data we expected to be written
   var body =
@@ -417,79 +417,79 @@ function check11ipHost(data) {
      "Version: 1.1",
      "Scheme:  http",
      "Host:    127.0.0.1",
      "Port:    4444",
     ];
 
   expectLines(iter, body);
 }
-test = new RawTest("localhost", PORT, data, check11ipHost),
+test = new RawTest("localhost", PORT, data, check11ipHost);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute path, accurate Host header
 
 // reusing previous request handler so not defining a new one
 
 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
        "Host: localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHost),
+test = new RawTest("localhost", PORT, data, check11goodHost);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute path, inaccurate Host header
 
 // reusing previous request handler so not defining a new one
 
 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
        "Host: localhost:1234\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHost),
+test = new RawTest("localhost", PORT, data, check11goodHost);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute path, different inaccurate Host header
 
 // reusing previous request handler so not defining a new one
 
 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
        "Host: not-localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHost),
+test = new RawTest("localhost", PORT, data, check11goodHost);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute path, yet another inaccurate Host header
 
 // reusing previous request handler so not defining a new one
 
 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
        "Host: yippity-skippity\r\n" +
        "\r\n";
-function checkInaccurate(data) {
-  check11goodHost(data);
+function checkInaccurate(aData) {
+  check11goodHost(aData);
 
   // dynamism setup
   srv.identity.setPrimary("http", "127.0.0.1", 4444);
 }
-test = new RawTest("localhost", PORT, data, checkInaccurate),
+test = new RawTest("localhost", PORT, data, checkInaccurate);
 tests.push(test);
 
 
 // HTTP/1.0 request, absolute path, different inaccurate Host header
 
 // reusing previous request handler so not defining a new one
 
 data = "GET /http/1.0-request HTTP/1.0\r\n" +
        "Host: not-localhost:4444\r\n" +
        "\r\n";
-function check10ip(data) {
-  var iter = LineIterator(data);
+function check10ip(aData) {
+  var iter = LineIterator(aData);
 
   // Status-Line
   Assert.equal(iter.next().value, "HTTP/1.0 200 TEST PASSED");
 
   skipHeaders(iter);
 
   // Okay, next line must be the data we expected to be written
   var body =
@@ -500,31 +500,31 @@ function check10ip(data) {
      "Version: 1.0",
      "Scheme:  http",
      "Host:    127.0.0.1",
      "Port:    4444",
     ];
 
   expectLines(iter, body);
 }
-test = new RawTest("localhost", PORT, data, check10ip),
+test = new RawTest("localhost", PORT, data, check10ip);
 tests.push(test);
 
 
 // HTTP/1.1 request, Host header with implied port
 
 function http11goodHostWackyPort(request, response) {
   writeDetails(request, response);
   response.setStatusLine("1.1", 200, "TEST PASSED");
 }
 data = "GET /http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
        "Host: localhost\r\n" +
        "\r\n";
-function check11goodHostWackyPort(data) {
-  var iter = LineIterator(data);
+function check11goodHostWackyPort(aData) {
+  var iter = LineIterator(aData);
 
   // Status-Line
   Assert.equal(iter.next().value, "HTTP/1.1 200 TEST PASSED");
 
   skipHeaders(iter);
 
   // Okay, next line must be the data we expected to be written
   var body =
@@ -535,100 +535,100 @@ function check11goodHostWackyPort(data) 
      "Version: 1.1",
      "Scheme:  http",
      "Host:    localhost",
      "Port:    80",
     ];
 
   expectLines(iter, body);
 }
-test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
+test = new RawTest("localhost", PORT, data, check11goodHostWackyPort);
 tests.push(test);
 
 
 // HTTP/1.1 request, Host header with wacky implied port
 
 data = "GET /http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
        "Host: localhost:\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
+test = new RawTest("localhost", PORT, data, check11goodHostWackyPort);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute URI with implied port
 
 data = "GET http://localhost/http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
        "Host: localhost\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
+test = new RawTest("localhost", PORT, data, check11goodHostWackyPort);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute URI with wacky implied port
 
 data = "GET http://localhost:/http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
        "Host: localhost\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
+test = new RawTest("localhost", PORT, data, check11goodHostWackyPort);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute URI with explicit implied port, ignored Host
 
 data = "GET http://localhost:80/http/1.1-good-host-wacky-port HTTP/1.1\r\n" +
        "Host: who-cares\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHostWackyPort),
+test = new RawTest("localhost", PORT, data, check11goodHostWackyPort);
 tests.push(test);
 
 
 // HTTP/1.1 request, a malformed Request-URI
 
 data = "GET is-this-the-real-life-is-this-just-fantasy HTTP/1.1\r\n" +
        "Host: localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, a malformed Host header
 
 data = "GET /http/1.1-request HTTP/1.1\r\n" +
        "Host: la la la\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, a malformed Host header but absolute URI, 5.2 sez fine
 
 data = "GET http://localhost:4444/http/1.1-good-host HTTP/1.1\r\n" +
        "Host: la la la\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check11goodHost),
+test = new RawTest("localhost", PORT, data, check11goodHost);
 tests.push(test);
 
 
 // HTTP/1.0 request, absolute URI, but those aren't valid in HTTP/1.0
 
 data = "GET http://localhost:4444/http/1.1-request HTTP/1.0\r\n" +
        "Host: localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute URI with unrecognized host
 
 data = "GET http://not-localhost:4444/http/1.1-request HTTP/1.1\r\n" +
        "Host: not-localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
 
 
 // HTTP/1.1 request, absolute URI with unrecognized host (but not in Host)
 
 data = "GET http://not-localhost:4444/http/1.1-request HTTP/1.1\r\n" +
        "Host: localhost:4444\r\n" +
        "\r\n";
-test = new RawTest("localhost", PORT, data, check400),
+test = new RawTest("localhost", PORT, data, check400);
 tests.push(test);
--- a/netwerk/test/httpserver/test/test_processasync.js
+++ b/netwerk/test/httpserver/test/test_processasync.js
@@ -1,14 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+
 /*
  * Tests for correct behavior of asynchronous responses.
  */
 
 XPCOMUtils.defineLazyGetter(this, "PREPATH", function() {
   return "http://localhost:" + srv.identity.primaryPort;
 });
 
@@ -117,35 +118,35 @@ const startToFinishedDelay = 750;
 
 function handleAsync2(request, response) {
   response.processAsync();
 
   response.setStatusLine(request.httpVersion, 200, "Status line");
   response.setHeader("X-Custom-Header", "value", false);
 
   callLater(startToHeaderDelay, function() {
-    var body = "BO";
-    response.bodyOutputStream.write(body, body.length);
+    var preBody = "BO";
+    response.bodyOutputStream.write(preBody, preBody.length);
 
     try {
       response.setStatusLine(request.httpVersion, 500, "after body write");
       do_throw("setStatusLine succeeded");
     } catch (e) {
       isException(e, Cr.NS_ERROR_NOT_AVAILABLE);
     }
 
     try {
       response.setHeader("X-Custom-Header", "new 1", false);
     } catch (e) {
       isException(e, Cr.NS_ERROR_NOT_AVAILABLE);
     }
 
     callLater(startToFinishedDelay - startToHeaderDelay, function() {
-      var body = "DY";
-      response.bodyOutputStream.write(body, body.length);
+      var postBody = "DY";
+      response.bodyOutputStream.write(postBody, postBody.length);
 
       response.finish();
       response.finish(); // idempotency
 
       try {
         response.setStatusLine(request.httpVersion, 500, "after finish");
       } catch (e) {
         isException(e, Cr.NS_ERROR_NOT_AVAILABLE);
--- a/netwerk/test/httpserver/test/test_qi.js
+++ b/netwerk/test/httpserver/test/test_qi.js
@@ -1,13 +1,14 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/* eslint-disable no-control-regex */
 
 /*
  * Verify the presence of explicit QueryInterface methods on XPCOM objects
  * exposed by httpd.js, rather than allowing QueryInterface to be implicitly
  * created by XPConnect.
  */
 
 XPCOMUtils.defineLazyGetter(this, "tests", function() {
@@ -19,19 +20,18 @@ XPCOMUtils.defineLazyGetter(this, "tests
   ];
 });
 
 var srv;
 
 function run_test() {
   srv = createServer();
 
-  var qi;
   try {
-    qi = srv.identity.QueryInterface(Ci.nsIHttpServerIdentity);
+    srv.identity.QueryInterface(Ci.nsIHttpServerIdentity);
   } catch (e) {
     var exstr = ("" + e).split(/[\x09\x20-\x7f\x81-\xff]+/)[0];
     do_throw("server identity didn't QI: " + exstr);
     return;
   }
 
   srv.registerPathHandler("/test", testHandler);
   srv.registerDirectory("/", do_get_file("data/"));
--- a/netwerk/test/httpserver/test/test_request_line_split_in_two_packets.js
+++ b/netwerk/test/httpserver/test/test_request_line_split_in_two_packets.js
@@ -23,17 +23,17 @@ function run_test() {
   runRawTests(tests, testComplete(srv));
 }
 
 
 /** *************
  * BEGIN TESTS *
  ***************/
 
-var test, data, str;
+var test, gData, str;
 var tests = [];
 
 
 function veryLongRequestLine(request, response) {
   writeDetails(request, response);
   response.setStatusLine(request.httpVersion, 200, "TEST PASSED");
 }
 
@@ -46,19 +46,19 @@ reallyLong = reallyLong + reallyLong + r
 reallyLong = reallyLong + reallyLong + reallyLong + reallyLong; // 32768
 reallyLong = reallyLong + reallyLong + reallyLong + reallyLong; // 131072
 reallyLong = reallyLong + reallyLong + reallyLong + reallyLong; // 524288
 if (reallyLong.length !== 524288)
   throw new TypeError("generated length not as long as expected");
 str = "GET /very-long-request-line?" + reallyLong + " HTTP/1.1\r\n" +
       "Host: localhost:" + PORT + "\r\n" +
       "\r\n";
-data = [];
-for (var i = 0; i < str.length; i += 16384)
-  data.push(str.substr(i, 16384));
+gData = [];
+for (let i = 0; i < str.length; i += 16384)
+  gData.push(str.substr(i, 16384));
 
 function checkVeryLongRequestLine(data) {
   var iter = LineIterator(data);
 
   print("data length: " + data.length);
   print("iter object: " + iter);
 
   // Status-Line
@@ -75,35 +75,35 @@ function checkVeryLongRequestLine(data) 
      "Version: 1.1",
      "Scheme:  http",
      "Host:    localhost",
      "Port:    " + PORT,
     ];
 
   expectLines(iter, body);
 }
-test = new RawTest("localhost", PORT, data, checkVeryLongRequestLine),
+test = new RawTest("localhost", PORT, gData, checkVeryLongRequestLine);
 tests.push(test);
 
 
 function lotsOfLeadingBlankLines(request, response) {
   writeDetails(request, response);
   response.setStatusLine(request.httpVersion, 200, "TEST PASSED");
 }
 
 var blankLines = "\r\n";
-for (var i = 0; i < 14; i++)
+for (let i = 0; i < 14; i++)
   blankLines += blankLines;
 str = blankLines +
       "GET /lots-of-leading-blank-lines HTTP/1.1\r\n" +
       "Host: localhost:" + PORT + "\r\n" +
       "\r\n";
-data = [];
-for (var i = 0; i < str.length; i += 100)
-  data.push(str.substr(i, 100));
+gData = [];
+for (let i = 0; i < str.length; i += 100)
+  gData.push(str.substr(i, 100));
 
 function checkLotsOfLeadingBlankLines(data) {
   var iter = LineIterator(data);
 
   // Status-Line
   print("data length: " + data.length);
   print("iter object: " + iter);
 
@@ -121,10 +121,10 @@ function checkLotsOfLeadingBlankLines(da
      "Scheme:  http",
      "Host:    localhost",
      "Port:    " + PORT,
     ];
 
   expectLines(iter, body);
 }
 
-test = new RawTest("localhost", PORT, data, checkLotsOfLeadingBlankLines),
+test = new RawTest("localhost", PORT, gData, checkLotsOfLeadingBlankLines);
 tests.push(test);
--- a/netwerk/test/httpserver/test/test_sjs_object_state.js
+++ b/netwerk/test/httpserver/test/test_sjs_object_state.js
@@ -168,16 +168,17 @@ function triggerStop(ch, cx, status, dat
 }
 
 var finished = false;
 function checkForFinish() {
   if (finished) {
     try {
       do_throw("uh-oh, how are we being finished twice?!?!");
     } finally {
+      // eslint-disable-next-line no-undef
       quit(1);
     }
   }
 
   if (triggerStopped && initialStopped) {
     finished = true;
     try {
       Assert.equal(srv.getObjectState("object-state-test"), null);
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/xpcshell-test.js
@@ -18,16 +18,17 @@ module.exports = {
     "do_get_cwd": false,
     "do_get_file": false,
     "do_get_idle": false,
     "do_get_profile": false,
     "do_get_tempdir": false,
     "do_load_child_test_harness": false,
     "do_load_manifest": false,
     "do_load_module": false,
+    "do_note_exception": false,
     "do_parse_document": false,
     "do_report_unexpected_exception": false,
     "do_send_remote_message": false,
     "do_test_finished": false,
     "do_test_pending": false,
     "do_throw": false,
     "do_timeout": false,
     "equal": false,