Bug 1314918 - Fix most of the remaining no-unused-vars issues for local scope in browser/. r?Mossop draft
authorMark Banner <standard8@mozilla.com>
Thu, 03 Nov 2016 11:51:48 +0000
changeset 433484 005d55c7addd1404c2090e0555c395c6ca33cf1e
parent 433311 3b80868f7a8fe0361918a814fbbbfb9308ae0c0a
child 535910 815170f78e0cc043c53aa36d93f5fafaea0d301b
push id34602
push userbmo:standard8@mozilla.com
push dateThu, 03 Nov 2016 20:22:55 +0000
reviewersMossop
bugs1314918
milestone52.0a1
Bug 1314918 - Fix most of the remaining no-unused-vars issues for local scope in browser/. r?Mossop MozReview-Commit-ID: LdoXLniNeT7
browser/.eslintrc.js
browser/components/contextualidentity/test/browser/browser_eme.js
browser/components/contextualidentity/test/browser/browser_favicon.js
browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js
browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
browser/components/contextualidentity/test/browser/browser_middleClick.js
browser/components/customizableui/CustomizableUI.jsm
browser/components/customizableui/CustomizableWidgets.jsm
browser/components/customizableui/CustomizeMode.jsm
browser/components/customizableui/DragPositionManager.jsm
browser/components/customizableui/PanelWideWidgetTracker.jsm
browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js
browser/components/customizableui/test/browser_1161838_inserted_new_default_buttons.js
browser/components/customizableui/test/browser_878452_drag_to_panel.js
browser/components/customizableui/test/browser_880164_customization_context_menus.js
browser/components/customizableui/test/browser_884402_customize_from_overflow.js
browser/components/customizableui/test/browser_938995_indefaultstate_nonremovable.js
browser/components/customizableui/test/browser_962069_drag_to_overflow_chevron.js
browser/components/customizableui/test/browser_967000_button_sync.js
browser/components/customizableui/test/browser_973641_button_addon.js
browser/components/customizableui/test/browser_984455_bookmarks_items_reparenting.js
browser/components/customizableui/test/head.js
browser/components/distribution.js
browser/components/feeds/FeedConverter.js
browser/components/feeds/FeedWriter.js
browser/components/feeds/test/unit/test_758990.js
browser/components/nsBrowserContentHandler.js
browser/components/nsBrowserGlue.js
browser/components/places/content/bookmarkProperties.js
browser/components/places/content/browserPlacesViews.js
browser/components/places/content/controller.js
browser/components/places/content/editBookmarkOverlay.js
browser/components/places/content/places.js
browser/components/places/content/treeView.js
browser/components/places/tests/browser/browser_425884.js
browser/components/places/tests/browser/browser_bookmarkProperties_addFolderDefaultButton.js
browser/components/places/tests/browser/browser_library_commands.js
browser/components/places/tests/browser/browser_library_views_liveupdate.js
browser/components/places/tests/browser/browser_views_liveupdate.js
browser/components/places/tests/unit/test_browserGlue_smartBookmarks.js
browser/components/preferences/cookies.js
browser/components/preferences/in-content/content.js
browser/components/preferences/in-content/main.js
browser/components/preferences/permissions.js
browser/components/search/content/search.xml
browser/components/search/test/browser_426329.js
browser/components/search/test/browser_abouthome_behavior.js
browser/components/search/test/browser_private_search_perwindowpb.js
browser/components/search/test/browser_searchbar_keyboard_navigation.js
browser/components/search/test/browser_searchbar_openpopup.js
browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js
browser/components/shell/test/browser_420786.js
browser/components/shell/test/unit/test_421977.js
browser/components/syncedtabs/SyncedTabsListStore.js
browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js
browser/components/translation/BingTranslator.jsm
browser/components/translation/TranslationDocument.jsm
browser/components/translation/test/browser_translation_infobar.js
browser/components/translation/test/browser_translation_telemetry.js
browser/components/uitour/UITour.jsm
browser/components/uitour/test/browser_UITour3.js
browser/extensions/flyweb/bootstrap.js
browser/modules/FormSubmitObserver.jsm
browser/modules/PluginContent.jsm
browser/modules/ProcessHangMonitor.jsm
browser/modules/RemotePrompt.jsm
browser/modules/Windows8WindowFrameColor.jsm
browser/modules/WindowsPreviewPerTab.jsm
browser/modules/test/browser_ContentSearch.js
browser/modules/test/browser_UnsubmittedCrashHandler.js
browser/modules/test/browser_UsageTelemetry_private_and_restore.js
browser/modules/test/browser_taskbar_preview.js
browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
--- 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/contextualidentity/test/browser/browser_eme.js
+++ b/browser/components/contextualidentity/test/browser/browser_eme.js
@@ -112,17 +112,17 @@ add_task(function* test() {
                                                                        sessionTypes: ['persistent-license'],
                                                                        persistentState: 'required',
                                                                      }]);
     let mediaKeys = yield access.createMediaKeys();
     let session = mediaKeys.createSession(aKeyInfo.sessionType);
     let res = {};
 
     // Insert the media key.
