Bug 1316882: Turn on rest-spread-spacing eslint rule. r=felipe
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 10 Nov 2016 15:12:47 -0800
changeset 367763 519f9207ae90aba24f21e29050be112fbb4b45fb
parent 367762 5e3138495bcf2a63b5ca13d559bd584838fc99bf
child 367764 e1fa4eab9a051a4db542e4c65871e34623171b6a
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1316882
milestone53.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 1316882: Turn on rest-spread-spacing eslint rule. r=felipe MozReview-Commit-ID: EbRmrGz1G0a
browser/components/customizableui/content/toolbar.xml
browser/components/migration/EdgeProfileMigrator.js
browser/components/migration/IEProfileMigrator.js
browser/modules/PluginContent.jsm
toolkit/.eslintrc.js
toolkit/content/widgets/richlistbox.xml
--- a/browser/components/customizableui/content/toolbar.xml
+++ b/browser/components/customizableui/content/toolbar.xml
@@ -562,17 +562,17 @@
           // evictNode might affect multiple windows.
           CustomizableUI.dispatchToolboxEvent("customizationchange", {}, window);
           CustomizableUI.dispatchToolboxEvent("aftercustomization", {}, window);
           return node;
         ]]></body>
       </method>
       <method name="getMigratedItems">
         <body><![CDATA[
-          return [... this._currentSetMigrated];
+          return [...this._currentSetMigrated];
         ]]></body>
       </method>
       <method name="_updateMigratedSet">
         <body><![CDATA[
           let newMigratedItems = this.getMigratedItems().join(',');
           if (this.getAttribute("migratedset") != newMigratedItems) {
             this.setAttribute("migratedset", newMigratedItems);
             this.ownerDocument.persist(this.id, "migratedset");
--- a/browser/components/migration/EdgeProfileMigrator.js
+++ b/browser/components/migration/EdgeProfileMigrator.js
@@ -429,27 +429,27 @@ EdgeProfileMigrator.prototype.getLastUse
   // sourceProfiles) or if we can't find the database file:
   if (this.sourceProfiles !== null || !gEdgeDatabase) {
     return Promise.resolve(new Date(0));
   }
   let logFilePath = OS.Path.join(gEdgeDatabase.parent.path, "LogFiles", "edb.log");
   let dbPath = gEdgeDatabase.path;
   let cookieMigrator = MSMigrationUtils.getCookiesMigrator(MSMigrationUtils.MIGRATION_TYPE_EDGE);
   let cookiePaths = cookieMigrator._cookiesFolders.map(f => f.path);
-  let datePromises = [logFilePath, dbPath, ... cookiePaths].map(path => {
+  let datePromises = [logFilePath, dbPath, ...cookiePaths].map(path => {
     return OS.File.stat(path).catch(() => null).then(info => {
       return info ? info.lastModificationDate : 0;
     });
   });
   datePromises.push(new Promise(resolve => {
     let typedURLs = new Map();
     try {
       typedURLs = MSMigrationUtils.getTypedURLs(kEdgeRegistryRoot);
     } catch (ex) {}
-    let times = [0, ... typedURLs.values()];
+    let times = [0, ...typedURLs.values()];
     resolve(Math.max.apply(Math, times));
   }));
   return Promise.all(datePromises).then(dates => {
     return new Date(Math.max.apply(Math, dates));
   });
 };
 
 /* Somewhat counterintuitively, this returns:
--- a/browser/components/migration/IEProfileMigrator.js
+++ b/browser/components/migration/IEProfileMigrator.js
@@ -495,17 +495,17 @@ IEProfileMigrator.prototype.getLastUsedD
       return info ? info.lastModificationDate : 0;
     });
   });
   datePromises.push(new Promise(resolve => {
     let typedURLs = new Map();
     try {
       typedURLs = MSMigrationUtils.getTypedURLs("Software\\Microsoft\\Internet Explorer");
     } catch (ex) {}
-    let dates = [0, ... typedURLs.values()];
+    let dates = [0, ...typedURLs.values()];
     resolve(Math.max.apply(Math, dates));
   }));
   return Promise.all(datePromises).then(dates => {
     return new Date(Math.max.apply(Math, dates));
   });
 };
 
 Object.defineProperty(IEProfileMigrator.prototype, "sourceHomePageURL", {
--- a/browser/modules/PluginContent.jsm
+++ b/browser/modules/PluginContent.jsm
@@ -134,17 +134,17 @@ PluginContent.prototype = {
         let data = JSON.parse(aData);
         if (this.haveShownNotification &&
             aSubject.top.document == this.content.document &&
             data.formats.toLowerCase().includes("application/x-mpegurl", 0)) {
           let principal = this.content.document.nodePrincipal;
           let location = this.content.document.location.href;
           this.global.content.pluginRequiresReload = true;
           this.global.sendAsyncMessage("PluginContent:ShowClickToPlayNotification",
-                                       { plugins: [... this.pluginData.values()],
+                                       { plugins: [...this.pluginData.values()],
                                          showNow: true,
                                          location: location,
                                        }, null, principal);
         }
     }
   },
 
   onPageShow: function (event) {
@@ -860,17 +860,17 @@ PluginContent.prototype = {
       }
 
       this.pluginData.set(pluginInfo.permissionString, pluginInfo);
     }
 
     this.haveShownNotification = true;
 
     this.global.sendAsyncMessage("PluginContent:ShowClickToPlayNotification", {
-      plugins: [... this.pluginData.values()],
+      plugins: [...this.pluginData.values()],
       showNow: showNow,
       location: location,
     }, null, principal);
   },
 
   /**
    * Updates the "hidden plugin" notification bar UI.
    *
@@ -943,17 +943,17 @@ PluginContent.prototype = {
         }
       }
     }
 
     // If there are any items remaining in `actions` now, they are hidden
     // plugins that need a notification bar.
     this.global.sendAsyncMessage("PluginContent:UpdateHiddenPluginUI", {
       haveInsecure: haveInsecure,
-      actions: [... actions.values()],
+      actions: [...actions.values()],
       location: location,
     }, null, principal);
   },
 
   removeNotification: function (name) {
     this.global.sendAsyncMessage("PluginContent:RemoveNotification", { name: name });
   },
 
--- a/toolkit/.eslintrc.js
+++ b/toolkit/.eslintrc.js
@@ -161,16 +161,19 @@ module.exports = {
     // }],
 
     // No using variables before defined
     // "no-use-before-define": ["error", "nofunc"],
 
     // No using with
     "no-with": "error",
 
+    // No spacing inside rest or spread expressions
+    "rest-spread-spacing": "error",
+
     // Always require semicolon at end of statement
     // "semi": ["error", "always"],
 
     // Require space before blocks
     "space-before-blocks": "error",
 
     // Never use spaces before function parentheses
     // "space-before-function-paren": ["error", { "anonymous": "always", "named": "never" }],
--- a/toolkit/content/widgets/richlistbox.xml
+++ b/toolkit/content/widgets/richlistbox.xml
@@ -56,17 +56,17 @@
             // (otherwise we'll lose the selection when a template gets rebuilt)
             if (this._suppressOnSelect || this.suppressOnSelect)
               return;
 
             // remember the current item and all selected items with IDs
             var state = this.currentItem ? this.currentItem.id : "";
             if (this.selType == "multiple" && this.selectedCount) {
               let getId = function getId(aItem) { return aItem.id; }
-              state += " " + [... this.selectedItems].filter(getId).map(getId).join(" ");
+              state += " " + [...this.selectedItems].filter(getId).map(getId).join(" ");
             }
             if (state)
               this.setAttribute("last-selected", state);
             else
               this.removeAttribute("last-selected");
 
             // preserve the index just in case no IDs are available
             if (this.currentIndex > -1)