Bug 1508819 - Enable ESLint for dom/bindings (manual changes). r=nika
authorRuihui Yan <ruihuiyan@icloud.com>
Fri, 29 Mar 2019 16:47:06 +0000
changeset 466841 f65788b4d22903b7dd502021fe781715626e2599
parent 466840 47b7423393a801c96bd315f98f2bed6ea44865e9
child 466842 e763663e3a43d8d9cff73cc952586f03dfb14885
push id112603
push usernerli@mozilla.com
push dateSat, 30 Mar 2019 09:35:57 +0000
treeherdermozilla-inbound@7c3183c56eb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1508819
milestone68.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 1508819 - Enable ESLint for dom/bindings (manual changes). r=nika Depends on D13891 Differential Revision: https://phabricator.services.mozilla.com/D13892
.eslintignore
dom/bindings/test/TestInterfaceJS.js
dom/bindings/test/file_bug775543.html
dom/bindings/test/test_ByteString.html
dom/bindings/test/test_Object.prototype_props.html
dom/bindings/test/test_async_stacks.html
dom/bindings/test/test_barewordGetsWindow.html
dom/bindings/test/test_bug1036214.html
dom/bindings/test/test_bug1123516_maplikesetlike.html
dom/bindings/test/test_bug1123875.html
dom/bindings/test/test_bug773326.html
dom/bindings/test/test_bug775543.html
dom/bindings/test/test_callback_across_document_open.html
dom/bindings/test/test_callback_exceptions.html
dom/bindings/test/test_crossOriginWindowSymbolAccess.html
dom/bindings/test/test_defineProperty.html
dom/bindings/test/test_dom_xrays.html
dom/bindings/test/test_enums.html
dom/bindings/test/test_exceptionSanitization.html
dom/bindings/test/test_exceptionThrowing.html
dom/bindings/test/test_exception_messages.html
dom/bindings/test/test_exception_options_from_jsimplemented.html
dom/bindings/test/test_forOf.html
dom/bindings/test/test_iterable.html
dom/bindings/test/test_jsimplemented_cross_realm_this.html
dom/bindings/test/test_jsimplemented_eventhandler.html
dom/bindings/test/test_lenientThis.html
dom/bindings/test/test_named_getter_enumerability.html
dom/bindings/test/test_promise_rejections_from_jsimplemented.html
dom/bindings/test/test_returnUnion.html
dom/bindings/test/test_sequence_detection.html
dom/bindings/test/test_sequence_wrapping.html
dom/bindings/test/test_stringBindings.html
dom/bindings/test/test_throwing_method_noDCE.html
dom/bindings/test/test_toJSON.html
dom/bindings/test/test_unforgeablesonexpando.html
dom/bindings/test/test_usvstring.html
--- a/.eslintignore
+++ b/.eslintignore
@@ -156,17 +156,16 @@ devtools/server/tests/unit/xpcshell_debu
 
 # dom/ exclusions
 dom/animation/**
 dom/base/*.*
 dom/base/test/*.*
 dom/base/test/unit/test_serializers_entities*.js
 dom/base/test/unit_ipc/**
 dom/base/test/jsmodules/**
-dom/bindings/**
 dom/canvas/**
 dom/encoding/**
 dom/events/**
 dom/fetch/**
 dom/file/**
 dom/flex/**
 dom/grid/**
 dom/html/**
--- a/dom/bindings/test/TestInterfaceJS.js
+++ b/dom/bindings/test/TestInterfaceJS.js
@@ -1,12 +1,13 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 noSuchMethodExistsYo1, noSuchMethodExistsYo2, noSuchMethodExistsYo3 */
 
 "use strict";
 
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function TestInterfaceJS(anyArg, objectArg) {}
 
--- a/dom/bindings/test/file_bug775543.html
+++ b/dom/bindings/test/file_bug775543.html
@@ -1,5 +1,5 @@
 <body>
 <script>
-worker = new Worker("a");
+var worker = new Worker("a");
 </script>
 </body>
--- a/dom/bindings/test/test_ByteString.html
+++ b/dom/bindings/test/test_ByteString.html
@@ -12,17 +12,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=796850">Mozilla Bug 796850</a>
 <p id="display"></p>
 <pre id="test">
 <script type="application/javascript">
 
   /** Test for Bug 796850 **/
   var xhr = new XMLHttpRequest();
-  caught = false;
+  var caught = false;
   try {
     xhr.open("\u5427", "about:mozilla", true);
   } catch (TypeError) {
     caught = true;
   }
   ok(caught, "Character values > 255 not rejected for ByteString");
 
 </script>
