Bug 1316882: Turn on func-call-spacing eslint rule. draft
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 10 Nov 2016 15:05:32 -0800
changeset 438561 1bcf8a619f3e3bce15513077960844232054cf83
parent 438560 886d0f64aa7da2b4bd6eaf44bfa0a16a7bb3b5ef
child 438562 56745c78697c722269c84d4063d177d445ffc87f
push id35762
push userdtownsend@mozilla.com
push dateMon, 14 Nov 2016 19:31:49 +0000
bugs1316882
milestone52.0a1
Bug 1316882: Turn on func-call-spacing eslint rule. MozReview-Commit-ID: GIkQnRX9woD
browser/base/content/test/general/browser_clipboard_pastefile.js
browser/base/content/test/general/browser_devedition.js
browser/base/content/test/general/browser_keywordBookmarklets.js
browser/base/content/test/general/browser_save_link-perwindowpb.js
browser/base/content/test/general/browser_save_link_when_window_navigates.js
browser/base/content/test/general/browser_save_private_link_perwindowpb.js
browser/base/content/test/general/browser_trackingUI_4.js
browser/base/content/test/general/browser_trackingUI_6.js
browser/components/migration/tests/unit/head_migration.js
browser/components/places/PlacesUIUtils.jsm
browser/components/places/tests/browser/browser_416459_cut.js
browser/modules/test/unit/social/test_SocialService.js
toolkit/.eslintrc.js
toolkit/components/crashes/CrashManagerTest.jsm
toolkit/components/places/tests/unit/test_preventive_maintenance_checkAndFixDatabase.js
toolkit/components/places/tests/unit/test_preventive_maintenance_runTasks.js
toolkit/components/prompts/test/bug619644_inner.html
toolkit/components/telemetry/TelemetrySession.jsm
toolkit/components/tooltiptext/tests/browser_bug581947.js
toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js
toolkit/content/widgets/colorpicker.xml
toolkit/content/widgets/preferences.xml
toolkit/modules/GMPInstallManager.jsm
toolkit/modules/Sntp.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/test/browser/browser_cancelCompatCheck.js
toolkit/mozapps/preferences/changemp.js
--- a/browser/base/content/test/general/browser_clipboard_pastefile.js
+++ b/browser/base/content/test/general/browser_clipboard_pastefile.js
@@ -30,17 +30,17 @@ add_task(function*() {
     content.document.getElementById("input").focus();
   });
 
   yield BrowserTestUtils.synthesizeKey("v", { accelKey: true }, browser);
 
   let output = yield ContentTask.spawn(browser, { }, function* (arg) {
     return content.document.getElementById("output").textContent;
   });
