Bug 1487246: Remove uses of comma sequences in linted code. r=Standard8
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 29 Aug 2018 16:12:55 -0700
changeset 482607 2897eaa81db844652558fbe941f6a0f6e23ed29a
parent 482606 8d7c48a6e1cc35866ef53dcb62546d9037024100
child 482608 05e07c98cc3654d75c2918eaa36882a3683ca65c
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersStandard8
bugs1487246, 1487431
milestone63.0a1
Bug 1487246: Remove uses of comma sequences in linted code. r=Standard8 Two cases were hiding permanently failing tests. I've commented those out and filed bug 1487431. Differential Revision: https://phabricator.services.mozilla.com/D4680
accessible/tests/mochitest/actions/test_media.html
accessible/tests/mochitest/events/test_text_alg.html
accessible/tests/mochitest/scroll/test_zoom.html
browser/base/content/test/sanitize/browser_sanitize-timespans.js
browser/components/uitour/test/browser_UITour3.js
browser/modules/AsyncTabSwitcher.jsm
dom/indexedDB/test/unit/test_create_objectStore.js
dom/media/mediasource/test/test_FrameSelection_mp4.html
services/sync/tests/unit/test_syncengine.js
testing/marionette/driver.js
toolkit/components/alerts/test/test_alerts_requireinteraction.html
toolkit/components/antitracking/test/browser/imageCacheWorker.js
toolkit/components/osfile/modules/osfile_async_front.jsm
toolkit/components/osfile/modules/osfile_async_worker.js
toolkit/components/osfile/modules/osfile_win_front.jsm
toolkit/components/promiseworker/tests/xpcshell/data/worker.js
toolkit/modules/Preferences.jsm
--- a/accessible/tests/mochitest/actions/test_media.html
+++ b/accessible/tests/mochitest/actions/test_media.html
@@ -37,17 +37,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       };
     }
 
     function nameChecker(aAcc, aName) {
       this.type = EVENT_NAME_CHANGE;
       this.target = aAcc;
       this.getID = function nameChecker_getID() {
         return "name change handling";
-      },
+      };
       this.check = function nameChecker_check(aEvent) {
         is(aEvent.accessible.name, aName,
            "Wrong name of " + prettyName(aEvent.accessible) + " on focus");
       };
     }
 
     function doTest() {
       // ////////////////////////////////////////////////////////////////////////
--- a/accessible/tests/mochitest/events/test_text_alg.html
+++ b/accessible/tests/mochitest/events/test_text_alg.html
@@ -186,24 +186,28 @@
 
       var newStr = "a" + longStr1 + "b", insStr = longStr1, rmStr = "";
       events = [
         [ kRemoval, rmStr, 1, kUnexpected ],
         [ kInsertion, insStr, 1 ]
       ];
       gQueue.push(new changeText("p12", newStr, events));
 
-      newStr = "a" + longStr2 + "b", insStr = longStr2, rmStr = longStr1;
+      newStr = "a" + longStr2 + "b";
+      insStr = longStr2;
+      rmStr = longStr1;
       events = [
         [ kRemoval, rmStr, 1 ],
         [ kInsertion, insStr, 1]
       ];
       gQueue.push(new changeText("p12", newStr, events));
 
-      newStr = "ab", insStr = "", rmStr = longStr2;
+      newStr = "ab";
+      insStr = "";
+      rmStr = longStr2;
       events = [
         [ kRemoval, rmStr, 1 ],
         [ kInsertion, insStr, 1, kUnexpected ]
       ];
       gQueue.push(new changeText("p12", newStr, events));
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
--- a/accessible/tests/mochitest/scroll/test_zoom.html
+++ b/accessible/tests/mochitest/scroll/test_zoom.html
@@ -36,17 +36,18 @@
 
       anchor.scrollToPoint(COORDTYPE_WINDOW_RELATIVE, scrollToX, scrollToY);
       testPos(anchor, [x, docY]);
 
       // scrollToPoint relative parent
       anchor = getAccessible("bottom3");
       [x, /* y */] = getPos(anchor);
       var [parentX, parentY] = getPos(anchor.parent);
-      scrollToX = parentX - docX, scrollToY = parentY - docY;
+      scrollToX = parentX - docX;
+      scrollToY = parentY - docY;
 
       anchor.scrollToPoint(COORDTYPE_PARENT_RELATIVE, scrollToX, scrollToY);
       testPos(anchor, [x, docY]);
     }
 
     function doTest() {
       testScrollToPoint();
       zoomDocument(document, 2.0);
--- a/browser/base/content/test/sanitize/browser_sanitize-timespans.js
+++ b/browser/base/content/test/sanitize/browser_sanitize-timespans.js
@@ -596,92 +596,92 @@ async function setupFormHistory() {
 async function setupDownloads() {
 
   let publicList = await Downloads.getList(Downloads.PUBLIC);
 
   let download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=480169",
     target: "fakefile-10-minutes"
   });
-  download.startTime = new Date(now_mSec - 10 * kMsecPerMin), // 10 minutes ago
+  download.startTime = new Date(now_mSec - 10 * kMsecPerMin); // 10 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=453440",
     target: "fakefile-1-hour"
   });
