Bug 1532935 - Enable ESLint for dom/promise (automatic changes). r=mccr8
authorAlec Gibson <violinmonkey42@gmail.com>
Tue, 25 Jun 2019 20:11:52 +0000
changeset 480075 f0b36a9e6be0076368bff7cfe6af2318ea6d2b13
parent 480074 b1c8bd117233e382d1eb0fb46c80ea467ede4fb3
child 480076 d077bc76802d9c6ee4b23fd03fd6ef560ea700a3
push id36201
push usercsabou@mozilla.com
push dateWed, 26 Jun 2019 03:57:29 +0000
treeherdermozilla-central@a3cad1d7836c [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 (automatic changes). r=mccr8 # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D29645
dom/promise/tests/file_promise_and_timeout_ordering.js
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/test_on_new_promise.html
dom/promise/tests/test_on_promise_settled.html
dom/promise/tests/test_on_promise_settled_duplicates.html
dom/promise/tests/test_promise.html
dom/promise/tests/test_promise_and_timeout_ordering.html
dom/promise/tests/test_promise_argument.html
dom/promise/tests/test_promise_argument_xrays.html
dom/promise/tests/test_promise_callback_retval.html
dom/promise/tests/test_promise_retval.html
dom/promise/tests/test_promise_retval_xrays.html
dom/promise/tests/test_promise_uncatchable_exception.html
dom/promise/tests/test_promise_utils.html
dom/promise/tests/test_promise_xrays.html
dom/promise/tests/test_resolve.html
dom/promise/tests/test_resolver_return_value.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/test_webassembly_compile_worker_terminate.js
dom/promise/tests/unit/test_monitor_uncaught.js
--- a/dom/promise/tests/file_promise_and_timeout_ordering.js
+++ b/dom/promise/tests/file_promise_and_timeout_ordering.js
@@ -1,18 +1,18 @@
 var log = [];
 var resolvedPromise = Promise.resolve(null);
 function schedulePromiseTask(f) {
   resolvedPromise.then(f);
 }
 
 setTimeout(function() {
-  log.push('t1start');
+  log.push("t1start");
   schedulePromiseTask(function() {
-    log.push('promise');
+    log.push("promise");
   });
-  log.push('t1end');
+  log.push("t1end");
 }, 10);
 
 setTimeout(function() {
-  log.push('t2');
-  postMessage(log.join(', '));
+  log.push("t2");
+  postMessage(log.join(", "));
 }, 10);
--- a/dom/promise/tests/file_promise_argument_tests.js
+++ b/dom/promise/tests/file_promise_argument_tests.js
@@ -30,20 +30,20 @@ function passPrimitive(global) {
   return p.then(function(arg) {
     is(arg, 5, "Should have the arg we passed in");
   });
 }
 
 function passThenable(global) {
   var called = false;
   var thenable = {
-    then: function(f) {
+    then(f) {
       called = true;
       f(7);
-    }
+    },
   };
   var p = getPromise(global, thenable);
   verifyPromiseGlobal(p, global, "Promise wrapping thenable");
   return p.then(function(arg) {
     ok(called, "Thenable should have been called");
     is(arg, 7, "Should have the arg our thenable passed in");
   });
 }
--- a/dom/promise/tests/file_promise_retval_tests.js
+++ b/dom/promise/tests/file_promise_retval_tests.js
@@ -12,17 +12,17 @@
  *    promises.
  */
 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)
+    var expected = expectedExceptionGlobal(global);
     is(SpecialPowers.unwrap(SpecialPowers.Cu.getGlobalForObject(err)),
        expected,
        "Should have an exception object from the right global too");
     ok(err instanceof expected.DOMException,
        "Should have a DOMException here");
     is(Object.getPrototypeOf(err), expected.DOMException.prototype,
        "Should have a DOMException from the right global");
     is(err.name, "InvalidStateError", "Should have the right DOMException");
