Bug 1229603 - Make most of browser/base lintable by removing non-standard syntax. r=Mossop
authorFelipe Gomes <felipc@gmail.com>
Wed, 02 Dec 2015 17:51:26 -0200
changeset 275255 fc6e4f66615258125ef090c4c3b50b42ff28b467
parent 275254 675689351241e48a85bf474ee08a6bc75787027b
child 275256 a78f8444400c700be312e2e653d7e2d74994900e
push id29751
push usercbook@mozilla.com
push dateThu, 03 Dec 2015 10:59:01 +0000
treeherdermozilla-central@31fc97d173b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1229603
milestone45.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 1229603 - Make most of browser/base lintable by removing non-standard syntax. r=Mossop
.eslintignore
browser/base/content/aboutTabCrashed.js
browser/base/content/browser-gestureSupport.js
browser/base/content/browser.js
browser/base/content/pageinfo/permissions.js
browser/base/content/sanitize.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -52,17 +52,21 @@ view/**
 webapprt/**
 widget/**
 xpcom/**
 xpfe/**
 xulrunner/**
 
 # browser/ exclusions
 browser/app/**
-browser/base/**
+browser/base/content/browser-social.js
+browser/base/content/nsContextMenu.js
+browser/base/content/sanitizeDialog.js
+browser/base/content/test/**
+browser/base/content/newtab/**
 browser/components/customizableui/**
 browser/components/downloads/**
 browser/components/feeds/**
 browser/components/migration/**
 browser/components/*.js
 browser/components/places/**
 browser/components/pocket/**
 browser/components/preferences/**
--- a/browser/base/content/aboutTabCrashed.js
+++ b/browser/base/content/aboutTabCrashed.js
@@ -250,9 +250,9 @@ var AboutTabCrashed = {
       email,
       emailMe,
       includeURL,
       URL,
     });
   },
 };
 
-AboutTabCrashed.init();
\ No newline at end of file
+AboutTabCrashed.init();
--- a/browser/base/content/browser-gestureSupport.js
+++ b/browser/base/content/browser-gestureSupport.js
@@ -250,17 +250,17 @@ var gGestureSupport = {
   /**
    * Generator producing the powerset of the input array where the first result
    * is the complete set and the last result (before StopIteration) is empty.
    *
    * @param aArray
    *        Source array containing any number of elements
    * @yield Array that is a subset of the input array from full set to empty
    */
-  _power: function GS__power(aArray) {
+  _power: function* GS__power(aArray) {
     // Create a bitmask based on the length of the array
     let num = 1 << aArray.length;
     while (--num >= 0) {
       // Only select array elements where the current bit is set
       yield aArray.reduce(function (aPrev, aCurr, aIndex) {
         if (num & 1 << aIndex)
           aPrev.push(aCurr);
         return aPrev;
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4451,18 +4451,21 @@ var XULBrowserWindow = {
       let uri = aLocationURI.clone();
       try {
         // If the current URI contains a username/password, remove it.
         uri.userPass = "";
       } catch (ex) { /* Ignore failures on about: URIs. */ }
 
       try {
         gCrashReporter.annotateCrashReport("URL", uri.spec);
-      } catch (ex if ex.result == Components.results.NS_ERROR_NOT_INITIALIZED) {
+      } catch (ex) {
         // Don't make noise when the crash reporter is built but not enabled.
+        if (ex.result != Components.results.NS_ERROR_NOT_INITIALIZED) {
+          throw ex;
+        }
       }
     }
   },
 
   asyncUpdateUI: function () {
     FeedHandler.updateFeeds();
     BrowserSearch.updateOpenSearchBadge();
   },
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -292,24 +292,23 @@ function initPluginsRow() {
         if (permString.startsWith("plugin-vulnerable:")) {
           name += " \u2014 " + vulnerableLabel;
         }
         permissionMap.set(permString, name);
       }
     }
   }
 
-  let entries = [{name: item[1], permission: item[0]} for (item of permissionMap)];
+  let entries = Array.from(permissionMap, item => ({ name: item[1], permission: item[0] }));
+
   entries.sort(function(a, b) {
     return a.name < b.name ? -1 : (a.name == b.name ? 0 : 1);
   });
 
-  let permissionEntries = [
-    fillInPluginPermissionTemplate(p.name, p.permission) for (p of entries)
-  ];
+  let permissionEntries = entries.map(p => fillInPluginPermissionTemplate(p.name, p.permission));
 
   let permPluginsRow = document.getElementById("perm-plugins-row");
   clearPluginPermissionTemplate();
   if (permissionEntries.length < 1) {
     permPluginsRow.hidden = true;
     return;
   }
 
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -445,17 +445,17 @@ Sanitizer.prototype = {
       }
     },
 
     downloads: {
       clear: function ()
       {
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_DOWNLOADS", refObj);
-        Task.spawn(function () {
+        Task.spawn(function*() {
           let filterByTime = null;
           if (this.range) {
             // Convert microseconds back to milliseconds for date comparisons.
             let rangeBeginMs = this.range[0] / 1000;
             let rangeEndMs = this.range[1] / 1000;
             filterByTime = download => download.startTime >= rangeBeginMs &&
                                        download.startTime <= rangeEndMs;
           }