-  download.startTime = new Date(now_mSec - 45 * kMsecPerMin), // 45 minutes ago
+  download.startTime = new Date(now_mSec - 45 * kMsecPerMin); // 45 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=480169",
     target: "fakefile-1-hour-10-minutes"
   });
-  download.startTime = new Date(now_mSec - 70 * kMsecPerMin), // 70 minutes ago
+  download.startTime = new Date(now_mSec - 70 * kMsecPerMin); // 70 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=453440",
     target: "fakefile-2-hour"
   });
-  download.startTime = new Date(now_mSec - 90 * kMsecPerMin), // 90 minutes ago
+  download.startTime = new Date(now_mSec - 90 * kMsecPerMin); // 90 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=480169",
     target: "fakefile-2-hour-10-minutes"
   });
-  download.startTime = new Date(now_mSec - 130 * kMsecPerMin), // 130 minutes ago
+  download.startTime = new Date(now_mSec - 130 * kMsecPerMin); // 130 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=453440",
     target: "fakefile-4-hour"
   });
-  download.startTime = new Date(now_mSec - 180 * kMsecPerMin), // 180 minutes ago
+  download.startTime = new Date(now_mSec - 180 * kMsecPerMin); // 180 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=480169",
     target: "fakefile-4-hour-10-minutes"
   });
-  download.startTime = new Date(now_mSec - 250 * kMsecPerMin), // 250 minutes ago
+  download.startTime = new Date(now_mSec - 250 * kMsecPerMin); // 250 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   // Add "today" download
   let today = new Date();
   today.setHours(0);
   today.setMinutes(0);
   today.setSeconds(0);
   today.setMilliseconds(1);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=453440",
     target: "fakefile-today"
   });
-  download.startTime = today, // 12:00:01 AM this morning
+  download.startTime = today; // 12:00:01 AM this morning
   download.canceled = true;
   await publicList.add(download);
 
   // Add "before today" download
   let lastYear = new Date();
   lastYear.setFullYear(lastYear.getFullYear() - 1);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=453440",
     target: "fakefile-old"
   });
-  download.startTime = lastYear,
+  download.startTime = lastYear;
   download.canceled = true;
   await publicList.add(download);
 
   // Confirm everything worked
   let downloads = await publicList.getAll();
   is(downloads.length, 9, "9 Pretend downloads added");
 
   ok((await downloadExists(publicList, "fakefile-old")), "Pretend download for everything case should exist");
