Bug 1508988 - Enable ESLint for dom/abort/, dom/asmjscache/, dom/battery/, dom/broadcastchannel/ and dom/console/ (automatic changes). r=Standard8,nika
authorAlex Kong <jrkong.hfd@gmail.com>
Wed, 19 Dec 2018 22:38:44 +0000
changeset 511405 b15b5b6dbce20140369dbe829b26f7fdbb0bf93a
parent 511404 1a8798cea67c7c12354545172447be1c70cd6549
child 511406 2326b807ec861bee551dc8a7f737845357a36919
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, nika
bugs1508988
milestone66.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 1508988 - Enable ESLint for dom/abort/, dom/asmjscache/, dom/battery/, dom/broadcastchannel/ and dom/console/ (automatic changes). r=Standard8,nika Differential Revision: https://phabricator.services.mozilla.com/D14131
.eslintignore
dom/asmjscache/test/file_slow.js
dom/asmjscache/test/test_cachingBasic.html
dom/asmjscache/test/test_cachingMulti.html
dom/asmjscache/test/test_slow.html
dom/asmjscache/test/test_workers.html
dom/battery/test/test_battery_basics.html
dom/battery/test/test_battery_charging.html
dom/battery/test/test_battery_discharging.html
dom/broadcastchannel/tests/broadcastchannel_sharedWorker.js
dom/broadcastchannel/tests/broadcastchannel_worker.js
dom/broadcastchannel/tests/broadcastchannel_worker_alive.js
dom/broadcastchannel/tests/broadcastchannel_worker_any.js
dom/broadcastchannel/tests/browser_private_browsing.js
dom/broadcastchannel/tests/file_mozbrowser.html
dom/broadcastchannel/tests/file_mozbrowser2.html
dom/broadcastchannel/tests/iframe_broadcastchannel.html
dom/broadcastchannel/tests/iframe_mozbrowser.html
dom/broadcastchannel/tests/iframe_mozbrowser2.html
dom/broadcastchannel/tests/test_bfcache.html
dom/broadcastchannel/tests/test_broadcastchannel_any.html
dom/broadcastchannel/tests/test_broadcastchannel_basic.html
dom/broadcastchannel/tests/test_broadcastchannel_close.html
dom/broadcastchannel/tests/test_broadcastchannel_close2.html
dom/broadcastchannel/tests/test_broadcastchannel_self.html
dom/broadcastchannel/tests/test_broadcastchannel_sharedWorker.html
dom/broadcastchannel/tests/test_broadcastchannel_worker.html
dom/broadcastchannel/tests/test_broadcastchannel_worker_alive.html
dom/broadcastchannel/tests/test_dataCloning.html
dom/broadcastchannel/tests/test_dataURL.html
dom/broadcastchannel/tests/test_event_listener_leaks.html
dom/broadcastchannel/tests/test_invalidState.html
dom/broadcastchannel/tests/test_ordering.html
dom/console/ConsoleAPIStorage.js
dom/console/tests/console.jsm
dom/console/tests/test_bug659625.html
dom/console/tests/test_bug978522.html
dom/console/tests/test_console_binding.html
dom/console/tests/test_count.html
dom/console/tests/test_devtools_pref.html
dom/console/tests/xpcshell/test_basic.js
dom/console/tests/xpcshell/test_reportForServiceWorkerScope.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -161,32 +161,27 @@ devtools/client/webconsole/test/mochites
 devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
 devtools/server/tests/unit/setBreakpoint*
 devtools/server/tests/unit/sourcemapped.js
 
 # devtools specific format test file
 devtools/server/tests/unit/xpcshell_debugging_script.js
 
 # dom/ exclusions