-    let result = yield new Promise(resolve => {
+    yield new Promise(resolve => {
       session.addEventListener("message", function(event) {
         session.update(aKeyInfo.keyObj).then(
           () => { resolve(); }
         ).catch(
           () => {
             ok(false, "Update the media key fail.");
             resolve();
           }
--- a/browser/components/contextualidentity/test/browser/browser_favicon.js
+++ b/browser/components/contextualidentity/test/browser/browser_favicon.js
@@ -108,17 +108,16 @@ add_task(function* test() {
   let testURL = "http://localhost:" + serverPort + "/";
   let testFaviconURL = "http://localhost:" + serverPort + "/favicon.png";
 
   for (let userContextId of Object.keys(USER_CONTEXTS)) {
     gUserContextId = userContextId;
 
     // Load the page in 3 different contexts and set a cookie
     // which should only be visible in that context.
-    let value = USER_CONTEXTS[userContextId];
 
     // Open our tab in the given user context.
     let tabInfo = yield* openTabInUserContext(testURL, userContextId);
 
     // Write a cookie according to the userContext.
     yield ContentTask.spawn(tabInfo.browser, { userContext: USER_CONTEXTS[userContextId] }, function (arg) {
       content.document.cookie = "userContext=" + arg.userContext;
     });
--- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js
@@ -102,17 +102,17 @@ function* setupEMEKey(browser) {
                                                                        sessionTypes: ['persistent-license'],
                                                                        persistentState: 'required',
                                                                      }]);
     let mediaKeys = yield access.createMediaKeys();
     let session = mediaKeys.createSession(aKeyInfo.sessionType);
     let res = {};
 
     // Insert the EME key.
-    let result = yield new Promise(resolve => {
+    yield new Promise(resolve => {
       session.addEventListener("message", function(event) {
         session.update(aKeyInfo.keyObj).then(
           () => { resolve(); }
         ).catch(
           () => {
             ok(false, "Update the EME key fail.");
             resolve();
           }
--- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js
@@ -82,17 +82,17 @@ function* checkIndexedDB(browser) {
 
     let db = yield new Promise(done => {
       request.onsuccess = event => {
         done(event.target.result);
       };
     });
 
     try {
-      let transaction = db.transaction(["obj"], "readonly");
+      db.transaction(["obj"], "readonly");
       ok(false, "The indexedDB should not exist");
     } catch (e) {
       is(e.name, "NotFoundError", "The indexedDB does not exist as expected");
     }
   });
 }
 
 //
@@ -140,9 +140,8 @@ add_task(function* test_quota_clearStora
 
     // Check whether indexed DB has been cleared.
     yield checkIndexedDB(tabs[userContextId].browser);
 
     // Close this tab.
     yield BrowserTestUtils.removeTab(tabs[userContextId].tab);
   }
 });
-
--- a/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
+++ b/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js
@@ -175,30 +175,30 @@ function* test_cache_cleared() {
                          "memory",
                          Ci.nsICacheStorage.OPEN_NORMALLY,
                          LoadContextInfo.custom(false, {userContextId}));
   }
 
 
   // Check that caches have been set correctly.
   for (let userContextId of Object.keys(USER_CONTEXTS)) {
-    let mem = getCacheStorage("memory");
-    let disk = getCacheStorage("disk");
+    let mem = getCacheStorage("memory", LoadContextInfo.custom(false, {userContextId}));
+    let disk = getCacheStorage("disk", LoadContextInfo.custom(false, {userContextId}));
 
     Assert.ok(mem.exists(createURI("http://" + TEST_HOST + "/"), ""), "The memory cache has been set correctly");
     Assert.ok(disk.exists(createURI("http://" + TEST_HOST + "/"), ""), "The disk cache has been set correctly");
   }
 
   // Forget the site.
   ForgetAboutSite.removeDataFromDomain(TEST_HOST);
 
   // Check that do caches be removed or not?
   for (let userContextId of Object.keys(USER_CONTEXTS)) {
-    let mem = getCacheStorage("memory");
-    let disk = getCacheStorage("disk");
+    let mem = getCacheStorage("memory", LoadContextInfo.custom(false, {userContextId}));
+    let disk = getCacheStorage("disk", LoadContextInfo.custom(false, {userContextId}));
 
     Assert.ok(!mem.exists(createURI("http://" + TEST_HOST + "/"), ""), "The memory cache is cleared");
     Assert.ok(!disk.exists(createURI("http://" + TEST_HOST + "/"), ""), "The disk cache is cleared");
   }
 }
 
 // Image Cache
 function* test_image_cache_cleared() {
@@ -299,17 +299,17 @@ function* test_storage_cleared() {
       let request = content.indexedDB.open("idb", 1);
 
       let db = yield new Promise(done => {
         request.onsuccess = event => {
           done(event.target.result);
         };
       });
       try {
-        let transaction = db.transaction(["obj"], "readonly");
+        db.transaction(["obj"], "readonly");
         Assert.ok(false, "The indexedDB should not exist");
       } catch (e) {
         Assert.equal(e.name, "NotFoundError", "The indexedDB does not exist as expected");
       }
     });
 
     // Close the tab.
     yield BrowserTestUtils.removeTab(tabInfo.tab);
--- a/browser/components/contextualidentity/test/browser/browser_middleClick.js
+++ b/browser/components/contextualidentity/test/browser/browser_middleClick.js
@@ -9,17 +9,17 @@ add_task(function* () {
 
   let tab = gBrowser.addTab(URI, { userContextId: 1 });
   gBrowser.selectedTab = tab;
 
   let browser = gBrowser.getBrowserForTab(tab);
   yield BrowserTestUtils.browserLoaded(browser);
 
   info("Create a HTMLAnchorElement...");
-  let position = yield ContentTask.spawn(browser, URI,
+  yield ContentTask.spawn(browser, URI,
     function(URI) {
       let anchor = content.document.createElement("a");
       anchor.setAttribute('id', 'clickMe');
       anchor.setAttribute("href", URI);
       anchor.appendChild(content.document.createTextNode("click me!"));
       content.document.body.appendChild(anchor);
     }
   );
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -329,17 +329,17 @@ var CustomizableUIInternal = {
     }
   },
 
   _introduceNewBuiltinWidgets: function() {
     // We should still enter even if gSavedState.currentVersion >= kVersion
     // because the per-widget pref facility is independent of versioning.
     if (!gSavedState) {
       // Flip all the prefs so we don't try to re-introduce later:
-      for (let [id, widget] of gPalette) {
+      for (let [, widget] of gPalette) {
         if (widget.defaultArea && widget._introducedInVersion === "pref") {
           let prefId = "browser.toolbarbuttons.introduced." + widget.id;
           Services.prefs.setBoolPref(prefId, true);
         }
       }
       return;
     }
 
@@ -605,17 +605,16 @@ var CustomizableUIInternal = {
     }
   },
 
   registerToolbarNode: function(aToolbar, aExistingChildren) {
     let area = aToolbar.id;
     if (gBuildAreas.has(area) && gBuildAreas.get(area).has(aToolbar)) {
       return;
     }
-    let document = aToolbar.ownerDocument;
     let areaProperties = gAreas.get(area);
 
     // If this area is not registered, try to do it automatically:
     if (!areaProperties) {
       // If there's no defaultset attribute and this isn't a legacy extra toolbar,
       // we assume that we should wait for registerArea to be called:
       if (!aToolbar.hasAttribute("defaultset") &&
           !aToolbar.hasAttribute("customindex")) {
@@ -1074,25 +1073,25 @@ var CustomizableUIInternal = {
       }
     }
 
     for (let [, widget] of gPalette) {
       widget.instances.delete(document);
       this.notifyListeners("onWidgetInstanceRemoved", widget.id, document);
     }
 
-    for (let [area, areaMap] of gPendingBuildAreas) {
+    for (let [, areaMap] of gPendingBuildAreas) {
       let toDelete = [];
       for (let [areaNode, ] of areaMap) {
         if (areaNode.ownerDocument == document) {
           toDelete.push(areaNode);
         }
       }
       for (let areaNode of toDelete) {
-        areaMap.delete(toDelete);
+        areaMap.delete(areaNode);
       }
     }
 
     this.notifyListeners("onWindowClosed", aWindow);
   },
 
   setLocationAttributes: function(aNode, aArea) {
     let props = gAreas.get(aArea);
@@ -2179,17 +2178,17 @@ var CustomizableUIInternal = {
           area.set("defaultPlacements", [widget.id]);
         }
       }
     }
 
     // Look through previously saved state to see if we're restoring a widget.
     let seenAreas = new Set();
     let widgetMightNeedAutoAdding = true;
-    for (let [area, placements] of gPlacements) {
+    for (let [area, ] of gPlacements) {
       seenAreas.add(area);
       let areaIsRegistered = gAreas.has(area);
       let index = gPlacements.get(area).indexOf(widget.id);
       if (index != -1) {
         widgetMightNeedAutoAdding = false;
         if (areaIsRegistered) {
           widget.currentArea = area;
           widget.currentPosition = index;
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -479,17 +479,16 @@ const CustomizableWidgets = [
       } else {
         for (let tab of client.tabs) {
           let tabEnt = this._createTabElement(doc, tab);
           attachFragment.appendChild(tabEnt);
         }
       }
     },
     _createTabElement(doc, tabInfo) {
-      let win = doc.defaultView;
       let item = doc.createElementNS(kNSXUL, "toolbarbutton");
       let tooltipText = (tabInfo.title ? tabInfo.title + "\n" : "") + tabInfo.url;
       item.setAttribute("itemtype", "tab");
       item.setAttribute("class", "subviewbutton");
       item.setAttribute("targetURI", tabInfo.url);
       item.setAttribute("label", tabInfo.title != "" ? tabInfo.title : tabInfo.url);
       item.setAttribute("image", tabInfo.icon);
       item.setAttribute("tooltiptext", tooltipText);
@@ -544,17 +543,16 @@ const CustomizableWidgets = [
     type: "view",
     viewId: "PanelUI-sidebar",
     tooltiptext: "sidebar-button.tooltiptext2",
     onViewShowing: function(aEvent) {
       // Populate the subview with whatever menuitems are in the
       // sidebar menu. We skip menu elements, because the menu panel has no way
       // of dealing with those right now.
       let doc = aEvent.target.ownerDocument;
-      let win = doc.defaultView;
       let menu = doc.getElementById("viewSidebarMenu");
 
       // First clear any existing menuitems then populate. Add it to the
       // standard menu first, then copy all sidebar options to the panel.
       let sidebarItems = doc.getElementById("PanelUI-sidebarItems");
       clearSubview(sidebarItems);
       fillSubviewFromMenuItems([...menu.children], sidebarItems);
     }
@@ -1131,17 +1129,16 @@ const CustomizableWidgets = [
 
       while (items.firstChild) {
         items.firstChild.remove();
       }
 
       let fragment = doc.createDocumentFragment();
 
       ContextualIdentityService.getIdentities().forEach(identity => {
-        let bundle = doc.getElementById("bundle_browser");
         let label = ContextualIdentityService.getUserContextLabel(identity.userContextId);
 
         let item = doc.createElementNS(kNSXUL, "toolbarbutton");
         item.setAttribute("label", label);
         item.setAttribute("usercontextid", identity.userContextId);
         item.setAttribute("class", "subviewbutton");
         item.setAttribute("image", identity.icon);
 
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -37,17 +37,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/LightweightThemeManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
                                   "resource:///modules/sessionstore/SessionStore.jsm");
 
 let gDebug;
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let scope = {};
   Cu.import("resource://gre/modules/Console.jsm", scope);
-  let ConsoleAPI = scope.ConsoleAPI;
   try {
     gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
   } catch (ex) {}
   let consoleOptions = {
     maxLogLevel: gDebug ? "all" : "log",
     prefix: "CustomizeMode",
   };
   return new scope.ConsoleAPI(consoleOptions);
@@ -241,17 +240,16 @@ CustomizeMode.prototype = {
           };
 
           Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished", false);
         });
       }
 
       let toolbarVisibilityBtn = document.getElementById(kToolbarVisibilityBtn);
       let togglableToolbars = window.getTogglableToolbars();
-      let bookmarksToolbar = document.getElementById("PersonalToolbar");
       if (togglableToolbars.length == 0) {
         toolbarVisibilityBtn.setAttribute("hidden", "true");
       } else {
         toolbarVisibilityBtn.removeAttribute("hidden");
       }
 
       this.updateLWTStyling();
 
@@ -422,17 +420,16 @@ CustomizeMode.prototype = {
     this.window.PanelUI.menuButton.open = false;
 
     this.window.PanelUI.beginBatchUpdate();
 
     this._removePanelCustomizationPlaceholders();
 
     let window = this.window;
     let document = this.document;
-    let documentElement = document.documentElement;
 
     // Hide the palette before starting the transition for increased perf.
     this.visiblePalette.hidden = true;
     this.visiblePalette.removeAttribute("showing");
     this.paletteEmptyNotice.hidden = true;
 
     // Disable the button-text fade-out mask
     // during the transition for increased perf.
@@ -1401,29 +1398,27 @@ CustomizeMode.prototype = {
       let currentLwt = LightweightThemeManager.currentTheme;
       for (let lwt of lwts) {
         lwt.isActive = !!currentLwt && (lwt.id == currentLwt.id);
         themes.push(lwt);
       }
 
       let footer = doc.getElementById("customization-lwtheme-menu-footer");
       let panel = footer.parentNode;
-      let themesInMyThemesSection = 0;
       let recommendedLabel = doc.getElementById("customization-lwtheme-menu-recommended");
       for (let theme of themes) {
         let button = buildToolbarButton(theme);
         button.addEventListener("command", () => {
           if ("userDisabled" in button.theme)
             button.theme.userDisabled = false;
           else
             LightweightThemeManager.currentTheme = button.theme;
           onThemeSelected(panel);
         });
         panel.insertBefore(button, recommendedLabel);
-        themesInMyThemesSection++;
       }
 
       let lwthemePrefs = Services.prefs.getBranch("lightweightThemes.");
       let recommendedThemes = lwthemePrefs.getComplexValue("recommendedThemes",
                                                            Ci.nsISupportsString).data;
       recommendedThemes = JSON.parse(recommendedThemes);
       let sb = Services.strings.createBundle("chrome://browser/locale/lightweightThemes.properties");
       for (let theme of recommendedThemes) {
--- a/browser/components/customizableui/DragPositionManager.jsm
+++ b/browser/components/customizableui/DragPositionManager.jsm
@@ -29,17 +29,16 @@ function AreaPositionManager(aContainer)
   this.update(aContainer);
 }
 
 AreaPositionManager.prototype = {
   _nodePositionStore: null,
   _wideCache: null,
 
   update: function(aContainer) {
-    let window = aContainer.ownerGlobal;
     this._nodePositionStore = new WeakMap();
     this._wideCache = new Set();
     let last = null;
     let singleItemHeight;
     for (let child of aContainer.children) {
       if (child.hidden) {
         continue;
       }
@@ -414,9 +413,8 @@ var DragPositionManager = {
   },
 
   getManagerForArea: function(aArea) {
     return gManagers.get(aArea);
   }
 };
 
 Object.freeze(DragPositionManager);
-
--- a/browser/components/customizableui/PanelWideWidgetTracker.jsm
+++ b/browser/components/customizableui/PanelWideWidgetTracker.jsm
@@ -34,17 +34,16 @@ var PanelWideWidgetTracker = {
       gPanelPlacements = CustomizableUI.getWidgetIdsInArea(gPanel);
       let moveForward = this.shouldMoveForward(aWidgetId, aNewPosition);
       this.adjustWidgets(aWidgetId, moveForward);
     }
   },
   onWidgetRemoved: function(aWidgetId, aPrevArea) {
     if (aPrevArea == gPanel) {
       gPanelPlacements = CustomizableUI.getWidgetIdsInArea(gPanel);
-      let pos = gPanelPlacements.indexOf(aWidgetId);
       this.adjustWidgets(aWidgetId, false);
     }
   },
   onWidgetReset: function(aWidgetId) {
     gPanelPlacements = CustomizableUI.getWidgetIdsInArea(gPanel);
   },
   // Listener to keep abreast of any new nodes. We use the DOM one because
   // we need access to the actual node's classlist, so we can't use the ones above.
--- a/browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js
+++ b/browser/components/customizableui/test/browser_1096763_seen_widgets_post_reset.js
@@ -1,14 +1,14 @@
 "use strict";
 
 const BUTTONID = "test-seenwidget-post-reset";
 
 add_task(function*() {
-  let widget = CustomizableUI.createWidget({
+  CustomizableUI.createWidget({
     id: BUTTONID,
     label: "Test widget seen post reset",
     defaultArea: CustomizableUI.AREA_NAVBAR
   });
 
   const kPrefCustomizationState = "browser.uiCustomization.state";
   let bsPass = Cu.import("resource:///modules/CustomizableUI.jsm", {});
   ok(bsPass.gSeenWidgets.has(BUTTONID), "Widget should be seen after createWidget is called.");
--- a/browser/components/customizableui/test/browser_1161838_inserted_new_default_buttons.js
+++ b/browser/components/customizableui/test/browser_1161838_inserted_new_default_buttons.js
@@ -16,19 +16,16 @@ function test() {
   // Force us to have a saved state:
   CustomizableUIInternal.saveState();
   CustomizableUIInternal.loadSavedState();
 
   CustomizableUIInternal._introduceNewBuiltinWidgets();
   is(gFuturePlacements.size, 0,
      "No change to future placements initially.");
 
-  let currentVersion = CustomizableUIBSPass.kVersion;
-
-
   // Add our widget to the defaults:
   let testWidgetNew = {
     id: "test-messing-with-default-placements-new-pref",
     label: "Test messing with default placements - pref-based",
     defaultArea: CustomizableUI.AREA_NAVBAR,
     introducedInVersion: "pref",
   };
 
@@ -74,9 +71,8 @@ function test() {
   gFuturePlacements.delete(CustomizableUI.AREA_NAVBAR);
   let indexInDefaultPlacements = navbarPlacements.indexOf(testWidgetNew.id);
   if (indexInDefaultPlacements != -1) {
     navbarPlacements.splice(indexInDefaultPlacements, 1);
   }
   gPalette.delete(testWidgetNew.id);
   CustomizableUI.reset();
 }
-
--- a/browser/components/customizableui/test/browser_878452_drag_to_panel.js
+++ b/browser/components/customizableui/test/browser_878452_drag_to_panel.js
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Dragging an item from the palette to another button in the panel should work.
 add_task(function*() {
   yield startCustomizing();
   let btn = document.getElementById("feed-button");
-  let panel = document.getElementById(CustomizableUI.AREA_PANEL);
   let placements = getAreaWidgetIds(CustomizableUI.AREA_PANEL);
 
   let lastButtonIndex = placements.length - 1;
   let lastButton = placements[lastButtonIndex];
   let placementsAfterInsert = placements.slice(0, lastButtonIndex).concat(["feed-button", lastButton]);
   let lastButtonNode = document.getElementById(lastButton);
   simulateItemDrag(btn, lastButtonNode);
   assertAreaPlacements(CustomizableUI.AREA_PANEL, placementsAfterInsert);
--- a/browser/components/customizableui/test/browser_880164_customization_context_menus.js
+++ b/browser/components/customizableui/test/browser_880164_customization_context_menus.js
@@ -112,17 +112,16 @@ add_task(function*() {
 
 // Right-click on the urlbar-container should
 // show a context menu with disabled options to move it.
 add_task(function*() {
   let contextMenu = document.getElementById("toolbar-context-menu");
   let shownPromise = popupShown(contextMenu);
   let urlBarContainer = document.getElementById("urlbar-container");
   // Need to make sure not to click within an edit field.
-  let urlbarRect = urlBarContainer.getBoundingClientRect();
   EventUtils.synthesizeMouse(urlBarContainer, 100, 1, {type: "contextmenu", button: 2 });
   yield shownPromise;
 
   let expectedEntries = [
     [".customize-context-moveToPanel", false],
     [".customize-context-removeFromToolbar", false],
     ["---"]
   ];
--- a/browser/components/customizableui/test/browser_884402_customize_from_overflow.js
+++ b/browser/components/customizableui/test/browser_884402_customize_from_overflow.js
@@ -14,17 +14,16 @@ registerCleanupFunction(function() {
 // show a context menu with options to move it.
 add_task(function*() {
 
   overflowPanel.setAttribute("animate", "false");
 
   originalWindowWidth = window.outerWidth;
   let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
   ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
-  let oldChildCount = navbar.customizationTarget.childElementCount;
   window.resizeTo(400, window.outerHeight);
 
   yield waitForCondition(() => navbar.hasAttribute("overflowing"));
   ok(navbar.hasAttribute("overflowing"), "Should have an overflowing toolbar.");
 
   let chevron = document.getElementById("nav-bar-overflow-button");
   let shownPanelPromise = promisePanelElementShown(window, overflowPanel);
   chevron.click();
--- a/browser/components/customizableui/test/browser_938995_indefaultstate_nonremovable.js
+++ b/browser/components/customizableui/test/browser_938995_indefaultstate_nonremovable.js
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const kWidgetId = "test-non-removable-widget";
 
 // Adding non-removable items to a toolbar or the panel shouldn't change inDefaultState
 add_task(function() {
-  let navbar = document.getElementById("nav-bar");
   ok(CustomizableUI.inDefaultState, "Should start in default state");
 
   let button = createDummyXULButton(kWidgetId, "Test non-removable inDefaultState handling");
   CustomizableUI.addWidgetToArea(kWidgetId, CustomizableUI.AREA_NAVBAR);
   button.setAttribute("removable", "false");
   ok(CustomizableUI.inDefaultState, "Should still be in default state after navbar addition");
   button.remove();
 
--- a/browser/components/customizableui/test/browser_962069_drag_to_overflow_chevron.js
+++ b/browser/components/customizableui/test/browser_962069_drag_to_overflow_chevron.js
@@ -7,17 +7,16 @@
 var originalWindowWidth;
 
 // Drag to overflow chevron should open the overflow panel.
 add_task(function*() {
   originalWindowWidth = window.outerWidth;
   let navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
   ok(!navbar.hasAttribute("overflowing"), "Should start with a non-overflowing toolbar.");
   ok(CustomizableUI.inDefaultState, "Should start in default state.");
-  let oldChildCount = navbar.customizationTarget.childElementCount;
   window.resizeTo(400, window.outerHeight);
   yield waitForCondition(() => navbar.hasAttribute("overflowing"));
   ok(navbar.hasAttribute("overflowing"), "Should have an overflowing toolbar.");
 
   let widgetOverflowPanel = document.getElementById("widget-overflow");
   let panelShownPromise = promisePanelElementShown(window, widgetOverflowPanel);
   let identityBox = document.getElementById("identity-box");
   let overflowChevron = document.getElementById("nav-bar-overflow-button");
--- a/browser/components/customizableui/test/browser_967000_button_sync.js
+++ b/browser/components/customizableui/test/browser_967000_button_sync.js
@@ -189,20 +189,18 @@ add_task(function* () {
   PanelUI.hide();
 
   Services.prefs.clearUserPref("identity.mobilepromo.android");
   Services.prefs.clearUserPref("identity.mobilepromo.ios");
 });
 
 // Test the "Sync Now" button
 add_task(function* () {
-  let nSyncs = 0;
   mockedInternal.getTabClients = () => [];
   mockedInternal.syncTabs = () => {
-    nSyncs++;
     return Promise.resolve();
   }
 
   // configure our broadcasters so we are in the right state.
   document.getElementById("sync-reauth-state").hidden = true;
   document.getElementById("sync-setup-state").hidden = true;
   document.getElementById("sync-syncnow-state").hidden = false;
 
--- a/browser/components/customizableui/test/browser_973641_button_addon.js
+++ b/browser/components/customizableui/test/browser_973641_button_addon.js
@@ -27,17 +27,16 @@ add_task(function*() {
   ok(addonButton, "Addon button exists");
   ok(navBar.contains(addonButton), "Addon button is in the navbar");
   yield checkButtonFunctionality(addonButton);
 
   resetTabs();
 
   // move the add-on button in the Panel Menu
   CustomizableUI.addWidgetToArea(kButton, CustomizableUI.AREA_PANEL);
-  let addonButtonInNavbar = navBar.getElementsByAttribute("id", kButton);
   ok(!navBar.contains(addonButton), "Addon button was removed from the browser bar");
 
   // check the addon button's functionality in the Panel Menu
   yield PanelUI.show();
   var panelMenu = document.getElementById("PanelUI-mainView");
   let addonButtonInPanel = panelMenu.getElementsByAttribute("id", kButton);
   ok(panelMenu.contains(addonButton), "Addon button was added to the Panel Menu");
   yield checkButtonFunctionality(addonButtonInPanel[0]);
--- a/browser/components/customizableui/test/browser_984455_bookmarks_items_reparenting.js
+++ b/browser/components/customizableui/test/browser_984455_bookmarks_items_reparenting.js
@@ -57,17 +57,16 @@ function checkPlacesContextMenu(aItemWit
 
 /**
  * Opens the bookmarks menu panel, and then opens each of the "special"
  * submenus in that list. Then it checks that those submenu's context menus
  * are properly hooked up to a controller.
  */
 function checkSpecialContextMenus() {
   return Task.spawn(function* () {
-    let contextMenu = document.getElementById("placesContext");
     let bookmarksMenuButton = document.getElementById(kBookmarksButton);
     let bookmarksMenuPopup = document.getElementById("BMB_bookmarksPopup");
 
     const kSpecialItemIDs = {
       "BMB_bookmarksToolbar": "BMB_bookmarksToolbarPopup",
       "BMB_unsortedBookmarks": "BMB_unsortedBookmarksPopup",
     };
 
--- a/browser/components/customizableui/test/head.js
+++ b/browser/components/customizableui/test/head.js
@@ -471,17 +471,16 @@ function popupHidden(aPopup) {
  *   yield popupShownPromise;
  *
  *  let popupHiddenPromise = promisePopupEvent(somePopup, "hidden");
  *  // ... something that hides a popup
  *  yield popupHiddenPromise;
  */
 function promisePopupEvent(aPopup, aEventSuffix) {
   let deferred = Promise.defer();
-  let win = aPopup.ownerGlobal;
   let eventType = "popup" + aEventSuffix;
 
   function onPopupEvent(e) {
     aPopup.removeEventListener(eventType, onPopupEvent);
     deferred.resolve();
   }
 
   aPopup.addEventListener(eventType, onPopupEvent);
--- a/browser/components/distribution.js
+++ b/browser/components/distribution.js
@@ -106,17 +106,17 @@ DistributionCustomizer.prototype = {
     let re = /^item\.(\d+)\.(\w+)\.?(\w*)/;
     let items = {};
     let defaultIndex = -1;
     let maxIndex = -1;
 
     for (let key of keys) {
       let m = re.exec(key);
       if (m) {
-        let [foo, itemIndex, iprop, ilocale] = m;
+        let [, itemIndex, iprop, ilocale] = m;
         itemIndex = parseInt(itemIndex);
 
         if (ilocale)
           continue;
 
         if (keys.indexOf(key + "." + this._locale) >= 0) {
           key += "." + this._locale;
         } else if (keys.indexOf(key + "." + this._language) >= 0) {
--- a/browser/components/feeds/FeedConverter.js
+++ b/browser/components/feeds/FeedConverter.js
@@ -294,17 +294,19 @@ FeedConverter.prototype = {
       let httpChannel = channel.QueryInterface(Ci.nsIHttpChannel);
       // Make sure to check requestSucceeded before the potentially-throwing
       // getResponseHeader.
       if (!httpChannel.requestSucceeded) {
         // Just give up, but don't forget to cancel the channel first!
         request.cancel(Cr.NS_BINDING_ABORTED);
         return;
       }
-      let noSniff = httpChannel.getResponseHeader("X-Moz-Is-Feed");
+
+      // Note: this throws if the header is not set.
+      httpChannel.getResponseHeader("X-Moz-Is-Feed");
     }
     catch (ex) {
       this._sniffed = true;
     }
 
     this._request = request;
 
     // Save and reset the forced state bit early, in case there's some kind of
--- a/browser/components/feeds/FeedWriter.js
+++ b/browser/components/feeds/FeedWriter.js
@@ -479,20 +479,16 @@ FeedWriter.prototype = {
    * @returns element
    */
   _buildEnclosureDiv(entry) {
     let enclosuresDiv = this._document.createElementNS(HTML_NS, "div");
     enclosuresDiv.className = "enclosures";
 
     enclosuresDiv.appendChild(this._document.createTextNode(this._getString("mediaLabel")));
 
-    let roundme = function(n) {
-      return (Math.round(n * 100) / 100).toLocaleString();
-    }
-
     for (let i_enc = 0; i_enc < entry.enclosures.length; ++i_enc) {
       let enc = entry.enclosures.queryElementAt(i_enc, Ci.nsIWritablePropertyBag2);
 
       if (!(enc.hasKey("url")))
         continue;
 
       let enclosureDiv = this._document.createElementNS(HTML_NS, "div");
       enclosureDiv.setAttribute("class", "enclosure");
@@ -514,18 +510,19 @@ FeedWriter.prototype = {
 
         } catch (ex) { }
 
       }
 
       if (enc.hasKey("length") && /^[0-9]+$/.test(enc.get("length"))) {
         let enc_size = convertByteUnits(parseInt(enc.get("length")));
 
-        let size_text = this._getFormattedString("enclosureSizeText",
-                             [enc_size[0], this._getString(enc_size[1])]);
+        size_text = this._getFormattedString("enclosureSizeText",
+                                             [enc_size[0],
+                                             this._getString(enc_size[1])]);
       }
 
       let iconimg = this._document.createElementNS(HTML_NS, "img");
       iconimg.setAttribute("src", mozicon);
       iconimg.setAttribute("class", "type-icon");
       enclosureDiv.appendChild(iconimg);
 
       enclosureDiv.appendChild(this._document.createTextNode( " " ));
@@ -1056,17 +1053,16 @@ FeedWriter.prototype = {
                                 { pref: aPrefName,
                                   value: aPrefValue });
   },
 
   subscribe() {
     let feedType = this._getFeedType();
 
     // Subscribe to the feed using the selected handler and save prefs
-    let prefs = Services.prefs;
     let defaultHandler = "reader";
     let useAsDefault = this._document.getElementById("alwaysUse").getAttribute("checked");
 
     let menuList = this._document.getElementById("handlersMenuList");
     let selectedItem = menuList.selectedOptions[0];
     let subscribeCallback = () => {
       if (selectedItem.hasAttribute("webhandlerurl")) {
         let webURI = selectedItem.getAttribute("webhandlerurl");
@@ -1079,17 +1075,17 @@ FeedWriter.prototype = {
         if (handler) {
           if (useAsDefault) {
             wccr.setAutoHandler(this._getMimeTypeForFeedType(feedType), handler);
           }
 
           this._window.location.href = handler.getHandlerURI(this._window.location.href);
         }
       } else {
-        let prefReader = null;
+        let feedReader = null;
         switch (selectedItem.id) {
           case "selectedAppMenuItem":
             feedReader = "client";
             break;
           case "defaultHandlerMenuItem":
             feedReader = "default";
             break;
           case "liveBookmarksMenuItem":
--- a/browser/components/feeds/test/unit/test_758990.js
+++ b/browser/components/feeds/test/unit/test_758990.js
@@ -1,42 +1,42 @@
 function run_test() {
   var success = false;
   try {
-    var newURI = ios.newURI("feed:javascript:alert('hi');", null, null);
+    ios.newURI("feed:javascript:alert('hi');", null, null);
   }
   catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a feed:javascript: URI");
 
   success = false;
   try {
-    newURI = ios.newURI("feed:data:text/html,hi", null, null);
+    ios.newURI("feed:data:text/html,hi", null, null);
   }
   catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a feed:data: URI");
 
   success = false;
   try {
-    newURI = ios.newURI("pcast:javascript:alert('hi');", null, null);
+    ios.newURI("pcast:javascript:alert('hi');", null, null);
   }
   catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a pcast:javascript: URI");
 
   success = false;
   try {
-    newURI = ios.newURI("pcast:data:text/html,hi", null, null);
+    ios.newURI("pcast:data:text/html,hi", null, null);
   }
   catch (e) {
     success = e.result == Cr.NS_ERROR_MALFORMED_URI;
   }
   if (!success)
     do_throw("We didn't throw NS_ERROR_MALFORMED_URI creating a pcast:data: URI");
 
 }
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -713,17 +713,17 @@ nsDefaultCommandLineHandler.prototype = 
       // displayed) we will crash if we open an url and then select a profile. To
       // prevent this handle all url command line flags and set the command line's
       // preventDefault to true to prevent the display of the ui. The initial
       // command line will be retained when nsAppRunner calls LaunchChild though
       // urls launched after the initial launch will be lost.
       if (!this._haveProfile) {
         try {
           // This will throw when a profile has not been selected.
-          var dir = Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile);
+          Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile);
           this._haveProfile = true;
         }
         catch (e) {
           while ((ar = cmdLine.handleFlagWithParam("url", false)));
           cmdLine.preventDefault = true;
         }
       }
     }
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1455,19 +1455,19 @@ BrowserGlue.prototype = {
                         accessKey: key,
                         popup:     null,
                         callback: function(aNotificationBar, aButton) {
                           win.openUILinkIn(url, "tab");
                         }
                       }
                     ];
 
-      let notification = notifyBox.appendNotification(text, "post-update-notification",
-                                                      null, notifyBox.PRIORITY_INFO_LOW,
-                                                      buttons);
+      notifyBox.appendNotification(text, "post-update-notification",
+                                   null, notifyBox.PRIORITY_INFO_LOW,
+                                   buttons);
     }
 
     if (actions.indexOf("showAlert") == -1)
       return;
 
     let title = getNotifyString({propName: "alertTitle",
                                  stringName: "puAlertTitle",
                                  stringParams: [appName]});
--- a/browser/components/places/content/bookmarkProperties.js
+++ b/browser/components/places/content/bookmarkProperties.js
@@ -628,22 +628,16 @@ var BookmarkPropertiesPanel = {
               Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER
     });
   }),
 
   _promiseNewItem: Task.async(function* () {
     if (!PlacesUIUtils.useAsyncTransactions)
       return this._createNewItem();
 
-    let txnFunc =
-      { [BOOKMARK_FOLDER]: PlacesTransactions.NewFolder,
-        [LIVEMARK_CONTAINER]: PlacesTransactions.NewLivemark,
-        [BOOKMARK_ITEM]: PlacesTransactions.NewBookmark
-      }[this._itemType];
-
     let [containerId, index] = this._getInsertionPointDetails();
     let parentGuid = yield PlacesUtils.promiseItemGuid(containerId);
     let annotations = [];
     if (this._description) {
       annotations.push({ name: PlacesUIUtils.DESCRIPTION_ANNO
                        , value: this._description });
     }
     if (this._loadInSidebar) {
--- a/browser/components/places/content/browserPlacesViews.js
+++ b/browser/components/places/content/browserPlacesViews.js
@@ -1397,17 +1397,16 @@ PlacesToolbar.prototype = {
   /**
    * This function returns information about where to drop when dragging over
    * the toolbar.  The returned object has the following properties:
    * - ip: the insertion point for the bookmarks service.
    * - beforeIndex: child index to drop before, for the drop indicator.
    * - folderElt: the folder to drop into, if applicable.
    */
   _getDropPoint: function PT__getDropPoint(aEvent) {
-    let result = this.result;
     if (!PlacesUtils.nodeIsFolder(this._resultNode))
       return null;
 
     let dropPoint = { ip: null, beforeIndex: null, folderElt: null };
     let elt = aEvent.target;
     if (elt._placesNode && elt != this._rootElt &&
         elt.localName != "menupopup") {
       let eltRect = elt.getBoundingClientRect();
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -384,17 +384,17 @@ PlacesController.prototype = {
       var data = { }, type = { };
       xferable.getAnyTransferData(type, data, { });
       data = data.value.QueryInterface(Ci.nsISupportsString).data;
       if (type.value != PlacesUtils.TYPE_X_MOZ_URL &&
           type.value != PlacesUtils.TYPE_UNICODE)
         return false;
 
       // unwrapNodes() will throw if the data blob is malformed.
-      var unwrappedNodes = PlacesUtils.unwrapNodes(data, type.value);
+      PlacesUtils.unwrapNodes(data, type.value);
       return this._view.insertionPoint != null;
     }
     catch (e) {
       // getAnyTransferData or unwrapNodes failed
       return false;
     }
   },
 
@@ -1599,17 +1599,16 @@ var PlacesControllerDragHelper = {
       if (flavor != TAB_DROP_TYPE) {
         // There's only ever one in the D&D case.
         unwrapped = PlacesUtils.unwrapNodes(data, flavor)[0];
       }
       else if (data instanceof XULElement && data.localName == "tab" &&
                data.ownerGlobal instanceof ChromeWindow) {
         let uri = data.linkedBrowser.currentURI;
         let spec = uri ? uri.spec : "about:blank";
-        let title = data.label;
         unwrapped = { uri: spec,
                       title: data.label,
                       type: PlacesUtils.TYPE_X_MOZ_URL};
       }
       else
         throw new Error("bogus data was passed as a tab");
 
       let index = insertionPoint.index;
@@ -1736,9 +1735,8 @@ function doGetPlacesControllerForCommand
 }
 
 function goDoPlacesCommand(aCommand)
 {
   let controller = doGetPlacesControllerForCommand(aCommand);
   if (controller && controller.isCommandEnabled(aCommand))
     controller.doCommand(aCommand);
 }
-
--- a/browser/components/places/content/editBookmarkOverlay.js
+++ b/browser/components/places/content/editBookmarkOverlay.js
@@ -190,18 +190,17 @@ var gEditItemOverlay = {
       }
     }
 
     // For sanity ensure that the implementer has uninited the panel before
     // trying to init it again, or we could end up leaking due to observers.
     if (this.initialized)
       this.uninitPanel(false);
 
-    let { itemId, itemGuid, isItem,
-          isURI, uri, title,
+    let { itemId, isItem, isURI,
           isBookmark, bulkTagging, uris,
           visibleRows, focusedElement } = this._setPaneInfo(aInfo);
 
     let showOrCollapse =
       (rowId, isAppropriateForInput, nameInHiddenRows = null) => {
         let visible = isAppropriateForInput;
         if (visible && "hiddenRows" in aInfo && nameInHiddenRows)
           visible &= aInfo.hiddenRows.indexOf(nameInHiddenRows) == -1;
@@ -621,17 +620,16 @@ var gEditItemOverlay = {
       // TODO: Bug 1089141 - Provide some feedback about the invalid url.
       return;
     }
 
     if (this._paneInfo.uri.equals(newURI))
       return;
 
     if (!PlacesUIUtils.useAsyncTransactions) {
-      let itemId = this._paneInfo.itemId;
       let txn = new PlacesEditBookmarkURITransaction(this._paneInfo.itemId, newURI);
       PlacesUtils.transactionManager.doTransaction(txn);
       return;
     }
     let guid = this._paneInfo.itemGuid;
     PlacesTransactions.EditUrl({ guid, url: newURI })
                       .transact().catch(Components.utils.reportError);
   },
--- a/browser/components/places/content/places.js
+++ b/browser/components/places/content/places.js
@@ -567,17 +567,16 @@ var PlacesOrganizer = {
      * The details of simple folder-items (as opposed to livemarks) or the
      * of livemark-children are not likely to fill the infoBox anyway,
      * thus we remove the "More/Less" button and show all details.
      *
      * the wasminimal attribute here is used to persist the "more/less"
      * state in a bookmark->folder->bookmark scenario.
      */
     var infoBox = document.getElementById("infoBox");
-    var infoBoxExpander = document.getElementById("infoBoxExpander");
     var infoBoxExpanderWrapper = document.getElementById("infoBoxExpanderWrapper");
     var additionalInfoBroadcaster = document.getElementById("additionalInfoBroadcaster");
 
     if (!aNode) {
       infoBoxExpanderWrapper.hidden = true;
       return;
     }
     if (aNode.itemId != -1 &&
@@ -1365,17 +1364,17 @@ var ContentArea = {
    * Options for the current view.
    *
    * @see ContentTree.viewOptions for supported options and default values.
    */
   get currentViewOptions() {
     // Use ContentTree options as default.
     let viewOptions = ContentTree.viewOptions;
     if (this._specialViews.has(this.currentPlace)) {
-      let { view, options } = this._specialViews.get(this.currentPlace);
+      let { options } = this._specialViews.get(this.currentPlace);
       for (let option in options) {
         viewOptions[option] = options[option];
       }
     }
     return viewOptions;
   },
 
   focus: function() {
--- a/browser/components/places/content/treeView.js
+++ b/browser/components/places/content/treeView.js
@@ -275,18 +275,16 @@ PlacesTreeView.prototype = {
     let cc = aContainer.childCount;
     let newElements = new Array(cc);
     this._rows = this._rows.splice(0, aFirstChildRow)
                      .concat(newElements, this._rows);
 
     if (this._isPlainContainer(aContainer))
       return cc;
 
-    const openLiteral = PlacesUIUtils.RDF.GetResource("http://home.netscape.com/NC-rdf#open");
-    const trueLiteral = PlacesUIUtils.RDF.GetLiteral("true");
     let sortingMode = this._result.sortingMode;
 
     let rowsInserted = 0;
     for (let i = 0; i < cc; i++) {
       let curChild = aContainer.getChild(i);
       let curChildType = curChild.type;
 
       let row = aFirstChildRow + rowsInserted;
@@ -1055,17 +1053,16 @@ PlacesTreeView.prototype = {
       sortedColumn.element.removeAttribute("sortDirection");
 
     // Set new sorting indicator by looking through all columns for ours.
     if (aSortingMode == Ci.nsINavHistoryQueryOptions.SORT_BY_NONE)
       return;
 
     let [desiredColumn, desiredIsDescending] =
       this._sortTypeToColumnType(aSortingMode);
-    let colCount = columns.count;
     let column = this._findColumnByType(desiredColumn);
     if (column) {
       let sortDir = desiredIsDescending ? "descending" : "ascending";
       column.element.setAttribute("sortDirection", sortDir);
     }
   },
 
   _inBatchMode: false,
@@ -1380,17 +1377,17 @@ PlacesTreeView.prototype = {
       PlacesControllerDragHelper.onDrop(ip, aDataTransfer)
                                 .then(null, Components.utils.reportError);
     }
 
     PlacesControllerDragHelper.currentDropTarget = null;
   },
 
   getParentIndex: function PTV_getParentIndex(aRow) {
-    let [parentNode, parentRow] = this._getParentByChildRow(aRow);
+    let [, parentRow] = this._getParentByChildRow(aRow);
     return parentRow;
   },
 
   hasNextSibling: function PTV_hasNextSibling(aRow, aAfterIndex) {
     if (aRow == this._rows.length - 1) {
       // The last row has no sibling.
       return false;
     }
--- a/browser/components/places/tests/browser/browser_425884.js
+++ b/browser/components/places/tests/browser/browser_425884.js
@@ -117,13 +117,11 @@ function validate(aNode) {
   PlacesUtils.asContainer(aNode);
   aNode.containerOpen = true;
   is(aNode.childCount, 1, "confirm child count match");
   var folderNode = aNode.getChild(0);
   is(folderNode.title, "test folder", "confirm folder title");
   PlacesUtils.asContainer(folderNode);
   folderNode.containerOpen = true;
   is(folderNode.childCount, 2, "confirm child count match");
-  var bookmarkNode = folderNode.getChild(0);
-  var separatorNode = folderNode.getChild(1);
   folderNode.containerOpen = false;
   aNode.containerOpen = false;
 }
--- a/browser/components/places/tests/browser/browser_bookmarkProperties_addFolderDefaultButton.js
+++ b/browser/components/places/tests/browser/browser_bookmarkProperties_addFolderDefaultButton.js
@@ -12,17 +12,16 @@ add_task(function* () {
     type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
     parentGuid: PlacesUtils.bookmarks.unfiledGuid,
     url: "http://example.com/",
   });
   let newBookmarkId = yield PlacesUtils.promiseItemId(newBookmark.guid);
 
   yield withSidebarTree("bookmarks", function* (tree) {
     // Select the new bookmark in the sidebar.
-    let itemId = PlacesUIUtils.leftPaneQueries["UnfiledBookmarks"];
     tree.selectItems([newBookmarkId]);
     ok(tree.controller.isCommandEnabled("placesCmd_new:folder"),
        "'placesCmd_new:folder' on current selected node is enabled");
 
     // Create a new folder.  Since the new bookmark is selected, and new items
     // are inserted at the index of the currently selected item, the new folder
     // will be inserted at index 0.
     yield withBookmarksDialog(
--- a/browser/components/places/tests/browser/browser_library_commands.js
+++ b/browser/components/places/tests/browser/browser_library_commands.js
@@ -133,21 +133,21 @@ add_task(function* test_query_on_toolbar
      "Query node bookmark has been correctly removed");
 
   toolbarNode.containerOpen = false;
 
   library.close();
 });
 
 add_task(function* test_search_contents() {
-  let item = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
-                                                  url: "http://example.com/",
-                                                  title: "example page",
-                                                  parentGuid: PlacesUtils.bookmarks.unfiledGuid,
-                                                  index: 0 });
+  yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
+                                       url: "http://example.com/",
+                                       title: "example page",
+                                       parentGuid: PlacesUtils.bookmarks.unfiledGuid,
+                                       index: 0 });
 
   let library = yield promiseLibrary();
   info("Ensure query contents can be cut or deleted");
 
   // Select and open the left pane "Bookmarks Toolbar" folder.
   let PO = library.PlacesOrganizer;
 
   PO.selectLeftPaneQuery('BookmarksToolbar');
@@ -170,21 +170,21 @@ add_task(function* test_search_contents(
      "Cut command is enabled");
   ok(library.ContentTree.view.controller.isCommandEnabled("cmd_delete"),
      "Delete command is enabled");
 
   library.close();
 });
 
 add_task(function* test_tags() {
-  let item = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
-                                                  url: "http://example.com/",
-                                                  title: "example page",
-                                                  parentGuid: PlacesUtils.bookmarks.unfiledGuid,
-                                                  index: 0 });
+  yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
+                                       url: "http://example.com/",
+                                       title: "example page",
+                                       parentGuid: PlacesUtils.bookmarks.unfiledGuid,
+                                       index: 0 });
   PlacesUtils.tagging.tagURI(NetUtil.newURI("http://example.com/"), ["test"]);
 
   let library = yield promiseLibrary();
   info("Ensure query contents can be cut or deleted");
 
   // Select and open the left pane "Bookmarks Toolbar" folder.
   let PO = library.PlacesOrganizer;
 
--- a/browser/components/places/tests/browser/browser_library_views_liveupdate.js
+++ b/browser/components/places/tests/browser/browser_library_views_liveupdate.js
@@ -182,18 +182,17 @@ var bookmarksObserver = {
       default:
         isnot(node, null, "Found new Places node in left pane");
         ok(index >= 0, "Node is at index " + index);
     }
   },
 
   onItemRemoved: function PSB_onItemRemoved(aItemId, aFolder, aIndex) {
     var node = null;
-    var index = null;
-    [node, index] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places);
+    [node, ] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places);
     is(node, null, "Places node not found in left pane");
   },
 
   onItemMoved: function(aItemId,
                         aOldFolderId, aOldIndex,
                         aNewFolderId, aNewIndex, aItemType) {
     var node = null;
     var index = null;
@@ -225,17 +224,17 @@ var bookmarksObserver = {
                                             aIsAnnotationProperty, aNewValue) {
     if (aProperty == "title") {
       let validator = function(aTreeRowIndex) {
         let tree = gLibrary.PlacesOrganizer._places;
         let cellText = tree.view.getCellText(aTreeRowIndex,
                                              tree.columns.getColumnAt(0));
         return cellText == aNewValue;
       }
-      let [node, index, valid] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places, validator);
+      let [node, , valid] = getNodeForTreeItem(aItemId, gLibrary.PlacesOrganizer._places, validator);
       if (node) // Only visible nodes.
         ok(valid, "Title cell value has been correctly updated");
     }
   }
 };
 
 
 /**
--- a/browser/components/places/tests/browser/browser_views_liveupdate.js
+++ b/browser/components/places/tests/browser/browser_views_liveupdate.js
@@ -213,18 +213,17 @@ var bookmarksObserver = {
 
   onItemRemoved: function PSB_onItemRemoved(aItemId, aFolderId, aIndex,
                                             aItemType) {
     var views = getViewsForFolder(aFolderId);
     ok(views.length > 0, "Found affected views (" + views.length + "): " + views);
     // Check that item has been removed.
     for (var i = 0; i < views.length; i++) {
       var node = null;
-      var index = null;
-      [node, index] = searchItemInView(aItemId, views[i]);
+      [node, ] = searchItemInView(aItemId, views[i]);
       is(node, null, "Places node not found in " + views[i]);
     }
   },
 
   onItemMoved: function(aItemId,
                         aOldFolderId, aOldIndex,
                         aNewFolderId, aNewIndex,
                         aItemType) {
@@ -268,17 +267,17 @@ var bookmarksObserver = {
       }
       if (!aNewValue && aElementOrTreeIndex.localName != "toolbarbutton") {
         return aElementOrTreeIndex.getAttribute("label") == PlacesUIUtils.getBestTitle(aElementOrTreeIndex._placesNode);
       }
       return aElementOrTreeIndex.getAttribute("label") == aNewValue;
     };
 
     for (var i = 0; i < views.length; i++) {
-      var [node, index, valid] = searchItemInView(aItemId, views[i], validator);
+      var [node, , valid] = searchItemInView(aItemId, views[i], validator);
       isnot(node, null, "Found changed Places node in " + views[i]);
       is(node.title, aNewValue, "Node has correct title: " + aNewValue);
       ok(valid, "Node element has correct label: " + aNewValue);
     }
   }
 };
 
 /**
--- a/browser/components/places/tests/unit/test_browserGlue_smartBookmarks.js
+++ b/browser/components/places/tests/unit/test_browserGlue_smartBookmarks.js
@@ -32,17 +32,17 @@ function countFolderChildren(aFolderItem
     print("Found child(" + i + "): " + title);
   }
   rootNode.containerOpen = false;
   return cc;
 }
 
 add_task(function* setup() {
   // Initialize browserGlue, but remove it's listener to places-init-complete.
-  let bg = Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIObserver);
+  Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIObserver);
 
   // Initialize Places.
   PlacesUtils.history;
 
   // Wait for Places init notification.
   yield promiseTopicObserved("places-browser-init-complete");
 
   // Ensure preferences status.
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -466,18 +466,16 @@ var gCookiesWindow = {
       ++aHostCount.value;
     }
 
     var c = this._makeCookieObject(aStrippedHost, aCookie);
     this._hosts[aStrippedHost].cookies.push(c);
   },
 
   _makeCookieObject: function (aStrippedHost, aCookie) {
-    var host = aCookie.host;
-    var formattedHost = host.charAt(0) == "." ? host.substring(1, host.length) : host;
     var c = { name            : aCookie.name,
               value           : aCookie.value,
               isDomain        : aCookie.isDomain,
               host            : aCookie.host,
               rawHost         : aStrippedHost,
               path            : aCookie.path,
               isSecure        : aCookie.isSecure,
               expires         : aCookie.expires,
--- a/browser/components/preferences/in-content/content.js
+++ b/browser/components/preferences/in-content/content.js
@@ -38,17 +38,16 @@ var gContentPane = {
       row.removeAttribute("hidden");
       // Showing attribution only for Bing Translator.
       Components.utils.import("resource:///modules/translation/Translation.jsm");
       if (Translation.translationEngine == "bing") {
         document.getElementById("bingAttribution").removeAttribute("hidden");
       }
     }
 
-    let doNotDisturbAlertsEnabled = false;
     if (AlertsServiceDND) {
       let notificationsDoNotDisturbRow =
         document.getElementById("notificationsDoNotDisturbRow");
       notificationsDoNotDisturbRow.removeAttribute("hidden");
       if (AlertsServiceDND.manualDoNotDisturb) {
         let notificationsDoNotDisturb =
           document.getElementById("notificationsDoNotDisturb");
         notificationsDoNotDisturb.setAttribute("checked", true);
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -291,19 +291,19 @@ var gMainPane = {
   /**
    * Displays a dialog in which the user can select a bookmark to use as home
    * page.  If the user selects a bookmark, that bookmark's name is displayed in
    * UI and the bookmark's address is stored to the home page preference.
    */
   setHomePageToBookmark: function ()
   {
     var rv = { urls: null, names: null };
-    var dialog = gSubDialog.open("chrome://browser/content/preferences/selectBookmark.xul",
-                                 "resizable=yes, modal=yes", rv,
-                                 this._setHomePageToBookmarkClosed.bind(this, rv));
+    gSubDialog.open("chrome://browser/content/preferences/selectBookmark.xul",
+                    "resizable=yes, modal=yes", rv,
+                    this._setHomePageToBookmarkClosed.bind(this, rv));
   },
 
   _setHomePageToBookmarkClosed: function(rv, aEvent) {
     if (aEvent.detail.button != "accept")
       return;
     if (rv.urls && rv.names) {
       var homePage = document.getElementById("browser.startup.homepage");
 
--- a/browser/components/preferences/permissions.js
+++ b/browser/components/preferences/permissions.js
@@ -396,17 +396,16 @@ var gPermissionManager = {
   },
 
   _loadPermissions: function ()
   {
     this._tree = document.getElementById("permissionsTree");
     this._permissions = [];
 
     // load permissions into a table
-    var count = 0;
     var enumerator = Services.perms.enumerator;
     while (enumerator.hasMoreElements()) {
       var nextPermission = enumerator.getNext().QueryInterface(Components.interfaces.nsIPermission);
       this._addPermissionToList(nextPermission);
     }
 
     this._view._rowCount = this._permissions.length;
 
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -816,18 +816,16 @@
           return true;
         },
 
         doCommand: function (aCommand) {
           switch (aCommand) {
             case "cmd_clearhistory":
               var param = this._self.getAttribute("autocompletesearchparam");
 
-              let searchBar = this._self.parentNode;
-
               BrowserSearch.searchBar.FormHistory.update({ op : "remove", fieldname : param }, null);
               this._self.value = "";
               break;
             case "cmd_togglesuggest":
               // The pref observer will update _suggestEnabled and the menu
               // checkmark.
               Services.prefs.setBoolPref("browser.search.suggest.enabled",
                                          !this._self._suggestEnabled);
@@ -1677,19 +1675,16 @@
         @return True if the selection can continue to advance after this method
                 returns and false if not.
       -->
       <method name="advanceSelection">
         <parameter name="aForward"/>
         <parameter name="aWrapAround"/>
         <parameter name="aCycleEngines"/>
         <body><![CDATA[
-          let popup = this.popup;
-          let list = document.getAnonymousElementByAttribute(popup, "anonid",
-                                                             "search-panel-one-offs");
           let selectedButton = this.selectedButton;
           let buttons = this.getSelectableButtons(aCycleEngines);
 
           if (selectedButton) {
             // cycle through one-off buttons.
             let index = buttons.indexOf(selectedButton);
             if (aForward)
               ++index;
--- a/browser/components/search/test/browser_426329.js
+++ b/browser/components/search/test/browser_426329.js
@@ -158,17 +158,17 @@ add_task(function* testShiftAltReturn() 
   return;
 
   yield* prepareTest();
 
   let url = expectedURL(searchBar.value);
 
   let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, url);
   EventUtils.synthesizeKey("VK_RETURN", { shiftKey: true, altKey: true });
-  let newTab = yield newTabPromise;
+  yield newTabPromise;
 
   is(gBrowser.tabs.length, preTabNo + 1, "Shift+Alt+Return key added new tab");
   is(gBrowser.currentURI.spec, url, "testShiftAltReturn opened correct search page");
 });
 
 add_task(function* testLeftClick() {
   yield* prepareTest();
   simulateClick({ button: 0 }, searchButton);
--- a/browser/components/search/test/browser_abouthome_behavior.js
+++ b/browser/components/search/test/browser_abouthome_behavior.js
@@ -6,27 +6,28 @@
  */
 
 "use strict";
 
 function test() {
   // Bug 992270: Ignore uncaught about:home exceptions (related to snippets from IndexedDB)
   ignoreAllUncaughtExceptions(true);
 
+  let previouslySelectedEngine = Services.search.currentEngine;
+
   function replaceUrl(base) {
     return base;
   }
 
   let gMutationObserver = null;
 
   function verify_about_home_search(engine_name) {
     let engine = Services.search.getEngineByName(engine_name);
     ok(engine, engine_name + " is installed");
 
-    let previouslySelectedEngine = Services.search.currentEngine;
     Services.search.currentEngine = engine;
 
     // load about:home, but remove the listener first so it doesn't
     // get in the way
     gBrowser.removeProgressListener(listener);
     gBrowser.loadURI("about:home");
     info("Waiting for about:home load");
     tab.linkedBrowser.addEventListener("load", function load(event) {
@@ -123,16 +124,17 @@ function test() {
 
       req.cancel(Components.results.NS_ERROR_FAILURE);
 
       executeSoon(nextTest);
     }
   }
 
   registerCleanupFunction(function () {
+    Services.search.currentEngine = previouslySelectedEngine;
     gBrowser.removeProgressListener(listener);
     gBrowser.removeTab(tab);
     if (gMutationObserver)
       gMutationObserver.disconnect();
   });
 
   tab.linkedBrowser.addEventListener("load", function load() {
     tab.linkedBrowser.removeEventListener("load", load, true);
--- a/browser/components/search/test/browser_private_search_perwindowpb.js
+++ b/browser/components/search/test/browser_private_search_perwindowpb.js
@@ -2,18 +2,16 @@
 // search in a private window, and then checks in the public window
 // whether there is an autocomplete entry for the private search.
 
 add_task(function* () {
   // Don't use about:home as the homepage for new windows
   Services.prefs.setIntPref("browser.startup.page", 0);
   registerCleanupFunction(() => Services.prefs.clearUserPref("browser.startup.page"));
 
-  let engineURL =
-    "http://mochi.test:8888/browser/browser/components/search/test/";
   let windowsToClose = [];
 
   function performSearch(aWin, aIsPrivate) {
     let searchBar = aWin.BrowserSearch.searchBar;
     ok(searchBar, "got search bar");
 
     let loadPromise = BrowserTestUtils.browserLoaded(aWin.gBrowser.selectedBrowser);
 
--- a/browser/components/search/test/browser_searchbar_keyboard_navigation.js
+++ b/browser/components/search/test/browser_searchbar_keyboard_navigation.js
@@ -366,17 +366,17 @@ add_task(function* test_tab_and_arrows()
   // Finally close the panel.
   let promise = promiseEvent(searchPopup, "popuphidden");
   searchPopup.hidePopup();
   yield promise;
 });
 
 add_task(function* test_open_search() {
   let rootDir = getRootDirectory(gTestPath);
-  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
+  yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
 
   let promise = promiseEvent(searchPopup, "popupshown");
   info("Opening search panel");
   searchbar.focus();
   yield promise;
 
   let engines = getOpenSearchItems();
   is(engines.length, 2, "the opensearch.html page exposes 2 engines")
--- a/browser/components/search/test/browser_searchbar_openpopup.js
+++ b/browser/components/search/test/browser_searchbar_openpopup.js
@@ -127,17 +127,16 @@ add_task(function* open_empty() {
   is(searchPopup.getAttribute("showonlysettings"), "true", "Should only show the settings");
   is(textbox.mController.searchString, "", "Should be an empty search string");
 
   // By giving the textbox some text any next attempt to open the search popup
   // from the click handler will try to search for this text.
   textbox.value = "foo";
 
   promise = promiseEvent(searchPopup, "popuphidden");
-  let clickPromise = promiseEvent(searchIcon, "click");
 
   info("Hiding popup");
   yield synthesizeNativeMouseClick(searchIcon);
   yield promise;
 
   is(textbox.mController.searchString, "", "Should not have started to search for the new text");
 
   // Cancel the search if it started.
--- a/browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js
+++ b/browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js
@@ -294,17 +294,17 @@ add_task(function* test_tab_and_arrows()
   // Finally close the panel.
   let promise = promiseEvent(searchPopup, "popuphidden");
   searchPopup.hidePopup();
   yield promise;
 });
 
 add_task(function* test_open_search() {
   let rootDir = getRootDirectory(gTestPath);
-  let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
+  yield BrowserTestUtils.openNewForegroundTab(gBrowser, rootDir + "opensearch.html");
 
   let promise = promiseEvent(searchPopup, "popupshown");
   info("Opening search panel");
   EventUtils.synthesizeMouseAtCenter(searchIcon, {});
   yield promise;
   is(searchPopup.getAttribute("showonlysettings"), "true", "Should show the small popup");
 
   let engines = getOpenSearchItems();
--- a/browser/components/shell/test/browser_420786.js
+++ b/browser/components/shell/test/browser_420786.js
@@ -65,25 +65,22 @@ function onPageLoad() {
   if (wpFileBackup.exists())
     wpFileBackup.moveTo(null, wpFile.leafName);
 
   gBrowser.removeCurrentTab();
   finish();
 }
 
 function test() {
-  var osString = Cc["@mozilla.org/xre/app-info;1"].
-                 getService(Ci.nsIXULRuntime).OS;
-
   try {
     // If GSettings is available, then the GConf tests
     // will fail
-    var gsettings = Cc["@mozilla.org/gsettings-service;1"].
-                    getService(Ci.nsIGSettingsService).
-                    getCollectionForSchema("org.gnome.desktop.background");
+    Cc["@mozilla.org/gsettings-service;1"].
+      getService(Ci.nsIGSettingsService).
+      getCollectionForSchema("org.gnome.desktop.background");
     todo(false, "This test doesn't work when GSettings is available");
     return;
   } catch (e) { }
 
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", onPageLoad, true);
   content.location = "about:logo";
 
--- a/browser/components/shell/test/unit/test_421977.js
+++ b/browser/components/shell/test/unit/test_421977.js
@@ -65,19 +65,19 @@ function run_test() {
 
   // This test is Linux specific for now
   if (!("@mozilla.org/gnome-gconf-service;1" in Cc))
     return;
 
   try {
     // If GSettings is available, then the GConf tests
     // will fail
-    var gsettings = Cc["@mozilla.org/gsettings-service;1"].
-                    getService(Ci.nsIGSettingsService).
-                    getCollectionForSchema("org.gnome.desktop.background");
+    Cc["@mozilla.org/gsettings-service;1"].
+      getService(Ci.nsIGSettingsService).
+      getCollectionForSchema("org.gnome.desktop.background");
     return;
   } catch (e) { }
 
   gGConf = Cc["@mozilla.org/gnome-gconf-service;1"].
            getService(Ci.nsIGConfService);
 
   gShell = Cc["@mozilla.org/browser/shell-service;1"].
            getService(Ci.nsIShellService);
--- a/browser/components/syncedtabs/SyncedTabsListStore.js
+++ b/browser/components/syncedtabs/SyncedTabsListStore.js
@@ -121,17 +121,16 @@ Object.assign(SyncedTabsListStore.protot
     } else if (childRow < branch.tabs.length) {
       this.selectRow(branchRow, childRow + 1);
     }
   },
 
   moveSelectionUp() {
     let branchRow = this._selectedRow[0];
     let childRow = this._selectedRow[1];
-    let branch = this.data[branchRow];
 
     if (this.filter) {
       this.selectRow(branchRow - 1);
       return;
     }
 
     if (branchRow < 0) {
       this.selectRow(0, -1);
@@ -229,9 +228,8 @@ Object.assign(SyncedTabsListStore.protot
           this._SyncedTabs.sortTabClientsByLastUsed(result);
         }
         this.data = result;
         this._change(updateType);
       })
       .catch(Cu.reportError);
   }
 });
-
--- a/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js
+++ b/browser/components/syncedtabs/test/xpcshell/test_SyncedTabsDeckComponent.js
@@ -180,17 +180,16 @@ add_task(function* testPanelStatus() {
 
   sinon.stub(component, "getPanelStatus", () => Promise.resolve("mock-panelId"));
   sinon.spy(deckStore, "selectPanel");
   yield component.updatePanel();
   Assert.ok(deckStore.selectPanel.calledWith("mock-panelId"));
 });
 
 add_task(function* testActions() {
-  let listComponent = {};
   let windowMock = {
     openUILink() {},
   };
   let chromeWindowMock = {
     gSyncUI: {
       openSetup() {}
     }
   };
--- a/browser/components/translation/BingTranslator.jsm
+++ b/browser/components/translation/BingTranslator.jsm
@@ -414,17 +414,17 @@ var BingTokenManager = {
       onError: function(e, responseText, xhr) {
         BingTokenManager._pendingRequest = null;
         deferred.reject(e);
       },
       postData: params
     };
 
     this._pendingRequest = deferred.promise;
-    let request = httpRequest(url, options);
+    httpRequest(url, options);
 
     return deferred.promise;
   }
 };
 
 /**
  * Escape a string to be valid XML content.
  */
--- a/browser/components/translation/TranslationDocument.jsm
+++ b/browser/components/translation/TranslationDocument.jsm
@@ -498,17 +498,16 @@ function parseResultNode(item, node) {
  * @param item     A TranslationItem object
  * @param target   A string that is either "translation"
  *                 or "original".
  */
 function swapTextForItem(item, target) {
   // visitStack is the stack of items that we still need to visit.
   // Let's start the process by adding the root item.
   let visitStack = [ item ];
-  let source = target == "translation" ? "original" : "translation";
 
   while (visitStack.length > 0) {
     let curItem = visitStack.shift();
 
     let domNode = curItem.nodeRef;
     if (!domNode) {
       // Skipping this item due to a missing node.
       continue;
--- a/browser/components/translation/test/browser_translation_infobar.js
+++ b/browser/components/translation/test/browser_translation_infobar.js
@@ -189,17 +189,16 @@ function run_tests(aFinishCallback) {
   notif._getAnonElt("translate").click();
   is(notif.state, Translation.STATE_TRANSLATING, "the infobar is in the translating state");
   ok(!!notif.translation.translatedFrom, "Translation.translate has been called");
   is(notif.translation.translatedFrom, "ja", "from language correct");
   notif.close();
 
   info("Reopen to check the 'Not Now' button closes the notification.");
   notif = showTranslationUI("fr");
-  let notificationBox = gBrowser.getNotificationBox();
   is(hasTranslationInfoBar(), true, "there's a 'translate' notification");
   notif._getAnonElt("notNow").click();
   is(hasTranslationInfoBar(), false, "no 'translate' notification after clicking 'not now'");
 
   info("Reopen to check the url bar icon closes the notification.");
   notif = showTranslationUI("fr");
   is(hasTranslationInfoBar(), true, "there's a 'translate' notification");
   PopupNotifications.getNotification("translate").anchorElement.click();
--- a/browser/components/translation/test/browser_translation_telemetry.js
+++ b/browser/components/translation/test/browser_translation_telemetry.js
@@ -213,17 +213,18 @@ add_task(function* test_show_original() 
     yield translate("<h1>Hallo Welt!</h1><h1>Bratwurst!</h1>", "de", false);
   yield MetricsChecker.checkAdditions({ pageCount: 1, showOriginal: 0 });
   getInfobarElement(tab.linkedBrowser, "showOriginal").doCommand();
   yield MetricsChecker.checkAdditions({ pageCount: 0, showOriginal: 1 });
   gBrowser.removeTab(tab);
 });
 
 add_task(function* test_language_change() {
-  for (let i of Array(4)) {
+  // This is run 4 times, the total additions are checked afterwards.
+  for (let i of Array(4)) { // eslint-disable-line no-unused-vars
     let tab = yield offerTranslationFor("<h1>Hallo Welt!</h1>", "fr");
     let browser = tab.linkedBrowser;
     // In the offer state, translation is executed by the Translate button,
     // so we expect just a single recoding.
     let detectedLangMenulist = getInfobarElement(browser, "detectedLanguage");
     simulateUserSelectInMenulist(detectedLangMenulist, "de");
     simulateUserSelectInMenulist(detectedLangMenulist, "it");
     simulateUserSelectInMenulist(detectedLangMenulist, "de");
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -175,17 +175,16 @@ this.UITour = {
                                                         "anonid",
                                                         "searchbar-search-button");
       },
       widgetName: "search-container",
     }],
     ["searchPrefsLink", {
       query: (aDocument) => {
         let element = null;
-        let searchbar = aDocument.getElementById("searchbar");
         let popup = aDocument.getElementById("PopupSearchAutoComplete");
         if (popup.state != "open")
           return null;
         element = aDocument.getAnonymousElementByAttribute(popup,
                                                            "anonid",
                                                            "search-settings");
         if (!element || !UITour.isElementVisible(element)) {
           return null;
@@ -1827,17 +1826,17 @@ this.UITour = {
 
         let canSetDefaultBrowserInBackground = true;
         if (AppConstants.isPlatformAndVersionAtLeast("win", "6.2") ||
             AppConstants.isPlatformAndVersionAtLeast("macosx", "10.10")) {
           canSetDefaultBrowserInBackground = false;
         } else if (AppConstants.platform == "linux") {
           // The ShellService may not exist on some versions of Linux.
           try {
-            let shell = aWindow.getShellService();
+            aWindow.getShellService();
           } catch (e) {
             canSetDefaultBrowserInBackground = null;
           }
         }
 
         appinfo["canSetDefaultBrowserInBackground"] =
           canSetDefaultBrowserInBackground;
 
--- a/browser/components/uitour/test/browser_UITour3.js
+++ b/browser/components/uitour/test/browser_UITour3.js
@@ -114,17 +114,16 @@ add_UITour_task(function* test_info_butt
   ok(true, "Popup should close automatically");
 
   let returnValue = yield waitForCallbackResultPromise();
 
   is(returnValue.result, "button2", "Correct callback should have been called");
 }),
 
 add_UITour_task(function* test_info_close_button() {
-  let popup = document.getElementById("UITourTooltip");
   let closeButton = document.getElementById("UITourTooltipClose");
 
   yield showInfoPromise("urlbar", "Close me", "X marks the spot", null, null, "makeInfoOptions");
 
   EventUtils.synthesizeMouseAtCenter(closeButton, {}, window);
 
   let returnValue = yield waitForCallbackResultPromise();
 
--- a/browser/extensions/flyweb/bootstrap.js
+++ b/browser/extensions/flyweb/bootstrap.js
@@ -232,17 +232,16 @@ let FlyWebView = {
       onDestroyed(aDocument) {
         aDocument.defaultView.QueryInterface(Ci.nsIInterfaceRequestor).
             getInterface(Ci.nsIDOMWindowUtils).removeSheet(this._sheetURI, 1);
       },
 
       onViewShowing(aEvent) {
         let doc = aEvent.target.ownerDocument;
 
-        let panel = doc.getElementById("flyweb-panel");
         let items = doc.getElementById("flyweb-items");
         let empty = doc.getElementById("flyweb-items-empty");
 
         if (!gDiscoveryManagerInstance) {
           gDiscoveryManagerInstance = new DiscoveryManager(doc.defaultView);
         }
 
         gDiscoveryManagerInstance.start((services) => {
--- a/browser/modules/FormSubmitObserver.jsm
+++ b/browser/modules/FormSubmitObserver.jsm
@@ -190,17 +190,16 @@ FormSubmitObserver.prototype =
 
     // Note, this is relative to the browser and needs to be translated
     // in chrome.
     panelData.contentRect = BrowserUtils.getElementBoundingRect(aElement);
 
     // We want to show the popup at the middle of checkbox and radio buttons
     // and where the content begin for the other elements.
     let offset = 0;
-    let position = "";
 
     if (aElement.tagName == 'INPUT' &&
         (aElement.type == 'radio' || aElement.type == 'checkbox')) {
       panelData.position = "bottomcenter topleft";
     } else {
       let win = aElement.ownerGlobal;
       let style = win.getComputedStyle(aElement, null);
       if (style.direction == 'rtl') {
--- a/browser/modules/PluginContent.jsm
+++ b/browser/modules/PluginContent.jsm
@@ -130,17 +130,16 @@ PluginContent.prototype = {
 
   observe: function observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "decoder-doctor-notification":
         let data = JSON.parse(aData);
         if (this.haveShownNotification &&
             aSubject.top.document == this.content.document &&
             data.formats.toLowerCase().includes("application/x-mpegurl", 0)) {
-          let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
           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()],
                                          showNow: true,
                                          location: location,
                                        }, null, principal);
@@ -448,17 +447,16 @@ PluginContent.prototype = {
           win.mozHiddenPluginTouched = true;
         } catch (e) {
           Cu.reportError("Error adding plugin replacement style sheet: " + e);
         }
       }
     }
 
     let plugin = event.target;
-    let doc = plugin.ownerDocument;
 
     if (eventType == "PluginPlaceholderReplaced") {
       plugin.removeAttribute("href");
       let overlay = this.getPluginUI(plugin, "main");
       this.setVisibility(plugin, overlay, true);
       let inIDOMUtils = Cc["@mozilla.org/inspector/dom-utils;1"]
                           .getService(Ci.inIDOMUtils);
       // Add psuedo class so our styling will take effect
@@ -509,17 +507,16 @@ PluginContent.prototype = {
         let { pluginTag } = this._getPluginInfo(plugin);
         this.addLinkClickCallback(updateLink, "forwardCallback",
                                   "openPluginUpdatePage", pluginTag);
         /* FALLTHRU */
 
       case "PluginVulnerableNoUpdate":
       case "PluginClickToPlay":
         this._handleClickToPlayEvent(plugin);
-        let overlay = this.getPluginUI(plugin, "main");
         let pluginName = this._getPluginInfo(plugin).pluginName;
         let messageString = gNavigatorBundle.formatStringFromName("PluginClickToActivate", [pluginName], 1);
         let overlayText = this.getPluginUI(plugin, "clickToPlay");
         overlayText.textContent = messageString;
         if (eventType == "PluginVulnerableUpdatable" ||
             eventType == "PluginVulnerableNoUpdate") {
           let vulnerabilityString = gNavigatorBundle.GetStringFromName(eventType);
           let vulnerabilityText = this.getPluginUI(plugin, "vulnerabilityStatus");
--- a/browser/modules/ProcessHangMonitor.jsm
+++ b/browser/modules/ProcessHangMonitor.jsm
@@ -208,17 +208,17 @@ var ProcessHangMonitor = {
     return null;
   },
 
   /**
    * Find a paused hang report for the given <browser> element.
    */
   findPausedReport: function(browser) {
     let frameLoader = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
-    for (let [report, timer] of this._pausedReports) {
+    for (let [report, ] of this._pausedReports) {
       if (report.isReportForBrowser(frameLoader)) {
         return report;
       }
     }
     return null;
   },
 
   /**
@@ -283,17 +283,16 @@ var ProcessHangMonitor = {
   showNotification: function(win, report) {
     let nb = win.document.getElementById("high-priority-global-notificationbox");
     let notification = nb.getNotificationWithValue("process-hang");
     if (notification) {
       return;
     }
 
     let bundle = win.gNavigatorBundle;
-    let brandBundle = win.document.getElementById("bundle_brand");
 
     let buttons = [{
         label: bundle.getString("processHang.button_stop.label"),
         accessKey: bundle.getString("processHang.button_stop.accessKey"),
         callback: function() {
           ProcessHangMonitor.stopIt(win);
         }
       },
--- a/browser/modules/RemotePrompt.jsm
+++ b/browser/modules/RemotePrompt.jsm
@@ -32,17 +32,16 @@ var RemotePrompt = {
         }
         break;
     }
   },
 
   openTabPrompt: function(args, browser) {
     let window = browser.ownerGlobal;
     let tabPrompt = window.gBrowser.getTabModalPromptBox(browser)
-    let callbackInvoked = false;
     let newPrompt;
     let needRemove = false;
     let promptId = args._remoteId;
 
     function onPromptClose(forceCleanup) {
       // It's possible that we removed the prompt during the
       // appendPrompt call below. In that case, newPrompt will be
       // undefined. We set the needRemove flag to remember to remove
--- a/browser/modules/Windows8WindowFrameColor.jsm
+++ b/browser/modules/Windows8WindowFrameColor.jsm
@@ -28,17 +28,17 @@ var Windows8WindowFrameColor = {
     }
 
     // The color returned from the Registry is in decimal form.
     let customizationColorHex = customizationColor.toString(16);
 
     // Zero-pad the number just to make sure that it is 8 digits.
     customizationColorHex = ("00000000" + customizationColorHex).substr(-8);
     let customizationColorArray = customizationColorHex.match(/../g);
-    let [unused, fgR, fgG, fgB] = customizationColorArray.map(val => parseInt(val, 16));
+    let [, fgR, fgG, fgB] = customizationColorArray.map(val => parseInt(val, 16));
     let colorizationColorBalance = Registry.readRegKey(HKCU, dwmKey,
                                                        "ColorizationColorBalance");
     if (colorizationColorBalance == undefined) {
       colorizationColorBalance = 78;
     }
 
     // Window frame base color when Color Intensity is at 0, see bug 1004576.
     let frameBaseColor = 217;
--- a/browser/modules/WindowsPreviewPerTab.jsm
+++ b/browser/modules/WindowsPreviewPerTab.jsm
@@ -471,17 +471,17 @@ TabWindow.prototype = {
     return this._enabled;
   },
 
   set enabled (enable) {
     this._enabled = enable;
     // Because making a tab visible requires that the tab it is next to be
     // visible, it is far simpler to unset the 'next' tab and recreate them all
     // at once.
-    for (let [tab, preview] of this.previews) {
+    for (let [, preview] of this.previews) {
       preview.move(null);
       preview.visible = enable;
     }
     this.updateTabOrdering();
   },
 
   previewFromTab: function (tab) {
     return this.previews.get(tab);
@@ -836,17 +836,17 @@ this.AeroPeek = {
   onFrecencyChanged() {},
   onManyFrecenciesChanged() {},
   onDeleteURI() {},
   onClearHistory() {},
   onDeleteVisits() {},
   onPageChanged(uri, changedConst, newValue) {
     if (this.enabled && changedConst == Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON) {
       for (let win of this.windows) {
-        for (let [tab, preview] of win.previews) {
+        for (let [tab, ] of win.previews) {
           if (tab.getAttribute("image") == newValue) {
             win.onLinkIconAvailable(tab.linkedBrowser, newValue);
           }
         }
       }
     }
   },
 
--- a/browser/modules/test/browser_ContentSearch.js
+++ b/browser/modules/test/browser_ContentSearch.js
@@ -109,17 +109,16 @@ add_task(function* search() {
 });
 
 add_task(function* searchInBackgroundTab() {
   // This test is like search(), but it opens a new tab after starting a search
   // in another.  In other words, it performs a search in a background tab.  The
   // search page should be loaded in the same tab that performed the search, in
   // the background tab.
   yield addTab();
-  let searchBrowser = gBrowser.selectedBrowser;
   let engine = Services.search.currentEngine;
   let data = {
     engineName: engine.name,
     searchString: "ContentSearchTest",
     healthReportKey: "ContentSearchTest",
     searchPurpose: "ContentSearchTest",
   };
   let submissionURL =
--- a/browser/modules/test/browser_UnsubmittedCrashHandler.js
+++ b/browser/modules/test/browser_UnsubmittedCrashHandler.js
@@ -501,18 +501,17 @@ add_task(function* test_shutdown_while_n
   // We'll not wait for the notification to finish its transition -
   // we'll just remove it right away.
   gNotificationBox.removeNotification(notification, true);
 
   yield waitForIgnoredReports(reportIDs);
 
   UnsubmittedCrashHandler.uninit();
   Assert.throws(() => {
-    let shutdownWhileShowing =
-      UnsubmittedCrashHandler.prefs.getBoolPref("shutdownWhileShowing");
+    UnsubmittedCrashHandler.prefs.getBoolPref("shutdownWhileShowing");
   }, "We should have noticed that the notification had closed before " +
      "uninitting.");
   UnsubmittedCrashHandler.init();
 
   clearPendingCrashReports();
 });
 
 /**
--- a/browser/modules/test/browser_UsageTelemetry_private_and_restore.js
+++ b/browser/modules/test/browser_UsageTelemetry_private_and_restore.js
@@ -63,17 +63,16 @@ add_task(function* test_sessionRestore()
         selected: 1
       }
     ]
   };
 
   // Save the current session.
   let SessionStore =
     Cu.import("resource:///modules/sessionstore/SessionStore.jsm", {}).SessionStore;
-  let backupState = SessionStore.getBrowserState();
 
   // Load the custom state and wait for SSTabRestored, as we want to make sure
   // that the URI counting code was hit.
   let tabRestored = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "SSTabRestored");
   SessionStore.setBrowserState(JSON.stringify(state));
   yield tabRestored;
 
   // Check that the URI is not recorded.
--- a/browser/modules/test/browser_taskbar_preview.js
+++ b/browser/modules/test/browser_taskbar_preview.js
@@ -92,13 +92,9 @@ function test() {
 
   function getPreviewForTab(tab) {
     return window.gTaskbarTabGroup.previewFromTab(tab);
   }
 
   function checkSelectedTab() {
     return getPreviewForTab(gBrowser.selectedTab).active;
   }
-
-  function isTabSelected(idx) {
-    return gBrowser.tabs[idx].selected;
-  }
 }
--- a/browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
+++ b/browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
@@ -475,17 +475,17 @@ add_task(function* test_topSitesWithSugg
 
   // We start off with no top sites with suggested links.
   do_check_eq(DirectoryLinksProvider._topSitesWithSuggestedLinks.size, 0);
 
   let data = {"suggested": [suggestedTile1, suggestedTile2, suggestedTile3], "directory": [someOtherSite]};
   let dataURI = 'data:application/json,' + JSON.stringify(data);
 
   yield promiseSetupDirectoryLinksProvider({linksURL: dataURI});
-  let links = yield fetchData();
+  yield fetchData();
 
   // Check we've populated suggested links as expected.
   do_check_eq(DirectoryLinksProvider._suggestedLinks.size, 5);
 
   // When many sites change, we update _topSitesWithSuggestedLinks as expected.
   let expectedTopSitesWithSuggestedLinks = ["hrblock.com", "1040.com", "freetaxusa.com"];
   DirectoryLinksProvider._handleManyLinksChanged();
   isIdentical([...DirectoryLinksProvider._topSitesWithSuggestedLinks], expectedTopSitesWithSuggestedLinks);
@@ -1604,17 +1604,17 @@ add_task(function test_DirectoryLinksPro
 
 add_task(function* test_sanitizeExplanation() {
   // Note: this is a basic test to ensure we applied sanitization to the link explanation.
   // Full testing for appropriate sanitization is done in parser/xml/test/unit/test_sanitizer.js.
   let data = {"suggested": [suggestedTile5]};
   let dataURI = 'data:application/json,' + encodeURIComponent(JSON.stringify(data));
 
   yield promiseSetupDirectoryLinksProvider({linksURL: dataURI});
-  let links = yield fetchData();
+  yield fetchData();
 
   let suggestedSites = [...DirectoryLinksProvider._suggestedLinks.keys()];
   do_check_eq(suggestedSites.indexOf("eviltarget.com"), 0);
   do_check_eq(suggestedSites.length, 1);
 
   let suggestedLink = [...DirectoryLinksProvider._suggestedLinks.get(suggestedSites[0]).values()][0];
   do_check_eq(suggestedLink.explanation, "This is an evil tile X muhahaha");
   do_check_eq(suggestedLink.targetedName, "WE ARE EVIL ");
@@ -1791,17 +1791,16 @@ add_task(function* test_inadjecentSites(
   NewTabUtils.isTopPlacesSite = origIsTopPlacesSite;
   NewTabUtils.getProviderLinks = origGetProviderLinks;
   DirectoryLinksProvider._getCurrentTopSiteCount = origCurrentTopSiteCount;
   yield promiseCleanDirectoryLinksProvider();
 });
 
 add_task(function* test_blockSuggestedTiles() {
   // Initial setup
-  let suggestedTile = suggestedTile1;
   let topSites = ["site0.com", "1040.com", "site2.com", "hrblock.com", "site4.com", "freetaxusa.com", "site6.com"];
   let data = {"suggested": [suggestedTile1, suggestedTile2, suggestedTile3], "directory": [someOtherSite]};
   let dataURI = 'data:application/json,' + JSON.stringify(data);
 
   yield promiseSetupDirectoryLinksProvider({linksURL: dataURI});
   let links = yield fetchData();
 
   let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;