--- a/dom/promise/tests/file_promise_xrays.html
+++ b/dom/promise/tests/file_promise_xrays.html
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
   <script>
     function vendGetter(name) {
-      return function() { throw "Getting " + String(name) };
+      return function() { throw "Getting " + String(name); };
     }
     function vendSetter(name) {
-      return function() { throw "Setting " + String(name) };
+      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);
         propNames = propNames.concat(Object.getOwnPropertySymbols(obj));
         for (var propName of propNames) {
--- a/dom/promise/tests/test_on_new_promise.html
+++ b/dom/promise/tests/test_on_new_promise.html
@@ -16,30 +16,30 @@ Debugger.prototype.onNewPromise.
 </head>
 <body>
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
   <script type="application/javascript">
-  is(Object.prototype.toString.call(new Promise(function () {})),
+  is(Object.prototype.toString.call(new Promise(function() {})),
      "[object Promise]",
      "We should have the native DOM promise implementation.");
 
   const {addDebuggerToGlobal} = ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
   var dbgGlobal = new Cu.Sandbox(document.nodePrincipal,
                                  {freshCompartment: true});
   addDebuggerToGlobal(dbgGlobal);
   var dbg = new dbgGlobal.Debugger(this);
 
   var wrappedPromise;
-  dbg.onNewPromise = function (wp) { wrappedPromise = wp; };
+  dbg.onNewPromise = function(wp) { wrappedPromise = wp; };
 
-  var promise = new Promise(function () {});
+  var promise = new Promise(function() {});
   debugger;
   ok(wrappedPromise);
   is(wrappedPromise.unsafeDereference(), promise);
   </script>
 </pre>
 </body>
 </html>
 
--- a/dom/promise/tests/test_on_promise_settled.html
+++ b/dom/promise/tests/test_on_promise_settled.html
@@ -18,37 +18,37 @@ Debugger.prototype.onPromiseResolved.
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
   <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
-  is(Object.prototype.toString.call(new Promise(function () {})),
+  is(Object.prototype.toString.call(new Promise(function() {})),
      "[object Promise]",
      "We should have the native DOM promise implementation.");
 
   const {addDebuggerToGlobal} = ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
   var dbgGlobal = new Cu.Sandbox(document.nodePrincipal,
                                  {freshCompartment: true});
   addDebuggerToGlobal(dbgGlobal);
   var dbg = new dbgGlobal.Debugger(this);
 
   var wrappedPromise;
-  dbg.onPromiseSettled = function (wp) { wrappedPromise = wp; };
+  dbg.onPromiseSettled = function(wp) { wrappedPromise = wp; };
 
   var promise = Promise.resolve();
   promise
-    .then(function () {
+    .then(function() {
       ok(wrappedPromise);
       is(wrappedPromise.unsafeDereference(), promise);
       dbg.onPromiseSettled = undefined;
     })
-    .catch(function (e) {
+    .catch(function(e) {
       ok(false, "Got an unexpected error: " + e);
     })
     .then(SimpleTest.finish);
   </script>
 </pre>
 </body>
 </html>
 
--- a/dom/promise/tests/test_on_promise_settled_duplicates.html
+++ b/dom/promise/tests/test_on_promise_settled_duplicates.html
@@ -17,43 +17,43 @@ Bug 1084065 - Test that Debugger.prototy
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
   <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
 
-  is(Object.prototype.toString.call(new Promise(function () {})),
+  is(Object.prototype.toString.call(new Promise(function() {})),
      "[object Promise]",
      "We should have the native DOM promise implementation.");
 
   const {addDebuggerToGlobal} = ChromeUtils.import("resource://gre/modules/jsdebugger.jsm");
   var dbgGlobal = new Cu.Sandbox(document.nodePrincipal,
                                  {freshCompartment: true});
   addDebuggerToGlobal(dbgGlobal);
   var dbg = new dbgGlobal.Debugger(this);
 
   var seen = new Set();
-  dbg.onPromiseSettled = function (wp) {
+  dbg.onPromiseSettled = function(wp) {
     is(seen.has(wp), false);
     seen.add(wp);
   };
 
-  var promise = new Promise(function (fulfill, reject) {
+  var promise = new Promise(function(fulfill, reject) {
     fulfill(1);
     fulfill(2);
     fulfill(3);
   });
 
   promise
-    .then(function () {
+    .then(function() {
       dbg.onPromiseSettled = undefined;
     })
-    .catch(function (e) {
+    .catch(function(e) {
       ok(false, "Got an unexpected error: " + e);
     })
     .then(SimpleTest.finish);
   </script>
 </pre>
 </body>
 </html>
 
--- a/dom/promise/tests/test_promise.html
+++ b/dom/promise/tests/test_promise.html
@@ -164,18 +164,17 @@ function promiseAsync_ResolveThenTimeout
 
     // Allow other assertions to run so the test could fail before the next one.
     setTimeout(runTest, 0);
   }, 0);
 
   ok(!handlerExecuted, "Handlers are not called before 'then' returns.");
 }
 
-function promiseAsync_SyncXHR()
-{
+function promiseAsync_SyncXHR() {
   var handlerExecuted = false;
 
   Promise.resolve().then(function() {
     handlerExecuted = true;
 
     // Allow other assertions to run so the test could fail before the next one.
     setTimeout(runTest, 0);
   });
@@ -317,17 +316,17 @@ function promiseRejectThenCatchThen() {
     return what + 1;
   });
 
   isnot(promise, promise2, "These 2 promise objs are different");
 
   promise2.then(function(what) {
     ok(true, "Then.resolve has been called");
     is(what, 43, "Value == 43");
-    return what+1;
+    return what + 1;
   }).catch(function(what) {
     ok(false, "Catch has been called");
   }).then(function(what) {
     ok(true, "Then.resolve has been called");
     is(what, 44, "Value == 44");
     runTest();
   });
 }
@@ -335,21 +334,21 @@ function promiseRejectThenCatchThen() {
 function promiseRejectThenCatchThen2() {
   var promise = new Promise(function(resolve, reject) {
     reject(42);
   });
 
   promise.then(function(what) {
     ok(true, "Then.resolve has been called");
     is(what, 42, "Value == 42");
-    return what+1;
+    return what + 1;
   }).catch(function(what) {
     is(what, 42, "Value == 42");
     ok(true, "Catch has been called");
-    return what+1;
+    return what + 1;
   }).then(function(what) {
     ok(true, "Then.resolve has been called");
     is(what, 43, "Value == 43");
     runTest();
   });
 }
 
 function promiseRejectThenCatchExceptionThen() {
@@ -357,17 +356,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");
-    throw(what + 1);
+    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");
     runTest();
@@ -396,17 +395,17 @@ function promiseThenCatchOrderingResolve
     }, 0);
   });
 }
 
 function promiseThenCatchOrderingReject() {
   var global = 0;
   var f = new Promise(function(r1, r2) {
     r2(42);
-  })
+  });
 
   f.then(function() {}, function() {
     f.then(function() {
       global++;
     });
     f.catch(function() {
       global++;
     });
@@ -447,17 +446,17 @@ function promiseNestedPromise() {
   });
 }
 
 function promiseNestedNestedPromise() {
   new Promise(function(resolve, reject) {
     resolve(new Promise(function(resolve, reject) {
       ok(true, "Nested promise is executed");
       resolve(42);
-    }).then(function(what) { return what+1; }));
+    }).then(function(what) { return what + 1; }));
   }).then(function(value) {
     is(value, 43, "Nested promise is executed and then == 43");
     runTest();
   });
 }
 
 function promiseWrongNestedPromise() {
   new Promise(function(resolve, reject) {
@@ -519,78 +518,78 @@ function promiseResolveNestedPromise() {
     is(what, 42, "Value == 42");
     runTest();
   }, function() {
     ok(false, "This should not be called");
   });
 }
 
 function promiseSimpleThenableResolve() {
-  var thenable = { then: function(resolve) { resolve(5); } };
+  var thenable = { then(resolve) { resolve(5); } };
   var promise = new Promise(function(resolve, reject) {
     resolve(thenable);
   });
 
   promise.then(function(v) {
     ok(v === 5, "promiseSimpleThenableResolve");
     runTest();
   }, function(e) {
     ok(false, "promiseSimpleThenableResolve: Should not reject");
   });
 }
 
 function promiseSimpleThenableReject() {
-  var thenable = { then: function(resolve, reject) { reject(5); } };
+  var thenable = { then(resolve, reject) { reject(5); } };
   var promise = new Promise(function(resolve, reject) {
     resolve(thenable);
   });
 
   promise.then(function() {
     ok(false, "promiseSimpleThenableReject: Should not resolve");
     runTest();
   }, function(e) {
     ok(e === 5, "promiseSimpleThenableReject");
     runTest();
   });
 }
 
 function promiseThenableThrowsBeforeCallback() {
-  var thenable = { then: function(resolve) {
+  var thenable = { then(resolve) {
     throw new TypeError("Hi there");
     resolve(5);
   }};
 
   var promise = Promise.resolve(thenable);
   promise.then(function(v) {
     ok(false, "promiseThenableThrowsBeforeCallback: Should've rejected");
     runTest();
   }, function(e) {
     ok(e instanceof TypeError, "promiseThenableThrowsBeforeCallback");
     runTest();
   });
 }
 
 function promiseThenableThrowsAfterCallback() {
-  var thenable = { then: function(resolve) {
+  var thenable = { then(resolve) {
     resolve(5);
     throw new TypeError("Hi there");
   }};
 
   var promise = Promise.resolve(thenable);
   promise.then(function(v) {
     ok(v === 5, "promiseThenableThrowsAfterCallback");
     runTest();
   }, function(e) {
     ok(false, "promiseThenableThrowsAfterCallback: Should've resolved");
     runTest();
   });
 }
 
 function promiseThenableRejectThenResolve() {
-  var thenable = { then: function(resolve, reject) {
+  var thenable = { then(resolve, reject) {
     reject(new TypeError("Hi there"));
     resolve(5);
   }};
 
   var promise = Promise.resolve(thenable);
   promise.then(function(v) {
     ok(false, "promiseThenableRejectThenResolve should have rejected");
     runTest();
@@ -604,17 +603,17 @@ function promiseWithThenReplaced() {
   // Ensure that we call the 'then' on the promise and not the internal then.
   var promise = new Promise(function(resolve, reject) {
     resolve(5);
   });
 
   // Rogue `then` always rejects.
   promise.then = function(onFulfill, onReject) {
     onReject(new TypeError("Foo"));
-  }
+  };
 
   var promise2 = Promise.resolve(promise);
   promise2.then(function(v) {
     ok(false, "promiseWithThenReplaced: Should've rejected");
     runTest();
   }, function(e) {
     ok(e instanceof TypeError, "promiseWithThenReplaced");
     runTest();
@@ -634,30 +633,30 @@ function promiseStrictExecutorThisArg() 
   var promise = new Promise(function(resolve, reject) {
     "use strict";
     ok(this === undefined, "thisArg should be undefined.");
     runTest();
   });
 }
 
 function promiseResolveArray() {
-  var p = Promise.resolve([1,2,3]);
+  var p = Promise.resolve([1, 2, 3]);
   ok(p instanceof Promise, "Should return a Promise.");
   p.then(function(v) {
     ok(Array.isArray(v), "Resolved value should be an Array");
     is(v.length, 3, "Length should match");
     is(v[0], 1, "Resolved value should match original");
     is(v[1], 2, "Resolved value should match original");
     is(v[2], 3, "Resolved value should match original");
     runTest();
   });
 }
 
 function promiseResolveThenable() {
-  var p = Promise.resolve({ then: function(onFulfill, onReject) { onFulfill(2); } });
+  var p = Promise.resolve({ then(onFulfill, onReject) { onFulfill(2); } });
   ok(p instanceof Promise, "Should cast to a Promise.");
   p.then(function(v) {
     is(v, 2, "Should resolve to 2.");
     runTest();
   }, function(e) {
     ok(false, "promiseResolveThenable should've resolved");
     runTest();
   });
@@ -676,37 +675,37 @@ function promiseResolvePromise() {
 }
 
 // Bug 1009569.
 // Ensure that thenables are run on a clean stack asynchronously.
 // Test case adopted from
 // https://gist.github.com/getify/d64bb01751b50ed6b281#file-bug1-js.
 function promiseResolveThenableCleanStack() {
   function immed(s) { x++; s(); }
-  function incX(){ x++; }
+  function incX() { x++; }
 
   var x = 0;
   var thenable = { then: immed };
   var results = [];
 
   var p = Promise.resolve(thenable).then(incX);
   results.push(x);
 
   // check what happens after all "next cycle" steps
   // have had a chance to complete
-  setTimeout(function(){
+  setTimeout(function() {
     // Result should be [0, 2] since `thenable` will be called async.
     is(results[0], 0, "Expected thenable to be called asynchronously");
     // See Bug 1023547 comment 13 for why this check has to be gated on p.
     p.then(function() {
       results.push(x);
       is(results[1], 2, "Expected thenable to be called asynchronously");
       runTest();
     });
-  },1000);
+  }, 1000);
 }
 
 // Bug 1008467 - Promise fails with "too much recursion".
 // The bug was that the callbacks passed to a thenable would resolve the
 // promise synchronously when the fulfill handler returned a non-thenable.
 //
 // For example:
 // var p = new Promise(function(resolve) {
@@ -714,49 +713,47 @@ function promiseResolveThenableCleanStac
 // });
 // var m = Promise.resolve(p);
 //
 // At this point `m` is a Promise that is resolved with a thenable `p`, so it
 // calls `p.then()` with two callbacks, both of which would synchronously resolve
 // `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()
-{
+function promiseTestAsyncThenableResolution() {
   var k = 3000;
   Promise.resolve().then(function next() {
     k--;
     if (k > 0) return Promise.resolve().then(next);
-  }).then(function () {
+  }).then(function() {
     ok(true, "Resolution of a chain of thenables should not be synchronous.");
     runTest();
   });
 }
 
 // Bug 1062323
-function promiseWrapperAsyncResolution()
-{
-  var p = new Promise(function(resolve, reject){
+function promiseWrapperAsyncResolution() {
+  var p = new Promise(function(resolve, reject) {
     resolve();
   });
 
   var results = [];
-  var q = p.then(function () {
+  var q = p.then(function() {
     results.push("1-1");
-  }).then(function () {
+  }).then(function() {
     results.push("1-2");
-  }).then(function () {
+  }).then(function() {
     results.push("1-3");
   });
 
-  var r = p.then(function () {
+  var r = p.then(function() {
     results.push("2-1");
-  }).then(function () {
+  }).then(function() {
     results.push("2-2");
-  }).then(function () {
+  }).then(function() {
     results.push("2-3");
   });
 
   Promise.all([q, r]).then(function() {
     var match = results[0] == "1-1" &&
                 results[1] == "2-1" &&
                 results[2] == "1-2" &&
                 results[3] == "2-2" &&
--- a/dom/promise/tests/test_promise_and_timeout_ordering.html
+++ b/dom/promise/tests/test_promise_and_timeout_ordering.html
@@ -2,14 +2,14 @@
 <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>
 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.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_argument.html
+++ b/dom/promise/tests/test_promise_argument.html
@@ -25,17 +25,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   const isXrayArgumentTest = false;
 
   function getPromise(global, arg) {
     return global.TestFunctions.passThroughPromise(arg);
   }
 
   addLoadEvent(function() {
     frames[0].label = "child";
-    SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]},
+    SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]},
                               runPromiseArgumentTests.bind(undefined,
                                                            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>
--- a/dom/promise/tests/test_promise_argument_xrays.html
+++ b/dom/promise/tests/test_promise_argument_xrays.html
@@ -75,16 +75,16 @@ function nextTest() {
     SimpleTest.finish();
     return;
   }
   tests.shift()();
 }
 
 addLoadEvent(function() {
   frames[0].label = "child";
-  SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]},
+  SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]},
                             nextTest);
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/promise/tests/test_promise_callback_retval.html
+++ b/dom/promise/tests/test_promise_callback_retval.html
@@ -27,17 +27,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   var func;
   function getPromise(global, arg) {
     func = new global.Function("x", "return x").bind(undefined, arg);
     return TestFunctions.passThroughCallbackPromise(func);
   }
 
   addLoadEvent(function() {
     frames[0].label = "child";
-    SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]},
+    SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]},
                               runPromiseArgumentTests.bind(undefined,
                                                            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>
--- a/dom/promise/tests/test_promise_retval.html
+++ b/dom/promise/tests/test_promise_retval.html
@@ -27,17 +27,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]]},
+    SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]},
                               runPromiseRetvalTests.bind(undefined,
 							 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>
--- a/dom/promise/tests/test_promise_retval_xrays.html
+++ b/dom/promise/tests/test_promise_retval_xrays.html
@@ -79,16 +79,16 @@ function nextTest() {
     SimpleTest.finish();
     return;
   }
   tests.shift()();
 }
 
 addLoadEvent(function() {
   frames[0].label = "child";
-  SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]},
+  SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]},
                             nextTest);
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/promise/tests/test_promise_uncatchable_exception.html
+++ b/dom/promise/tests/test_promise_uncatchable_exception.html
@@ -14,22 +14,22 @@
 
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 onmessage = function(evt) {
   ok(true, "finished");
   SimpleTest.finish();
-}
+};
 
 function go() {
   var script = document.createElement("script");
   script.src = "promise_uncatchable_exception.js";
   document.body.appendChild(script);
 }
 
 SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]}, go);
+SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, go);
 </script>
 </pre>
 </body>
 </html>
--- a/dom/promise/tests/test_promise_utils.html
+++ b/dom/promise/tests/test_promise_utils.html
@@ -85,17 +85,17 @@ function promiseAllWaitsForAllPromises()
     }),
     new Promise(function(resolve) {
       setTimeout(resolve.bind(undefined, new Promise(function(resolve2) {
         resolve2(3);
       })), 10);
     }),
     new Promise(function(resolve) {
       setTimeout(resolve.bind(undefined, 4), 20);
-    })
+    }),
   ];
 
   var p = Promise.all(arr);
   p.then(function(values) {
     ok(Array.isArray(values), "Resolved value should be an array.");
     is(values.length, 4, "Resolved array length should match iterable's length.");
     is(values[0], 1, "Array values should match.");
     is(values[1], 2, "Array values should match.");
@@ -116,32 +116,32 @@ function promiseAllRejectFails() {
     new Promise(function(resolve, reject) {
       setTimeout(reject.bind(undefined, 2), 10);
     }),
     new Promise(function(resolve) {
       setTimeout(resolve.bind(undefined, 3), 10);
     }),
     new Promise(function(resolve) {
       setTimeout(resolve.bind(undefined, 4), 20);
-    })
+    }),
   ];
 
   var p = Promise.all(arr);
   p.then(function(values) {
     ok(false, "Promise.all shouldn't resolve when iterable has rejected Promises.");
     runTest();
   }, 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: function() { foo(); } }]);
+  var p = Promise.all([Promise.resolve(2), { then() { foo(); } }]);
   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();
   });