-dom/abort/**
 dom/animation/**
-dom/asmjscache/**
-dom/battery/**
 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/broadcastchannel/**
 dom/browser-element/**
 dom/cache/test/mochitest/**
 dom/cache/test/xpcshell/**
 dom/canvas/**
-dom/console/**
 dom/encoding/**
 dom/events/**
 dom/fetch/**
 dom/file/**
 dom/flex/**
 dom/grid/**
 dom/html/**
 dom/jsurl/**
--- a/dom/asmjscache/test/file_slow.js
+++ b/dom/asmjscache/test/file_slow.js
@@ -1,22 +1,22 @@
-function f1() { "use asm"; function g() {} return g }
+function f1() { "use asm"; function g() {} return g; }
 if (this.jsFuns) {
     ok(jsFuns.isAsmJSModule(f1), "f1 is an asm.js module");
     ok(jsFuns.isAsmJSFunction(f1()), "f1.g is an asm.js function");
 }
 
 function f2(stdlib, foreign, buffer) {
     "use asm";
     var i32 = new stdlib.Int32Array(buffer);
     function main(n) {
         n = n|0;
         var i = 0, sum = 0;
-        for (; (i|0) < (n|0); i=(i+1)|0)
-            sum = (sum + (i32[(i<<2)>>2]|0))|0;
+        for (; (i|0) < (n|0); i=(i + 1)|0)
+            sum = (sum + (i32[(i << 2) >> 2]|0))|0;
         return sum|0;
     }
     return main;
 }
 if (this.jsFuns)
     ok(jsFuns.isAsmJSModule(f2), "f2 is an asm.js module");
 var i32 = new Int32Array(16384); // Smallest allowed buffer size is 64KBy
 for (var i = 0; i < i32.length; i++)
@@ -36,34 +36,34 @@ if (f2Main(i32.length + 100) !== sum)
 
 function f3(stdlib, foreign, buffer) {
     "use asm";
     var done = foreign.done;
     var i32 = new stdlib.Int32Array(buffer);
     function main() {
         var i = 0, sum = 0;
         while (1) {
-            for (i = 0; (i|0) < 1000; i=(i+1)|0)
+            for (i = 0; (i|0) < 1000; i=(i + 1)|0)
                 sum = (sum + i)|0;
             if (done(sum|0)|0)
                 break;
         }
         return sum|0;
     }
     return main;
 }
 var begin;
 var lastSum;
 function done(sum) {
     if (sum !== ((lastSum + 499500)|0))
         throw "bad sum: " + sum + ", " + lastSum + ", " + ((lastSum + 499500)|0);
     lastSum = sum;
     return (Date.now() - begin) > 3000;
 }
-var f3Main = f3(this, {done:done}, i32.buffer);
+var f3Main = f3(this, {done}, i32.buffer);
 if (this.jsFuns)
     ok(jsFuns.isAsmJSFunction(f3Main), "f3.main is an asm.js function");
 
 begin = Date.now();
 lastSum = 0;
 if (f3Main() !== lastSum)
     throw "f3.main()";
 
--- a/dom/asmjscache/test/test_cachingBasic.html
+++ b/dom/asmjscache/test/test_cachingBasic.html
@@ -25,31 +25,31 @@ https://bugzilla.mozilla.org/show_bug.cg
   code += "ok(jsFuns.isAsmJSModule(f), 'f is an asm.js module')\n";
   code += "var g42 = f();\n";
   code += "ok(jsFuns.isAsmJSFunction(g42), 'g42 is an asm.js function')\n";
   code += "ok(g42() === 42, 'g42 returns the correct result')\n";
   code += "finishedEvalAsync(f);";
   ok(code.length > 100000, "code is long enough to definitely hit the cache");
 
   function evalAsync(code) {
-    var blob = new Blob([code], {type:"application/javascript"});
-    var script = document.createElement('script');
+    var blob = new Blob([code], {type: "application/javascript"});
+    var script = document.createElement("script");
     script.src = URL.createObjectURL(blob);
     document.body.appendChild(script);
   }
 
   var state = 0;
   function finishedEvalAsync(module) {
     switch (state) {
       case 0:
         state++;
         evalAsync(code);
         break;
       case 1:
-        ok(jsFuns.isAsmJSModuleLoadedFromCache(module), 'module loaded from cache');
+        ok(jsFuns.isAsmJSModuleLoadedFromCache(module), "module loaded from cache");
         SimpleTest.finish();
         break;
       default:
         throw "huh?";
     }
   }
 
   function runTest() {
--- a/dom/asmjscache/test/test_cachingMulti.html
+++ b/dom/asmjscache/test/test_cachingMulti.html
@@ -40,33 +40,33 @@ https://bugzilla.mozilla.org/show_bug.cg
     code2 += "var gX = f();\n";
     code2 += "ok(jsFuns.isAsmJSFunction(gX), 'gX is an asm.js function')\n";
     code2 += "ok(gX() === " + i + ", 'gX returns the correct result')\n";
     code2 += "finishedEvalAsync();\n";
     codes.push(code2);
   }
 
   function evalAsync(code) {
-    var blob = new Blob([code], {type:"application/javascript"});
-    var script = document.createElement('script');
+    var blob = new Blob([code], {type: "application/javascript"});
+    var script = document.createElement("script");
     script.src = URL.createObjectURL(blob);
     document.body.appendChild(script);
   }
 
   var finishedCount = 0;
   function finishedEvalAsync() {
     finishedCount++;
 
-    if (finishedCount < 1 || finishedCount > 2*N) {
+    if (finishedCount < 1 || finishedCount > 2 * N) {
       throw "Huh?!";
     } else if (finishedCount == N) {
       assertCacheHit = true;
       for (var i = 0; i < N; i++)
         evalAsync(codes[i]);
-    } else if (finishedCount == 2*N) {
+    } else if (finishedCount == 2 * N) {
       SimpleTest.finish();
     }
   }
 
   function runTest() {
       for (var i = 0; i < N; i++)
         evalAsync(codes[i]);
 
--- a/dom/asmjscache/test/test_slow.html
+++ b/dom/asmjscache/test/test_slow.html
@@ -26,21 +26,21 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   if (!jsFuns.isAsmJSCompilationAvailable()) {
       ok(true, "isAsmJSCompilationAvailable is false, skipping this test!");
   } else {
       var script = document.createElement("script");
       script.src = "http://mochi.test:8888/tests/dom/asmjscache/test/file_slow.js";
       document.body.appendChild(script);
 
-      var w = new Worker('http://mochi.test:8888/tests/dom/asmjscache/test/file_slow.js');
+      var w = new Worker("http://mochi.test:8888/tests/dom/asmjscache/test/file_slow.js");
       w.onmessage = function(e) {
           ok(e.data === "ok", "Worker asm.js tests");
           complete();
-      }
+      };
 
       SimpleTest.waitForExplicitFinish();
   }
   </script>
 
   <script>
   </script>
 
--- a/dom/asmjscache/test/test_workers.html
+++ b/dom/asmjscache/test/test_workers.html
@@ -23,47 +23,47 @@ https://bugzilla.mozilla.org/show_bug.cg
       for (var i = 0; i < 5000; i++)
         asmjsCode += "function g" + i + "() { return " + i + "}";
       asmjsCode += "return g42 }";
       ok(asmjsCode.length > 100000, "code is long enough to definitely hit the cache");
 
       var workerCode = asmjsCode;
       workerCode += "if (f()() !== 42) postMessage('fail'); else postMessage('ok');";
       workerCode = 'var code = "' + workerCode + '"; eval(code); eval(code)';
-      var workerBlob = new Blob([workerCode], {type:"application/javascript"});
+      var workerBlob = new Blob([workerCode], {type: "application/javascript"});
 
       var mainCode = asmjsCode;
       mainCode += "ok(jsFuns.isAsmJSModuleLoadedFromCache(f), 'f is a cache hit')\n";
       mainCode += "var g42 = f();\n";
       mainCode += "ok(jsFuns.isAsmJSFunction(g42), 'g42 is an asm.js function');\n";
       mainCode += "ok(g42() === 42, 'g42 returns the correct result');\n";
       mainCode += "SimpleTest.finish();\n";
-      var mainBlob = new Blob([mainCode], {type:"application/javascript"});
+      var mainBlob = new Blob([mainCode], {type: "application/javascript"});
 
       var w = new Worker(URL.createObjectURL(workerBlob));
 
       var received = 0;
       w.onmessage = function(e) {
           switch (received) {
             case 0:
               ok(e.data === "ok", "Received first message");
               received = 1;
               break;
             case 1:
               ok(e.data === "ok", "Received second message");
               received = 2;
 
-              var script = document.createElement('script');
+              var script = document.createElement("script");
               script.src = URL.createObjectURL(mainBlob);
               document.body.appendChild(script);
               break;
             default:
               throw "Huh?";
           }
-      }
+      };
 
       SimpleTest.waitForExplicitFinish();
   }
 
   if (!jsFuns.isAsmJSCompilationAvailable()) {
       ok(true, "isAsmJSCompilationAvailable is false, skipping this test!");
   } else {
       runTest();
--- a/dom/battery/test/test_battery_basics.html
+++ b/dom/battery/test/test_battery_basics.html
@@ -15,20 +15,20 @@
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 
 /** Test for Battery API **/
 ok("getBattery" in navigator, "navigator.getBattery should exist");
 ok(!("battery" in navigator), "navigator.battery should not exist");
 
-navigator.getBattery().then(function (battery) {
+navigator.getBattery().then(function(battery) {
   ok(battery.level >= 0.0 && battery.level <= 1.0, "Battery level " + battery.level + " should be in the range [0.0, 1.0]");
 
-  SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.default", true]]}, function () {
+  SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.default", true]]}, function() {
     ok(battery.charging, "Battery should be charging by default");
     is(battery.chargingTime, 0, "Battery chargingTime " + battery.chargingTime + " should be zero by default");
     is(battery.dischargingTime, Infinity, "Battery dischargingTime should be Infinity by default");
     is(battery.level, 1.0, "Battery level " + battery.level + " should be 1.0 by default");
 
     SimpleTest.finish();
   });
 });
--- a/dom/battery/test/test_battery_charging.html
+++ b/dom/battery/test/test_battery_charging.html
@@ -12,20 +12,20 @@
 <pre id="test">
 <script type="application/javascript">
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 
 /** Test for Battery API **/
-navigator.getBattery().then(function (battery) {
+navigator.getBattery().then(function(battery) {
   ok(battery.level >= 0.0 && battery.level <= 1.0, "Battery level " + battery.level + " should be in the range [0.0, 1.0]");
 
-  SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.charging", true]]}, function () {
+  SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.charging", true]]}, function() {
     is(battery.charging, true, "Battery should be charging");
     ok(battery.chargingTime >= 0, "Battery chargingTime " + battery.chargingTime + " should be nonnegative when charging");
     is(battery.dischargingTime, Infinity, "Battery dischargingTime should be Infinity when charging");
 
     SimpleTest.finish();
   });
 });
 
