Bug 1532935 - Enable ESLint for dom/promise (manual changes). r=mccr8
authorAlec Gibson <violinmonkey42@gmail.com>
Tue, 25 Jun 2019 20:12:47 +0000
changeset 542914 d077bc76802d9c6ee4b23fd03fd6ef560ea700a3
parent 542913 f0b36a9e6be0076368bff7cfe6af2318ea6d2b13
child 542915 021c05e47e6f4932a63fc1eeabc3c965fae6e882
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1532935
milestone69.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 1532935 - Enable ESLint for dom/promise (manual changes). r=mccr8 Patch by Alec, updated by Standard8. Differential Revision: https://phabricator.services.mozilla.com/D29646
.eslintignore
dom/promise/tests/file_promise_argument_tests.js
dom/promise/tests/file_promise_retval_tests.js
dom/promise/tests/file_promise_xrays.html
dom/promise/tests/promise_uncatchable_exception.js
dom/promise/tests/test_on_new_promise.html
dom/promise/tests/test_promise.html
dom/promise/tests/test_promise_and_timeout_ordering.html
dom/promise/tests/test_promise_and_timeout_ordering_workers.html
dom/promise/tests/test_promise_callback_retval.html
dom/promise/tests/test_promise_retval.html
dom/promise/tests/test_promise_utils.html
dom/promise/tests/test_promise_xrays.html
dom/promise/tests/test_species_getter.html
dom/promise/tests/test_thenable_vs_promise_ordering.html
dom/promise/tests/test_webassembly_compile.html
dom/promise/tests/test_webassembly_compile_worker.js
dom/promise/tests/unit/test_monitor_uncaught.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -10,17 +10,16 @@
 
 # Exclude expected objdirs.
 obj*/**
 
 # dom/ exclusions which should be removed (aka ESLint enabled)
 dom/base/*.*
 dom/media/test/**
 !dom/media/test/marionette/yttest/*.js
-dom/promise/**
 dom/xhr/**
 
 # build/ third-party code
 build/pgo/js-input/**
 
 # browser/ exclusions
 browser/app/**
 browser/branding/**/firefox-branding.js
--- a/dom/promise/tests/file_promise_argument_tests.js
+++ b/dom/promise/tests/file_promise_argument_tests.js
@@ -9,16 +9,19 @@
  * 3) A function named getPromise.  This function is given a global object and a
  *    single argument to use for getting the promise.  The getPromise function
  *    is expected to trigger the canonical Promise.resolve for the given global
  *    with the given argument in some way that depends on the test, and return
  *    the result.
  * 4) A subframe (frames[0]) which can be used as a second global for creating
  *    promises.
  */
+
+/* global verifyPromiseGlobal, getPromise, isXrayArgumentTest */
+
 var label = "parent";
 
 function passBasicPromise() {
   var p1 = Promise.resolve();
   verifyPromiseGlobal(p1, window, "Promise.resolve return value 1");
   var p2 = getPromise(window, p1);
   is(p1, p2, "Basic promise should just pass on through");
   return p2;
--- a/dom/promise/tests/file_promise_retval_tests.js
+++ b/dom/promise/tests/file_promise_retval_tests.js
@@ -6,16 +6,19 @@
  *    wants.  This function is passed a promise and the global whose
  *    TestFunctions was used to get the promise.
  * 2) A expectedExceptionGlobal function which is handed the global whose
  *    TestFunctions was used to trigger the exception and should return the
  *    global the exception is expected to live in.
  * 3) A subframe (frames[0]) which can be used as a second global for creating
  *    promises.
  */