--- a/dom/bindings/test/test_Object.prototype_props.html
+++ b/dom/bindings/test/test_Object.prototype_props.html
@@ -1,15 +1,16 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for bug 987110</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+/* global test, assert_array_equals */
 test(function() {
   var props = Object.getOwnPropertyNames(Object.prototype);
   // If you change this list, make sure it continues to match the list in
   // Codegen.py's CGDictionary.getMemberDefinition method.
   var expected = [
       "constructor", "toSource", "toString", "toLocaleString", "valueOf",
       "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable",
       "__defineGetter__", "__defineSetter__", "__lookupGetter__",
--- a/dom/bindings/test/test_async_stacks.html
+++ b/dom/bindings/test/test_async_stacks.html
@@ -4,16 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=1148593
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1148593</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
+  /* global noSuchFunction */
 
   /** Test for Bug 1148593 **/
 
   SimpleTest.waitForExplicitFinish();
 
   var TESTS;
 
   function nextTest() {
--- a/dom/bindings/test/test_barewordGetsWindow.html
+++ b/dom/bindings/test/test_barewordGetsWindow.html
@@ -14,17 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   SimpleTest.waitForExplicitFinish();
   window.onload = function() {
     var desc = Object.getOwnPropertyDescriptor(frames[0], "document");
     if (!desc || !desc.get) {
       todo(false, "This test does nothing so far, but will once Window is on WebIDL bindings");
       SimpleTest.finish();
       return;
     }
-    get = desc.get;
+    var get = desc.get;
     ok(get, "Couldn't find document getter");
     Object.defineProperty(frames[0], "foo", { get, configurable: true });
 
     var barewordFunc = frames[0].eval("(function (count) { var doc; for (var i = 0; i < count; ++i) doc = foo; return doc.documentElement; })");
     var qualifiedFunc = frames[0].eval("(function (count) { var doc; for (var i = 0; i < count; ++i) doc = window.document; return doc.documentElement; })");
     document.querySelector("iframe").onload = function() {
       // interp
       is(barewordFunc(1).innerText, "OLD", "Bareword should see own inner 1");
--- a/dom/bindings/test/test_bug1036214.html
+++ b/dom/bindings/test/test_bug1036214.html
@@ -4,16 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=1036214
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1036214</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
+  /* global TestInterfaceJS */
 
   /** Test for subsumes-checking |any| and |object| for js-implemented WebIDL. **/
   SimpleTest.waitForExplicitFinish();
   var xoObjects = [];
   function setup() {
     xoObjects.push(window[0]);
     xoObjects.push(window[0].location);
     xoObjects.push(SpecialPowers.unwrap(SpecialPowers.wrap(window[0]).document));
@@ -79,17 +80,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     is(t.objectSequenceLength([{}, {}, {}]), 3, "ping pong works with object sequence");
     is(t.anySequenceLength([42, "string", {}, undefined]), 4, "ping pong works with any sequence");
 
     //
     // Test that we throw in the cross-origin cases.
     //
 
     xoObjects.forEach(function(xoObj) {
-      var blank = new TestInterfaceJS();
+      new TestInterfaceJS();
       checkThrows(() => new TestInterfaceJS(xoObj, undefined), "any param for constructor");
       checkThrows(() => new TestInterfaceJS(undefined, xoObj), "obj param for constructor");
       checkThrows(() => new TestInterfaceJS(undefined, undefined, { anyMember: xoObj }), "any dict param for constructor");
       checkThrows(() => new TestInterfaceJS(undefined, undefined, { objectMember: xoObj }), "object dict param for constructor");
       checkThrows(() => new TestInterfaceJS(undefined, undefined, { objectOrStringMember: xoObj }), "union dict param for constructor");
       checkThrows(() => new TestInterfaceJS(undefined, undefined, { anySequenceMember: [0, xoObj, "hi" ] }), "sequence dict param for constructor");
       checkThrows(() => new TestInterfaceJS(undefined, undefined, { innerDictionary: { innerObject: xoObj } }), "inner dict param for constructor");
       checkThrows(() => t.anyAttr = xoObj, "anyAttr");
--- a/dom/bindings/test/test_bug1123516_maplikesetlike.html
+++ b/dom/bindings/test/test_bug1123516_maplikesetlike.html
@@ -4,30 +4,30 @@
 <html>
     <head>
         <title>Test Maplike Interface</title>
         <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
         <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     </head>
     <body>
         <script class="testbody" type="application/javascript">
+        /* global TestInterfaceMaplike, TestInterfaceSetlike, TestInterfaceMaplikeObject, TestInterfaceJSMaplike */
          SimpleTest.waitForExplicitFinish();
          SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, function() {
-             base_properties = [["has", "function", 1],
-                                ["entries", "function", 0],
-                                ["keys", "function", 0],
-                                ["values", "function", 0],
-                                ["forEach", "function", 1],
-                                ["size", "number"]];
-             maplike_properties = base_properties.concat([["set", "function", 2]]);
-             setlike_properties = base_properties;
-             rw_properties = [["clear", "function", 0],
-                              ["delete", "function", 1]];
-             setlike_rw_properties = base_properties.concat(rw_properties).concat([["add", "function", 1]]);
-             maplike_rw_properties = maplike_properties.concat(rw_properties).concat([["get", "function", 1]]);
+             var base_properties = [["has", "function", 1],
+                                    ["entries", "function", 0],
+                                    ["keys", "function", 0],
+                                    ["values", "function", 0],
+                                    ["forEach", "function", 1],
+                                    ["size", "number"]];
+             var maplike_properties = base_properties.concat([["set", "function", 2]]);
+             var rw_properties = [["clear", "function", 0],
+                                  ["delete", "function", 1]];
+             var setlike_rw_properties = base_properties.concat(rw_properties).concat([["add", "function", 1]]);
+             var maplike_rw_properties = maplike_properties.concat(rw_properties).concat([["get", "function", 1]]);
              var testExistence = function testExistence(prefix, obj, properties) {
                  for (var [name, type, args] of properties) {
                      // Properties are somewhere up the proto chain, hasOwnProperty won't work
                      isnot(obj[name], undefined,
                         `${prefix} object has property ${name}`);
 
                      is(typeof obj[name], type,
                         `${prefix} object property ${name} is a ${type}`);
@@ -51,62 +51,63 @@
                          owner = Object.getPrototypeOf(owner);
                      }
                  }
              };
 
              var m;
              var testSet;
              var testIndex;
+
              // Simple map creation and functionality test
              info("SimpleMap: Testing simple map creation and functionality");
              m = new TestInterfaceMaplike();
              ok(m, "SimpleMap: got a TestInterfaceMaplike object");
              testExistence("SimpleMap: ", m, maplike_rw_properties);
              is(m.size, 0, "SimpleMap: size should be zero");
              ok(!m.has("test"), "SimpleMap: maplike has should return false");
              is(m.get("test"), undefined, "SimpleMap: maplike get should return undefined on bogus lookup");
-             m1 = m.set("test", 1);
+             var m1 = m.set("test", 1);
              is(m, m1, "SimpleMap: return from set should be map object");
              is(m.size, 1, "SimpleMap: size should be 1");
              ok(m.has("test"), "SimpleMap: maplike has should return true");
              is(m.get("test"), 1, "SimpleMap: maplike get should return value entered");
-             m2 = m.set("test2", 2);
+             m.set("test2", 2);
              is(m.size, 2, "SimpleMap: size should be 2");
              testSet = [["test", 1], ["test2", 2]];
              testIndex = 0;
              m.forEach(function(v, k, o) {
                  "use strict";
                  is(o, m, "SimpleMap: foreach obj is correct");
                  is(k, testSet[testIndex][0], "SimpleMap: foreach map key: " + k + " = " + testSet[testIndex][0]);
                  is(v, testSet[testIndex][1], "SimpleMap: foreach map value: " + v + " = " + testSet[testIndex][1]);
                  testIndex += 1;
              });
              is(testIndex, 2, "SimpleMap: foreach ran correct number of times");
              ok(m.has("test2"), "SimpleMap: maplike has should return true");
              is(m.get("test2"), 2, "SimpleMap: maplike get should return value entered");
              is(m.delete("test2"), true, "SimpleMap: maplike deletion should return boolean");
              is(m.size, 1, "SimpleMap: size should be 1");
-             iterable = false;
-             for (var e of m) {
+             var iterable = false;
+             for (let e of m) {
                  iterable = true;
                  is(e[0], "test", "SimpleMap: iterable first array element should be key");
                  is(e[1], 1, "SimpleMap: iterable second array element should be value");
              }
              is(m[Symbol.iterator].length, 0, "SimpleMap: @@iterator symbol is correct length");
              is(m[Symbol.iterator].name, "entries", "SimpleMap: @@iterator symbol has correct name");
              is(m[Symbol.iterator], m.entries, 'SimpleMap: @@iterator is an alias for "entries"');
              ok(iterable, "SimpleMap: @@iterator symbol resolved correctly");
-             for (var k of m.keys()) {
+             for (let k of m.keys()) {
                  is(k, "test", "SimpleMap: first keys element should be 'test'");
              }
-             for (var v of m.values()) {
+             for (let v of m.values()) {
                  is(v, 1, "SimpleMap: first values elements should be 1");
              }
-             for (var e of m.entries()) {
+             for (let e of m.entries()) {
                  is(e[0], "test", "SimpleMap: entries first array element should be 'test'");
                  is(e[1], 1, "SimpleMap: entries second array element should be 1");
              }
              m.clear();
              is(m.size, 0, "SimpleMap: size should be 0 after clear");
 
              // Simple set creation and functionality test
              info("SimpleSet: Testing simple set creation and functionality");
@@ -114,63 +115,63 @@
              ok(m, "SimpleSet: got a TestInterfaceSetlike object");
              testExistence("SimpleSet: ", m, setlike_rw_properties);
              is(m.size, 0, "SimpleSet: size should be zero");
              ok(!m.has("test"), "SimpleSet: maplike has should return false");
              m1 = m.add("test");
              is(m, m1, "SimpleSet: return from set should be map object");
              is(m.size, 1, "SimpleSet: size should be 1");
              ok(m.has("test"), "SimpleSet: maplike has should return true");
-             m2 = m.add("test2");
+             m.add("test2");
              is(m.size, 2, "SimpleSet: size should be 2");
              testSet = ["test", "test2"];
              testIndex = 0;
              m.forEach(function(v, k, o) {
                  "use strict";
                  is(o, m, "SimpleSet: foreach obj is correct");
                  is(k, testSet[testIndex], "SimpleSet: foreach set key: " + k + " = " + testSet[testIndex]);
                  testIndex += 1;
              });
              is(testIndex, 2, "SimpleSet: foreach ran correct number of times");
              ok(m.has("test2"), "SimpleSet: maplike has should return true");
              is(m.delete("test2"), true, "SimpleSet: maplike deletion should return true");
              is(m.size, 1, "SimpleSet: size should be 1");
              iterable = false;
-             for (var e of m) {
+             for (let e of m) {
                  iterable = true;
                  is(e, "test", "SimpleSet: iterable first array element should be key");
              }
              is(m[Symbol.iterator].length, 0, "SimpleSet: @@iterator symbol is correct length");
              is(m[Symbol.iterator].name, "values", "SimpleSet: @@iterator symbol has correct name");
              is(m[Symbol.iterator], m.values, 'SimpleSet: @@iterator is an alias for "values"');
              ok(iterable, "SimpleSet: @@iterator symbol resolved correctly");
-             for (var k of m.keys()) {
+             for (let k of m.keys()) {
                  is(k, "test", "SimpleSet: first keys element should be 'test'");
              }
-             for (var v of m.values()) {
+             for (let v of m.values()) {
                  is(v, "test", "SimpleSet: first values elements should be 'test'");
              }
-             for (var e of m.entries()) {
+             for (let e of m.entries()) {
                  is(e[0], "test", "SimpleSet: Entries first array element should be 'test'");
                  is(e[1], "test", "SimpleSet: Entries second array element should be 'test'");
              }
              m.clear();
              is(m.size, 0, "SimpleSet: size should be 0 after clear");
 
              // Map convenience function test
              info("Testing map convenience functions");
              m = new TestInterfaceMaplike();
              ok(m, "MapConvenience: got a TestInterfaceMaplike object");
              is(m.size, 0, "MapConvenience: size should be zero");
              ok(!m.hasInternal("test"), "MapConvenience: maplike hasInternal should return false");
              m.setInternal("test", 1);
              is(m.size, 1, "MapConvenience: size should be 1");
              ok(m.hasInternal("test"), "MapConvenience: maplike hasInternal should return true");
              is(m.get("test"), 1, "MapConvenience: maplike get should return value entered");
-             m2 = m.setInternal("test2", 2);
+             m.setInternal("test2", 2);
              is(m.size, 2, "size should be 2");
              ok(m.hasInternal("test2"), "MapConvenience: maplike hasInternal should return true");
              is(m.get("test2"), 2, "MapConvenience: maplike get should return value entered");
              is(m.deleteInternal("test2"), true, "MapConvenience: maplike deleteInternal should return true");
              is(m.size, 1, "MapConvenience: size should be 1");
              m.clearInternal();
              is(m.size, 0, "MapConvenience: size should be 0 after clearInternal");
 
@@ -182,17 +183,17 @@
              is(m.size, 0, "ReadOnlyMapConvenience: size should be zero");
              is(m.set, undefined, "ReadOnlyMapConvenience: readonly map, should be no set function");
              is(m.clear, undefined, "ReadOnlyMapConvenience: readonly map, should be no clear function");
              is(m.delete, undefined, "ReadOnlyMapConvenience: readonly map, should be no delete function");
              ok(!m.hasInternal("test"), "ReadOnlyMapConvenience: maplike hasInternal should return false");
              m.setInternal("test");
              is(m.size, 1, "size should be 1");
              ok(m.hasInternal("test"), "ReadOnlyMapConvenience: maplike hasInternal should return true");
-             m2 = m.setInternal("test2");
+             m.setInternal("test2");
              is(m.size, 2, "size should be 2");
              ok(m.hasInternal("test2"), "ReadOnlyMapConvenience: maplike hasInternal should return true");
              is(m.deleteInternal("test2"), true, "ReadOnlyMapConvenience: maplike deleteInternal should return true");
              is(m.size, 1, "ReadOnlyMapConvenience: size should be 1");
              m.clearInternal();
              is(m.size, 0, "ReadOnlyMapConvenience: size should be 0 after clearInternal");
 
              // JS implemented map creation convenience function test
@@ -201,29 +202,29 @@
              m = new TestInterfaceJSMaplike();
              ok(m, "JSMapConvenience: got a TestInterfaceJSMaplike object");
              is(m.size, 0, "JSMapConvenience: size should be zero");
              ok(!m.has("test"), "JSMapConvenience: maplike has should return false");
              m.setInternal("test", 1);
              is(m.size, 1, "JSMapConvenience: size should be 1");
              ok(m.has("test"), "JSMapConvenience: maplike has should return true");
              is(m.get("test"), 1, "JSMapConvenience: maplike get should return value entered");
-             m2 = m.setInternal("test2", 2);
+             m.setInternal("test2", 2);
              is(m.size, 2, "JSMapConvenience: size should be 2");
              ok(m.has("test2"), "JSMapConvenience: maplike has should return true");
              is(m.get("test2"), 2, "JSMapConvenience: maplike get should return value entered");
              is(m.deleteInternal("test2"), true, "JSMapConvenience: maplike deleteInternal should return true");
              is(m.size, 1, "JSMapConvenience: size should be 1");
-             for (var k of m.keys()) {
+             for (let k of m.keys()) {
                  is(k, "test", "JSMapConvenience: first keys element should be 'test'");
              }
-             for (var v of m.values()) {
+             for (let v of m.values()) {
                  is(v, 1, "JSMapConvenience: first values elements should be 1");
              }
-             for (var e of m.entries()) {
+             for (let e of m.entries()) {
                  is(e[0], "test", "JSMapConvenience: entries first array element should be 'test'");
                  is(e[1], 1, "JSMapConvenience: entries second array element should be 1");
              }
              m.clearInternal();
              is(m.size, 0, "JSMapConvenience: size should be 0 after clearInternal");
 
              // Test this override for forEach
              info("ForEachThisOverride: Testing this override for forEach");
--- a/dom/bindings/test/test_bug1123875.html
+++ b/dom/bindings/test/test_bug1123875.html
@@ -1,14 +1,15 @@
 <!doctype html>
 <meta charset=utf-8>
 <title>Test for Bug 1123875</title>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <div id=log></div>
 <script>
+/* global test, assert_throws */
   test(() => {
     assert_throws(new TypeError, () => {
       "use strict";
       document.childNodes.length = 0;
     });
   }, "setting a readonly attribute on a proxy in strict mode should throw a TypeError");
 </script>
--- a/dom/bindings/test/test_bug773326.html
+++ b/dom/bindings/test/test_bug773326.html
@@ -1,11 +1,13 @@
 <!doctype html>
 <meta charset=utf-8>
 <title>Test for Bug 773326</title>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <div id=log></div>
 <script>
+/* global test */
+
 test(function() {
   new Worker("data:text/javascript,new XMLHttpRequest(42)");
 }, "Should not crash");
 </script>
--- a/dom/bindings/test/test_bug775543.html
+++ b/dom/bindings/test/test_bug775543.html
@@ -8,21 +8,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug 775543</title>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=775543">Mozilla Bug 775543</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-<iframe id="t" src="http://example.org/tests/dom/bindings/test/file_bug775543.html" onload="test();"></iframe>  
+<iframe id="t" src="http://example.org/tests/dom/bindings/test/file_bug775543.html" onload="test();"></iframe>
 </div>
 <pre id="test">
 <script type="application/javascript">
-
+/* global XPCNativeWrapper */
 /** Test for Bug 775543 **/
 
 function test() {
   var a = XPCNativeWrapper(document.getElementById("t").contentWindow.wrappedJSObject.worker);
   isnot(XPCNativeWrapper.unwrap(a), a, "XPCNativeWrapper(Worker) should be an Xray wrapper");
   a.toString();
   ok(true, "Shouldn't crash when calling a method on an Xray wrapper around a worker");
   SimpleTest.finish();
--- a/dom/bindings/test/test_callback_across_document_open.html
+++ b/dom/bindings/test/test_callback_across_document_open.html
@@ -2,16 +2,17 @@
 <meta charset=utf-8>
 <title>Test for callback invocation for a callback that comes from a
   no-longer-current window that still has an active document.</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <iframe srcdoc='<script>function f() { parent.callCount++; }</script>'></iframe>
 <script>
+/* global async_test, assert_equals */
   var callCount = 0;
   var t = async_test("A test of callback invocation in a no-longer-current window with a still-active document");
   window.addEventListener("load", t.step_func_done(function() {
     var d = document.createElement("div");
     d.addEventListener("xyz", frames[0].f);
     frames[0].document.open();
     frames[0].document.write("All gone");
     frames[0].document.close();
--- a/dom/bindings/test/test_callback_exceptions.html
+++ b/dom/bindings/test/test_callback_exceptions.html
@@ -1,15 +1,17 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for ...</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+/* global promise_test, promise_rejects */
+
 promise_test(function(t) {
   var iterator = document.createNodeIterator(document, NodeFilter.SHOW_ALL, JSON.parse);
   return promise_rejects(t, new SyntaxError,
                          Promise.resolve().then(iterator.nextNode.bind(iterator)));
 }, "Trying to use JSON.parse as filter should throw a catchable SyntaxError exception even when the filter is invoked async");
 
 promise_test(function(t) {
   return promise_rejects(t, new SyntaxError, Promise.resolve("{").then(JSON.parse));
--- a/dom/bindings/test/test_crossOriginWindowSymbolAccess.html
+++ b/dom/bindings/test/test_crossOriginWindowSymbolAccess.html
@@ -1,16 +1,18 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for accessing symbols on a cross-origin window</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <iframe src="http://www1.w3c-test.org/common/blank.html"></iframe>
 <script>
+/* global async_test, assert_equals, assert_throws */
+
 async_test(function(t) {
   window.addEventListener("load", t.step_func(
     function() {
       assert_equals(document.querySelector("iframe").contentDocument, null, "Should have a crossorigin frame");
       assert_throws("SecurityError", function() {
         frames[0][Symbol.iterator];
       }, "Should throw exception on cross-origin Window symbol-named get");
       assert_throws("SecurityError", function() {
--- a/dom/bindings/test/test_defineProperty.html
+++ b/dom/bindings/test/test_defineProperty.html
@@ -79,17 +79,17 @@ function namedSetNonStrict(obj) {
     Object.defineProperty(obj, "x", { value: 17 });
     threw = false;
   } catch (e) {
     threw = true;
   }
   ok(threw,
      "Should throw in non-strict mode when defining named property on " + obj);
 }
-for (var obj of [ document, document.forms ]) {
+for (let obj of [ document, document.forms ]) {
   namedSetStrict(obj);
   namedSetNonStrict(obj);
 }
 
 function indexedSetStrict(obj) {
   "use strict";
   var threw;
   try {
@@ -143,15 +143,15 @@ function indexedSetNonStrict(obj) {
     Object.defineProperty(obj, "0", { value: 17 });
     threw = false;
   } catch (e) {
     threw = true;
   }
   ok(threw,
      "Should throw in non-strict mode when defining indexed property on " + obj);
 }
-for (var obj of [ document.forms, document.childNodes ]) {
+for (let obj of [ document.forms, document.childNodes ]) {
   indexedSetStrict(obj);
   indexedSetNonStrict(obj);
 }
 </script>
 </body>
 </html>
--- a/dom/bindings/test/test_dom_xrays.html
+++ b/dom/bindings/test/test_dom_xrays.html
@@ -88,16 +88,17 @@ function test() {
   ok("document" in win, "WebIDL properties should be exposed through Xrays");
 
   // Unforgeable properties live on the instance, shadowing the properties of the named property object.
   checkWindowXrayProperty(win, "self", win, undefined, undefined, undefined);
   ok("self" in win, "WebIDL properties should be exposed through Xrays");
 
   // Object.prototype is at the end of the prototype chain.
   var obj = win;
+  var proto;
   while ((proto = Object.getPrototypeOf(obj))) {
     obj = proto;
   }
   is(obj, win.Object.prototype, "Object.prototype should be at the end of the prototype chain");
 
   // Named properties shouldn't shadow WebIDL- or ECMAScript-defined properties.
   checkWindowXrayProperty(win, "addEventListener", undefined, undefined, undefined, eventTargetProto.addEventListener);
   is(win.addEventListener, eventTargetProto.addEventListener, "Named properties shouldn't shadow WebIDL-defined properties");
@@ -186,17 +187,17 @@ function test() {
      "Should have contains() set up as an alias to includes()");
   // Waive Xrays on the dataTransfer itself, since the .types we get is
   // different over Xrays vs not.
   is(dataTransfer.wrappedJSObject.types.contains, undefined,
      "Underlying object should not have contains() set up as an alias to " +
      "includes()");
 
   // Check that deleters work correctly in the [OverrideBuiltins] case.
-  var elem = win.document.documentElement;
+  elem = win.document.documentElement;
   var dataset = elem.dataset;
   is(dataset.foo, undefined, "Should not have a 'foo' property");
   ok(!("foo" in dataset), "Really should not have a 'foo' property");
   is(elem.getAttribute("data-foo"), null,
      "Should not have a 'data-foo' attribute");
   ok(!elem.hasAttribute("data-foo"),
      "Really should not have a 'data-foo' attribute");
   dataset.foo = "bar";
@@ -281,17 +282,17 @@ function test() {
   isnot(typeof elem.ELEMENT_NODE, "undefined",
         "Should see constant property on prototype objects");
   is(Object.getOwnPropertyDescriptor(elem, "ELEMENT_NODE"), undefined,
      "Shouldn't see constant property on instances");
   isnot(typeof Object.getOwnPropertyDescriptor(win.Node.prototype, "ELEMENT_NODE"), "undefined",
         "Should see constant property on prototype objects");
 
   // Adopting nodes should not lose expandos.
-  var elem = doc.createElement("span");
+  elem = doc.createElement("span");
   elem.expando = 5;
   is(elem.expando, 5, "We just set this property");
   document.adoptNode(elem);
   is(elem.wrappedJSObject, undefined, "Shouldn't be an Xray anymore");
   is(elem.expando, 5, "Expando should not get lost");
 
   SimpleTest.finish();
 }
--- a/dom/bindings/test/test_enums.html
+++ b/dom/bindings/test/test_enums.html
@@ -1,15 +1,16 @@
 <!doctype html>
 <meta charset=utf-8>
 <title>Enums</title>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <div id=log></div>
 <script>
+/* global test, assert_equals */
 test(function() {
   var xhr = new XMLHttpRequest();
   xhr.open("get", "foo");
   assert_equals(xhr.responseType, "");
   xhr.responseType = "foo";
   assert_equals(xhr.responseType, "");
 }, "Assigning an invalid value to an enum attribute should not throw.");
 </script>
--- a/dom/bindings/test/test_exceptionSanitization.html
+++ b/dom/bindings/test/test_exceptionSanitization.html
@@ -13,47 +13,43 @@ https://bugzilla.mozilla.org/show_bug.cg
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1295322">Mozilla Bug 1295322</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 </pre>
   <script type="application/javascript">
-
+  /* global TestFunctions */
     SimpleTest.waitForExplicitFinish();
     async function runTests() {
       await SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]});
 
       var t = new TestFunctions();
 
       try {
-	t.testThrowNsresult();
+        t.testThrowNsresult();
       } catch (e) {
-	try {
-	  is(e.name, "NS_BINDING_ABORTED",
-	     "Should have the right exception");
-	  is(e.filename, location.href,
-             "Should not be seeing where the exception really came from");
-	} catch (e2) {
-	  ok(false, "Should be able to work with the exception");
-	}
+        try {
+          is(e.name, "NS_BINDING_ABORTED", "Should have the right exception");
+          is(e.filename, location.href, "Should not be seeing where the exception really came from");
+        } catch (e2) {
+          ok(false, "Should be able to work with the exception");
+        }
       }
 
       try {
-	t.testThrowNsresultFromNative();
+        t.testThrowNsresultFromNative();
       } catch (e) {
         try {
-	  is(e.name, "NS_ERROR_UNEXPECTED",
-	     "Should have the right exception");
-	  is(e.filename, location.href,
-             "Should not be seeing where the exception really came from");
-	} catch (e2) {
-	  ok(false, "Should be able to work with the exception");
-	}
+          is(e.name, "NS_ERROR_UNEXPECTED", "Should have the right exception");
+          is(e.filename, location.href, "Should not be seeing where the exception really came from");
+        } catch (e2) {
+          ok(false, "Should be able to work with the exception");
+        }
       }
 
       SimpleTest.finish();
     }
 
     runTests();
   </script>
 </body>
--- a/dom/bindings/test/test_exceptionThrowing.html
+++ b/dom/bindings/test/test_exceptionThrowing.html
@@ -11,38 +11,38 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="application/javascript">
 
   /** Test for Bug 847119 **/
 
   var xhr = new XMLHttpRequest();
   var domthrows = function() { xhr.open(); };
 
   var count = 20000;
-  
+
   function f() {
     var k = 0;
     for (var j = 0; j < count; ++j) {
       try { domthrows(); } catch (e) { ++k; }
     }
     return k;
   }
   function g() { return count; }
 
   is(f(), count, "Should get count exceptions");
-  for (var h of [f, g]) {
+  for (let h of [f, g]) {
     try { is(h(), count, "Should get count exceptions here too"); } catch (e) {}
   }
   ok(true, "We should get here");
 
-  var domthrows = function() { xhr.withCredentials = false; };
+  domthrows = function() { xhr.withCredentials = false; };
   xhr.open("GET", "");
   xhr.send();
 
   is(f(), count, "Should get count exceptions from getter");
-  for (var h of [f, g]) {
+  for (let h of [f, g]) {
     try { is(h(), count, "Should get count exceptions from getter here too"); } catch (e) {}
   }
   ok(true, "We should get here too");
 
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=847119">Mozilla Bug 847119</a>
--- a/dom/bindings/test/test_exception_messages.html
+++ b/dom/bindings/test/test_exception_messages.html
@@ -54,18 +54,19 @@ https://bugzilla.mozilla.org/show_bug.cg
         "Argument 1 of HTMLSelectElement.add could not be converted to any of: HTMLOptionElement, HTMLOptGroupElement.",
         "invalid value passed for union" ],
       [ 'document.createElement("canvas").getContext("2d").createLinearGradient(0, 1, 0, 1).addColorStop(NaN, "")',
         "Argument 1 of CanvasGradient.addColorStop is not a finite floating-point value.",
         "invalid float" ],
   ];
 
   for (var i = 0; i < tests.length; ++i) {
-      msg = "Correct exception should be thrown for " + tests[i][2];
+      var msg = "Correct exception should be thrown for " + tests[i][2];
       try {
+          // eslint-disable-next-line no-eval
           eval(tests[i][0]);
           ok(false, msg);
       } catch (e) {
           is(e.message, tests[i][1], msg);
       }
   }
 
   </script>
--- a/dom/bindings/test/test_exception_options_from_jsimplemented.html
+++ b/dom/bindings/test/test_exception_options_from_jsimplemented.html
@@ -4,17 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1107592</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
-
+  /* global TestInterfaceJS */
   /** Test for Bug 1107592 **/
 
   SimpleTest.waitForExplicitFinish();
 
   function doTest() {
     var file = location.href;
     var asyncFrame;
     /* Async parent frames from pushPrefEnv don't show up in e10s.  */
--- a/dom/bindings/test/test_forOf.html
+++ b/dom/bindings/test/test_forOf.html
@@ -8,66 +8,67 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug 725907</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=725907">Mozilla Bug 725907</a>
 <p id="display"></p>
 <div id="content" style="display: none">
-  
+
 </div>
 <div id="basket">
   <span id="egg0"></span>
   <span id="egg1"><span id="duckling1"></span></span>
   <span id="egg2"></span>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 725907 **/
 
+
 function runTestsForDocument(document, msgSuffix) {
     function is(a, b, msg) { SimpleTest.is(a, b, msg + msgSuffix); }
-    function isnot(a, b, msg) { SimpleTest.isnot(a, b, msg + msgSuffix); }
 
     var basket = document.getElementById("basket");
     var egg3 = document.createElement("span");
     egg3.id = "egg3";
 
     var log = "";
-    for (var x of basket.childNodes) {
+    for (let x of basket.childNodes) {
         if (x.nodeType != x.TEXT_NODE)
             log += x.id + ";";
     }
     is(log, "egg0;egg1;egg2;", "'for (x of div.childNodes)' should iterate over child nodes");
 
     log = "";
-    for (var x of basket.childNodes) {
+    for (let x of basket.childNodes) {
         if (x.nodeType != x.TEXT_NODE) {
             log += x.id + ";";
             if (x.id == "egg1")
                 basket.appendChild(egg3);
         }
     }
     is(log, "egg0;egg1;egg2;egg3;", "'for (x of div.childNodes)' should see elements added during iteration");
 
     log = "";
     basket.appendChild(document.createTextNode("some text"));
-    for (var x of basket.children)
+    for (let x of basket.children)
         log += x.id + ";";
     is(log, "egg0;egg1;egg2;egg3;", "'for (x of div.children)' should iterate over child elements");
 
     var count = 0;
-    for (var x of document.getElementsByClassName("hazardous-materials"))
+    // eslint-disable-next-line no-unused-vars
+    for (let x of document.getElementsByClassName("hazardous-materials"))
         count++;
     is(count, 0, "'for (x of emptyNodeList)' loop should run zero times");
 
-    var log = "";
-    for (var x of document.querySelectorAll("span"))
+    log = "";
+    for (let x of document.querySelectorAll("span"))
         log += x.id + ";";
     is(log, "egg0;egg1;duckling1;egg2;egg3;", "for-of loop should work with a querySelectorAll() NodeList");
 }
 
 /* All the tests run twice. First, in this document, so without any wrappers. */
 runTestsForDocument(document, "");
 
 /* And once using the document of an iframe, so working with cross-compartment wrappers. */
--- a/dom/bindings/test/test_iterable.html
+++ b/dom/bindings/test/test_iterable.html
@@ -4,22 +4,24 @@
 <html>
   <head>
     <title>Test Iterable Interface</title>
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   </head>
   <body>
     <script class="testbody" type="application/javascript">
+    /* global TestInterfaceIterableSingle, TestInterfaceIterableDouble, TestInterfaceIterableDoubleUnion */
+
      SimpleTest.waitForExplicitFinish();
      SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, function() {
-       base_properties = [["entries", "function", 0],
-                          ["keys", "function", 0],
-                          ["values", "function", 0],
-                          ["forEach", "function", 1]];
+       var base_properties = [["entries", "function", 0],
+                              ["keys", "function", 0],
+                              ["values", "function", 0],
+                              ["forEach", "function", 1]];
        var testExistence = function testExistence(prefix, obj, properties) {
          for (var [name, type, args] of properties) {
            // Properties are somewhere up the proto chain, hasOwnProperty won't work
            isnot(obj[name], undefined,
                  `${prefix} object has property ${name}`);
 
            is(typeof obj[name], type,
               `${prefix} object property ${name} is a ${type}`);
@@ -41,17 +43,16 @@
                break;
              }
              owner = Object.getPrototypeOf(owner);
            }
          }
        };
 
        var itr;
-       // Simple single type iterable creation and functionality test
        info("IterableSingle: Testing simple iterable creation and functionality");
        itr = new TestInterfaceIterableSingle();
        testExistence("IterableSingle: ", itr, base_properties);
        is(itr[Symbol.iterator], Array.prototype[Symbol.iterator],
           "IterableSingle: Should be using %ArrayIterator% for @@iterator");
        is(itr.keys, Array.prototype.keys,
           "IterableSingle: Should be using %ArrayIterator% for 'keys'");
        is(itr.entries, Array.prototype.entries,
@@ -61,53 +62,53 @@
        is(itr.forEach, Array.prototype.forEach,
           "IterableSingle: Should be using %ArrayIterator% for 'forEach'");
        var keys = [...itr.keys()];
        var values = [...itr.values()];
        var entries = [...itr.entries()];
        var key_itr = itr.keys();
        var value_itr = itr.values();
        var entries_itr = itr.entries();
-       for (var i = 0; i < 3; ++i) {
-         var key = key_itr.next();
-         var value = value_itr.next();
-         var entry = entries_itr.next();
+       for (let i = 0; i < 3; ++i) {
+         let key = key_itr.next();
+         let value = value_itr.next();
+         let entry = entries_itr.next();
          is(key.value, i, "IterableSingle: Key iterator value should be " + i);
          is(key.value, keys[i],
             "IterableSingle: Key iterator value should match destructuring " + i);
          is(value.value, key.value, "IterableSingle: Value iterator value should be " + key.value);
          is(value.value, values[i],
             "IterableSingle: Value iterator value should match destructuring " + i);
          is(entry.value[0], i, "IterableSingle: Entry iterator value 0 should be " + i);
          is(entry.value[1], i, "IterableSingle: Entry iterator value 1 should be " + i);
          is(entry.value[0], entries[i][0],
             "IterableSingle: Entry iterator value 0 should match destructuring " + i);
          is(entry.value[1], entries[i][1],
             "IterableSingle: Entry iterator value 1 should match destructuring " + i);
        }
 
        var callsToForEachCallback = 0;
        var thisArg = {};
-       itr.forEach(function(value, index, obj) {
+       itr.forEach(function(value1, index, obj) {
          is(index, callsToForEachCallback,
             `IterableSingle: Should have the right index at ${callsToForEachCallback} calls to forEach callback`);
-         is(value, values[index],
+         is(value1, values[index],
             `IterableSingle: Should have the right value at ${callsToForEachCallback} calls to forEach callback`);
          is(this, thisArg,
             "IterableSingle: Should have the right this value for forEach callback");
          is(obj, itr,
             "IterableSingle: Should have the right third arg for forEach callback");
          ++callsToForEachCallback;
        }, thisArg);
        is(callsToForEachCallback, 3,
           "IterableSingle: Should have right total number of calls to forEach callback");
 
-       var key = key_itr.next();
-       var value = value_itr.next();
-       var entry = entries_itr.next();
+       let key = key_itr.next();
+       let value = value_itr.next();
+       let entry = entries_itr.next();
        is(key.value, undefined, "IterableSingle: Key iterator value should be undefined");
        is(key.done, true, "IterableSingle: Key iterator done should be true");
        is(value.value, undefined, "IterableSingle: Value iterator value should be undefined");
        is(value.done, true, "IterableSingle: Value iterator done should be true");
        is(entry.value, undefined, "IterableDouble: Entry iterator value should be undefined");
        is(entry.done, true, "IterableSingle: Entry iterator done should be true");
        is(Object.prototype.toString.call(Object.getPrototypeOf(key_itr)),
           "[object Array Iterator]",
@@ -115,119 +116,119 @@
 
        // Simple dual type iterable creation and functionality test
        info("IterableDouble: Testing simple iterable creation and functionality");
        itr = new TestInterfaceIterableDouble();
        testExistence("IterableDouble: ", itr, base_properties);
        is(itr.entries, itr[Symbol.iterator],
           "IterableDouble: Should be using @@iterator for 'entries'");
        var elements = [["a", "b"], ["c", "d"], ["e", "f"]];
-       var keys = [...itr.keys()];
-       var values = [...itr.values()];
-       var entries = [...itr.entries()];
-       var key_itr = itr.keys();
-       var value_itr = itr.values();
-       var entries_itr = itr.entries();
-       for (var i = 0; i < 3; ++i) {
-         var key = key_itr.next();
-         var value = value_itr.next();
-         var entry = entries_itr.next();
+       keys = [...itr.keys()];
+       values = [...itr.values()];
+       entries = [...itr.entries()];
+       key_itr = itr.keys();
+       value_itr = itr.values();
+       entries_itr = itr.entries();
+       for (let i = 0; i < 3; ++i) {
+         key = key_itr.next();
+         value = value_itr.next();
+         entry = entries_itr.next();
          is(key.value, elements[i][0], "IterableDouble: Key iterator value should be " + elements[i][0]);
          is(key.value, keys[i],
             "IterableDouble: Key iterator value should match destructuring " + i);
          is(value.value, elements[i][1], "IterableDouble: Value iterator value should be " + elements[i][1]);
          is(value.value, values[i],
             "IterableDouble: Value iterator value should match destructuring " + i);
          is(entry.value[0], elements[i][0], "IterableDouble: Entry iterator value 0 should be " + elements[i][0]);
          is(entry.value[1], elements[i][1], "IterableDouble: Entry iterator value 1 should be " + elements[i][1]);
          is(entry.value[0], entries[i][0],
             "IterableDouble: Entry iterator value 0 should match destructuring " + i);
          is(entry.value[1], entries[i][1],
             "IterableDouble: Entry iterator value 1 should match destructuring " + i);
        }
 
        callsToForEachCallback = 0;
        thisArg = {};
-       itr.forEach(function(value, key, obj) {
-         is(key, keys[callsToForEachCallback],
+       itr.forEach(function(value1, key1, obj) {
+         is(key1, keys[callsToForEachCallback],
             `IterableDouble: Should have the right key at ${callsToForEachCallback} calls to forEach callback`);
-         is(value, values[callsToForEachCallback],
+         is(value1, values[callsToForEachCallback],
             `IterableDouble: Should have the right value at ${callsToForEachCallback} calls to forEach callback`);
          is(this, thisArg,
             "IterableDouble: Should have the right this value for forEach callback");
          is(obj, itr,
             "IterableSingle: Should have the right third arg for forEach callback");
          ++callsToForEachCallback;
        }, thisArg);
        is(callsToForEachCallback, 3,
           "IterableDouble: Should have right total number of calls to forEach callback");
 
-       var key = key_itr.next();
-       var value = value_itr.next();
-       var entry = entries_itr.next();
+       key = key_itr.next();
+       value = value_itr.next();
+       entry = entries_itr.next();
        is(key.value, undefined, "IterableDouble: Key iterator value should be undefined");
        is(key.done, true, "IterableDouble: Key iterator done should be true");
        is(value.value, undefined, "IterableDouble: Value iterator value should be undefined");
        is(value.done, true, "IterableDouble: Value iterator done should be true");
        is(entry.value, undefined, "IterableDouble: Entry iterator value should be undefined");
        is(entry.done, true, "IterableDouble: Entry iterator done should be true");
        is(Object.prototype.toString.call(Object.getPrototypeOf(key_itr)),
           "[object TestInterfaceIterableDouble Iterator]",
           "iterator prototype should have the right brand");
 
        // Simple dual type iterable creation and functionality test
        info("IterableDoubleUnion: Testing simple iterable creation and functionality");
        itr = new TestInterfaceIterableDoubleUnion();
        testExistence("IterableDoubleUnion: ", itr, base_properties);
        is(itr.entries, itr[Symbol.iterator],
           "IterableDoubleUnion: Should be using @@iterator for 'entries'");
-       var elements = [["long", 1], ["string", "a"]];
-       var keys = [...itr.keys()];
-       var values = [...itr.values()];
-       var entries = [...itr.entries()];
-       var key_itr = itr.keys();
-       var value_itr = itr.values();
-       var entries_itr = itr.entries();
-       for (var i = 0; i < elements.length; ++i) {
-         var key = key_itr.next();
-         var value = value_itr.next();
-         var entry = entries_itr.next();
+       elements = [["long", 1], ["string", "a"]];
+       keys = [...itr.keys()];
+       values = [...itr.values()];
+       entries = [...itr.entries()];
+       key_itr = itr.keys();
+       value_itr = itr.values();
+       entries_itr = itr.entries();
+       for (let i = 0; i < elements.length; ++i) {
+         key = key_itr.next();
+         value = value_itr.next();
+         entry = entries_itr.next();
          is(key.value, elements[i][0], "IterableDoubleUnion: Key iterator value should be " + elements[i][0]);
          is(key.value, keys[i],
             "IterableDoubleUnion: Key iterator value should match destructuring " + i);
          is(value.value, elements[i][1], "IterableDoubleUnion: Value iterator value should be " + elements[i][1]);
          is(value.value, values[i],
             "IterableDoubleUnion: Value iterator value should match destructuring " + i);
          is(entry.value[0], elements[i][0], "IterableDoubleUnion: Entry iterator value 0 should be " + elements[i][0]);
          is(entry.value[1], elements[i][1], "IterableDoubleUnion: Entry iterator value 1 should be " + elements[i][1]);
          is(entry.value[0], entries[i][0],
             "IterableDoubleUnion: Entry iterator value 0 should match destructuring " + i);
          is(entry.value[1], entries[i][1],
             "IterableDoubleUnion: Entry iterator value 1 should match destructuring " + i);
        }
 
        callsToForEachCallback = 0;
        thisArg = {};
-       itr.forEach(function(value, key, obj) {
-         is(key, keys[callsToForEachCallback],
+       itr.forEach(function(value1, key1, obj) {
+         is(key1, keys[callsToForEachCallback],
             `IterableDoubleUnion: Should have the right key at ${callsToForEachCallback} calls to forEach callback`);
-         is(value, values[callsToForEachCallback],
+         is(value1, values[callsToForEachCallback],
             `IterableDoubleUnion: Should have the right value at ${callsToForEachCallback} calls to forEach callback`);
          is(this, thisArg,
             "IterableDoubleUnion: Should have the right this value for forEach callback");
          is(obj, itr,
             "IterableSingle: Should have the right third arg for forEach callback");
          ++callsToForEachCallback;
        }, thisArg);
        is(callsToForEachCallback, 2,
           "IterableDoubleUnion: Should have right total number of calls to forEach callback");
 
-       var key = key_itr.next();
-       var value = value_itr.next();
-       var entry = entries_itr.next();
+       key = key_itr.next();
+       value = value_itr.next();
+       entry = entries_itr.next();
        is(key.value, undefined, "IterableDoubleUnion: Key iterator value should be undefined");
        is(key.done, true, "IterableDoubleUnion: Key iterator done should be true");
        is(value.value, undefined, "IterableDoubleUnion: Value iterator value should be undefined");
        is(value.done, true, "IterableDoubleUnion: Value iterator done should be true");
        is(entry.value, undefined, "IterableDoubleUnion: Entry iterator value should be undefined");
        is(entry.done, true, "IterableDoubleUnion: Entry iterator done should be true");
        is(Object.prototype.toString.call(Object.getPrototypeOf(key_itr)),
           "[object TestInterfaceIterableDoubleUnion Iterator]",
--- a/dom/bindings/test/test_jsimplemented_cross_realm_this.html
+++ b/dom/bindings/test/test_jsimplemented_cross_realm_this.html
@@ -14,16 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 </pre>
 
 <iframe></iframe>
 <script type="application/javascript">
+  /* global TestInterfaceJS */
   /** Test for Bug 1464374 **/
   SimpleTest.waitForExplicitFinish();
 
   function doTest() {
     var frame = frames[0];
     var obj = new frame.TestInterfaceJS();
     var ex;
     try {
--- a/dom/bindings/test/test_jsimplemented_eventhandler.html
+++ b/dom/bindings/test/test_jsimplemented_eventhandler.html
@@ -4,17 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=1186696
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1186696</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
-
+  /* global TestInterfaceJS  */
   /** Test for Bug 1186696 **/
   SimpleTest.waitForExplicitFinish();
 
   function doTest() {
     var values = [ function() {}, 5, null, undefined, "some string", {} ];
 
     while (values.length != 0) {
       var value = values.pop();
--- a/dom/bindings/test/test_lenientThis.html
+++ b/dom/bindings/test/test_lenientThis.html
@@ -1,15 +1,16 @@
 <!doctype html>
 <meta charset=utf-8>
 <title>[LenientThis]</title>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <div id=log></div>
 <script>
+/* global test, assert_equals */
 function noop1() { }
 function noop2() { }
 
 test(function() {
   var desc = Object.getOwnPropertyDescriptor(Document.prototype, "onreadystatechange");
 
   document.onreadystatechange = noop1;
   assert_equals(document.onreadystatechange, noop1, "document.onreadystatechange == noop1");
--- a/dom/bindings/test/test_named_getter_enumerability.html
+++ b/dom/bindings/test/test_named_getter_enumerability.html
@@ -1,40 +1,41 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for named getter enumerability</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+/* global test, assert_equals, assert_true, assert_false, assert_not_equals */
 test(function() {
   var list = document.getElementsByTagName("div");
   var desc = Object.getOwnPropertyDescriptor(list, "0");
   assert_equals(typeof desc, "object", "Should have a '0' property");
   assert_true(desc.enumerable, "'0' property should be enumerable");
   desc = Object.getOwnPropertyDescriptor(list, "log");
   assert_equals(typeof desc, "object", "Should have a 'log' property");
   assert_false(desc.enumerable, "'log' property should not be enumerable");
 }, "Correct getOwnPropertyDescriptor behavior");
 test(function() {
   var list = document.getElementsByTagName("div");
-  props = [];
+  var props = [];
   for (var prop in list) {
     props.push(prop);
   }
   assert_not_equals(props.indexOf("0"), -1, "Should enumerate '0'");
   assert_equals(props.indexOf("log"), -1, "Should not enumerate 'log'");
 }, "Correct enumeration behavior");
 test(function() {
   var list = document.getElementsByTagName("div");
-  props = Object.keys(list);
+  var props = Object.keys(list);
   assert_not_equals(props.indexOf("0"), -1, "Keys should contain '0'");
   assert_equals(props.indexOf("log"), -1, "Keys should not contain 'log'");
 }, "Correct keys() behavior");
 test(function() {
   var list = document.getElementsByTagName("div");
-  props = Object.getOwnPropertyNames(list);
+  var props = Object.getOwnPropertyNames(list);
   assert_not_equals(props.indexOf("0"), -1,
                     "own prop names should contain '0'");
   assert_not_equals(props.indexOf("log"), -1,
                     "own prop names should contain 'log'");
 }, "Correct getOwnPropertyNames() behavior");
 </script>
--- a/dom/bindings/test/test_promise_rejections_from_jsimplemented.html
+++ b/dom/bindings/test/test_promise_rejections_from_jsimplemented.html
@@ -4,17 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=1107592
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1107592</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
-
+  /* global TestInterfaceJS, thereIsNoSuchContentFunction1, thereIsNoSuchContentFunction2, thereIsNoSuchContentFunction3 */
   /** Test for Bug 1107592 **/
 
   SimpleTest.waitForExplicitFinish();
 
   function checkExn(lineNumber, name, message, code, filename, testNumber, stack, exn) {
     is(exn.lineNumber, lineNumber,
        "Should have the right line number in test " + testNumber);
     is(exn.name, name,
@@ -88,17 +88,17 @@ doTest@${ourFile}:56:9
                         parentFrame) : "")),
       t.testPromiseWithThrowingContentThenable({
             then() { thereIsNoSuchContentFunction3(); },
         }).then(
           ensurePromiseFail.bind(null, 6),
           checkExn.bind(null, 90, "ReferenceError",
                         "thereIsNoSuchContentFunction3 is not defined",
                         undefined, ourFile, 6,
-                        `then@${ourFile}:90:32
+                        `then@${ourFile}:90:22
 ` + (asyncStack ? `Async*doTest@${ourFile}:89:9\n` + parentFrame : ""))),
       t.testPromiseWithDOMExceptionThrowingPromiseInit().then(
           ensurePromiseFail.bind(null, 7),
           checkExn.bind(null, 98, "NotFoundError",
                         "We are a second DOMException",
                         DOMException.NOT_FOUND_ERR, ourFile, 7,
                         `doTest@${ourFile}:98:9
 ` +
--- a/dom/bindings/test/test_returnUnion.html
+++ b/dom/bindings/test/test_returnUnion.html
@@ -4,17 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=1048659
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1048659</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
-
+  /* global TestInterfaceJS */
   /** Test for returning unions from JS-implemented WebIDL. **/
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, go);
 
   function go() {
     var t = new TestInterfaceJS();
     var t2 = new TestInterfaceJS();
 
--- a/dom/bindings/test/test_sequence_detection.html
+++ b/dom/bindings/test/test_sequence_detection.html
@@ -4,17 +4,17 @@
 https://bugzilla.mozilla.org/show_bug.cgi?id=1066432
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1066432</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
-
+  /* global TestInterfaceJS */
   /** Test for Bug 1066432 **/
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, function() {
     var testInterfaceJS = new TestInterfaceJS();
     ok(testInterfaceJS, "got a TestInterfaceJS object");
 
     var nonIterableObject = {[Symbol.iterator]: 5};
 
--- a/dom/bindings/test/test_sequence_wrapping.html
+++ b/dom/bindings/test/test_sequence_wrapping.html
@@ -23,17 +23,17 @@ function doTest() {
   var gl = $("c").getContext("experimental-webgl");
   if (!gl) {
     // No WebGL support on MacOS 10.5.  Just skip this test
     todo(false, "WebGL not supported");
     return;
   }
   var setterCalled = false;
 
-  extLength = gl.getSupportedExtensions().length;
+  var extLength = gl.getSupportedExtensions().length;
   ok(extLength > 0,
      "This test won't work right if we have no supported extensions");
 
   Object.defineProperty(Array.prototype, "0",
     {
       set(val) {
              setterCalled = true;
            },
--- a/dom/bindings/test/test_stringBindings.html
+++ b/dom/bindings/test/test_stringBindings.html
@@ -28,17 +28,17 @@ https://bugzilla.mozilla.org/show_bug.cg
     // control inside the test harness, if we really want to exercise the string
     // cache in controlled ways.
 
     var asShortDOMString = t.getStringDataAsDOMString(substringLength);
     var asFullDOMString = t.getStringDataAsDOMString();
     var asShortAString = t.getStringDataAsAString(substringLength);
     var asAString = t.getStringDataAsAString();
 
-    is(asShortAString, shortTestString, "Short DOMString should be short");
+    is(asShortDOMString, shortTestString, "Short DOMString should be short");
     is(asFullDOMString, testString, "Full DOMString should be test string");
     is(asShortAString, shortTestString, "Short AString should be short");
     is(asAString, testString, "Full AString should be test string");
 
     SimpleTest.finish();
   }
 
   addLoadEvent(function() {
--- a/dom/bindings/test/test_throwing_method_noDCE.html
+++ b/dom/bindings/test/test_throwing_method_noDCE.html
@@ -1,25 +1,28 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test that we don't DCE functions that can throw</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+/* global test, assert_true */
 test(function() {
   function test(root) {
     var threw = false;
     try {
         root.querySelectorAll("");
     } catch (e) { threw = true; }
     // Hot loop to make sure the JIT heuristics ion-compile this function even
     // though it's throwing exceptions (which would normally make us back off
     // of ion compilation).
-    for (var i = 0; i < 1500; i++) {}
+    for (var i = 0; i < 1500; i++) {
+      // empty
+    }
     return threw;
   }
 
   var threw = false;
   var el = document.createElement("div");
   for (var i = 0; i < 200; i++)
       threw = test(el);
   assert_true(threw);
--- a/dom/bindings/test/test_toJSON.html
+++ b/dom/bindings/test/test_toJSON.html
@@ -13,17 +13,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1465602">Mozilla Bug 1465602</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   <iframe></iframe>
 </div>
 <pre id="test">
 </pre>
   <script type="application/javascript">
-
+  /* global TestFunctions */
   /** Test for Bug 1465602 **/
 
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, go);
 
   function go() {
     var ourObj = new TestFunctions();
     is(ourObj.one, 1, "Basic sanity check for our 'one'");
--- a/dom/bindings/test/test_unforgeablesonexpando.html
+++ b/dom/bindings/test/test_unforgeablesonexpando.html
@@ -1,16 +1,17 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for making sure named getters don't override the unforgeable location on HTMLDocument</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <img name="location">
 <script>
+/* global test, assert_equals */
 test(function() {
   assert_equals(document.location, window.location,
                 'The <img name="location"> should not override the location getter');
 }, "document.location is the right thing");
 test(function() {
   var doc = new DOMParser().parseFromString("<img name='location'>", "text/html");
   assert_equals(doc.location, null,
                 'The <img name="location"> should not override the location getter on a data document');
--- a/dom/bindings/test/test_usvstring.html
+++ b/dom/bindings/test/test_usvstring.html
@@ -4,16 +4,18 @@
 <html>
 <head>
   <title>Test USVString</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <script class="testbody" type="application/javascript">
+/* global TestInterfaceJS */
+
 SimpleTest.waitForExplicitFinish();
 SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, function() {
   var testInterfaceJS = new TestInterfaceJS();
   ok(testInterfaceJS, "got a TestInterfaceJS object");
   // For expected values, see algorithm definition here:
   //  http://heycam.github.io/webidl/#dfn-obtain-unicode
   var testList = [
     { string:   "foo",