--- a/dom/battery/test/test_battery_discharging.html
+++ b/dom/battery/test/test_battery_discharging.html
@@ -12,20 +12,20 @@
 <pre id="test">
 <script type="application/javascript">
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 
 /** Test for Battery API **/
-navigator.getBattery().then(function (battery) {
+navigator.getBattery().then(function(battery) {
   ok(battery.level >= 0.0 && battery.level <= 1.0, "Battery level " + battery.level + " should be in the range [0.0, 1.0]");
 
-  SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.discharging", true]]}, function () {
+  SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.discharging", true]]}, function() {
     is(battery.charging, false, "Battery should be discharging");
     is(battery.chargingTime, Infinity, "Battery chargingTime should be Infinity when discharging");
     ok(battery.dischargingTime > 0, "Battery dischargingTime " + battery.dischargingTime + " should be positive when discharging");
 
     SimpleTest.finish();
   });
 });
 
--- a/dom/broadcastchannel/tests/broadcastchannel_sharedWorker.js
+++ b/dom/broadcastchannel/tests/broadcastchannel_sharedWorker.js
@@ -1,12 +1,12 @@
 onconnect = function(evt) {
   evt.ports[0].onmessage = function(evt) {
-    var bc = new BroadcastChannel('foobar');
-    bc.addEventListener('message', function(event) {
+    var bc = new BroadcastChannel("foobar");
+    bc.addEventListener("message", function(event) {
       bc.postMessage(event.data == "hello world from the window" ?
                        "hello world from the worker" : "KO");
       bc.close();
     });
 
     evt.target.postMessage("READY");
-  }
-}
+  };
+};
--- a/dom/broadcastchannel/tests/broadcastchannel_worker.js
+++ b/dom/broadcastchannel/tests/broadcastchannel_worker.js
@@ -1,18 +1,18 @@
 onmessage = function(evt) {
   if (evt.data != 0) {
     var worker = new Worker("broadcastchannel_worker.js");
     worker.onmessage = function(evt) {
       postMessage(evt.data);
-    }
+    };
     worker.postMessage(evt.data - 1);
     return;
   }
 