@@ -242,17 +242,17 @@ function promiseRaceIterable() {
   });
 }
 
 function promiseRaceReject() {
   var p = Promise.race([
     Promise.reject(new Error("Fail bad!")),
     new Promise(function(resolve) {
       setTimeout(resolve, 0);
-    })
+    }),
   ]);
 
   p.then(function() {
     ok(false, "Should not resolve when winning Promise rejected.");
     runTest();
   }, function(e) {
     ok(true, "Should be rejected");
     ok(e instanceof Error, "Should reject with Error.");
@@ -263,17 +263,17 @@ function promiseRaceReject() {
 
 function promiseRaceThrow() {
   var p = Promise.race([
     new Promise(function(resolve) {
       nonExistent();
     }),
     new Promise(function(resolve) {
       setTimeout(resolve, 0);
-    })
+    }),
   ]);
 
   p.then(function() {
     ok(false, "Should not resolve when winning Promise had an error.");
     runTest();
   }, function(e) {
     ok(true, "Should be rejected");
     ok(e instanceof ReferenceError, "Should reject with ReferenceError for function nonExistent().");
--- a/dom/promise/tests/test_promise_xrays.html
+++ b/dom/promise/tests/test_promise_xrays.html
@@ -265,48 +265,48 @@ function testReject2() {
     function(e) {
       is(e, 42, "Rejecting an Xray to a promise with TestingFunctions rejectPromise should work");
     }
   ).then(nextTest);
 }
 
 function testThen1() {
   var p = win.Promise.resolve(5);
-  var q = p.then((x) => x*x);
+  var q = p.then((x) => x * x);
   ok(q instanceof win.Promise,
      "Promise.then should return a promise from the right global");
   q.then(
     function(arg) {
       is(arg, 25, "Promise.then should work");
     },
     function(e) {
       ok(false, "Promise.then should not fail");
     }
   ).then(nextTest);
 }
 
 function testThen2() {
   var p = win.Promise.resolve(5);
-  var q = p.then((x) => Promise.resolve(x*x));
+  var q = p.then((x) => Promise.resolve(x * x));
   ok(q instanceof win.Promise,
      "Promise.then should return a promise from the right global");
   q.then(
     function(arg) {
       is(arg, 25, "Promise.then resolved with chrome promise should work");
     },
     function(e) {
       ok(false, "Promise.then resolved with chrome promise should not fail");
     }
   ).then(nextTest);
 }
 
 function testCatch1() {
   var p = win.Promise.reject(5);
   ok(p instanceof win.Promise, "Promise.reject should return a promise");
-  var q = p.catch((x) => x*x);
+  var q = p.catch((x) => x * x);
   ok(q instanceof win.Promise,
      "Promise.catch should return a promise from the right global");
   q.then(
     function(arg) {
       is(arg, 25, "Promise.catch should work");
     },
     function(e) {
       ok(false, "Promise.catch should not fail");
--- a/dom/promise/tests/test_resolve.html
+++ b/dom/promise/tests/test_resolve.html
@@ -23,17 +23,17 @@ var tests = [
   true,
   false,
   {},
   { a: 42 },
   [ 1, 2, 3, 4, null, true, "hello world" ],
   function() {},
   window,
   undefined,
-  document.createElement('input'),
+  document.createElement("input"),
   new Date(),
 ];
 
 function cbError() {
   ok(false, "Nothing should arrive here!");
 }
 
 function runTest() {
@@ -45,17 +45,17 @@ function runTest() {
   var test = tests.pop();
 
   new Promise(function(resolve, reject) {
     resolve(test);
   }).then(function(what) {
     ok(test === what, "What is: " + what);
   }, cbError).then(function() {
     new Promise(function(resolve, reject) {
-      reject(test)
+      reject(test);
     }).then(cbError, function(what) {
       ok(test === what, "What is: " + what);
     }).then(runTest, cbError);
   });
 }
 
 SimpleTest.waitForExplicitFinish();
 runTest();
--- a/dom/promise/tests/test_resolver_return_value.html
+++ b/dom/promise/tests/test_resolver_return_value.html
@@ -12,21 +12,21 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   /** Test for Bug 1120235 **/
   var res, rej;
   var p = new Promise(function(resolve, reject) { res = resolve; rej = reject; });
   is(res(1), undefined, "Resolve function should return undefined");
   is(rej(2), undefined, "Reject function should return undefined");
 
   var thenable = {
-    then: function(resolve, reject) {
+    then(resolve, reject) {
       is(resolve(3), undefined, "Thenable resolve argument should return undefined");
       is(reject(4), undefined, "Thenable reject argument should return undefined");
       SimpleTest.finish();
-    }
+    },
   };
 
   SimpleTest.waitForExplicitFinish();
   p = Promise.resolve(thenable);
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1120235">Mozilla Bug 1120235</a>
--- a/dom/promise/tests/test_species_getter.html
+++ b/dom/promise/tests/test_species_getter.html
@@ -14,11 +14,10 @@ test(function() {
   assert_equals(desc.set, undefined, "Should not have a setter");
   var getter = desc.get;
 
   var things = [undefined, null, 5, "xyz", Promise, Object];
   for (var thing of things) {
     assert_equals(getter.call(thing), thing,
                   "Getter should return its this value");
   }
-
 }, "Promise should have an @@species getter that works per spec");
 </script>
--- a/dom/promise/tests/test_thenable_vs_promise_ordering.html
+++ b/dom/promise/tests/test_thenable_vs_promise_ordering.html
@@ -7,17 +7,17 @@
 <script>
 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);
-  }
+  };
   var p1 = new Promise(function(r) { r(p0); });
   delete p0.then;
   var p2 = new Promise(function(r) { r(p0); });
   var resolutionOrder = "";
   Promise.all([ p1.then(function() { resolutionOrder += "1"; }),
                 p2.then(function() { resolutionOrder += "2"; }) ])
          .then(t.step_func_done(function() {
            assert_true(customThenCalled, "Should have called custom then");
--- a/dom/promise/tests/test_webassembly_compile.html
+++ b/dom/promise/tests/test_webassembly_compile.html
@@ -6,24 +6,24 @@
 <head>
   <title>WebAssembly.compile Test</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 <script>
 const wasmTextToBinary = SpecialPowers.unwrap(SpecialPowers.Cu.getJSTestingFunctions().wasmTextToBinary);
-const wasmIsSupported = SpecialPowers.Cu.getJSTestingFunctions().wasmIsSupported
+const wasmIsSupported = SpecialPowers.Cu.getJSTestingFunctions().wasmIsSupported;
 
 // The test_webassembly_compile_sample.wasm is a medium-sized module with 100
 // functions that call each other recursively, returning a computed sum.
 // Any other non-trivial module could be generated and used.
 var sampleCode;
-const sampleURL = 'test_webassembly_compile_sample.wasm';
-const sampleExportName = 'run';
+const sampleURL = "test_webassembly_compile_sample.wasm";
+const sampleExportName = "run";
 const sampleResult = 1275;
 
 function checkSampleModule(m) {
   ok(m instanceof WebAssembly.Module, "got a module");
   var i = new WebAssembly.Instance(m);
   ok(i instanceof WebAssembly.Instance, "got an instance");
   ok(i.exports[sampleExportName]() === sampleResult, "got result");
 }
@@ -31,64 +31,64 @@ function checkSampleModule(m) {
 function checkSampleInstance(i) {
   ok(i instanceof WebAssembly.Instance, "got a module");
   ok(i.exports[sampleExportName]() === sampleResult, "got result");
 }
 
 function fetchSampleModuleCode() {
   fetch(sampleURL)
   .then(response => response.arrayBuffer())
-  .then(buffer => {sampleCode = buffer; runTest()})
+  .then(buffer => { sampleCode = buffer; runTest(); })
   .catch(err => ok(false, String(err)));
 }
 
 function propertiesExist() {
   if (!wasmIsSupported()) {
-    ok(!this["WebAssembly"], "If the device doesn't support, there will be no WebAssembly object");
+    ok(!this.WebAssembly, "If the device doesn't support, there will be no WebAssembly object");
     SimpleTest.finish();
     return;
   }
 
   ok(WebAssembly, "WebAssembly object should exist");
   ok(WebAssembly.compile, "WebAssembly.compile function should exist");
   runTest();
 }
 
 function compileFail() {
   WebAssembly.compile().then(
-    () => { ok(false, "should have failed"); runTest() }
+    () => { ok(false, "should have failed"); runTest(); }
   ).catch(
-    err => { ok(err instanceof TypeError, "empty compile failed"); runTest() }
+    err => { ok(err instanceof TypeError, "empty compile failed"); runTest(); }
   );
 }
 
 function compileSuccess() {
   WebAssembly.compile(sampleCode).then(
-    m => { checkSampleModule(m); runTest() }
+    m => { checkSampleModule(m); runTest(); }
   ).catch(
-    err => { ok(false, String(err)); runTest() }
+    err => { ok(false, String(err)); runTest(); }
   );
 }
 
 function compileManySuccess() {
   const N = 100;
 
   var arr = [];
   for (var i = 0; i < N; i++)
     arr.push(WebAssembly.compile(sampleCode));
 
   SpecialPowers.gc();
 
-  Promise.all(arr).then (ms => {
+  Promise.all(arr).then(ms => {
     ok(ms.length === N, "got the right number");
     for (var i = 0; i < N; i++)
       checkSampleModule(ms[i]);
     runTest();
   }).catch(
-    err => { ok(false, String(err)); runTest() }
+    err => { ok(false, String(err)); runTest(); }
   );
 }
 
 function terminateCompileInWorker() {
     var w = new Worker(`data:text/plain,
       var sampleCode;
       function spawnWork() {
         const N = 100;
@@ -103,164 +103,164 @@ function terminateCompileInWorker() {
         postMessage("ok");
       }
     `);
     w.postMessage(sampleCode);
     w.onmessage = e => {
       ok(e.data === "ok", "worker finished first step");
       w.terminate();
       runTest();
-    }
+    };
 }
 
 function instantiateFail() {
   WebAssembly.instantiate().then(
-    () => { ok(false, "should have failed"); runTest() }
+    () => { ok(false, "should have failed"); runTest(); }
   ).catch(
-    err => { ok(err instanceof TypeError, "empty compile failed"); runTest() }
+    err => { ok(err instanceof TypeError, "empty compile failed"); runTest(); }
   );
 }
 
 function instantiateSuccess() {
   WebAssembly.instantiate(sampleCode).then(
-    r => { checkSampleModule(r.module); checkSampleInstance(r.instance); runTest() }
+    r => { checkSampleModule(r.module); checkSampleInstance(r.instance); runTest(); }
   ).catch(
-    err => { ok(false, String(err)); runTest() }
+    err => { ok(false, String(err)); runTest(); }
   );
 }
 
 function chainSuccess() {
   WebAssembly.compile(sampleCode).then(
     m => WebAssembly.instantiate(m)
   ).then(
-    i => { checkSampleInstance(i); runTest() }
+    i => { checkSampleInstance(i); runTest(); }
   ).catch(
-    err => { ok(false, String(err)); runTest() }
+    err => { ok(false, String(err)); runTest(); }
   );
 }
 
 function compileStreamingNonResponse() {
   WebAssembly.compileStreaming({})
-  .then(() => { ok(false) })
-  .catch(err => { ok(err instanceof TypeError, "rejected {}"); runTest() });
+  .then(() => { ok(false); })
+  .catch(err => { ok(err instanceof TypeError, "rejected {}"); runTest(); });
 }
 
 function compileStreamingNoMime() {
   WebAssembly.compileStreaming(new Response(new ArrayBuffer()))
-  .then(() => { ok(false) })
-  .catch(err => { ok(err instanceof TypeError, "rejected no MIME type"); runTest() });
+  .then(() => { ok(false); })
+  .catch(err => { ok(err instanceof TypeError, "rejected no MIME type"); runTest(); });
 }
 
 function compileStreamingBadMime() {
   var badMimes = [
-    '',
-    'application/js',
-    'application/js;application/wasm',
-    'application/wasm;application/js',
-    'application/wasm;',
-    'application/wasm1'
+    "",
+    "application/js",
+    "application/js;application/wasm",
+    "application/wasm;application/js",
+    "application/wasm;",
+    "application/wasm1",
   ];
   var promises = [];
   for (let mimeType of badMimes) {
-    var init = { headers: { 'Content-Type' : mimeType } };
+    var init = { headers: { "Content-Type": mimeType } };
     promises.push(
       WebAssembly.compileStreaming(new Response(sampleCode, init))
       .then(() => Promise.reject(), err => Promise.resolve())
     );
   }
   Promise.all(promises)
-  .then(() => { ok(true, "all bad MIME types rejected"); runTest() })
+  .then(() => { ok(true, "all bad MIME types rejected"); runTest(); });
 }
 
 function compileStreamingGoodMime() {
   var badMimes = [
-    'application/wasm',
-    '   application/wasm ',
-    'application/wasm   '
+    "application/wasm",
+    "   application/wasm ",
+    "application/wasm   ",
   ];
   var promises = [];
   for (let mimeType of badMimes) {
-    var init = { headers: { 'Content-Type' : mimeType } };
+    var init = { headers: { "Content-Type": mimeType } };
     promises.push(
       WebAssembly.compileStreaming(new Response(sampleCode, init))
     );
   }
   Promise.all(promises)
-  .then(() => { ok(true, "all good MIME types accepted"); runTest() })
+  .then(() => { ok(true, "all good MIME types accepted"); runTest(); });
 }
 
 function compileStreamingDoubleUseFail() {
   fetch(sampleURL)
   .then(response => {
       WebAssembly.compileStreaming(response)
       .then(m => {
         checkSampleModule(m);
-        return WebAssembly.compileStreaming(response)
+        return WebAssembly.compileStreaming(response);
       })
       .then(
         () => ok(false, "should have failed on second use"),
-        err => { ok(true, "failed on second use"); runTest() }
+        err => { ok(true, "failed on second use"); runTest(); }
       );
   });
 }
 
 function compileStreamingNullBody() {
-  var init = { headers: { 'Content-Type' : 'application/wasm' } };
+  var init = { headers: { "Content-Type": "application/wasm" } };
   WebAssembly.compileStreaming(new Response(undefined, init))
-  .then(() => { ok(false) })
-  .catch(err => { ok(err instanceof WebAssembly.CompileError, "null body"); runTest() });
+  .then(() => { ok(false); })
+  .catch(err => { ok(err instanceof WebAssembly.CompileError, "null body"); runTest(); });
 }
 
 function compileStreamingFetch() {
   WebAssembly.compileStreaming(fetch(sampleURL))
   .then(m => { checkSampleModule(m); runTest(); })
-  .catch(err => { ok(false, String(err)) });
+  .catch(err => { ok(false, String(err)); });
 }
 
 function instantiateStreamingFetch() {
   WebAssembly.instantiateStreaming(fetch(sampleURL))
-  .then(({module,instance}) => { checkSampleModule(module); checkSampleInstance(instance); runTest(); })
-  .catch(err => { ok(false, String(err)) });
+  .then(({module, instance}) => { checkSampleModule(module); checkSampleInstance(instance); runTest(); })
+  .catch(err => { ok(false, String(err)); });
 }
 
 function compileManyStreamingFetch() {
   const N = 20;
 
   var arr = [];
   for (var i = 0; i < N; i++)
     arr.push(WebAssembly.compileStreaming(fetch(sampleURL)));
 
   SpecialPowers.gc();
 
-  Promise.all(arr).then (ms => {
+  Promise.all(arr).then(ms => {
     ok(ms.length === N, "got the right number");
     for (var i = 0; i < N; i++)
       checkSampleModule(ms[i]);
     runTest();
   }).catch(
-    err => { ok(false, String(err)); runTest() }
+    err => { ok(false, String(err)); runTest(); }
   );
 }
 
 function runWorkerTests() {
-  var w = new Worker('test_webassembly_compile_worker.js');
+  var w = new Worker("test_webassembly_compile_worker.js");
   w.postMessage(sampleCode);
   w.onmessage = e => {
     ok(e.data === "ok", "worker test: " + e.data);
     runTest();
-  }
+  };
 }
 
 function terminateCompileStreamingInWorker() {
-  var w = new Worker('test_webassembly_compile_worker_terminate.js');
+  var w = new Worker("test_webassembly_compile_worker_terminate.js");
   w.onmessage = e => {
     ok(e.data === "ok", "worker streaming terminate test: " + e.data);
     w.terminate();
     runTest();
-  }
+  };
 }
 
 var tests = [ propertiesExist,
               compileFail,
               compileSuccess,
               compileManySuccess,
               terminateCompileInWorker,
               instantiateFail,
@@ -271,17 +271,17 @@ var tests = [ propertiesExist,
               compileStreamingBadMime,
               compileStreamingGoodMime,
               compileStreamingDoubleUseFail,
               compileStreamingNullBody,
               compileStreamingFetch,
               instantiateStreamingFetch,
               compileManyStreamingFetch,
               runWorkerTests,
-              terminateCompileStreamingInWorker
+              terminateCompileStreamingInWorker,
             ];
 
 // This initialization must always run
 tests.unshift(fetchSampleModuleCode);
 
 function runTest() {
   if (!tests.length) {
     SimpleTest.finish();
--- a/dom/promise/tests/test_webassembly_compile_worker.js
+++ b/dom/promise/tests/test_webassembly_compile_worker.js
@@ -1,10 +1,10 @@
-const sampleURL = 'test_webassembly_compile_sample.wasm';
-const sampleExportName = 'run';
+const sampleURL = "test_webassembly_compile_sample.wasm";
+const sampleExportName = "run";
 const sampleResult = 1275;
 
 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";
@@ -14,26 +14,26 @@ function checkSampleModule(m) {
 
 function checkSampleInstance(i) {
   if (!(i instanceof WebAssembly.Instance))
     throw "not an instance";
   if (i.exports[sampleExportName]() !== sampleResult)
     throw "wrong result";
 }
 
-const initObj = { headers: { 'Content-Type' : 'application/wasm' } };
+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/test_webassembly_compile_worker_terminate.js
+++ b/dom/promise/tests/test_webassembly_compile_worker_terminate.js
@@ -1,9 +1,9 @@
-const sampleURL = 'test_webassembly_compile_sample.wasm';
+const sampleURL = "test_webassembly_compile_sample.wasm";
 
 function spawnWork() {
   const N = 50;
   var arr = [];
   for (var i = 0; i < N; i++)
     arr.push(WebAssembly.compileStreaming(fetch(sampleURL)));
   Promise.all(arr).then(spawnWork);
 }
--- a/dom/promise/tests/unit/test_monitor_uncaught.js
+++ b/dom/promise/tests/unit/test_monitor_uncaught.js
@@ -40,73 +40,72 @@ add_task(async function test_observe_unc
   // The results for UncaughtPromiseObserver callbacks.
   let CallbackResults = function(name) {
     this.name = name;
     this.expected = new Set();
     this.observed = new Set();
     this.blocker = new Promise(resolve => this.resolve = resolve);
   };
   CallbackResults.prototype = {
-    observe: function(promise) {
+    observe(promise) {
       info(this.name + " observing Promise " + names.get(promise));
       Assert.equal(PromiseDebugging.getState(promise).state, "rejected",
                    this.name + " observed a rejected Promise");
       if (!this.expected.has(promise)) {
         Assert.ok(false,
             this.name + " observed a Promise that it expected to observe, " +
             names.get(promise) +
             " (" + PromiseDebugging.getPromiseID(promise) +
             ", " + PromiseDebugging.getAllocationStack(promise) + ")");
-
       }
       Assert.ok(this.expected.delete(promise),
                 this.name + " observed a Promise that it expected to observe, " +
-                names.get(promise)  + " (" + PromiseDebugging.getPromiseID(promise) + ")");
+                names.get(promise) + " (" + PromiseDebugging.getPromiseID(promise) + ")");
       Assert.ok(!this.observed.has(promise),
                 this.name + " observed a Promise that it has not observed yet");
       this.observed.add(promise);
       if (this.expected.size == 0) {
         this.resolve();
       } else {
         info(this.name + " is still waiting for " + this.expected.size + " observations:");
         info(JSON.stringify(Array.from(this.expected.values(), (x) => names.get(x))));
       }
     },
   };
 
   let onLeftUncaught = new CallbackResults("onLeftUncaught");
   let onConsumed = new CallbackResults("onConsumed");
 
   let observer = {
-    onLeftUncaught: function(promise, data) {
+    onLeftUncaught(promise, data) {
       onLeftUncaught.observe(promise);
     },
-    onConsumed: function(promise) {
+    onConsumed(promise) {
       onConsumed.observe(promise);
     },
   };
 
   let resolveLater = function(delay = 20) {
     return new Promise((resolve, reject) => setTimeout(resolve, delay));
   };
   let rejectLater = function(delay = 20) {
     return new Promise((resolve, reject) => setTimeout(reject, delay));
   };
-  let makeSamples = function*() {
+  let makeSamples = function* () {
     yield {
       promise: Promise.resolve(0),
       name: "Promise.resolve",
     };
     yield {
       promise: Promise.resolve(resolve => resolve(0)),
       name: "Resolution callback",
     };
     yield {
       promise: Promise.resolve(0).catch(null),
-      name: "`catch(null)`"
+      name: "`catch(null)`",
     };
     yield {
       promise: Promise.reject(0).catch(() => {}),
       name: "Reject and catch immediately",
     };
     yield {
       promise: resolveLater(),
       name: "Resolve later",
@@ -128,33 +127,33 @@ add_task(async function test_observe_unc
       leftUncaught: true,
       consumed: true,
       name: "Reject now, consume later",
     };
 
     yield {
       promise: Promise.all([
         Promise.resolve("Promise.all"),
-        rejectLater()
+        rejectLater(),
       ]),
       leftUncaught: true,
-      name: "Rejecting through Promise.all"
+      name: "Rejecting through Promise.all",
     };
     yield {
       promise: Promise.race([
         resolveLater(500),
         Promise.reject(),
       ]),
       leftUncaught: true, // The rejection wins the race.
       name: "Rejecting through Promise.race",
     };
     yield {
       promise: Promise.race([
         Promise.resolve(),
-        rejectLater(500)
+        rejectLater(500),
       ]),
       leftUncaught: false, // The resolution wins the race.
       name: "Resolving through Promise.race",
     };
 
     let boom = new Error("`throw` in the constructor");
     yield {
       promise: new Promise(() => { throw boom; }),
@@ -236,21 +235,21 @@ add_task(async function test_uninstall_o
     set active(x) {
       this._active = x;
       if (x) {
         PromiseDebugging.addUncaughtRejectionObserver(this);
       } else {
         PromiseDebugging.removeUncaughtRejectionObserver(this);
       }
     },
-    onLeftUncaught: function() {
+    onLeftUncaught() {
       Assert.ok(this._active, "This observer is active.");
       this.resolve();
     },
-    onConsumed: function() {
+    onConsumed() {
       Assert.ok(false, "We should not consume any Promise.");
     },
   };
 
   info("Adding an observer.");
   let deactivate = new Observer();
   Promise.reject("I am an uncaught rejection.");
   await deactivate.blocker;
@@ -261,12 +260,8 @@ add_task(async function test_uninstall_o
   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;
   await new Promise(resolve => setTimeout(resolve, 100));
   // Normally, `deactivate` should not be notified of the uncaught rejection.
   wait.active = false;
 });
-
-function run_test() {
-  run_next_test();
-}