Bug 1315617 - Fix remaining no-unused-vars for local scope in browser/ and enable the rule for all of browser/ r=mossop
authorMark Banner <standard8@mozilla.com>
Thu, 03 Nov 2016 11:56:28 +0000
changeset 351578 5bc308f6ac4c5f428399d975cfadf4039d44827f
parent 351577 6fb5f161f09c4a75984b053c022fe36a101a7bcc
child 351579 967dd79df01ce7a8702c87bf568a0b4807bf1561
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1315617
milestone52.0a1
Bug 1315617 - Fix remaining no-unused-vars for local scope in browser/ and enable the rule for all of browser/ r=mossop MozReview-Commit-ID: FO1p5G5K3zg
browser/.eslintrc.js
browser/components/nsBrowserGlue.js
browser/components/places/content/places.js
browser/components/preferences/containers.js
browser/modules/DirectoryLinksProvider.jsm
--- a/browser/.eslintrc.js
+++ b/browser/.eslintrc.js
@@ -1,7 +1,15 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "../toolkit/.eslintrc.js"
   ],
+
+  "rules": {
+    "no-unused-vars": ["error", {
+      "vars": "local",
+      "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
+      "args": "none",
+    }]
+  }
 };
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -643,22 +643,16 @@ BrowserGlue.prototype = {
   },
 
   // runs on startup, before the first command line handler is invoked
   // (i.e. before the first window is opened)
   _finalUIStartup: function BG__finalUIStartup() {
     this._sanitizer.onStartup();
     // check if we're in safe mode
     if (Services.appinfo.inSafeMode) {
-      // See https://bugzilla.mozilla.org/show_bug.cgi?id=1231112#c7 . We need to
-      // register the observer early if we have to migrate tab groups
-      let currentUIVersion = 0;
-      try {
-        currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
-      } catch (ex) {}
       Services.ww.openWindow(null, "chrome://browser/content/safeMode.xul",
                              "_blank", "chrome,centerscreen,modal,resizable=no", null);
     }
 
     // apply distribution customizations
     // prefs are applied in _onAppDefaults()
     this._distributionCustomizer.applyCustomizations();
 
--- a/browser/components/places/content/places.js
+++ b/browser/components/places/content/places.js
@@ -638,33 +638,16 @@ var PlacesOrganizer = {
       }
     }
 
     // Clean up the panel before initing it again.
     gEditItemOverlay.uninitPanel(false);
 
     if (selectedNode && !PlacesUtils.nodeIsSeparator(selectedNode)) {
       detailsDeck.selectedIndex = 1;
-      // Using the concrete itemId is arguably wrong.  The bookmarks API
-      // does allow setting properties for folder shortcuts as well, but since
-      // the UI does not distinct between the couple, we better just show
-      // the concrete item properties for shortcuts to root nodes.
-      let concreteId = PlacesUtils.getConcreteItemId(selectedNode);
-      var isRootItem = concreteId != -1 && PlacesUtils.isRootItem(concreteId);
-      var readOnly = isRootItem ||
-                     selectedNode.parent.itemId == PlacesUIUtils.leftPaneFolderId;
-      var useConcreteId = isRootItem ||
-                          PlacesUtils.nodeIsTagQuery(selectedNode);
-      var itemId = -1;
-      if (concreteId != -1 && useConcreteId)
-        itemId = concreteId;
-      else if (selectedNode.itemId != -1)
-        itemId = selectedNode.itemId;
-      else
-        itemId = PlacesUtils._uri(selectedNode.uri);
 
       gEditItemOverlay.initPanel({ node: selectedNode
                                  , hiddenRows: ["folderPicker"] });
 
       this._detectAndSetDetailsPaneMinimalState(selectedNode);
     }
     else if (!selectedNode && aNodeList[0]) {
       if (aNodeList.every(PlacesUtils.nodeIsURI)) {
@@ -1054,19 +1037,16 @@ var ViewMenu = {
    *          localized accesskey.
    *          If propertyPrefix is null, the column label is used as label and
    *          no accesskey is assigned.
    */
   fillWithColumns: function VM_fillWithColumns(event, startID, endID, type, propertyPrefix) {
     var popup = event.target;
     var pivot = this._clean(popup, startID, endID);
 
-    // If no column is "sort-active", the "Unsorted" item needs to be checked,
-    // so track whether or not we find a column that is sort-active.
-    var isSorted = false;
     var content = document.getElementById("placeContent");
     var columns = content.columns;
     for (var i = 0; i < columns.count; ++i) {
       var column = columns.getColumnAt(i).element;
       var menuitem = document.createElement("menuitem");
       menuitem.id = "menucol_" + column.id;
       menuitem.column = column;
       var label = column.getAttribute("label");
@@ -1082,17 +1062,16 @@ var ViewMenu = {
       }
       menuitem.setAttribute("label", label);
       if (type == "radio") {
         menuitem.setAttribute("type", "radio");
         menuitem.setAttribute("name", "columns");
         // This column is the sort key. Its item is checked.
         if (column.getAttribute("sortDirection") != "") {
           menuitem.setAttribute("checked", "true");
-          isSorted = true;
         }
       }
       else if (type == "checkbox") {
         menuitem.setAttribute("type", "checkbox");
         // Cannot uncheck the primary column.
         if (column.getAttribute("primary") == "true")
           menuitem.setAttribute("disabled", "true");
         // Items for visible columns are checked.
--- a/browser/components/preferences/containers.js
+++ b/browser/components/preferences/containers.js
@@ -142,17 +142,16 @@ let gContainersManager = {
     }
     return radiogroup;
   },
 
   onApplyChanges() {
     let icon = document.getElementById("icon").value;
     let color = document.getElementById("color").value;
     let name = document.getElementById("name").value;
-    let userContextId = false;
 
     if (this.icons.indexOf(icon) == -1) {
       throw "Internal error. The icon value doesn't match.";
     }
 
     if (this.colors.indexOf(color) == -1) {
       throw "Internal error. The color value doesn't match.";
     }
--- a/browser/modules/DirectoryLinksProvider.jsm
+++ b/browser/modules/DirectoryLinksProvider.jsm
@@ -521,17 +521,16 @@ var DirectoryLinksProvider = {
   /**
    * Report some action on a newtab page (view, click)
    * @param sites Array of sites shown on newtab page
    * @param action String of the behavior to report
    * @param triggeringSiteIndex optional Int index of the site triggering action
    * @return download promise
    */
   reportSitesAction: function DirectoryLinksProvider_reportSitesAction(sites, action, triggeringSiteIndex) {
-    let pastImpressions;
     // Check if the suggested tile was shown
     if (action == "view") {
       sites.slice(0, triggeringSiteIndex + 1).filter(s => s).forEach(site => {
         let {targetedSite, url} = site.link;
         if (targetedSite) {
           this._addFrequencyCapView(url);
         }
       });
@@ -539,23 +538,16 @@ var DirectoryLinksProvider = {
     // any click action on a suggested tile should stop that tile suggestion
     // click/block - user either removed a tile or went to a landing page
     // pin - tile turned into history tile, should no longer be suggested
     // unpin - the tile was pinned before, should not matter
     else {
       // suggested tile has targetedSite, or frecent_sites if it was pinned
       let {frecent_sites, targetedSite, url} = sites[triggeringSiteIndex].link;
       if (frecent_sites || targetedSite) {
-        // skip past_impressions for "unpin" to avoid chance of tracking
-        if (this._frequencyCaps[url] && action != "unpin") {
-          pastImpressions = {
-            total: this._frequencyCaps[url].totalViews,
-            daily: this._frequencyCaps[url].dailyViews
-          };
-        }
         this._setFrequencyCapClick(url);
       }
     }
 
     let newtabEnhanced = false;
     let pingEndPoint = "";
     try {
       newtabEnhanced = Services.prefs.getBoolPref(PREF_NEWTAB_ENHANCED);