-  var bc = new BroadcastChannel('foobar');
-  bc.addEventListener('message', function(event) {
+  var bc = new BroadcastChannel("foobar");
+  bc.addEventListener("message", function(event) {
     bc.postMessage(event.data == "hello world from the window" ? "hello world from the worker" : "KO");
     bc.close();
   });
 
   postMessage("READY");
-}
+};
--- a/dom/broadcastchannel/tests/broadcastchannel_worker_alive.js
+++ b/dom/broadcastchannel/tests/broadcastchannel_worker_alive.js
@@ -1,7 +1,7 @@
-(new BroadcastChannel('foobar')).addEventListener('message', function(event) {
-  if (event.data != 'READY') {
+(new BroadcastChannel("foobar")).addEventListener("message", function(event) {
+  if (event.data != "READY") {
     event.target.postMessage(event.data);
   }
 });
 
-(new BroadcastChannel('foobar')).postMessage('READY');
+(new BroadcastChannel("foobar")).postMessage("READY");
--- a/dom/broadcastchannel/tests/broadcastchannel_worker_any.js
+++ b/dom/broadcastchannel/tests/broadcastchannel_worker_any.js
@@ -1,5 +1,5 @@
-(new BroadcastChannel('foobar')).onmessage = function(event) {
+(new BroadcastChannel("foobar")).onmessage = function(event) {
   event.target.postMessage(event.data);
-}
+};
 
 postMessage("READY");
--- a/dom/broadcastchannel/tests/browser_private_browsing.js
+++ b/dom/broadcastchannel/tests/browser_private_browsing.js
@@ -25,48 +25,48 @@ add_task(async function() {
   var browser1 = gBrowser.getBrowserForTab(tab1);
 
   var tab2 = BrowserTestUtils.addTab(win2.gBrowser, URL);
   await BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
   var browser2 = gBrowser.getBrowserForTab(tab2);
 
   var p1 = ContentTask.spawn(browser1, null, function(opts) {
     return new content.window.Promise(resolve => {
-      content.window.bc = new content.window.BroadcastChannel('foobar');
-      content.window.bc.onmessage = function(e) { resolve(e.data); }
+      content.window.bc = new content.window.BroadcastChannel("foobar");
+      content.window.bc.onmessage = function(e) { resolve(e.data); };
     });
   });
 
   var p2 = ContentTask.spawn(browser2, null, function(opts) {
     return new content.window.Promise(resolve => {
-      content.window.bc = new content.window.BroadcastChannel('foobar');
-      content.window.bc.onmessage = function(e) { resolve(e.data); }
+      content.window.bc = new content.window.BroadcastChannel("foobar");
+      content.window.bc.onmessage = function(e) { resolve(e.data); };
     });
   });
 
   await ContentTask.spawn(browser1, null, function(opts) {
     return new content.window.Promise(resolve => {
-      var bc = new content.window.BroadcastChannel('foobar');
-      bc.postMessage('hello world from private browsing');
+      var bc = new content.window.BroadcastChannel("foobar");
+      bc.postMessage("hello world from private browsing");
       resolve();
     });
   });
 
   await ContentTask.spawn(browser2, null, function(opts) {
     return new content.window.Promise(resolve => {
-      var bc = new content.window.BroadcastChannel('foobar');
-      bc.postMessage('hello world from non private browsing');
+      var bc = new content.window.BroadcastChannel("foobar");
+      bc.postMessage("hello world from non private browsing");
       resolve();
     });
   });
 
   var what1 = await p1;
-  is(what1, 'hello world from private browsing', 'No messages received from the other window.');
+  is(what1, "hello world from private browsing", "No messages received from the other window.");
 
   var what2 = await p2;
-  is(what2, 'hello world from non private browsing', 'No messages received from the other window.');
+  is(what2, "hello world from non private browsing", "No messages received from the other window.");
 
   BrowserTestUtils.removeTab(tab1);
   await BrowserTestUtils.closeWindow(win1);
 
   BrowserTestUtils.removeTab(tab2);
   await BrowserTestUtils.closeWindow(win2);
 });
--- a/dom/broadcastchannel/tests/file_mozbrowser.html
+++ b/dom/broadcastchannel/tests/file_mozbrowser.html
@@ -3,18 +3,18 @@
 <head>
   <meta charset="utf-8">
   <title>MozBrowser iframe</title>
 </head>
 <body>
 <div id="container"></div>
   <script type="application/javascript">
 
-  var ifr = document.createElement('iframe');
-  ifr.src = 'http://mochi.test:8888/tests/dom/broadcastchannel/tests/iframe_mozbrowser.html';
-  ifr.onload = function() { alert('DONE'); }
+  var ifr = document.createElement("iframe");
+  ifr.src = "http://mochi.test:8888/tests/dom/broadcastchannel/tests/iframe_mozbrowser.html";
+  ifr.onload = function() { alert("DONE"); };
 
-  var domParent = document.getElementById('container');
+  var domParent = document.getElementById("container");
   domParent.appendChild(ifr);
 
   </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/file_mozbrowser2.html
+++ b/dom/broadcastchannel/tests/file_mozbrowser2.html
@@ -3,19 +3,19 @@
 <head>
   <meta charset="utf-8">
   <title>MozBrowser iframe</title>
 </head>
 <body>
 <div id="container"></div>
   <script type="application/javascript">
 
-  var ifr = document.createElement('iframe');
-  ifr.setAttribute('mozbrowser', true);
-  ifr.src = 'http://mochi.test:8888/tests/dom/broadcastchannel/tests/iframe_mozbrowser2.html';
-  ifr.onload = function() { alert('DONE'); }
+  var ifr = document.createElement("iframe");
+  ifr.setAttribute("mozbrowser", true);
+  ifr.src = "http://mochi.test:8888/tests/dom/broadcastchannel/tests/iframe_mozbrowser2.html";
+  ifr.onload = function() { alert("DONE"); };
 
-  var domParent = document.getElementById('container');
+  var domParent = document.getElementById("container");
   domParent.appendChild(ifr);
 
   </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/iframe_broadcastchannel.html
+++ b/dom/broadcastchannel/tests/iframe_broadcastchannel.html
@@ -10,26 +10,26 @@ function is(a, b, msg) {
 function ok(a, msg) {
   window.parent.postMessage({ status: a ? "OK" : "KO", message: msg }, "*");
 }
 
 ok("BroadcastChannel" in window, "BroadcastChannel exists");
 
 var bc = new BroadcastChannel("foobar");
 ok(bc, "BroadcastChannel can be created");
-is(bc.name, 'foobar', "BroadcastChannel.name is foobar");
+is(bc.name, "foobar", "BroadcastChannel.name is foobar");
 
 ok("postMessage" in bc, "BroadcastChannel has postMessage() method");
 
 bc.onmessage = function(evt) {
-  ok(evt instanceof MessageEvent, 'evt is a MessageEvent');
-  is(evt.target, bc, 'MessageEvent.target is bc');
-  is(evt.target.name, 'foobar', 'MessageEvent.target.name is foobar');
-  is(evt.target.name, bc.name, 'MessageEvent.target.name is bc.name');
+  ok(evt instanceof MessageEvent, "evt is a MessageEvent");
+  is(evt.target, bc, "MessageEvent.target is bc");
+  is(evt.target.name, "foobar", "MessageEvent.target.name is foobar");
+  is(evt.target.name, bc.name, "MessageEvent.target.name is bc.name");
   is(evt.data, "Hello world from the window!", "Message received from the window");
   bc.postMessage("Hello world from the iframe!");
-}
+};
 
   </script>
 </body>
 </html>
 
 
--- a/dom/broadcastchannel/tests/iframe_mozbrowser.html
+++ b/dom/broadcastchannel/tests/iframe_mozbrowser.html
@@ -2,14 +2,14 @@
 <html>
 <head>
   <meta charset="utf-8">
   <title>MozBrowser iframe</title>
 </head>
 <body>
   <script type="application/javascript">
 
-var bc = new BroadcastChannel('foobar');
-bc.postMessage('This is wrong!');
+var bc = new BroadcastChannel("foobar");
+bc.postMessage("This is wrong!");
 
   </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/iframe_mozbrowser2.html
+++ b/dom/broadcastchannel/tests/iframe_mozbrowser2.html
@@ -2,14 +2,14 @@
 <html>
 <head>
   <meta charset="utf-8">
   <title>MozBrowser iframe</title>
 </head>
 <body>
   <script type="application/javascript">
 
-var bc = new BroadcastChannel('foobar');
-bc.postMessage('This is wrong!');
+var bc = new BroadcastChannel("foobar");
+bc.postMessage("This is wrong!");
 
   </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/test_bfcache.html
+++ b/dom/broadcastchannel/tests/test_bfcache.html
@@ -34,17 +34,17 @@
   var bc;
 
   function page1Shown(e) {
     info("Page1Shown: " + testWin.location.href);
 
     if (counter == 0) {
       ok(!e.persisted, "test page should have been persisted initially");
 
-      bc = new testWin.BroadcastChannel('a');
+      bc = new testWin.BroadcastChannel("a");
 
       SimpleTest.executeSoon(function() {
         info("New location: " + testUrl2);
         testWin.location.href = testUrl2;
       });
     } else {
       is(e.persisted, expectedPersisted, "test page should have been persisted in pageshow");
       testWin.close();
--- a/dom/broadcastchannel/tests/test_broadcastchannel_any.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_any.html
@@ -7,106 +7,106 @@
 </head>
 <body>
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
 var tests = [
- 'hello world',
+ "hello world",
  123,
  null,
  true,
  new Date(),
- [ 1, 'test', true, new Date() ],
+ [ 1, "test", true, new Date() ],
  { a: true, b:  null, c: new Date(), d: [ true, false, {} ] },
- new Blob([123], { type: 'plain/text' })
+ new Blob([123], { type: "plain/text" }),
 ];
 
 var currentTest = null;
 
 function getType(a) {
   if (a === null || a === undefined)
-    return 'null';
+    return "null";
 
   if (Array.isArray(a))
-    return 'array';
+    return "array";
 
-  if (typeof a == 'object')
-    return 'object';
+  if (typeof a == "object")
+    return "object";
 
-  return 'primitive';
+  return "primitive";
 }
 
 function compare(a, b) {
-  is (getType(a), getType(b), 'Type matches');
+  is(getType(a), getType(b), "Type matches");
 
   var type = getType(a);
-  if (type == 'array') {
-    is (a.length, b.length, 'Array.length matches');
+  if (type == "array") {
+    is(a.length, b.length, "Array.length matches");
     for (var i = 0; i < a.length; ++i) {
       compare(a[i], b[i]);
     }
 
     return;
   }
 
-  if (type == 'object') {
-    ok (a !== b, 'They should not match');
+  if (type == "object") {
+    ok(a !== b, "They should not match");
 
     var aProps = [];
     for (var p in a) aProps.push(p);
 
     var bProps = [];
     for (var p in b) bProps.push(p);
 
-    is (aProps.length, bProps.length, 'Props match');
-    is (aProps.sort().toSource(), bProps.sort().toSource(), 'Props match - using toSource()');
+    is(aProps.length, bProps.length, "Props match");
+    is(aProps.sort().toSource(), bProps.sort().toSource(), "Props match - using toSource()");
 
     for (var p in a) {
       compare(a[p], b[p]);
     }
 
     return;
   }
 
-  if (type != 'null') {
-    is (a.toSource(), b.toSource(), 'Matching using toSource()');
+  if (type != "null") {
+    is(a.toSource(), b.toSource(), "Matching using toSource()");
   }
 }
 
 function runTest() {
   var count = 2;
 
   var bc = new BroadcastChannel("foobar");
   ok(bc, "BroadcastChannel can be created");
 
   bc.onmessage = function(event) {
     ok(count < 2, "Still comparing...");
     info("bc: " + currentTest);
     compare(event.data, currentTest);
     ++count;
     next();
-  }
+  };
 
   var bc2 = new BroadcastChannel("foobar");
   ok(bc2, "BroadcastChannel can be created");
 
   var toSkip = true;
   bc2.onmessage = function(event) {
     toSkip = !toSkip;
     if (toSkip) return;
 
     ok(count < 2, "Still comparing...");
     info("bc2: " + currentTest);
     compare(event.data, currentTest);
     ++count;
     next();
-  }
+  };
 
   function next() {
     if (count < 2) {
       return;
     }
 
     is(count, 2, "Just 2 comparations");
     count = 0;
--- a/dom/broadcastchannel/tests/test_broadcastchannel_basic.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_basic.html
@@ -7,51 +7,51 @@
 </head>
 <body>
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
 function runTest() {
-  addEventListener('message', receiveMessage, false);
+  addEventListener("message", receiveMessage, false);
   function receiveMessage(evt) {
-    if (evt.data.status == 'OK') {
+    if (evt.data.status == "OK") {
       ok(true, evt.data.message);
-    } else if (evt.data.status == 'KO') {
+    } else if (evt.data.status == "KO") {
       ok(false, evt.data.message);
     } else {
       ok(false, "Unknown message");
     }
   }
 
   ok("BroadcastChannel" in window, "BroadcastChannel exists");
 
   var bc = new BroadcastChannel("foobar");
   ok(bc, "BroadcastChannel can be created");
-  is(bc.name, 'foobar', "BroadcastChannel.name is foobar");
+  is(bc.name, "foobar", "BroadcastChannel.name is foobar");
 
   ok("postMessage" in bc, "BroadcastChannel has postMessage() method");
 
   bc.onmessage = function(evt) {
     ok(evt instanceof MessageEvent, "This is a MessageEvent");
     is(evt.target, bc, "MessageEvent.target is bc");
-    is(evt.target.name, 'foobar', "MessageEvent.target.name is foobar");
+    is(evt.target.name, "foobar", "MessageEvent.target.name is foobar");
     is(evt.target.name, bc.name, "MessageEvent.target.name == bc.name");
-    ok(evt.origin.indexOf('http://mochi.test:8888') == 0, "MessageEvent.origin is correct");
+    ok(evt.origin.indexOf("http://mochi.test:8888") == 0, "MessageEvent.origin is correct");
     is(evt.data, "Hello world from the iframe!", "The message from the iframe has been received!");
     SimpleTest.finish();
-  }
+  };
 
   var div = document.getElementById("content");
   ok(div, "Parent exists");
 
   var ifr = document.createElement("iframe");
   ifr.addEventListener("load", iframeLoaded);
-  ifr.setAttribute('src', "iframe_broadcastchannel.html");
+  ifr.setAttribute("src", "iframe_broadcastchannel.html");
   div.appendChild(ifr);
 
   function iframeLoaded() {
     bc.postMessage("Hello world from the window!");
   }
 
   // A leak test
   var dummyBc = new BroadcastChannel("dont_leak_this");
--- a/dom/broadcastchannel/tests/test_broadcastchannel_close.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_close.html
@@ -7,55 +7,55 @@
 </head>
 <body>
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
 function runTest() {
-  var receiver = new BroadcastChannel('foo');
-  var sequence = [ '2', 'done' ];
+  var receiver = new BroadcastChannel("foo");
+  var sequence = [ "2", "done" ];
   receiver.onmessage = function(e) {
     if (!sequence.length) {
-      ok (false, 'No more data is expected');
+      ok(false, "No more data is expected");
       return;
     }
 
     var data = sequence.shift();
     is(e.data, data);
 
     if (!sequence.length) {
       SimpleTest.executeSoon(function() {
         SimpleTest.finish();
       });
     }
-  }
+  };
 
-  var x = new BroadcastChannel('foo');
+  var x = new BroadcastChannel("foo");
   x.close();
   try {
-    x.postMessage('1');
+    x.postMessage("1");
     ok(false, "PostMessage should throw if called after a close().");
-  } catch(e) {
+  } catch (e) {
     ok(true, "PostMessage should throw if called after a close().");
   }
 
-  var y = new BroadcastChannel('foo');
-  y.postMessage('2');
+  var y = new BroadcastChannel("foo");
+  y.postMessage("2");
   y.close();
   try {
-    y.postMessage('3');
+    y.postMessage("3");
     ok(false, "PostMessage should throw if called after a close().");
-  } catch(e) {
+  } catch (e) {
     ok(true, "PostMessage should throw if called after a close().");
   }
 
-  var z = new BroadcastChannel('foo');
-  z.postMessage('done');
+  var z = new BroadcastChannel("foo");
+  z.postMessage("done");
 }
 
 SimpleTest.waitForExplicitFinish();
 runTest();
 
 </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/test_broadcastchannel_close2.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_close2.html
@@ -7,33 +7,33 @@
 </head>
 <body>
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
 function runTest() {
-  var c1 = new BroadcastChannel('foo');
-  var c2 = new BroadcastChannel('foo');
+  var c1 = new BroadcastChannel("foo");
+  var c2 = new BroadcastChannel("foo");
 
   var status = [];
   c2.onmessage = function(e) {
     status.push(e.data);
     if (status.length == 2) {
-      is (status[0], 'first', "First message has been received");
-      is (status[1], 'second', "Second message has been received");
+      is(status[0], "first", "First message has been received");
+      is(status[1], "second", "Second message has been received");
       SimpleTest.finish();
     }
 
     c2.close();
-  }
+  };
 
-  c1.postMessage('first');
-  c1.postMessage('second');
+  c1.postMessage("first");
+  c1.postMessage("second");
 }
 
 SimpleTest.waitForExplicitFinish();
 runTest();
 
 </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/test_broadcastchannel_self.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_self.html
@@ -7,31 +7,31 @@
 </head>
 <body>
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
 function runTest() {
-  x = new BroadcastChannel('foo');
-  y = new BroadcastChannel('foo');
+  x = new BroadcastChannel("foo");
+  y = new BroadcastChannel("foo");
 
   function func(e) {
     is(e.target, y, "The target is !x");
 
     SimpleTest.executeSoon(function() {
       SimpleTest.finish();
     });
   }
 
   x.onmessage = func;
   y.onmessage = func;
 
-  x.postMessage('foo');
+  x.postMessage("foo");
 }
 
 SimpleTest.waitForExplicitFinish();
 runTest();
 
 </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/test_broadcastchannel_sharedWorker.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_sharedWorker.html
@@ -18,34 +18,34 @@ Tests of DOM BroadcastChannel in SharedW
 
 </div>
 <pre id="test">
 <script class="testbody" language="javascript">
 
 function runTests() {
   var worker = new SharedWorker("broadcastchannel_sharedWorker.js");
 
-  var bc = new BroadcastChannel('foobar');
+  var bc = new BroadcastChannel("foobar");
 
   worker.port.onmessage = function(event) {
     if (event.data == "READY") {
       ok(true, "SharedWorker is ready!");
-      bc.postMessage('hello world from the window');
+      bc.postMessage("hello world from the window");
     } else {
       ok(false, "Something wrong happened");
     }
   };
 
   bc.onmessage = function(event) {
     is("hello world from the worker", event.data, "The message matches!");
     bc.close();
     SimpleTest.finish();
-  }
+  };
 
-  worker.port.postMessage('go');
+  worker.port.postMessage("go");
 }
 
 SimpleTest.waitForExplicitFinish();
 runTests();
 
 </script>
 </pre>
 </body>
--- a/dom/broadcastchannel/tests/test_broadcastchannel_worker.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_worker.html
@@ -18,32 +18,32 @@ Tests of DOM BroadcastChannel in workers
 
 </div>
 <pre id="test">
 <script class="testbody" language="javascript">
 
 function testWorker(x) {
   var worker = new Worker("broadcastchannel_worker.js");
 
-  var bc = new BroadcastChannel('foobar');
+  var bc = new BroadcastChannel("foobar");
 
   worker.onmessage = function(event) {
     if (event.data == "READY") {
       ok(true, "Worker is ready!");
-      bc.postMessage('hello world from the window');
+      bc.postMessage("hello world from the window");
     } else {
       ok(false, "Something wrong happened");
     }
   };
 
   bc.onmessage = function(event) {
     is("hello world from the worker", event.data, "The message matches!");
     bc.close();
     runTests();
-  }
+  };
 
   worker.postMessage(x);
 }
 
 var tests = [ 0, 3 ];
 function runTests() {
   if (tests.length == 0) {
     SimpleTest.finish();
--- a/dom/broadcastchannel/tests/test_broadcastchannel_worker_alive.html
+++ b/dom/broadcastchannel/tests/test_broadcastchannel_worker_alive.html
@@ -17,17 +17,17 @@ Tests of DOM BroadcastChannel in workers
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
 <script class="testbody" language="javascript">
 
 function runTests() {
   var id = 0;
-  (new BroadcastChannel('foobar')).onmessage = function(event) {
+  (new BroadcastChannel("foobar")).onmessage = function(event) {
     info("MSG: " + event.data);
 
     if (event.data == "READY") {
       ok(true, "Worker is ready!");
     } else {
       is(id, event.data, "The message is correct: " + id);
     }
 
--- a/dom/broadcastchannel/tests/test_dataCloning.html
+++ b/dom/broadcastchannel/tests/test_dataCloning.html
@@ -9,19 +9,19 @@
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
 
 let c = new BroadcastChannel("foo");
 
-try  {
+try {
   c.postMessage(Symbol());
   ok(false, "This should throw!");
-} catch(e) {
+} catch (e) {
   ok(true, "This should throw!");
   is(e.name, "DataCloneError", "Correct DataCloneError exception thrown");
 }
 
 </script>
 </body>
 </html>
--- a/dom/broadcastchannel/tests/test_dataURL.html
+++ b/dom/broadcastchannel/tests/test_dataURL.html
@@ -12,24 +12,24 @@ var b = new BroadcastChannel('a');
 a.onmessage = function(e) { parent.postMessage(e.data, "*"); };
 b.postMessage(42);
 </div>
 
 <script>
 
 SimpleTest.waitForExplicitFinish();
 
-onmessage= function(e) {
+onmessage = function(e) {
   is(e.data, 42, "BroadcastChannel works with data URLs");
   SimpleTest.finish();
-}
+};
 
 var url = "data:text/html,<script>" + document.getElementById("dataURL").textContent + "</" + "script>";
 
-var ifr = document.createElement('iframe');
+var ifr = document.createElement("iframe");
 document.body.appendChild(ifr);
 
-ifr.setAttribute('sandbox', 'allow-scripts');
+ifr.setAttribute("sandbox", "allow-scripts");
 ifr.src = url;
 </script>
 </body>
 </html>
 
--- a/dom/broadcastchannel/tests/test_event_listener_leaks.html
+++ b/dom/broadcastchannel/tests/test_event_listener_leaks.html
@@ -20,17 +20,17 @@ let count = 0;
 async function useBroadcastChannel(contentWindow) {
   contentWindow.messageCount = 0;
 
   count += 1;
   const name = `test_event_listener_leaks-${count}`;
 
   let bc = new contentWindow.BroadcastChannel(name);
   let outer = new BroadcastChannel(name);
-  outer.postMessage('foo');
+  outer.postMessage("foo");
 
   await new Promise(resolve => {
     bc.onmessage = e => {
       contentWindow.messageCount += 1;
       resolve();
     };
   });
 
--- a/dom/broadcastchannel/tests/test_invalidState.html
+++ b/dom/broadcastchannel/tests/test_invalidState.html
@@ -9,20 +9,20 @@
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
 var c = new BroadcastChannel("foo");
 c.close();
 
-try  {
+try {
   c.postMessage("bar");
   ok(false, "This should throw!");
-} catch(e) {
+} catch (e) {
   ok(true, "This should throw!");
   is(e.name, "InvalidStateError", "Correct invalid-state exception thrown");
 }
 
 </script>
 </body>
 </html>
 
--- a/dom/broadcastchannel/tests/test_ordering.html
+++ b/dom/broadcastchannel/tests/test_ordering.html
@@ -6,60 +6,60 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <div id="content"></div>
 
 <script type="application/javascript">
 
-let c1 = new BroadcastChannel('order');
-let c2 = new BroadcastChannel('order');
-let c3 = new BroadcastChannel('order');
+let c1 = new BroadcastChannel("order");
+let c2 = new BroadcastChannel("order");
+let c3 = new BroadcastChannel("order");
 
 let events = [];
 let doneCount = 0;
 
 function whichBC(bc) {
   if (bc == c1) return "c1";
   if (bc == c2) return "c2";
   if (bc == c3) return "c3";
   return "What?!?";
 }
 
 function handler(e) {
   events.push(e);
-  if (e.data == 'done') {
+  if (e.data == "done") {
     doneCount++;
     if (doneCount == 2) {
       is(events.length, 6, "Correct length");
-      is(whichBC(events[0].target), "c2", 'target for event 0');
-      is(events[0].data, 'from c1');
-      is(whichBC(events[1].target), "c3", 'target for event 1');
-      is(events[1].data, 'from c1');
-      is(whichBC(events[2].target), "c1", 'target for event 2');
-      is(events[2].data, 'from c3');
-      is(whichBC(events[3].target), "c2", 'target for event 3');
-      is(events[3].data, 'from c3');
-      is(whichBC(events[4].target), "c1", 'target for event 4');
-      is(events[4].data, 'done');
-      is(whichBC(events[5].target), "c3", 'target for event 5');
-      is(events[5].data, 'done');
+      is(whichBC(events[0].target), "c2", "target for event 0");
+      is(events[0].data, "from c1");
+      is(whichBC(events[1].target), "c3", "target for event 1");
+      is(events[1].data, "from c1");
+      is(whichBC(events[2].target), "c1", "target for event 2");
+      is(events[2].data, "from c3");
+      is(whichBC(events[3].target), "c2", "target for event 3");
+      is(events[3].data, "from c3");
+      is(whichBC(events[4].target), "c1", "target for event 4");
+      is(events[4].data, "done");
+      is(whichBC(events[5].target), "c3", "target for event 5");
+      is(events[5].data, "done");
 
       SimpleTest.finish();
     }
   }
 }
 
 c1.onmessage = handler;
 c2.onmessage = handler;
 c3.onmessage = handler;
 
-c1.postMessage('from c1');
-c3.postMessage('from c3');
-c2.postMessage('done');
+c1.postMessage("from c1");
+c3.postMessage("from c3");
+c2.postMessage("done");
 
 SimpleTest.waitForExplicitFinish();
 
 </script>
 </body>
 </html>
 
--- a/dom/console/ConsoleAPIStorage.js
+++ b/dom/console/ConsoleAPIStorage.js
@@ -3,23 +3,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // This constant tells how many messages to process in a single timer execution.
-const MESSAGES_IN_INTERVAL = 1500
+const MESSAGES_IN_INTERVAL = 1500;
 
 const STORAGE_MAX_EVENTS = 1000;
 
 var _consoleStorage = new Map();
 
-const CONSOLEAPISTORAGE_CID = Components.ID('{96cf7855-dfa9-4c6d-8276-f9705b4890f2}');
+const CONSOLEAPISTORAGE_CID = Components.ID("{96cf7855-dfa9-4c6d-8276-f9705b4890f2}");
 
 /**
  * The ConsoleAPIStorage is meant to cache window.console API calls for later
  * reuse by other components when needed. For example, the Web Console code can
  * display the cached messages when it opens for the active tab.
  *
  * ConsoleAPI messages are stored as they come from the ConsoleAPI code, with
  * all their properties. They are kept around until the inner window object that
@@ -38,57 +38,52 @@ const CONSOLEAPISTORAGE_CID = Components
  *    // Clear the events for the given inner window ID.
  *    ConsoleAPIStorage.clearEvents(innerWindowID);
  */
 function ConsoleAPIStorageService() {
   this.init();
 }
 
 ConsoleAPIStorageService.prototype = {
-  classID : CONSOLEAPISTORAGE_CID,
+  classID: CONSOLEAPISTORAGE_CID,
   QueryInterface: ChromeUtils.generateQI([Ci.nsIConsoleAPIStorage,
                                           Ci.nsIObserver]),
 
-  observe: function CS_observe(aSubject, aTopic, aData)
-  {
+  observe: function CS_observe(aSubject, aTopic, aData) {
     if (aTopic == "xpcom-shutdown") {
       Services.obs.removeObserver(this, "xpcom-shutdown");
       Services.obs.removeObserver(this, "inner-window-destroyed");
       Services.obs.removeObserver(this, "memory-pressure");
-    }
-    else if (aTopic == "inner-window-destroyed") {
+    } else if (aTopic == "inner-window-destroyed") {
       let innerWindowID = aSubject.QueryInterface(Ci.nsISupportsPRUint64).data;
       this.clearEvents(innerWindowID + "");
-    }
-    else if (aTopic == "memory-pressure") {
+    } else if (aTopic == "memory-pressure") {
       this.clearEvents();
     }
   },
 
   /** @private */
-  init: function CS_init()
-  {
+  init: function CS_init() {
     Services.obs.addObserver(this, "xpcom-shutdown");
     Services.obs.addObserver(this, "inner-window-destroyed");
     Services.obs.addObserver(this, "memory-pressure");
   },
 
   /**
    * Get the events array by inner window ID or all events from all windows.
    *
    * @param string [aId]
    *        Optional, the inner window ID for which you want to get the array of
    *        cached events.
    * @returns array
    *          The array of cached events for the given window. If no |aId| is
    *          given this function returns all of the cached events, from any
    *          window.
    */
-  getEvents: function CS_getEvents(aId)
-  {
+  getEvents: function CS_getEvents(aId) {
     if (aId != null) {
       return (_consoleStorage.get(aId) || []).slice(0);
     }
 
     let result = [];
 
     for (let [id, events] of _consoleStorage) {
       result.push.apply(result, events);
@@ -106,18 +101,17 @@ ConsoleAPIStorageService.prototype = {
    *        The ID of the inner window for which the event occurred or "jsm" for
    *        messages logged from JavaScript modules..
    * @param string aOuterId
    *        This ID is used as 3rd parameters for the console-api-log-event
    *        notification.
    * @param object aEvent
    *        A JavaScript object you want to store.
    */
-  recordEvent: function CS_recordEvent(aId, aOuterId, aEvent)
-  {
+  recordEvent: function CS_recordEvent(aId, aOuterId, aEvent) {
     if (!_consoleStorage.has(aId)) {
       _consoleStorage.set(aId, []);
     }
 
     let storage = _consoleStorage.get(aId);
 
     storage.push(aEvent);
 
@@ -133,21 +127,19 @@ ConsoleAPIStorageService.prototype = {
   /**
    * Clear storage data for the given window.
    *
    * @param string [aId]
    *        Optional, the inner window ID for which you want to clear the
    *        messages. If this is not specified all of the cached messages are
    *        cleared, from all window objects.
    */
-  clearEvents: function CS_clearEvents(aId)
-  {
+  clearEvents: function CS_clearEvents(aId) {
     if (aId != null) {
       _consoleStorage.delete(aId);
-    }
-    else {
+    } else {
       _consoleStorage.clear();
       Services.obs.notifyObservers(null, "console-storage-reset");
     }
   },
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPIStorageService]);
--- a/dom/console/tests/console.jsm
+++ b/dom/console/tests/console.jsm
@@ -1,16 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 var EXPORTED_SYMBOLS = [ "ConsoleTest" ];
 
 var ConsoleTest = {
-  go: function(dumpFunction) {
+  go(dumpFunction) {
     console.log("Hello world!");
     console.createInstance().log("Hello world!");
 
     let c = console.createInstance({
       consoleID: "wow",
       innerID: "CUSTOM INNER",
       dump: dumpFunction,
       prefix: "_PREFIX_",
@@ -18,10 +18,10 @@ var ConsoleTest = {
 
     c.log("Hello world!");
     c.trace("Hello world!");
 
     console.createInstance({ innerID: "LEVEL", maxLogLevel: "Off" }).log("Invisible!");
     console.createInstance({ innerID: "LEVEL",  maxLogLevel: "All" }).log("Hello world!");
     console.createInstance({ innerID: "LEVEL", maxLogLevelPref: "foo.pref" }).log("Invisible!");
     console.createInstance({ innerID: "LEVEL", maxLogLevelPref: "pref.test.console" }).log("Hello world!");
-  }
+  },
 };
--- a/dom/console/tests/test_bug659625.html
+++ b/dom/console/tests/test_bug659625.html
@@ -17,17 +17,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   let storage = consoleStorage.getService(Ci.nsIConsoleAPIStorage);
 
   let clearAndCheckStorage = () => {
     console.clear();
     ok(storage.getEvents().length === 1,
       "Only one event remains in consoleAPIStorage");
     ok(storage.getEvents()[0].level === "clear",
       "Remaining event has level 'clear'");
-  }
+  };
 
   storage.clearEvents();
   ok(storage.getEvents().length === 0,
     "Console is empty when test is starting");
   clearAndCheckStorage();
 
   console.log("log");
   console.debug("debug");
@@ -64,31 +64,31 @@ https://bugzilla.mozilla.org/show_bug.cg
   is(events.length, 3,
     "3 new console events registered for 3 'default' count calls");
   for (let i = 0; i < events.length; ++i) {
       is(events[i].counter.count, i + 1, "check counter for event " + i);
       is(events[i].counter.label, "default", "check label for event " + i);
   }
   clearAndCheckStorage();
 
-  console.group("group-label")
+  console.group("group-label");
   console.log("group-log");
   ok(storage.getEvents().length === 3,
     "2 new console events registered for group + log");
   clearAndCheckStorage();
 
-  console.groupCollapsed("group-collapsed")
+  console.groupCollapsed("group-collapsed");
   console.log("group-collapsed-log");
   ok(storage.getEvents().length === 3,
     "2 new console events registered for groupCollapsed + log");
   clearAndCheckStorage();
 
-  console.group("closed-group-label")
+  console.group("closed-group-label");
   console.log("group-log");
-  console.groupEnd()
+  console.groupEnd();
   ok(storage.getEvents().length === 4,
     "3 new console events registered for group/groupEnd");
   clearAndCheckStorage();
 
   console.time("time-label");
   console.timeEnd();
   ok(storage.getEvents().length === 3,
     "2 new console events registered for time/timeEnd");
--- a/dom/console/tests/test_bug978522.html
+++ b/dom/console/tests/test_bug978522.html
@@ -8,25 +8,25 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug 978522 - basic support</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=978522">Mozilla Bug 978522</a>
 <script type="application/javascript">
 
-  console.log('%s', {
-    toString: function() {
-      console.log('%s', {
-        toString: function() {
-          ok(true, "Still alive \\o/");
-          SimpleTest.finish();
-          return "hello world";
-        }
-      });
-    }
+  console.log("%s", {
+    toString() {
+    console.log("%s", {
+      toString() {
+      ok(true, "Still alive \\o/");
+      SimpleTest.finish();
+      return "hello world";
+    },
+    });
+  },
   });
 
   SimpleTest.waitForExplicitFinish();
 
 </script>
 </body>
 </html>
--- a/dom/console/tests/test_console_binding.html
+++ b/dom/console/tests/test_console_binding.html
@@ -10,33 +10,33 @@
   <script type="application/javascript">
 
 function consoleListener() {
   SpecialPowers.addObserver(this, "console-api-log-event");
 }
 
 var order = 0;
 consoleListener.prototype  = {
-  observe: function(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     if (aTopic == "console-api-log-event") {
       var obj = aSubject.wrappedJSObject;
-      if (order+1 == parseInt(obj.arguments[0])) {
+      if (order + 1 == parseInt(obj.arguments[0])) {
         ok(true, "Message received: " + obj.arguments[0]);
         order++;
       }
 
       if (order == 3) {
         SpecialPowers.removeObserver(this, "console-api-log-event");
         SimpleTest.finish();
-        return;
+
       }
     }
-  }
-}
+  },
+};
 
 var cl = new consoleListener();
 SimpleTest.waitForExplicitFinish();
 
-[1,2,3].forEach(console.log);
+[1, 2, 3].forEach(console.log);
 
   </script>
 </body>
 </html>
--- a/dom/console/tests/test_count.html
+++ b/dom/console/tests/test_count.html
@@ -13,17 +13,17 @@ SimpleTest.waitForExplicitFinish();
 
 function ConsoleListener() {
   SpecialPowers.addObserver(this, "console-api-log-event");
 }
 
 ConsoleListener.prototype = {
   observe(aSubject, aTopic, aData) {
     let obj = aSubject.wrappedJSObject;
-    if (obj.arguments[0] != 'test') {
+    if (obj.arguments[0] != "test") {
       return;
     }
 
     if (!this._cb) {
       ok(false, "Callback not set!");
       return;
     }
 
--- a/dom/console/tests/test_devtools_pref.html
+++ b/dom/console/tests/test_devtools_pref.html
@@ -15,27 +15,27 @@ function consoleListener(expected) {
     let observer = {
       observe: function listener(aSubject, aTopic, aData) {
         var obj = aSubject.wrappedJSObject;
         messages.push(parseInt(obj.arguments[0]));
         if (messages.length == expected) {
           SpecialPowers.removeObserver(observer, "console-api-log-event");
           SpecialPowers.removeObserver(observer, "console-api-profiler");
           done(messages);
-          return;
+
         }
-      }
+      },
     };
     SpecialPowers.addObserver(observer, "console-api-log-event");
     SpecialPowers.addObserver(observer, "console-api-profiler");
   });
 }
 
 SimpleTest.waitForExplicitFinish();
-(async function () {
+(async function() {
   var onMessages = consoleListener(4);
 
   await SpecialPowers.pushPrefEnv({set: [["devtools.enabled", false]]});
   console.log(1);
   console.profile(2);
 
   await SpecialPowers.pushPrefEnv({set: [["devtools.enabled", true]]});
   console.log(3);
--- a/dom/console/tests/xpcshell/test_basic.js
+++ b/dom/console/tests/xpcshell/test_basic.js
@@ -7,25 +7,25 @@ add_task(async function() {
   Assert.ok("console" in this);
 
   let p = new Promise(resolve => {
     function consoleListener() {
       Services.obs.addObserver(this, "console-api-log-event");
     }
 
     consoleListener.prototype  = {
-      observe: function(aSubject, aTopic, aData) {
+      observe(aSubject, aTopic, aData) {
         let obj = aSubject.wrappedJSObject;
         Assert.ok(obj.arguments[0] === 42, "Message received!");
         Assert.ok(obj.ID === "jsm", "The ID is JSM");
         Assert.ok(obj.innerID.endsWith("test_basic.js"), "The innerID matches");
 
         Services.obs.removeObserver(this, "console-api-log-event");
         resolve();
-      }
+      },
     };
 
     new consoleListener();
   });
 
   console.log(42);
   await p;
 });
--- a/dom/console/tests/xpcshell/test_reportForServiceWorkerScope.js
+++ b/dom/console/tests/xpcshell/test_reportForServiceWorkerScope.js
@@ -5,29 +5,29 @@ ChromeUtils.import("resource://gre/modul
 
 add_task(async function() {
   let p = new Promise(resolve => {
     function consoleListener() {
       Services.obs.addObserver(this, "console-api-log-event");
     }
 
     consoleListener.prototype  = {
-      observe: function(aSubject, aTopic, aData) {
+      observe(aSubject, aTopic, aData) {
         let obj = aSubject.wrappedJSObject;
         Assert.ok(obj.arguments[0] === "Hello world!", "Message received!");
         Assert.ok(obj.ID === "scope", "The ID is the scope");
         Assert.ok(obj.innerID === "ServiceWorker", "The innerID is ServiceWorker");
         Assert.ok(obj.filename === "filename", "The filename matches");
         Assert.ok(obj.lineNumber === 42, "The lineNumber matches");
         Assert.ok(obj.columnNumber === 24, "The columnNumber matches");
         Assert.ok(obj.level === "error", "The level is correct");
 
         Services.obs.removeObserver(this, "console-api-log-event");
         resolve();
-      }
+      },
     };
 
     new consoleListener();
   });
 
   let ci = console.createInstance();
   ci.reportForServiceWorkerScope("scope", "Hello world!", "filename", 42, 24, "error");
   await p;