--- a/browser/components/uitour/test/browser_UITour3.js
+++ b/browser/components/uitour/test/browser_UITour3.js
@@ -27,17 +27,17 @@ add_UITour_task(async function test_info
   is(title.textContent, "a title", "Popup should have correct title");
   is(desc.textContent, "some text", "Popup should have correct description text");
 
   let imageURL = getRootDirectory(gTestPath) + "image.png";
   imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
   is(icon.src, imageURL, "Popup should have correct icon shown");
 
   is(buttons.hasChildNodes(), false, "Popup should have no buttons");
-}),
+});
 
 add_UITour_task(async function test_info_buttons_1() {
   let popup = document.getElementById("UITourTooltip");
   let title = document.getElementById("UITourTooltipTitle");
   let desc = document.getElementById("UITourTooltipDescription");
   let icon = document.getElementById("UITourTooltipIcon");
 
   await showInfoPromise("urlbar", "another title", "moar text", "./image.png", "makeButtons");
@@ -114,29 +114,29 @@ add_UITour_task(async function test_info
   EventUtils.synthesizeMouseAtCenter(buttons.children[3], {}, window);
   await promiseHidden;
 
   ok(true, "Popup should close automatically");
 
   let returnValue = await waitForCallbackResultPromise();
 
   is(returnValue.result, "button2", "Correct callback should have been called");
-}),
+});
 
 add_UITour_task(async function test_info_close_button() {
   let closeButton = document.getElementById("UITourTooltipClose");
 
   await showInfoPromise("urlbar", "Close me", "X marks the spot", null, null, "makeInfoOptions");
 
   EventUtils.synthesizeMouseAtCenter(closeButton, {}, window);
 
   let returnValue = await waitForCallbackResultPromise();
 
   is(returnValue.result, "closeButton", "Close button callback called");
-}),
+});
 
 add_UITour_task(async function test_info_target_callback() {
   let popup = document.getElementById("UITourTooltip");
 
   await showInfoPromise("appMenu", "I want to know when the target is clicked", "*click*", null, null, "makeInfoOptions");
 
   await gCUITestUtils.openMainMenu();
 
@@ -145,17 +145,17 @@ add_UITour_task(async function test_info
   is(returnValue.result, "target", "target callback called");
   is(returnValue.data.target, "appMenu", "target callback was from the appMenu");
   is(returnValue.data.type, "popupshown", "target callback was from the mousedown");
 
   // Cleanup.
   await hideInfoPromise();
 
   popup.removeAttribute("animate");
-}),
+});
 
 add_UITour_task(async function test_getConfiguration_selectedSearchEngine() {
   await new Promise((resolve) => {
     Services.search.init(async function(rv) {
       ok(Components.isSuccessCode(rv), "Search service initialized");
       let engine = Services.search.defaultEngine;
       let data = await getConfigurationPromise("selectedSearchEngine");
       is(data.searchEngineIdentifier, engine.identifier, "Correct engine identifier");
--- a/browser/modules/AsyncTabSwitcher.jsm
+++ b/browser/modules/AsyncTabSwitcher.jsm
@@ -127,17 +127,17 @@ class AsyncTabSwitcher {
     this.STATE_UNLOADING = 3;
 
     // re-entrancy guard:
     this._processing = false;
 
     // For telemetry, keeps track of what most recently cleared
     // the loadTimer, which can tell us something about the cause
     // of tab switch spinners.
-    this._loadTimerClearedBy = "none",
+    this._loadTimerClearedBy = "none";
 
     this._useDumpForLogging = false;
     this._logInit = false;
 
     this.window.addEventListener("MozAfterPaint", this);
     this.window.addEventListener("MozLayerTreeReady", this);
     this.window.addEventListener("MozLayerTreeCleared", this);
     this.window.addEventListener("TabRemotenessChange", this);
--- a/dom/indexedDB/test/unit/test_create_objectStore.js
+++ b/dom/indexedDB/test/unit/test_create_objectStore.js
@@ -75,17 +75,17 @@ function* testSteps()
       }
     }
     is(found, true, "objectStoreNames contains name");
 
     is(objectStore.name, name, "Bad name");
     is(objectStore.keyPath, info.options && info.options.keyPath ?
                             info.options.keyPath : null,
        "Bad keyPath");
-    if (objectStore.indexNames.length, 0, "Bad indexNames");
+    is(objectStore.indexNames.length, 0, "Bad indexNames");
 
     ok(event.target.transaction, "event has a transaction");
     ok(event.target.transaction.db === db, "transaction has the right db");
     is(event.target.transaction.mode, "versionchange",
        "transaction has the correct mode");
     is(event.target.transaction.objectStoreNames.length, index + 1,
        "transaction has correct objectStoreNames list");
     found = false;
--- a/dom/media/mediasource/test/test_FrameSelection_mp4.html
+++ b/dom/media/mediasource/test/test_FrameSelection_mp4.html
@@ -34,16 +34,17 @@ runWithMSE(async (ms, v) => {
   // We have nothing to play, waiting will be fired.
   await waitUntilTime(v, 1.5);
   await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", ["init"], ".mp4");
   sb.timestampOffset = 1.601666; // End of the video track buffered - time of first video sample (0.095).
   sb.appendWindowEnd = 1.796677; // Only allow room for three extra video frames (we need 3 as this video has b-frames).
   await fetchAndLoad(sb, "bipbop/bipbop_480_624kbps-video", ["1"], ".m4s");
   ms.endOfStream();
   await Promise.all([once(ms, "sourceended"), once(v, "playing"), once(v, "ended")]);
-  if (v.width, 640, "has proper width");
-  if (v.height, 480, "has proper height");
+  // These tests are permafailing
+  // is(v.width, 640, "has proper width");
+  // is(v.height, 480, "has proper height");
   SimpleTest.finish();
 });
 </script>
 </pre>
 </body>
 </html>
--- a/services/sync/tests/unit/test_syncengine.js
+++ b/services/sync/tests/unit/test_syncengine.js
@@ -253,17 +253,17 @@ add_task(async function test_wipeServer(
     "/1.1/foo/storage/steam": steamCollection.handler()
   });
   await SyncTestingInfrastructure(steamServer);
   do_test_pending();
 
   try {
     // Some data to reset.
     await engine.setLastSync(123.45);
-    engine.toFetch = guidSetOfSize(3),
+    engine.toFetch = guidSetOfSize(3);
 
     _("Wipe server data and reset client.");
     await engine.wipeServer();
     Assert.equal(steamCollection.payload, undefined);
     Assert.equal(await engine.getLastSync(), 0);
     Assert.equal(engine.toFetch.size, 0);
 
   } finally {
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -1297,17 +1297,17 @@ GeckoDriver.prototype.getIdForBrowser = 
   }
 
   let winId = browser.outerWindowID;
   if (winId) {
     this._browserIds.set(permKey, winId);
     return winId;
   }
   return null;
-},
+};
 
 /**
  * Get the current window's handle. On desktop this typically corresponds
  * to the currently selected tab.
  *
  * Return an opaque server-assigned identifier to this window that
  * uniquely identifies it within this Marionette instance.  This can
  * be used to switch to this window at a later point.
--- a/toolkit/components/alerts/test/test_alerts_requireinteraction.html
+++ b/toolkit/components/alerts/test/test_alerts_requireinteraction.html
@@ -128,17 +128,17 @@ add_task(async function test_require_int
   xulAlertCreated = await promiseCreateXULAlert(alertService,
     createAlertListener("second replacement"), "second");
   ok(xulAlertCreated, "Create XUL alert");
 
   var testFinishResolve;
   var testFinishPromise = new Promise((resolve) => { testFinishResolve = resolve; });
 
   xulAlertCreated = await promiseCreateXULAlert(alertService,
-    createAlertListener("third"), "third"),
+    createAlertListener("third"), "third");
   ok(!xulAlertCreated, "XUL alert should not be visible");
 
   // Replace the not-yet-visible third alert.
   xulAlertCreated = await promiseCreateXULAlert(alertService,
     createAlertListener("third replacement",
     function showCallback() {
       alertService.closeAlert("second");
       alertService.closeAlert("third");
--- a/toolkit/components/antitracking/test/browser/imageCacheWorker.js
+++ b/toolkit/components/antitracking/test/browser/imageCacheWorker.js
@@ -3,44 +3,44 @@
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 AntiTracking.runTest("Image cache - should load the image twice.",
   // blocking callback
   async _ => {
     // Let's load the image twice here.
     let img = document.createElement("img");
     document.body.appendChild(img);
-    img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs",
+    img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs";
     await new Promise(resolve => { img.onload = resolve; });
     ok(true, "Image 1 loaded");
 
     img = document.createElement("img");
     document.body.appendChild(img);
-    img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs",
+    img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs";
     await new Promise(resolve => { img.onload = resolve; });
     ok(true, "Image 2 loaded");
   },
 
   // non-blocking callback
   {
     runExtraTests: false,
     cookieBehavior,
     blockingByContentBlocking,
     blockingByAllowList,
     callback: async _ => {
       // Let's load the image twice here as well.
       let img = document.createElement("img");
       document.body.appendChild(img);
-      img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs",
+      img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs";
       await new Promise(resolve => { img.onload = resolve; });
       ok(true, "Image 3 loaded");
 
       img = document.createElement("img");
       document.body.appendChild(img);
-      img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs",
+      img.src = "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/image.sjs";
       await new Promise(resolve => { img.onload = resolve; });
       ok(true, "Image 4 loaded");
     },
   },
   null, // cleanup function
   null, // no extra prefs
   false, // no window open test
   false // no user-interaction test
--- a/toolkit/components/osfile/modules/osfile_async_front.jsm
+++ b/toolkit/components/osfile/modules/osfile_async_front.jsm
@@ -1451,17 +1451,17 @@ var Barriers = {
         result[key][0] = Date(result[key][0]);
       }
     }
     return result;
   }
 };
 
 function setupShutdown(phaseName) {
-  Barriers[phaseName] = new AsyncShutdown.Barrier(`OS.File: Waiting for clients before ${phaseName}`),
+  Barriers[phaseName] = new AsyncShutdown.Barrier(`OS.File: Waiting for clients before ${phaseName}`);
   File[phaseName] = Barriers[phaseName].client;
 
   // Auto-flush OS.File during `phaseName`. This ensures that any I/O
   // that has been queued *before* `phaseName` is properly completed.
   // To ensure that I/O queued *during* `phaseName` change is completed,
   // clients should register using AsyncShutdown.addBlocker.
   AsyncShutdown[phaseName].addBlocker(
     `OS.File: flush I/O queued before ${phaseName}`,
--- a/toolkit/components/osfile/modules/osfile_async_worker.js
+++ b/toolkit/components/osfile/modules/osfile_async_worker.js
@@ -25,17 +25,17 @@ if (this.Components) {
 
   let PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js");
   let SharedAll = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
   let LOG = SharedAll.LOG.bind(SharedAll, "Agent");
 
   let worker = new PromiseWorker.AbstractWorker();
   worker.dispatch = function(method, args = []) {
     return Agent[method](...args);
-  },
+  };
   worker.log = LOG;
   worker.postMessage = function(message, ...transfers) {
     if (timeStamps) {
       message.timeStamps = timeStamps;
       timeStamps = null;
     }
     self.postMessage(message, ...transfers);
   };
--- a/toolkit/components/osfile/modules/osfile_win_front.jsm
+++ b/toolkit/components/osfile/modules/osfile_win_front.jsm
@@ -798,17 +798,17 @@
          let error = ctypes.winLastError;
          this.close();
          if (error == Const.ERROR_NO_MORE_FILES) {
             return null;
          }
             throw new File.Error("iter (FindNextFile)", error, this._path);
 
 
-     },
+     };
 
      /**
       * Return the next entry in the directory, if any such entry is
       * available.
       *
       * Skip special directories "." and "..".
       *
       * @return By definition of the iterator protocol, either
--- a/toolkit/components/promiseworker/tests/xpcshell/data/worker.js
+++ b/toolkit/components/promiseworker/tests/xpcshell/data/worker.js
@@ -8,17 +8,17 @@
 // Trivial worker definition
 
 importScripts("resource://gre/modules/workers/require.js");
 var PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js");
 
 var worker = new PromiseWorker.AbstractWorker();
 worker.dispatch = function(method, args = []) {
   return Agent[method](...args);
-},
+};
 worker.postMessage = function(...args) {
   self.postMessage(...args);
 };
 worker.close = function() {
   self.close();
 };
 worker.log = function(...args) {
   dump("Worker: " + args.join(" ") + "\n");
--- a/toolkit/modules/Preferences.jsm
+++ b/toolkit/modules/Preferences.jsm
@@ -182,24 +182,24 @@ Preferences.has = function(prefName) {
  *          provided an array of pref names, an array of booleans indicating
  *          whether or not the prefs have user-set values
  */
 Preferences.isSet = function(prefName) {
   if (Array.isArray(prefName))
     return prefName.map(this.isSet, this);
 
   return (this.has(prefName) && this._prefBranch.prefHasUserValue(prefName));
-},
+};
 
 /**
  * Whether or not the given pref has a user-set value. Use isSet instead,
  * which is equivalent.
  * @deprecated
  */
-Preferences.modified = function(prefName) { return this.isSet(prefName); },
+Preferences.modified = function(prefName) { return this.isSet(prefName); };
 
 Preferences.reset = function(prefName) {
   if (Array.isArray(prefName)) {
     prefName.map(v => this.reset(v));
     return;
   }
 
   this._prefBranch.clearUserPref(prefName);
@@ -324,17 +324,17 @@ Preferences.resetBranch = function(prefB
   } catch (ex) {
     // The current implementation of nsIPrefBranch in Mozilla
     // doesn't implement resetBranch, so we do it ourselves.
     if (ex.result == Cr.NS_ERROR_NOT_IMPLEMENTED)
       this.reset(this._prefBranch.getChildList(prefBranch, []));
     else
       throw ex;
   }
-},
+};
 
 /**
  * A string identifying the branch of the preferences tree to which this
  * instance provides access.
  * @private
  */
 Preferences._branchStr = "";