+
+/* global verifyPromiseGlobal, expectedExceptionGlobal */
+
 var label = "parent";
 
 function testThrownException(global) {
   var p = global.TestFunctions.throwToRejectPromise();
   verifyPromiseGlobal(p, global, "throwToRejectPromise return value");
   return p.then(() => {}).catch((err) => {
     var expected = expectedExceptionGlobal(global);
     is(SpecialPowers.unwrap(SpecialPowers.Cu.getGlobalForObject(err)),
--- a/dom/promise/tests/file_promise_xrays.html
+++ b/dom/promise/tests/file_promise_xrays.html
@@ -1,22 +1,24 @@
 <!DOCTYPE html>
 <html>
   <script>
     function vendGetter(name) {
+      // eslint-disable-next-line no-throw-literal
       return function() { throw "Getting " + String(name); };
     }
     function vendSetter(name) {
+      // eslint-disable-next-line no-throw-literal
       return function() { throw "Setting " + String(name); };
     }
     var setupThrew = false;
     try {
       // Neuter everything we can think of on Promise.
       for (var obj of [Promise, Promise.prototype]) {
-        propNames = Object.getOwnPropertyNames(obj);
+        let propNames = Object.getOwnPropertyNames(obj);
         propNames = propNames.concat(Object.getOwnPropertySymbols(obj));
         for (var propName of propNames) {
           if ((propName == "prototype" ||
                propName == Symbol.hasInstance) &&
               obj == Promise) {
             // They're not configurable.
             continue;
           }
--- a/dom/promise/tests/promise_uncatchable_exception.js
+++ b/dom/promise/tests/promise_uncatchable_exception.js
@@ -1,8 +1,10 @@
+/* global TestFunctions */
+
 postMessage("Done", "*");
 
 var p = new Promise(function(resolve, reject) {
   TestFunctions.throwUncatchableException();
   ok(false, "Shouldn't get here!");
 }).catch(function(exception) {
   ok(false, "Shouldn't get here!");
 });
--- a/dom/promise/tests/test_on_new_promise.html
+++ b/dom/promise/tests/test_on_new_promise.html
@@ -30,16 +30,17 @@ Debugger.prototype.onNewPromise.
                                  {freshCompartment: true});
   addDebuggerToGlobal(dbgGlobal);
   var dbg = new dbgGlobal.Debugger(this);
 
   var wrappedPromise;
   dbg.onNewPromise = function(wp) { wrappedPromise = wp; };
 
   var promise = new Promise(function() {});
+  // eslint-disable-next-line no-debugger
   debugger;
   ok(wrappedPromise);
   is(wrappedPromise.unsafeDereference(), promise);
   </script>
 </pre>
 </body>
 </html>
 
--- a/dom/promise/tests/test_promise.html
+++ b/dom/promise/tests/test_promise.html
@@ -19,95 +19,104 @@
 function promiseResolve() {
   ok(Promise, "Promise object should exist");
 
   var promise = new Promise(function(resolve, reject) {
     ok(resolve, "Promise.resolve exists");
     ok(reject, "Promise.reject exists");
 
     resolve(42);
-  }).then(function(what) {
+  });
+  promise.then(function(what) {
     ok(true, "Then - resolveCb has been called");
     is(what, 42, "ResolveCb received 42");
     runTest();
   }, function() {
     ok(false, "Then - rejectCb has been called");
     runTest();
   });
 }
 
 function promiseResolveNoArg() {
   var promise = new Promise(function(resolve, reject) {
     ok(resolve, "Promise.resolve exists");
     ok(reject, "Promise.reject exists");
 
     resolve();
-  }).then(function(what) {
+  });
+  promise.then(function(what) {
     ok(true, "Then - resolveCb has been called");
     is(what, undefined, "ResolveCb received undefined");
     runTest();
   }, function() {
     ok(false, "Then - rejectCb has been called");
     runTest();
   });
 }
 
 function promiseReject() {
   var promise = new Promise(function(resolve, reject) {
     reject(42);
-  }).then(function(what) {
+  });
+  promise.then(function(what) {
     ok(false, "Then - resolveCb has been called");
     runTest();
   }, function(what) {
     ok(true, "Then - rejectCb has been called");
     is(what, 42, "RejectCb received 42");
     runTest();
   });
 }
 
 function promiseRejectNoHandler() {
   // This test only checks that the code that reports unhandled errors in the
   // Promises implementation does not crash or leak.
-  var promise = new Promise(function(res, rej) {
+
+  new Promise(function(res, rej) {
+    // eslint-disable-next-line no-undef
     noSuchMethod();
   });
   runTest();
 }
 
 function promiseRejectNoArg() {
   var promise = new Promise(function(resolve, reject) {
     reject();
-  }).then(function(what) {
+  });
+  promise.then(function(what) {
     ok(false, "Then - resolveCb has been called");
     runTest();
   }, function(what) {
     ok(true, "Then - rejectCb has been called");
     is(what, undefined, "RejectCb received undefined");
     runTest();
   });
 }
 
 function promiseException() {
   var promise = new Promise(function(resolve, reject) {
+    // eslint-disable-next-line no-throw-literal
     throw 42;
-  }).then(function(what) {
+  });
+  promise.then(function(what) {
     ok(false, "Then - resolveCb has been called");
     runTest();
   }, function(what) {
     ok(true, "Then - rejectCb has been called");
     is(what, 42, "RejectCb received 42");
     runTest();
   });
 }
 
 function promiseGC() {
   var resolve;
   var promise = new Promise(function(r1, r2) {
     resolve = r1;
-  }).then(function(what) {
+  });
+  promise.then(function(what) {
     ok(true, "Then - promise is still alive");
     runTest();
   });
 
   promise = null;
 
   SpecialPowers.gc();
   SpecialPowers.forceGC();
@@ -214,16 +223,17 @@ function promiseDoubleThen() {
 
 function promiseThenException() {
   var promise = new Promise(function(resolve, reject) {
     resolve(42);
   });
 
   promise.then(function(what) {
     ok(true, "Then.resolve has been called");
+    // eslint-disable-next-line no-throw-literal
     throw "booh";
   }).catch(function(e) {
     ok(true, "window.onerror has been called!");
     runTest();
   });
 }
 
 function promiseThenCatchThen() {
@@ -356,16 +366,17 @@ function promiseRejectThenCatchException
     reject(42);
   });
 
   promise.then(function(what) {
     ok(false, "Then.resolve has been called");
   }, function(what) {
     ok(true, "Then.reject has been called");
     is(what, 42, "Value == 42");
+    // eslint-disable-next-line no-throw-literal
     throw (what + 1);
   }).catch(function(what) {
     ok(true, "Catch has been called");
     is(what, 43, "Value == 43");
     return what + 1;
   }).then(function(what) {
     ok(true, "Then.resolve has been called");
     is(what, 44, "Value == 44");
@@ -431,31 +442,31 @@ function promiseCatchNoArg() {
       is(v, cv, "Both reject to the same value");
       runTest();
     });
   });
 }
 
 function promiseNestedPromise() {
   new Promise(function(resolve, reject) {
-    resolve(new Promise(function(resolve, reject) {
+    resolve(new Promise(function(res, rej) {
       ok(true, "Nested promise is executed");
-      resolve(42);
+      res(42);
     }));
   }).then(function(value) {
     is(value, 42, "Nested promise is executed and then == 42");
     runTest();
   });
 }
 
 function promiseNestedNestedPromise() {
   new Promise(function(resolve, reject) {
-    resolve(new Promise(function(resolve, reject) {
+    resolve(new Promise(function(res, rej) {
       ok(true, "Nested promise is executed");
-      resolve(42);
+      res(42);
     }).then(function(what) { return what + 1; }));
   }).then(function(value) {
     is(value, 43, "Nested promise is executed and then == 43");
     runTest();
   });
 }
 
 function promiseWrongNestedPromise() {
@@ -470,56 +481,59 @@ function promiseWrongNestedPromise() {
     runTest();
   }, function(value) {
      ok(false, "This is wrong");
   });
 }
 
 function promiseLoop() {
   new Promise(function(resolve, reject) {
-    resolve(new Promise(function(r1, r2) {
+    resolve(new Promise(function(res, rej) {
       ok(true, "Nested promise is executed");
-      r1(new Promise(function(r1, r2) {
+      res(new Promise(function(resInner, rejInner) {
         ok(true, "Nested nested promise is executed");
-        r1(42);
+        resInner(42);
       }));
     }));
   }).then(function(value) {
     is(value, 42, "Nested nested promise is executed and then == 42");
     runTest();
   }, function(value) {
      ok(false, "This is wrong");
   });
 }
 
 function promiseStaticReject() {
-  var promise = Promise.reject(42).then(function(what) {
+  var promise = Promise.reject(42);
+  promise.then(function(what) {
     ok(false, "This should not be called");
   }, function(what) {
     is(what, 42, "Value == 42");
     runTest();
   });
 }
 
 function promiseStaticResolve() {
-  var promise = Promise.resolve(42).then(function(what) {
+  var promise = Promise.resolve(42);
+  promise.then(function(what) {
     is(what, 42, "Value == 42");
     runTest();
   }, function() {
     ok(false, "This should not be called");
   });
 }
 
 function promiseResolveNestedPromise() {
   var promise = Promise.resolve(new Promise(function(r, r2) {
     ok(true, "Nested promise is executed");
     r(42);
   }, function() {
     ok(false, "This should not be called");
-  })).then(function(what) {
+  }));
+  promise.then(function(what) {
     is(what, 42, "Value == 42");
     runTest();
   }, function() {
     ok(false, "This should not be called");
   });
 }
 
 function promiseSimpleThenableResolve() {
@@ -549,16 +563,18 @@ function promiseSimpleThenableReject() {
     ok(e === 5, "promiseSimpleThenableReject");
     runTest();
   });
 }
 
 function promiseThenableThrowsBeforeCallback() {
   var thenable = { then(resolve) {
     throw new TypeError("Hi there");
+
+    // eslint-disable-next-line no-unreachable
     resolve(5);
   }};
 
   var promise = Promise.resolve(thenable);
   promise.then(function(v) {
     ok(false, "promiseThenableThrowsBeforeCallback: Should've rejected");
     runTest();
   }, function(e) {
@@ -625,17 +641,17 @@ function promiseStrictHandlers() {
   promise.then(function() {
     "use strict";
     ok(this === undefined, "Strict mode callback should have this === undefined.");
     runTest();
   });
 }
 
 function promiseStrictExecutorThisArg() {
-  var promise = new Promise(function(resolve, reject) {
+  new Promise(function(resolve, reject) {
     "use strict";
     ok(this === undefined, "thisArg should be undefined.");
     runTest();
   });
 }
 
 function promiseResolveArray() {
   var p = Promise.resolve([1, 2, 3]);
@@ -718,16 +734,17 @@ function promiseResolveThenableCleanStac
 // `m` when `p` invoked them (on account of itself being resolved, possibly
 // synchronously. A chain of these 'Promise resolved by a Promise' would lead to
 // stack overflow.
 function promiseTestAsyncThenableResolution() {
   var k = 3000;
   Promise.resolve().then(function next() {
     k--;
     if (k > 0) return Promise.resolve().then(next);
+    return undefined;
   }).then(function() {
     ok(true, "Resolution of a chain of thenables should not be synchronous.");
     runTest();
   });
 }
 
 // Bug 1062323
 function promiseWrapperAsyncResolution() {
@@ -820,9 +837,8 @@ function runTest() {
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 runTest();
 // -->
 </script>
 </pre>
 </body>
 </html>
-
--- a/dom/promise/tests/test_promise_and_timeout_ordering.html
+++ b/dom/promise/tests/test_promise_and_timeout_ordering.html
@@ -1,15 +1,16 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for promise and timeout ordering</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+/* global async_test, assert_equals */
 var t = async_test("Promise callbacks should run immediately after the setTimeout handler that enqueues them");
 var origPostMessage = window.postMessage;
 window.postMessage = function(msg) { origPostMessage.call(window, msg, "*"); };
 window.onmessage = t.step_func_done(function(e) {
   assert_equals(e.data, "t1start, t1end, promise, t2");
 });
 </script>
 <script src="file_promise_and_timeout_ordering.js"></script>
--- a/dom/promise/tests/test_promise_and_timeout_ordering_workers.html
+++ b/dom/promise/tests/test_promise_and_timeout_ordering_workers.html
@@ -1,13 +1,14 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for promise and timeout ordering in workers</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+/* global async_test, assert_equals */
 var t = async_test("Promise callbacks in workers should run immediately after the setTimeout handler that enqueues them");
 var w = new Worker("file_promise_and_timeout_ordering.js");
 w.onmessage = t.step_func_done(function(e) {
   assert_equals(e.data, "t1start, t1end, promise, t2");
 });
 </script>
--- a/dom/promise/tests/test_promise_callback_retval.html
+++ b/dom/promise/tests/test_promise_callback_retval.html
@@ -5,16 +5,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1323324</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script src="file_promise_argument_tests.js"></script>
   <script type="application/javascript">
+  /* global TestFunctions */
+
   /** Test for Bug 1323324 **/
   SimpleTest.waitForExplicitFinish();
 
   var globalWrapper;
   function verifyPromiseGlobal(p, global, msg) {
     // SpecialPowers.Cu.getGlobalForObject returns a SpecialPowers wrapper for
     // the actual global.  We want to grab the underlying object.
     globalWrapper = SpecialPowers.Cu.getGlobalForObject(p);
--- a/dom/promise/tests/test_promise_retval.html
+++ b/dom/promise/tests/test_promise_retval.html
@@ -29,17 +29,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   function getPromise(global, arg) {
     return global.TestFunctions.passThroughPromise(arg);
   }
 
   addLoadEvent(function() {
     frames[0].label = "child";
     SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]},
                               runPromiseRetvalTests.bind(undefined,
-							 SimpleTest.finish));
+                                                         SimpleTest.finish));
   });
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1323324">Mozilla Bug 1323324</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   <!-- A subframe so we have another global to work with -->
--- a/dom/promise/tests/test_promise_utils.html
+++ b/dom/promise/tests/test_promise_utils.html
@@ -131,33 +131,35 @@ function promiseAllRejectFails() {
   }, function(e) {
     ok(true, "Promise.all should reject when iterable has rejected Promises.");
     is(e, 2, "Rejection value should match.");
     runTest();
   });
 }
 
 function promiseAllCastError() {
-  var p = Promise.all([Promise.resolve(2), { then() { foo(); } }]);
+  var p = Promise.all([Promise.resolve(2), { then() {
+    throw new ReferenceError("placeholder for nonexistent function call");
+  } }]);
   ok(p instanceof Promise, "Should cast to a Promise.");
   p.then(function(v) {
     ok(false, "promiseAllCastError: should've rejected.");
     runTest();
   }, function(e) {
     ok(e instanceof ReferenceError, "promiseCastThenableError");
     runTest();
   });
 }
 
 // Check that the resolved array is enumerable.
 function promiseAllEnumerable() {
   var p = Promise.all([1, new Date(), Promise.resolve("firefox")]);
   p.then(function(v) {
     var count = 0;
-    for (key in v) {
+    for (let key in v) {
       ++count;
       ok(v[key] === 1 || v[key] instanceof Date || v[key] === "firefox",
          "Enumerated properties don't match.");
     }
     is(count, 3, "Resolved array from Promise.all should be enumerable");
     runTest();
   }, function(e) {
     ok(false, "promiseAllEnumerable: should've resolved.");
@@ -188,24 +190,16 @@ function promiseRaceValuesArray() {
     runTest();
   }, function(err) {
     ok(false, "Should not fail " + err + ".");
     runTest();
   });
 }
 
 function promiseRacePromiseArray() {
-  function timeoutPromise(n) {
-    return new Promise(function(resolve) {
-      setTimeout(function() {
-        resolve(n);
-      }, n);
-    });
-  }
-
   var arr = [
     new Promise(function(resolve) {
       resolve("first");
     }),
     Promise.resolve("second"),
     new Promise(function() {}),
     new Promise(function(resolve) {
       setTimeout(function() {
@@ -259,17 +253,17 @@ function promiseRaceReject() {
     ok(e.message == "Fail bad!", "Message should match.");
     runTest();
   });
 }
 
 function promiseRaceThrow() {
   var p = Promise.race([
     new Promise(function(resolve) {
-      nonExistent();
+      throw new ReferenceError("placeholder for nonexistent function call");
     }),
     new Promise(function(resolve) {
       setTimeout(resolve, 0);
     }),
   ]);
 
   p.then(function() {
     ok(false, "Should not resolve when winning Promise had an error.");
--- a/dom/promise/tests/test_promise_xrays.html
+++ b/dom/promise/tests/test_promise_xrays.html
@@ -77,17 +77,17 @@ function testRace1() {
     function(e) {
       ok(false, "testRace1 threw exception: " + e);
     }
   ).then(nextTest);
 }
 
 function testRace2() {
   var p = win.Promise.race(
-    new Array(win.Promise.resolve(1), win.Promise.resolve(2)));
+    [win.Promise.resolve(1), win.Promise.resolve(2)]);
   p.then(
     function(arg) {
       ok(arg == 1 || arg == 2,
          "Should get the right value when racing content-side array of explicit Promises");
     },
     function(e) {
       ok(false, "testRace2 threw exception: " + e);
     }
@@ -135,17 +135,17 @@ function testAll1() {
     function(e) {
       ok(false, "testAll1 threw exception: " + e);
     }
   ).then(nextTest);
 }
 
 function testAll2() {
   var p = win.Promise.all(
-    new Array(win.Promise.resolve(1), win.Promise.resolve(2)));
+    [win.Promise.resolve(1), win.Promise.resolve(2)]);
   p.then(
     function(arg) {
       ok(arg instanceof win.Array, "Should get an Array from Promise.all (2)");
       is(arg[0], 1, "First entry of Promise.all return value should be correct (2)");
       is(arg[1], 2, "Second entry of Promise.all return value should be correct (2)");
     },
     function(e) {
       ok(false, "testAll2 threw exception: " + e);
--- a/dom/promise/tests/test_species_getter.html
+++ b/dom/promise/tests/test_species_getter.html
@@ -1,16 +1,18 @@
 <!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>
 test(function() {
+  /* global test, assert_not_equals, assert_equals */
+
   var desc = Object.getOwnPropertyDescriptor(Promise, Symbol.species);
   assert_not_equals(desc, undefined, "Should have a property");
 
   assert_equals(desc.configurable, true, "Property should be configurable");
   assert_equals(desc.enumerable, false, "Property should not be enumerable");
   assert_equals(desc.set, undefined, "Should not have a setter");
   var getter = desc.get;
 
--- a/dom/promise/tests/test_thenable_vs_promise_ordering.html
+++ b/dom/promise/tests/test_thenable_vs_promise_ordering.html
@@ -1,15 +1,17 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>Test for promise resolution ordering with thenables and promises</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+/* global async_test, assert_true, assert_equals */
+
 var t = async_test("A promise resolved first (with a thenable) should trigger its callbacks before a promise resolved second (with a promise).");
 t.step(function() {
   var customThenCalled = false;
   var p0 = Promise.resolve();
   p0.then = function(resolved, rejected) {
     customThenCalled = true;
     Promise.prototype.then.call(this, resolved, rejected);
   };
--- a/dom/promise/tests/test_webassembly_compile.html
+++ b/dom/promise/tests/test_webassembly_compile.html
@@ -74,18 +74,18 @@ function compileManySuccess() {
   var arr = [];
   for (var i = 0; i < N; i++)
     arr.push(WebAssembly.compile(sampleCode));
 
   SpecialPowers.gc();
 
   Promise.all(arr).then(ms => {
     ok(ms.length === N, "got the right number");
-    for (var i = 0; i < N; i++)
-      checkSampleModule(ms[i]);
+    for (var j = 0; j < N; j++)
+      checkSampleModule(ms[j]);
     runTest();
   }).catch(
     err => { ok(false, String(err)); runTest(); }
   );
 }
 
 function terminateCompileInWorker() {
     var w = new Worker(`data:text/plain,
@@ -227,18 +227,18 @@ function compileManyStreamingFetch() {
   var arr = [];
   for (var i = 0; i < N; i++)
     arr.push(WebAssembly.compileStreaming(fetch(sampleURL)));
 
   SpecialPowers.gc();
 
   Promise.all(arr).then(ms => {
     ok(ms.length === N, "got the right number");
-    for (var i = 0; i < N; i++)
-      checkSampleModule(ms[i]);
+    for (var j = 0; j < N; j++)
+      checkSampleModule(ms[j]);
     runTest();
   }).catch(
     err => { ok(false, String(err)); runTest(); }
   );
 }
 
 function runWorkerTests() {
   var w = new Worker("test_webassembly_compile_worker.js");
--- a/dom/promise/tests/test_webassembly_compile_worker.js
+++ b/dom/promise/tests/test_webassembly_compile_worker.js
@@ -1,12 +1,14 @@
 const sampleURL = "test_webassembly_compile_sample.wasm";
 const sampleExportName = "run";
 const sampleResult = 1275;
 
+/* eslint-disable no-throw-literal */
+
 function checkSampleModule(m) {
   if (!(m instanceof WebAssembly.Module))
     throw "not a module";
   var i = new WebAssembly.Instance(m);
   if (!(i instanceof WebAssembly.Instance))
     throw "not an instance";
   if (i.exports[sampleExportName]() !== sampleResult)
     throw "wrong result";
@@ -20,20 +22,20 @@ function checkSampleInstance(i) {
 }
 
 const initObj = { headers: { "Content-Type": "application/wasm" } };
 
 onmessage = e => {
   WebAssembly.compile(e.data)
   .then(m => checkSampleModule(m))
   .then(() => WebAssembly.instantiate(e.data))
-  .then(({module, instance}) => { checkSampleModule(module), checkSampleInstance(instance); })
+  .then(({module, instance}) => { checkSampleModule(module); checkSampleInstance(instance); })
   .then(() => WebAssembly.compileStreaming(new Response(e.data, initObj)))
   .then(m => checkSampleModule(m))
   .then(() => WebAssembly.instantiateStreaming(new Response(e.data, initObj)))
-  .then(({module, instance}) => { checkSampleModule(module), checkSampleInstance(instance); })
+  .then(({module, instance}) => { checkSampleModule(module); checkSampleInstance(instance); })
   .then(() => WebAssembly.compileStreaming(fetch(sampleURL)))
   .then(m => checkSampleModule(m))
   .then(() => WebAssembly.instantiateStreaming(fetch(sampleURL)))
-  .then(({module, instance}) => { checkSampleModule(module), checkSampleInstance(instance); })
+  .then(({module, instance}) => { checkSampleModule(module); checkSampleInstance(instance); })
   .then(() => postMessage("ok"))
   .catch(err => postMessage("fail: " + err));
 };
--- a/dom/promise/tests/unit/test_monitor_uncaught.js
+++ b/dom/promise/tests/unit/test_monitor_uncaught.js
@@ -79,19 +79,21 @@ add_task(async function test_observe_unc
       onLeftUncaught.observe(promise);
     },
     onConsumed(promise) {
       onConsumed.observe(promise);
     },
   };
 
   let resolveLater = function(delay = 20) {
+    // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
     return new Promise((resolve, reject) => setTimeout(resolve, delay));
   };
   let rejectLater = function(delay = 20) {
+    // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
     return new Promise((resolve, reject) => setTimeout(reject, delay));
   };
   let makeSamples = function* () {
     yield {
       promise: Promise.resolve(0),
       name: "Promise.resolve",
     };
     yield {
@@ -114,16 +116,18 @@ add_task(async function test_observe_unc
       promise: Promise.reject("Simple rejection"),
       leftUncaught: true,
       consumed: false,
       name: "Promise.reject",
     };
 
     // Reject a promise now, consume it later.
     let p = Promise.reject("Reject now, consume later");
+
+    // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
     setTimeout(() => p.catch(() => {
       info("Consumed promise");
     }), 200);
     yield {
       promise: p,
       leftUncaught: true,
       consumed: true,
       name: "Reject now, consume later",
@@ -256,12 +260,13 @@ add_task(async function test_uninstall_o
   Assert.ok(true, "The observer has observed an uncaught Promise.");
   deactivate.active = false;
   info("Removing the observer, it should not observe any further uncaught Promise.");
 
   info("Rejecting a Promise and waiting a little to give a chance to observers.");
   let wait = new Observer();
   Promise.reject("I am another uncaught rejection.");
   await wait.blocker;
+  // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
   await new Promise(resolve => setTimeout(resolve, 100));
   // Normally, `deactivate` should not be notified of the uncaught rejection.
   wait.active = false;
 });