-  is (output, "Passed", "Paste file");
+  is(output, "Passed", "Paste file");
 
   textbox.focus();
 
   yield new Promise((resolve, reject) => {
     textbox.addEventListener("paste", function copyEvent(event) {
       textbox.removeEventListener("paste", copyEvent, true);
 
       let dt = event.clipboardData;
--- a/browser/base/content/test/general/browser_devedition.js
+++ b/browser/base/content/test/general/browser_devedition.js
@@ -20,100 +20,100 @@ registerCleanupFunction(() => {
 
   LightweightThemeManager.currentTheme = null;
   LightweightThemeManager.clearBuiltInThemes();
 });
 
 add_task(function* startTests() {
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
 
-  info ("Setting the current theme to null");
+  info("Setting the current theme to null");
   LightweightThemeManager.currentTheme = null;
-  ok (!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
+  ok(!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
 
-  info ("Adding a lightweight theme.");
+  info("Adding a lightweight theme.");
   LightweightThemeManager.currentTheme = dummyLightweightTheme("preview0");
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been removed when a lightweight theme is applied.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been removed when a lightweight theme is applied.");
 
-  info ("Applying the devedition lightweight theme.");
+  info("Applying the devedition lightweight theme.");
   let onAttributeAdded = waitForBrightTitlebarAttribute();
   LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
   yield onAttributeAdded;
-  is (document.documentElement.getAttribute("brighttitlebarforeground"), "true",
+  is(document.documentElement.getAttribute("brighttitlebarforeground"), "true",
      "The brighttitlebarforeground attribute is set on the window.");
 
-  info ("Unapplying all themes.");
+  info("Unapplying all themes.");
   LightweightThemeManager.currentTheme = null;
-  ok (!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
+  ok(!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
 
-  info ("Applying the devedition lightweight theme.");
+  info("Applying the devedition lightweight theme.");
   onAttributeAdded = waitForBrightTitlebarAttribute();
   LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
   yield onAttributeAdded;
-  ok (document.documentElement.hasAttribute("brighttitlebarforeground"),
+  ok(document.documentElement.hasAttribute("brighttitlebarforeground"),
      "The brighttitlebarforeground attribute is set on the window with dark devtools theme.");
 });
 
 add_task(function* testDevtoolsTheme() {
-  info ("Checking stylesheet and :root attributes based on devtools theme.");
+  info("Checking stylesheet and :root attributes based on devtools theme.");
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
-  is (document.documentElement.getAttribute("devtoolstheme"), "light",
+  is(document.documentElement.getAttribute("devtoolstheme"), "light",
     "The documentElement has an attribute based on devtools theme.");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the light devtools theme.");
-  ok (!document.documentElement.hasAttribute("brighttitlebarforeground"),
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the light devtools theme.");
+  ok(!document.documentElement.hasAttribute("brighttitlebarforeground"),
      "The brighttitlebarforeground attribute is not set on the window with light devtools theme.");
 
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
-  is (document.documentElement.getAttribute("devtoolstheme"), "dark",
+  is(document.documentElement.getAttribute("devtoolstheme"), "dark",
     "The documentElement has an attribute based on devtools theme.");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the dark devtools theme.");
-  is (document.documentElement.getAttribute("brighttitlebarforeground"), "true",
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the dark devtools theme.");
+  is(document.documentElement.getAttribute("brighttitlebarforeground"), "true",
      "The brighttitlebarforeground attribute is set on the window with dark devtools theme.");
 
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "foobar");
-  is (document.documentElement.getAttribute("devtoolstheme"), "light",
+  is(document.documentElement.getAttribute("devtoolstheme"), "light",
     "The documentElement has 'light' as a default for the devtoolstheme attribute");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the foobar devtools theme.");
-  ok (!document.documentElement.hasAttribute("brighttitlebarforeground"),
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the foobar devtools theme.");
+  ok(!document.documentElement.hasAttribute("brighttitlebarforeground"),
      "The brighttitlebarforeground attribute is not set on the window with light devtools theme.");
 });
 
 function dummyLightweightTheme(id) {
   return {
     id: id,
     name: id,
     headerURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.header.png",
     iconURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.icon.png",
     textcolor: "red",
     accentcolor: "blue"
   };
 }
 
 add_task(function* testLightweightThemePreview() {
-  info ("Setting devedition to current and the previewing others");
+  info("Setting devedition to current and the previewing others");
   LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
   LightweightThemeManager.previewTheme(dummyLightweightTheme("preview0"));
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a lightweight theme preview.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a lightweight theme preview.");
   LightweightThemeManager.resetPreview();
   LightweightThemeManager.previewTheme(dummyLightweightTheme("preview1"));
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a second lightweight theme preview.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a second lightweight theme preview.");
   LightweightThemeManager.resetPreview();
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled again after resetting the preview.");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled again after resetting the preview.");
   LightweightThemeManager.currentTheme = null;
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is gone after removing the current theme.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is gone after removing the current theme.");
 
-  info ("Previewing the devedition theme");
+  info("Previewing the devedition theme");
   LightweightThemeManager.previewTheme(LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org"));
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
   LightweightThemeManager.previewTheme(dummyLightweightTheme("preview2"));
   LightweightThemeManager.resetPreview();
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is now disabled after resetting the preview.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is now disabled after resetting the preview.");
 });
 
 // Use a mutation observer to wait for the brighttitlebarforeground
 // attribute to change.  Using this instead of waiting for the load
 // event on the DevEdition styleSheet.
 function waitForBrightTitlebarAttribute() {
   return new Promise((resolve, reject) => {
     let mutationObserver = new MutationObserver(function (mutations) {
--- a/browser/base/content/test/general/browser_keywordBookmarklets.js
+++ b/browser/base/content/test/general/browser_keywordBookmarklets.js
@@ -1,16 +1,16 @@
 "use strict"
 
 add_task(function* test_keyword_bookmarklet() {
   let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
                                                 title: "bookmarklet",
                                                 url: "javascript:'1';" });
   let tab = gBrowser.selectedTab = gBrowser.addTab();
-  registerCleanupFunction (function* () {
+  registerCleanupFunction(function* () {
     gBrowser.removeTab(tab);
     yield PlacesUtils.bookmarks.remove(bm);
   });
   yield promisePageShow();
   let originalPrincipal = gBrowser.contentPrincipal;
 
   function getPrincipalURI() {
     return ContentTask.spawn(tab.linkedBrowser, null, function() {
--- a/browser/base/content/test/general/browser_save_link-perwindowpb.js
+++ b/browser/base/content/test/general/browser_save_link-perwindowpb.js
@@ -34,17 +34,17 @@ function triggerSave(aWindow, aCallback)
     var destDir = createTemporarySaveDirectory();
     var destFile = destDir.clone();
 
     MockFilePicker.displayDirectory = destDir;
     MockFilePicker.showCallback = function(fp) {
       info("showCallback");
       fileName = fp.defaultString;
       info("fileName: " + fileName);
-      destFile.append (fileName);
+      destFile.append(fileName);
       MockFilePicker.returnFiles = [destFile];
       MockFilePicker.filterIndex = 1; // kSaveAsType_URL
       info("done showCallback");
     };
 
     mockTransferCallback = function(downloadSuccess) {
       info("mockTransferCallback");
       onTransferComplete(aWindow, downloadSuccess, destDir);
--- a/browser/base/content/test/general/browser_save_link_when_window_navigates.js
+++ b/browser/base/content/test/general/browser_save_link_when_window_navigates.js
@@ -38,17 +38,17 @@ function triggerSave(aWindow, aCallback)
   var destDir = createTemporarySaveDirectory();
   var destFile = destDir.clone();
 
   MockFilePicker.displayDirectory = destDir;
   MockFilePicker.showCallback = function(fp) {
     info("showCallback");
     fileName = fp.defaultString;
     info("fileName: " + fileName);
-    destFile.append (fileName);
+    destFile.append(fileName);
     MockFilePicker.returnFiles = [destFile];
     MockFilePicker.filterIndex = 1; // kSaveAsType_URL
     info("done showCallback");
   };
 
   mockTransferCallback = function(downloadSuccess) {
     info("mockTransferCallback");
     onTransferComplete(aWindow, downloadSuccess, destDir);
--- a/browser/base/content/test/general/browser_save_private_link_perwindowpb.js
+++ b/browser/base/content/test/general/browser_save_private_link_perwindowpb.js
@@ -55,17 +55,17 @@ function promiseImageDownloaded() {
 
     // Create the folder the image will be saved into.
     var destDir = createTemporarySaveDirectory();
     var destFile = destDir.clone();
 
     MockFilePicker.displayDirectory = destDir;
     MockFilePicker.showCallback = function(fp) {
       fileName = fp.defaultString;
-      destFile.append (fileName);
+      destFile.append(fileName);
       MockFilePicker.returnFiles = [destFile];
       MockFilePicker.filterIndex = 1; // kSaveAsType_URL
     };
 
     mockTransferCallback = onTransferComplete;
     mockTransferRegisterer.register();
 
     registerCleanupFunction(function () {
--- a/browser/base/content/test/general/browser_trackingUI_4.js
+++ b/browser/base/content/test/general/browser_trackingUI_4.js
@@ -25,17 +25,17 @@ registerCleanupFunction(function() {
 });
 
 function waitForSecurityChange(numChanges = 1) {
   return new Promise(resolve => {
     let n = 0;
     let listener = {
       onSecurityChange: function() {
         n = n + 1;
-        info ("Received onSecurityChange event " + n + " of " + numChanges);
+        info("Received onSecurityChange event " + n + " of " + numChanges);
         if (n >= numChanges) {
           tabbrowser.removeProgressListener(listener);
           resolve();
         }
       }
     };
     tabbrowser.addProgressListener(listener);
   });
--- a/browser/base/content/test/general/browser_trackingUI_6.js
+++ b/browser/base/content/test/general/browser_trackingUI_6.js
@@ -1,17 +1,17 @@
 const URL = "http://mochi.test:8888/browser/browser/base/content/test/general/file_trackingUI_6.html";
 
 function waitForSecurityChange(numChanges = 1) {
   return new Promise(resolve => {
     let n = 0;
     let listener = {
       onSecurityChange: function() {
         n = n + 1;
-        info ("Received onSecurityChange event " + n + " of " + numChanges);
+        info("Received onSecurityChange event " + n + " of " + numChanges);
         if (n >= numChanges) {
           gBrowser.removeProgressListener(listener);
           resolve();
         }
       }
     };
     gBrowser.addProgressListener(listener);
   });
--- a/browser/components/migration/tests/unit/head_migration.js
+++ b/browser/components/migration/tests/unit/head_migration.js
@@ -25,17 +25,17 @@ updateAppInfo();
 /**
  * Migrates the requested resource and waits for the migration to be complete.
  */
 function promiseMigration(migrator, resourceType, aProfile = null) {
   // Ensure resource migration is available.
   let availableSources = migrator.getMigrateData(aProfile, false);
   Assert.ok((availableSources & resourceType) > 0, "Resource supported by migrator");
 
-  return new Promise (resolve => {
+  return new Promise(resolve => {
     Services.obs.addObserver(function onMigrationEnded() {
       Services.obs.removeObserver(onMigrationEnded, "Migration:Ended");
       resolve();
     }, "Migration:Ended", false);
 
     migrator.migrate(resourceType, null, aProfile);
   });
 }
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -585,17 +585,17 @@ this.PlacesUIUtils = {
    *          move/insert command.
    */
   getTransactionForData: function(aData, aType, aNewParentGuid, aIndex, aCopy) {
     if (!this.SUPPORTED_FLAVORS.includes(aData.type))
       throw new Error(`Unsupported '${aData.type}' data type`);
 
     if ("itemGuid" in aData) {
       if (!this.PLACES_FLAVORS.includes(aData.type))
-        throw new Error (`itemGuid unexpectedly set on ${aData.type} data`);
+        throw new Error(`itemGuid unexpectedly set on ${aData.type} data`);
 
       let info = { guid: aData.itemGuid
                  , newParentGuid: aNewParentGuid
                  , newIndex: aIndex };
       if (aCopy) {
         info.excludingAnnotation = "Places/SmartBookmark";
         return PlacesTransactions.Copy(info);
       }
--- a/browser/components/places/tests/browser/browser_416459_cut.js
+++ b/browser/components/places/tests/browser/browser_416459_cut.js
@@ -63,17 +63,17 @@ var selectBookmarksIn = Task.async(funct
   let PlacesOrganizer = organizer.PlacesOrganizer;
   let ContentTree = organizer.ContentTree;
   info("Selecting " + aLeftPaneQuery + " in the left pane");
   PlacesOrganizer.selectLeftPaneQuery(aLeftPaneQuery);
 
   let ids = [];
   for (let {guid} of bookmarks) {
     let bookmark = yield PlacesUtils.bookmarks.fetch(guid);
-    is (bookmark.parentGuid, PlacesOrganizer._places.selectedNode.targetFolderGuid,
+    is(bookmark.parentGuid, PlacesOrganizer._places.selectedNode.targetFolderGuid,
         "Bookmark has the right parent");
     ids.push(yield PlacesUtils.promiseItemId(bookmark.guid));
   }
 
   info("Selecting the bookmarks in the right pane");
   ContentTree.view.selectItems(ids);
 
   for (let node of ContentTree.view.selectedNodes) {
--- a/browser/modules/test/unit/social/test_SocialService.js
+++ b/browser/modules/test/unit/social/test_SocialService.js
@@ -29,17 +29,17 @@ function run_test() {
 
   let runner = new AsyncRunner();
   let next = runner.next.bind(runner);
   runner.appendIterator(testAddProviders(manifests, next));
   runner.appendIterator(testGetProvider(manifests, next));
   runner.appendIterator(testGetProviderList(manifests, next));
   runner.appendIterator(testAddRemoveProvider(manifests, next));
   runner.appendIterator(testIsSameOrigin(manifests, next));
-  runner.appendIterator(testResolveUri  (manifests, next));
+  runner.appendIterator(testResolveUri(manifests, next));
   runner.appendIterator(testOrderedProviders(manifests, next));
   runner.appendIterator(testRemoveProviders(manifests, next));
   runner.next();
 }
 
 function* testAddProviders(manifests, next) {
   do_check_false(SocialService.enabled);
   let provider = yield SocialService.addProvider(manifests[0], next);
--- a/toolkit/.eslintrc.js
+++ b/toolkit/.eslintrc.js
@@ -31,16 +31,19 @@ module.exports = {
     // Require braces around blocks that start a new line
     // Note that this rule is likely to be overridden on a per-directory basis
     // very frequently.
     // "curly": ["error", "multi-line"],
 
     // Always require a trailing EOL
     "eol-last": "error",
 
+    // No spaces between function name and parentheses
+    "func-call-spacing": "error",
+
     // Require function* name()
     // "generator-star-spacing": ["error", {"before": false, "after": true}],
 
     // Two space indent
     // "indent": ["error", 2, { "SwitchCase": 1 }],
 
     // Space after colon not before in property declarations
     // "key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }],
@@ -133,19 +136,16 @@ module.exports = {
     "no-self-compare": "error",
 
     // No declaring variables from an outer scope
     // "no-shadow": "error",
 
     // No declaring variables that hide things like arguments
     "no-shadow-restricted-names": "error",
 
-    // No spaces between function name and parentheses
-    // "no-spaced-func": "error",
-
     // No trailing whitespace
     "no-trailing-spaces": "error",
 
     // No using undeclared variables
     // "no-undef": "error",
 
     // Error on newline where a semicolon is needed
     "no-unexpected-multiline": "error",
--- a/toolkit/components/crashes/CrashManagerTest.jsm
+++ b/toolkit/components/crashes/CrashManagerTest.jsm
@@ -95,17 +95,17 @@ this.TestingCrashManager.prototype = {
       path = OS.Path.join(this._submittedDumpsDir, filename);
     } else {
       path = OS.Path.join(this._pendingDumpsDir, filename);
     }
 
     return Task.spawn(function* () {
       let mode = OS.Constants.libc.S_IRUSR | OS.Constants.libc.S_IWUSR;
       yield OS.File.open(path, {create: true}, {unixMode: mode});
-      dump ("Create ignored dump file: " + path + "\n");
+      dump("Create ignored dump file: " + path + "\n");
     });
   },
 
   createEventsFile: function (filename, type, date, content, index = 0) {
     let path = OS.Path.join(this._eventsDirs[index], filename);
 
     let data = type + "\n" +
                Math.floor(date.getTime() / 1000) + "\n" +
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance_checkAndFixDatabase.js
+++ b/toolkit/components/places/tests/unit/test_preventive_maintenance_checkAndFixDatabase.js
@@ -15,17 +15,17 @@ function run_test() {
   do_test_pending();
   PlacesDBUtils.checkAndFixDatabase(function(aLog) {
     let sections = [];
     let positives = [];
     let negatives = [];
     let infos = [];
 
     aLog.forEach(function (aMsg) {
-      print (aMsg);
+      print(aMsg);
       switch (aMsg.substr(0, 1)) {
         case "+":
           positives.push(aMsg);
           break;
         case "-":
           negatives.push(aMsg);
           break;
         case ">":
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance_runTasks.js
+++ b/toolkit/components/places/tests/unit/test_preventive_maintenance_runTasks.js
@@ -13,17 +13,17 @@ function run_test() {
   do_test_pending();
   PlacesDBUtils.runTasks([PlacesDBUtils.reindex], function(aLog) {
     let sections = [];
     let positives = [];
     let negatives = [];
     let infos = [];
 
     aLog.forEach(function (aMsg) {
-      print (aMsg);
+      print(aMsg);
       switch (aMsg.substr(0, 1)) {
         case "+":
           positives.push(aMsg);
           break;
         case "-":
           negatives.push(aMsg);
           break;
         case ">":
--- a/toolkit/components/prompts/test/bug619644_inner.html
+++ b/toolkit/components/prompts/test/bug619644_inner.html
@@ -1,7 +1,7 @@
 <head></head><body><p>Original content</p>
 <script>
     window.opener.postMessage("", "*");
-    confirm ("Message");
-    document.write ("Extra content");
+    confirm("Message");
+    document.write("Extra content");
     window.opener.postMessage(document.documentElement.innerHTML, "*");
 </script></body>
--- a/toolkit/components/telemetry/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/TelemetrySession.jsm
@@ -1724,17 +1724,17 @@ var Impl = {
     if (Telemetry.canRecordExtended) {
       let payload = this.getSessionPayload(REASON_SAVED_SESSION, false);
 
       let options = {
         addClientId: true,
         addEnvironment: true,
       };
       p.push(TelemetryController.submitExternalPing(getPingType(payload), payload, options)
-                                .catch (e => this._log.error("saveShutdownPings - failed to submit saved-session ping", e)));
+                                .catch(e => this._log.error("saveShutdownPings - failed to submit saved-session ping", e)));
     }
 
     // Wait on pings to be saved.
     return Promise.all(p);
   },
 
 
   testSavePendingPing: function testSaveHistograms() {
--- a/toolkit/components/tooltiptext/tests/browser_bug581947.js
+++ b/toolkit/components/tooltiptext/tests/browser_bug581947.js
@@ -19,22 +19,22 @@ function check(aBrowser, aElementName, a
       ok(!tttp.getNodeText(e, {}, {}),
          "No tooltip should be shown when the element is barred from constraint validation");
     } else {
       ok(tttp.getNodeText(e, {}, {}),
          e.tagName + " " + "A tooltip should be shown when the element isn't valid");
     }
 
     e.setAttribute('title', '');
-    ok (!tttp.getNodeText(e, {}, {}),
+    ok(!tttp.getNodeText(e, {}, {}),
         "No tooltip should be shown if the title attribute is set");
 
     e.removeAttribute('title');
     contentElement.setAttribute('novalidate', '');
-    ok (!tttp.getNodeText(e, {}, {}),
+    ok(!tttp.getNodeText(e, {}, {}),
         "No tooltip should be shown if the novalidate attribute is set on the form owner");
     contentElement.removeAttribute('novalidate');
 
     e.remove();
   });
 }
 
 function todo_check(aBrowser, aElementName, aBarred) {
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js
+++ b/toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js
@@ -1216,17 +1216,17 @@ WidgetStack.prototype = {
       }
 
       // initialize inner bounds to top-left
       state.viewportInnerBounds = new wsRect(0, 0, state.rect.width, state.rect.height);
     }
 
     this._widgetState[wid] = state;
 
-    log ("(New widget: " + wid + (state.viewport ? " [viewport]" : "") + " at: " + state.rect + ")");
+    log("(New widget: " + wid + (state.viewport ? " [viewport]" : "") + " at: " + state.rect + ")");
   },
 
   _removeWidget: function (w) {
     let wid = w.getAttribute("id");
     delete this._widgetState[wid];
     this._updateWidgets();
   },
 
--- a/toolkit/content/widgets/colorpicker.xml
+++ b/toolkit/content/widgets/colorpicker.xml
@@ -225,17 +225,17 @@
         <parameter name="aEventName"/>
         <body>
         <![CDATA[
           try {
             var event = document.createEvent("Events");
             event.initEvent(aEventName, true, true);
             var cancel = !aTarget.dispatchEvent(event);
             if (aTarget.hasAttribute("on" + aEventName)) {
-              var fn = new Function ("event", aTarget.getAttribute("on" + aEventName));
+              var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
               var rv = fn.call(aTarget, event);
               if (rv == false)
                 cancel = true;
             }
             return !cancel;
           }
           catch (e) {
             Components.utils.reportError(e);
@@ -481,17 +481,17 @@
         <parameter name="aEventName"/>
         <body>
         <![CDATA[
           try {
             var event = document.createEvent("Events");
             event.initEvent(aEventName, true, true);
             var cancel = !aTarget.dispatchEvent(event);
             if (aTarget.hasAttribute("on" + aEventName)) {
-              var fn = new Function ("event", aTarget.getAttribute("on" + aEventName));
+              var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
               var rv = fn.call(aTarget, event);
               if (rv == false)
                 cancel = true;
             }
             return !cancel;
           }
           catch (e) {
             dump(e);
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -432,18 +432,18 @@
             return;
 
           var rv = undefined;
           if (aElement.hasAttribute("onsyncfrompreference")) {
             // Value changed, synthesize an event
             try {
               var event = document.createEvent("Events");
               event.initEvent("syncfrompreference", true, true);
-              var f = new Function ("event",
-                                    aElement.getAttribute("onsyncfrompreference"));
+              var f = new Function("event",
+                                   aElement.getAttribute("onsyncfrompreference"));
               rv = f.call(aElement, event);
             }
             catch (e) {
               Components.utils.reportError(e);
             }
           }
           var val = rv;
           if (val === undefined)
@@ -487,18 +487,18 @@
         <parameter name="aElement"/>
         <body>
         <![CDATA[
           if (aElement.hasAttribute("onsynctopreference")) {
             // Value changed, synthesize an event
             try {
               var event = document.createEvent("Events");
               event.initEvent("synctopreference", true, true);
-              var f = new Function ("event",
-                                    aElement.getAttribute("onsynctopreference"));
+              var f = new Function("event",
+                                   aElement.getAttribute("onsynctopreference"));
               var rv = f.call(aElement, event);
               if (rv !== undefined)
                 return rv;
             }
             catch (e) {
               Components.utils.reportError(e);
             }
           }
@@ -639,17 +639,17 @@
               // no buttons on Mac except Help
               cancelButton.hidden = true;
               // Move Help button to the end
               document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;
               // Also, don't fire onDialogAccept on enter
               acceptButton.disabled = true;
             } else {
               // morph the Cancel button into the Close button
-              cancelButton.setAttribute ("icon", "close");
+              cancelButton.setAttribute("icon", "close");
               cancelButton.label = docElt.getAttribute("closebuttonlabel");
               cancelButton.accesskey = docElt.getAttribute("closebuttonaccesskey");
             }
           }
         }
         this.setAttribute("animated", this._shouldAnimate ? "true" : "false");
         var panes = this.preferencePanes;
 
@@ -792,17 +792,17 @@
         <body>
         <![CDATA[
           // Panel loaded, synthesize a load event.
           try {
             var event = document.createEvent("Events");
             event.initEvent(aEventName, true, true);
             var cancel = !aTarget.dispatchEvent(event);
             if (aTarget.hasAttribute("on" + aEventName)) {
-              var fn = new Function ("event", aTarget.getAttribute("on" + aEventName));
+              var fn = new Function("event", aTarget.getAttribute("on" + aEventName));
               var rv = fn.call(aTarget, event);
               if (rv == false)
                 cancel = true;
             }
             return !cancel;
           }
           catch (e) {
             Components.utils.reportError(e);
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -320,17 +320,17 @@ GMPInstallManager.prototype = {
  *
  * @param addon The ProductAddonChecker `addon` object
  */
 function GMPAddon(addon) {
   let log = getScopedLogger("GMPAddon.constructor");
   for (let name of Object.keys(addon)) {
     this[name] = addon[name];
   }
-  log.info ("Created new addon: " + this.toString());
+  log.info("Created new addon: " + this.toString());
 }
 
 GMPAddon.prototype = {
   /**
    * Returns a string representation of the addon
    */
   toString: function() {
     return this.id + " (" +
--- a/toolkit/modules/Sntp.jsm
+++ b/toolkit/modules/Sntp.jsm
@@ -124,17 +124,17 @@ Sntp.prototype = {
   },
 
   /**
    * Used for retry SNTP requests.
    */
   _retry: function _retry() {
     this._retryCount++;
     if (this._retryCount > this._maxRetryCount) {
-      debug ("stop retrying SNTP");
+      debug("stop retrying SNTP");
       // Clear so we can start with clean status next time we have network.
       this._retryCount = 0;
       this._retryPeriodInMS = 0;
       return;
     }
     this._retryPeriodInMS = Math.max(1000, this._retryPeriodInMS * 2);
 
     this._schedule(this._retryPeriodInMS);
@@ -171,32 +171,32 @@ Sntp.prototype = {
 
     function SNTPListener() {}
     SNTPListener.prototype = {
       onStartRequest: function onStartRequest(request, context) {
       },
 
       onStopRequest: function onStopRequest(request, context, status) {
         if (!Components.isSuccessCode(status)) {
-          debug ("Connection failed");
+          debug("Connection failed");
           this._requesting = false;
           this._retry();
         }
       }.bind(this),
 
       onDataAvailable: function onDataAvailable(request, context, inputStream,
                                                 offset, count) {
         function GetTimeStamp(binaryInputStream) {
           let s = binaryInputStream.read32();
           let f = binaryInputStream.read32();
           return Math.floor(
             ((s - OFFSET_1900_TO_1970) * 1000) + ((f * 1000) / 0x100000000)
           );
         }
-        debug ("Data available: " + count + " bytes");
+        debug("Data available: " + count + " bytes");
 
         try {
           let binaryInputStream = Cc["@mozilla.org/binaryinputstream;1"]
                                     .createInstance(Ci.nsIBinaryInputStream);
           binaryInputStream.setInputStream(inputStream);
           // We don't need first 24 bytes.
           for (let i = 0; i < 6; i++) {
             binaryInputStream.read32();
@@ -208,34 +208,34 @@ Sntp.prototype = {
           // Offset 40: transmit time.
           let transmitTimeInMS = GetTimeStamp(binaryInputStream);
           let respondTimeInMS = Date.now();
 
           this._handleSntp(originateTimeInMS, receiveTimeInMS,
                            transmitTimeInMS, respondTimeInMS);
           this._requesting = false;
         } catch (e) {
-          debug ("SNTPListener Error: " + e.message);
+          debug("SNTPListener Error: " + e.message);
           this._requesting = false;
           this._retry();
         }
         inputStream.close();
       }.bind(this)
     };
 
     function SNTPRequester() {}
     SNTPRequester.prototype = {
       onOutputStreamReady: function(stream) {
         try {
           let data = GetRequest();
           let bytes_write = stream.write(data, data.length);
-          debug ("SNTP: sent " + bytes_write + " bytes");
+          debug("SNTP: sent " + bytes_write + " bytes");
           stream.close();
         } catch (e) {
-          debug ("SNTPRequester Error: " + e.message);
+          debug("SNTPRequester Error: " + e.message);
           this._requesting = false;
           this._retry();
         }
       }.bind(this)
     };
 
     // Number of seconds between Jan 1, 1900 and Jan 1, 1970.
     // 70 years plus 17 leap days.
@@ -247,17 +247,17 @@ Sntp.prototype = {
     if (this._pools.length < 1) {
       debug("No server defined");
       return;
     }
     if (this._updateTimer) {
       this._updateTimer.cancel();
     }
 
-    debug ("Making request");
+    debug("Making request");
     this._requesting = true;
 
     let currentThread = Cc["@mozilla.org/thread-manager;1"]
                           .getService().currentThread;
     let socketTransportService =
       Cc["@mozilla.org/network/socket-transport-service;1"]
         .getService(Ci.nsISocketTransportService);
     let pump = Cc["@mozilla.org/network/input-stream-pump;1"]
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -4215,17 +4215,17 @@ this.XPIProvider = {
    * Called to get an Addon with a particular ID.
    *
    * @param  aId
    *         The ID of the add-on to retrieve
    * @param  aCallback
    *         A callback to pass the Addon to
    */
   getAddonByID: function(aId, aCallback) {
-    XPIDatabase.getVisibleAddonForID (aId, function(aAddon) {
+    XPIDatabase.getVisibleAddonForID(aId, function(aAddon) {
       aCallback(aAddon ? aAddon.wrapper : null);
     });
   },
 
   /**
    * Called to get Addons of a particular type.
    *
    * @param  aTypes
--- a/toolkit/mozapps/extensions/test/browser/browser_cancelCompatCheck.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_cancelCompatCheck.js
@@ -273,17 +273,17 @@ add_task(function* cancel_during_repopul
   info("Waiting for installs to complete");
   yield installsDone;
   ok(!repo.AddonRepository.isSearching, "Background installs are done");
 
   // There should be no active updates
   let getInstalls = Promise.defer();
   AddonManager.getAllInstalls(getInstalls.resolve);
   let installs = yield getInstalls.promise;
-  is (installs.length, 0, "There should be no active installs after background installs are done");
+  is(installs.length, 0, "There should be no active installs after background installs are done");
 
   // addon8 should have updated in the background,
   // addon9 was listed as previously disabled so it should not have updated
   [a5, a8, a9, a10] = yield promise_addons_by_ids([ao5.id, ao8.id, ao9.id, ao10.id]);
   ok(a5.isCompatible, "addon5 should be compatible");
   ok(a8.isCompatible, "addon8 should have been upgraded");
   ok(!a9.isCompatible, "addon9 should not have been upgraded");
   ok(!a10.isCompatible, "addon10 should not be compatible");
@@ -342,17 +342,17 @@ add_task(function* cancel_during_findUpd
   [a5, a8, a9] = yield promise_addons_by_ids([ao5.id, ao8.id, ao9.id]);
   ok(a5.isCompatible, "addon5 should be compatible");
   ok(!a8.isCompatible, "addon8 should not have been upgraded");
   ok(a9.isCompatible, "addon9 should have been upgraded");
 
   let getInstalls = Promise.defer();
   AddonManager.getAllInstalls(getInstalls.resolve);
   let installs = yield getInstalls.promise;
-  is (installs.length, 0, "There should be no active installs after the dialog is cancelled 2");
+  is(installs.length, 0, "There should be no active installs after the dialog is cancelled 2");
 
   info("findUpdates done");
   yield promise_uninstall_test_addons();
 });
 
 // Cancelling during the 'mismatch' screen allows add-ons that can auto-update
 // to continue updating in the background and cancels any other updates
 // Same conditions as the previous test - addon8 and addon9 have updates available,
--- a/toolkit/mozapps/preferences/changemp.js
+++ b/toolkit/mozapps/preferences/changemp.js
@@ -167,29 +167,29 @@ function setPasswordStrength()
 
 // length of the password
   var pwlength = (pw.length);
   if (pwlength > 5)
     pwlength = 5;
 
 
 // use of numbers in the password
-  var numnumeric = pw.replace (/[0-9]/g, "");
+  var numnumeric = pw.replace(/[0-9]/g, "");
   var numeric = (pw.length - numnumeric.length);
   if (numeric > 3)
     numeric = 3;
 
 // use of symbols in the password
-  var symbols = pw.replace (/\W/g, "");
+  var symbols = pw.replace(/\W/g, "");
   var numsymbols = (pw.length - symbols.length);
   if (numsymbols > 3)
     numsymbols = 3;
 
 // use of uppercase in the password
-  var numupper = pw.replace (/[A-Z]/g, "");
+  var numupper = pw.replace(/[A-Z]/g, "");
   var upper = (pw.length - numupper.length);
   if (upper > 3)
     upper = 3;
 
 
   var pwstrength = ((pwlength * 10) - 20) + (numeric * 10) + (numsymbols * 15) + (upper * 10);
 
   // make sure we're give a value between 0 and 100