Bug 1498041 - Turn on ESLint in mail/base; r=aceman
authorGeoff Lankow <geoff@darktrojan.net>
Sun, 18 Nov 2018 23:31:01 +1300
changeset 33729 c680423af71f9cc93a50876c0218967b85a8995b
parent 33728 ffda4a36eba4288f242646b7ebc89a0dcf96019e
child 33730 38c2cc49dccc59a155c9060ef557dcadc2b978d3
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersaceman
bugs1498041
Bug 1498041 - Turn on ESLint in mail/base; r=aceman
.eslintignore
mail/base/content/.eslintrc.js
mail/base/content/ABSearchDialog.js
mail/base/content/FilterListDialog.js
mail/base/content/SearchDialog.js
mail/base/content/aboutAddonsExtra.js
mail/base/content/aboutDialog-appUpdater.js
mail/base/content/aboutDialog.js
mail/base/content/browserRequest.js
mail/base/content/commandglue.js
mail/base/content/contentAreaClick.js
mail/base/content/editContactPanel.js
mail/base/content/folderDisplay.js
mail/base/content/folderPane.js
mail/base/content/foldersummary.js
mail/base/content/glodaFacetBindings.xml
mail/base/content/glodaFacetTab.js
mail/base/content/glodaFacetView.js
mail/base/content/glodaFacetVis.js
mail/base/content/hiddenWindow.js
mail/base/content/macMessengerMenu.js
mail/base/content/mail-compacttheme.js
mail/base/content/mail-offline.js
mail/base/content/mail3PaneWindowCommands.js
mail/base/content/mailCommands.js
mail/base/content/mailContextMenus.js
mail/base/content/mailCore.js
mail/base/content/mailTabs.js
mail/base/content/mailWidgets.xml
mail/base/content/mailWindow.js
mail/base/content/mailWindowOverlay.js
mail/base/content/messageDisplay.js
mail/base/content/messageWindow.js
mail/base/content/messageWindow.xul
mail/base/content/msgHdrView.js
mail/base/content/msgMail3PaneWindow.js
mail/base/content/msgViewNavigation.js
mail/base/content/multimessageview.js
mail/base/content/newTagDialog.js
mail/base/content/nsContextMenu.js
mail/base/content/nsDragAndDrop.js
mail/base/content/phishingDetector.js
mail/base/content/plugins.js
mail/base/content/quickFilterBar.js
mail/base/content/safeMode.js
mail/base/content/sanitize.js
mail/base/content/sanitizeDialog.js
mail/base/content/search.xml
mail/base/content/searchBar.js
mail/base/content/specialTabs.js
mail/base/content/systemIntegrationDialog.js
mail/base/content/tabmail.xml
mail/base/content/threadPane.js
mail/base/content/toolbarIconColor.js
mail/base/content/utilityOverlay.js
mail/base/jar.mn
mail/locales/en-US/chrome/messenger/messenger.properties
--- a/.eslintignore
+++ b/.eslintignore
@@ -44,17 +44,17 @@ mailnews/news/*
 mailnews/test/*
 
 # mailnews/extensions exclusions
 mailnews/extensions/*
 !mailnews/extensions/newsblog
 
 # mail exclusions
 mail/app/**
-mail/base/content/**
+mail/base/content/protovis-r2.6-modded.js
 mail/branding/**
 mail/config/**
 mail/extensions/**
 mail/installer/**
 mail/locales/**
 mail/test/**
 mail/themes/**
 
new file mode 100644
--- /dev/null
+++ b/mail/base/content/.eslintrc.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = {
+  "rules": {
+    "no-undef": "off",
+  },
+};
--- a/mail/base/content/ABSearchDialog.js
+++ b/mail/base/content/ABSearchDialog.js
@@ -22,35 +22,34 @@ var gAddressBookBundle;
 
 var gSearchStopButton;
 var gPropertiesCmd;
 var gComposeCmd;
 var gDeleteCmd;
 var gSearchPhoneticName = "false";
 
 var gSearchAbViewListener = {
-  onSelectionChanged: function() {
+  onSelectionChanged() {
     UpdateCardView();
   },
-  onCountChanged: function(aTotal) {
+  onCountChanged(aTotal) {
     let statusText;
     if (aTotal == 0) {
       statusText = gAddressBookBundle.getString("noMatchFound");
     } else {
       statusText = PluralForm
         .get(aTotal, gAddressBookBundle.getString("matchesFound1"))
         .replace("#1", aTotal);
     }
 
     gStatusText.setAttribute("label", statusText);
-  }
+  },
 };
 
-function searchOnLoad()
-{
+function searchOnLoad() {
   initializeSearchWidgets();
   initializeSearchWindowWidgets();
 
   gSearchBundle = document.getElementById("bundle_search");
   gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton"));
   gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
   gAddressBookBundle = document.getElementById("bundle_addressBook");
   gSearchSession = Cc[searchSessionContractID].createInstance(Ci.nsIMsgSearchSession);
@@ -67,109 +66,97 @@ function searchOnLoad()
     SelectDirectory(window.arguments[0].directory);
   else
     SelectDirectory(document.getElementById("abPopup-menupopup")
                             .firstChild.value);
 
   onMore(null);
 }
 
-function searchOnUnload()
-{
+function searchOnUnload() {
   CloseAbView();
 }
 
-function disableCommands()
-{
+function disableCommands() {
   gPropertiesCmd.setAttribute("disabled", "true");
   gComposeCmd.setAttribute("disabled", "true");
   gDeleteCmd.setAttribute("disabled", "true");
 }
 
-function initializeSearchWindowWidgets()
-{
+function initializeSearchWindowWidgets() {
   gSearchStopButton = document.getElementById("search-button");
   gPropertiesCmd = document.getElementById("cmd_properties");
   gComposeCmd = document.getElementById("cmd_compose");
   gDeleteCmd = document.getElementById("cmd_deleteCard");
-  gStatusText = document.getElementById('statusText');
+  gStatusText = document.getElementById("statusText");
   disableCommands();
   // matchAll doesn't make sense for address book search
   hideMatchAllItem();
 }
 
-function onSearchStop()
-{
+function onSearchStop() {
 }
 
-function onAbSearchReset(event)
-{
+function onAbSearchReset(event) {
   disableCommands();
   CloseAbView();
 
   onReset(event);
   gStatusText.setAttribute("label", "");
 }
 
-function SelectDirectory(aURI)
-{
+function SelectDirectory(aURI) {
   var selectedAB = aURI;
 
   if (!selectedAB)
     selectedAB = kPersonalAddressbookURI;
 
   // set popup with address book names
-  var abPopup = document.getElementById('abPopup');
-  if ( abPopup )
+  var abPopup = document.getElementById("abPopup");
+  if (abPopup)
     abPopup.value = selectedAB;
 
   setSearchScope(GetScopeForDirectoryURI(selectedAB));
 }
 
-function GetScopeForDirectoryURI(aURI)
-{
+function GetScopeForDirectoryURI(aURI) {
   var directory = MailServices.ab.getDirectory(aURI);
   var booleanAnd = gSearchBooleanRadiogroup.selectedItem.value == "and";
 
   if (directory.isRemote) {
     if (booleanAnd)
       return nsMsgSearchScope.LDAPAnd;
-    else
-      return nsMsgSearchScope.LDAP;
+    return nsMsgSearchScope.LDAP;
   }
-  else {
-    if (booleanAnd)
-      return nsMsgSearchScope.LocalABAnd;
-    else
-      return nsMsgSearchScope.LocalAB;
+
+  if (booleanAnd) {
+    return nsMsgSearchScope.LocalABAnd;
   }
+  return nsMsgSearchScope.LocalAB;
 }
 
-function onEnterInSearchTerm()
-{
+function onEnterInSearchTerm() {
   // on enter
   // if not searching, start the search
   // if searching, stop and then start again
   if (gSearchStopButton.getAttribute("label") == gSearchBundle.getString("labelForSearchButton")) {
      onSearch();
-  }
-  else {
+  } else {
      onSearchStop();
      onSearch();
   }
 }
 
-function onSearch()
-{
+function onSearch() {
     gStatusText.setAttribute("label", "");
     disableCommands();
 
     gSearchSession.clearScopes();
 
-    var currentAbURI = document.getElementById('abPopup').getAttribute('value');
+    var currentAbURI = document.getElementById("abPopup").getAttribute("value");
 
     gSearchSession.addDirectoryScopeTerm(GetScopeForDirectoryURI(currentAbURI));
     saveSearchTerms(gSearchSession.searchTerms, gSearchSession);
 
     var searchUri = currentAbURI + "?(";
     for (let i = 0; i < gSearchSession.searchTerms.length; i++) {
       let searchTerm = gSearchSession.searchTerms.queryElementAt(i, nsIMsgSearchTerm);
 
@@ -181,28 +168,29 @@ function onSearch()
          searchUri += "or";
       }
 
       var attrs;
 
       switch (searchTerm.attrib) {
        case nsMsgSearchAttrib.Name:
          if (gSearchPhoneticName != "true")
-           attrs = ["DisplayName","FirstName","LastName","NickName","_AimScreenName"];
+           attrs = ["DisplayName", "FirstName", "LastName", "NickName", "_AimScreenName"];
          else
-           attrs = ["DisplayName","FirstName","LastName","NickName","_AimScreenName","PhoneticFirstName","PhoneticLastName"];
+           attrs = ["DisplayName", "FirstName", "LastName", "NickName",
+                    "_AimScreenName", "PhoneticFirstName", "PhoneticLastName"];
          break;
        case nsMsgSearchAttrib.DisplayName:
          attrs = ["DisplayName"];
          break;
        case nsMsgSearchAttrib.Email:
          attrs = ["PrimaryEmail"];
          break;
        case nsMsgSearchAttrib.PhoneNumber:
-         attrs = ["HomePhone","WorkPhone","FaxNumber","PagerNumber","CellularNumber"];
+         attrs = ["HomePhone", "WorkPhone", "FaxNumber", "PagerNumber", "CellularNumber"];
          break;
        case nsMsgSearchAttrib.Organization:
          attrs = ["Company"];
          break;
        case nsMsgSearchAttrib.Department:
          attrs = ["Department"];
          break;
        case nsMsgSearchAttrib.City:
@@ -272,77 +260,69 @@ function onSearch()
         opStr = "c";
         break;
       }
 
       // currently, we can't do "and" and "or" searches at the same time
       // (it's either all "and"s or all "or"s)
       var max_attrs = attrs.length;
 
-      for (var j=0;j<max_attrs;j++) {
+      for (var j = 0; j < max_attrs; j++) {
        // append the term(s) to the searchUri
        searchUri += "(" + attrs[j] + "," + opStr + "," + encodeABTermValue(searchTerm.value.str) + ")";
       }
     }
 
     searchUri += ")";
     SetAbView(searchUri);
 }
 
 // used to toggle functionality for Search/Stop button.
-function onSearchButton(event)
-{
+function onSearchButton(event) {
     if (event.target.label == gSearchBundle.getString("labelForSearchButton"))
         onSearch();
     else
         onSearchStop();
 }
 
-function GetAbViewListener()
-{
+function GetAbViewListener() {
   return gSearchAbViewListener;
 }
 
-function onProperties()
-{
+function onProperties() {
   if (!gPropertiesCmd.hasAttribute("disabled"))
     AbEditSelectedCard();
 }
 
-function onCompose()
-{
+function onCompose() {
   if (!gComposeCmd.hasAttribute("disabled"))
     AbNewMessage();
 }
 
-function onDelete()
-{
+function onDelete() {
   if (!gDeleteCmd.hasAttribute("disabled"))
     AbDelete();
 }
 
-function AbResultsPaneKeyPress(event)
-{
+function AbResultsPaneKeyPress(event) {
   switch (event.keyCode) {
   case KeyEvent.DOM_VK_RETURN:
     onProperties();
     break;
   case KeyEvent.DOM_VK_DELETE:
   case KeyEvent.DOM_VK_BACK_SPACE:
     onDelete();
   }
 }
 
-function AbResultsPaneDoubleClick(card)
-{
+function AbResultsPaneDoubleClick(card) {
   AbEditCard(card);
 }
 
-function UpdateCardView()
-{
+function UpdateCardView() {
   disableCommands();
   let numSelected = GetNumSelectedCards();
 
   if (!numSelected)
     return;
 
   if (MailServices.accounts.allIdentities.length > 0)
     gComposeCmd.removeAttribute("disabled");
--- a/mail/base/content/FilterListDialog.js
+++ b/mail/base/content/FilterListDialog.js
@@ -21,82 +21,72 @@ var gDownButton = null;
 var gBottomButton = null;
 var gSearchBox = null;
 var gRunFiltersFolder = null;
 var gRunFiltersButton = null;
 
 var gFilterBundle = null;
 
 var msgMoveMotion = {
-  Up     : 0,
-  Down   : 1,
-  Top    : 2,
-  Bottom : 3
-}
+  Up: 0,
+  Down: 1,
+  Top: 2,
+  Bottom: 3,
+};
 
 var gStatusFeedback = {
-  progressMeterVisible : false,
+  progressMeterVisible: false,
 
-  showStatusString: function(status)
-  {
+  showStatusString(status) {
     document.getElementById("statusText").setAttribute("value", status);
   },
-  startMeteors: function()
-  {
+  startMeteors() {
     // change run button to be a stop button
     gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("stoplabel"));
     gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("stopaccesskey"));
 
-    if (!this.progressMeterVisible)
-    {
-      document.getElementById('statusbar-progresspanel').removeAttribute('collapsed');
+    if (!this.progressMeterVisible) {
+      document.getElementById("statusbar-progresspanel").removeAttribute("collapsed");
       this.progressMeterVisible = true;
     }
 
     document.getElementById("statusbar-icon").removeAttribute("value");
   },
-  stopMeteors: function()
-  {
+  stopMeteors() {
     try {
       // change run button to be a stop button
       gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("runlabel"));
       gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("runaccesskey"));
 
-      if (this.progressMeterVisible)
-      {
-        document.getElementById('statusbar-progresspanel').collapsed = true;
+      if (this.progressMeterVisible) {
+        document.getElementById("statusbar-progresspanel").collapsed = true;
         this.progressMeterVisible = true;
       }
-    }
-    catch (ex) {
+    } catch (ex) {
       // can get here if closing window when running filters
     }
   },
-  showProgress: function(percentage)
-  {
+  showProgress(percentage) {
   },
-  closeWindow: function()
-  {
-  }
+  closeWindow() {
+  },
 };
 
 var filterEditorQuitObserver = {
-  observe: function(aSubject, aTopic, aData)
-  {
+  observe(aSubject, aTopic, aData) {
     // Check whether or not we want to veto the quit request (unless another
     // observer already did.
     if (aTopic == "quit-application-requested" &&
         (aSubject instanceof Ci.nsISupportsPRBool) &&
         !aSubject.data)
       aSubject.data = !onFilterClose();
-  }
-}
+  },
+};
 
-function onLoad()
-{
+function onLoad() {
     gFilterListMsgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
                              .createInstance(Ci.nsIMsgWindow);
     gFilterListMsgWindow.domWindow = window;
     gFilterListMsgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
     gFilterListMsgWindow.statusFeedback = gStatusFeedback;
 
     gServerMenu       = document.getElementById("serverMenu");
     gFilterListbox    = document.getElementById("filterList");
@@ -127,18 +117,17 @@ function onLoad()
  *                    { arg1: value1, arg2: value2, ... }
  */
 function processWindowArguments(aArguments) {
   // If a specific folder was requested, try to select it
   // if we don't already show its server.
   if (!gServerMenu._folder ||
       (("folder" in aArguments) &&
       (aArguments.folder != gServerMenu._folder) &&
-      (aArguments.folder.rootFolder != gServerMenu._folder)))
-  {
+      (aArguments.folder.rootFolder != gServerMenu._folder))) {
     let wantedFolder;
     if ("folder" in aArguments)
       wantedFolder = aArguments.folder;
 
     // Get the folder where filters should be defined, if that server
     // can accept filters.
     let firstItem = getFilterFolderForSelection(wantedFolder);
 
@@ -166,40 +155,37 @@ function processWindowArguments(aArgumen
 
 /**
  * This is called from OpenOrFocusWindow() if the dialog is already open.
  * New filters could have been created by operations outside the dialog.
  *
  * @param aArguments  An object of arguments having the same format
  *                    as window.arguments[0].
  */
-function refresh(aArguments)
-{
+function refresh(aArguments) {
   // As we really don't know what has changed, clear the search box
   // undonditionally so that the changed/added filters are surely visible.
   resetSearchBox();
 
   processWindowArguments(aArguments);
 }
 
-function CanRunFiltersAfterTheFact(aServer)
-{
+function CanRunFiltersAfterTheFact(aServer) {
   // filter after the fact is implement using search
   // so if you can't search, you can't filter after the fact
   return aServer.canSearchMessages;
 }
 
 /**
  * Change the root server for which we are managing filters.
  *
  * @param msgFolder The nsIMsgFolder server containing filters
  *                  (or a folder for NNTP server).
  */
-function setFilterFolder(msgFolder)
-{
+function setFilterFolder(msgFolder) {
   if (!msgFolder || msgFolder == gServerMenu._folder)
     return;
 
   // Save the current filters to disk before switching because
   // the dialog may be closed and we'll lose current filters.
   if (gCurrentFilterList)
     gCurrentFilterList.saveToDefaultFile();
 
@@ -289,18 +275,17 @@ function setRunFolder(aFolder) {
   updateButtons();
 }
 
 /**
  * Toggle enabled state of a filter, in both the filter properties and the UI.
  *
  * @param aFilterItem  an item (row) of the filter list to be toggled
  */
-function toggleFilter(aFilterItem, aSetForEvent)
-{
+function toggleFilter(aFilterItem, aSetForEvent) {
   let filter = aFilterItem._filter;
   if (filter.unparseable && !filter.enabled) {
     Services.prompt.alert(window, null, gFilterBundle.getString("cannotEnableFilter"));
     return;
   }
   filter.enabled = aSetForEvent === undefined ? !filter.enabled : aSetForEvent;
 
   // Now update the checkbox
@@ -335,24 +320,22 @@ function selectFilter(aFilter) {
   }
   return false;
 }
 
 /**
  * Returns the currently selected filter. If multiple filters are selected,
  * returns the first one. If none are selected, returns null.
  */
-function currentFilter()
-{
+function currentFilter() {
   let currentItem = gFilterListbox.selectedItem;
   return currentItem ? currentItem._filter : null;
 }
 
-function onEditFilter()
-{
+function onEditFilter() {
   if (gEditButton.disabled)
     return;
 
   let selectedFilter = currentFilter();
   if (!selectedFilter)
     return;
 
   let args = {filter: selectedFilter, filterList: gCurrentFilterList};
@@ -365,27 +348,25 @@ function onEditFilter()
     rebuildFilterList();
   }
 }
 
 /**
  * Handler function for the 'New...' buttons.
  * Opens the filter dialog for creating a new filter.
  */
-function onNewFilter()
-{
+function onNewFilter() {
   calculatePositionAndShowCreateFilterDialog({});
 }
 
 /**
  * Handler function for the 'Copy...' button.
  * Opens the filter dialog for copying the selected filter.
  */
-function onCopyToNewFilter()
-{
+function onCopyToNewFilter() {
   if (gCopyToNewButton.disabled)
     return;
 
   let selectedFilter = currentFilter();
   if (!selectedFilter)
     return;
 
   let args = {copiedFilter: selectedFilter};
@@ -397,18 +378,17 @@ function onCopyToNewFilter()
  * Calculates the position for inserting the new filter,
  * and then displays the create dialog.
  *
  * @param args  The object containing the arguments for the dialog,
  *              passed to the filterEditorOnLoad() function.
  *              It will be augmented with the insertion position
  *              and global filters list properties by this function.
  */
-function calculatePositionAndShowCreateFilterDialog(args)
-{
+function calculatePositionAndShowCreateFilterDialog(args) {
   let selectedFilter = currentFilter();
   // If no filter is selected use the first position.
   let position = 0;
   if (selectedFilter) {
     // Get the position in the unfiltered list.
     // - this is where the new filter should be inserted!
     let filterCount = gCurrentFilterList.filterCount;
     for (let i = 0; i < filterCount; i++) {
@@ -436,32 +416,31 @@ function calculatePositionAndShowCreateF
       Cu.reportError("Filter created at an unexpected position!");
   }
 }
 
 /**
  * Delete selected filters.
  *  'Selected' is not to be confused with active (checkbox checked)
  */
-function onDeleteFilter()
-{
+function onDeleteFilter() {
   if (gDeleteButton.disabled)
     return;
 
   let items = gFilterListbox.selectedItems;
   if (!items.length)
     return;
 
-  let checkValue = {value:false};
+  let checkValue = {value: false};
   if ((Services.prefs.getBoolPref("mailnews.filters.confirm_delete")) &&
       (Services.prompt.confirmEx(window, null,
                                  gFilterBundle.getString("deleteFilterConfirmation"),
                                  Services.prompt.STD_YES_NO_BUTTONS,
-                                 '', '', '',
-                                 gFilterBundle.getString('dontWarnAboutDeleteCheckbox'),
+                                 "", "", "",
+                                 gFilterBundle.getString("dontWarnAboutDeleteCheckbox"),
                                  checkValue)))
     return;
 
   if (checkValue.value)
      Services.prefs.setBoolPref("mailnews.filters.confirm_delete", false);
 
   // Save filter position before the first selected one.
   let newSelectionIndex = gFilterListbox.selectedIndex - 1;
@@ -531,17 +510,17 @@ function moveFilter(motion) {
   // At the moment, do not allow moving groups of filters.
   let selectedFilter = currentFilter();
   if (!selectedFilter)
     return;
 
   var relativeStep = 0;
   var moveFilterNative = null;
 
-  switch(motion) {
+  switch (motion) {
     case msgMoveMotion.Top:
       if (selectedFilter) {
         gCurrentFilterList.removeFilter(selectedFilter);
         gCurrentFilterList.insertFilterAt(0, selectedFilter);
         rebuildFilterList();
       }
       return;
     case msgMoveMotion.Bottom:
@@ -585,55 +564,51 @@ function moveFilter(motion) {
   if (motion == msgMoveMotion.Down)
     newIndex += relativeStep;
 
   gCurrentFilterList.insertFilterAt(newIndex, selectedFilter);
 
   rebuildFilterList();
 }
 
-function viewLog()
-{
+function viewLog() {
   var args = {filterList: gCurrentFilterList};
 
   window.openDialog("chrome://messenger/content/viewLog.xul", "FilterLog", "chrome,modal,titlebar,resizable,centerscreen", args);
 }
 
-function onFilterUnload()
-{
+function onFilterUnload() {
   gCurrentFilterList.saveToDefaultFile();
   Services.obs.removeObserver(filterEditorQuitObserver,
                               "quit-application-requested");
 }
 
-function onFilterClose()
-{
+function onFilterClose() {
   if (gRunFiltersButton.getAttribute("label") ==
       gRunFiltersButton.getAttribute("stoplabel")) {
     let promptTitle = gFilterBundle.getString("promptTitle");
     let promptMsg = gFilterBundle.getString("promptMsg");
     let stopButtonLabel = gFilterBundle.getString("stopButtonLabel");
     let continueButtonLabel = gFilterBundle.getString("continueButtonLabel");
 
     let result = Services.prompt.confirmEx(window, promptTitle, promptMsg,
                (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) +
                (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1),
-               continueButtonLabel, stopButtonLabel, null, null, {value:0});
+               continueButtonLabel, stopButtonLabel, null, null, {value: 0});
 
     if (result)
       gFilterListMsgWindow.StopUrls();
     else
       return false;
   }
 
   return true;
 }
 
-function runSelectedFilters()
-{
+function runSelectedFilters() {
   // if run button has "stop" label, do stop.
   if (gRunFiltersButton.getAttribute("label") ==
       gRunFiltersButton.getAttribute("stoplabel")) {
     gFilterListMsgWindow.StopUrls();
     return;
   }
 
   let folder = gRunFiltersFolder._folder || gRunFiltersFolder.selectedItem._folder;
@@ -652,50 +627,47 @@ function runSelectedFilters()
   let index = 0;
   for (let item of gFilterListbox.selectedItems) {
     filterList.insertFilterAt(index++, item._filter);
   }
 
   MailServices.filters.applyFiltersToFolders(filterList, folders, gFilterListMsgWindow);
 }
 
-function moveCurrentFilter(motion)
-{
+function moveCurrentFilter(motion) {
   let filter = currentFilter();
   if (!filter)
     return;
 
   gCurrentFilterList.moveFilter(filter, motion);
   rebuildFilterList();
 }
 
 /**
  * Redraws the list of filters. Takes the search box value into account.
  *
  * This function should perform very fast even in case of high number of filters.
  * Therefore there are some optimizations (e.g. listelement.itemChildren[] instead of
  * list.getItemAtIndex()), that favour speed vs. semantical perfection.
  */
-function rebuildFilterList()
-{
+function rebuildFilterList() {
   // Get filters that match the search box.
   let aTempFilterList = onFindFilter();
 
   let searchBoxFocus = false;
   let activeElement = document.activeElement;
 
   // Find if the currently focused element is a child inside the search box
   // (probably html:input). Traverse up the parents until the first element
   // with an ID is found. If it is not searchBox, return false.
   while (activeElement != null) {
     if (activeElement == gSearchBox) {
       searchBoxFocus = true;
       break;
-    }
-    else if (activeElement.id) {
+    } else if (activeElement.id) {
       searchBoxFocus = false;
       break;
     }
     activeElement = activeElement.parentNode;
   }
 
   // Make a note of which filters were previously selected
   let selectedNames = [];
@@ -727,19 +699,17 @@ function rebuildFilterList()
       continue;
 
     if (listitemCount > listitemIndex) {
       // If there is a free existing listitem, reuse it.
       // Use .itemChildren[] instead of .getItemAtIndex() as it is much faster.
       listitem = gFilterListbox.itemChildren[listitemIndex];
       nameCell = listitem.firstChild;
       enabledCell = nameCell.nextSibling;
-    }
-    else
-    {
+    } else {
       // If there are not enough listitems in the list, create a new one.
       listitem = document.createElement("richlistitem");
       listitem.setAttribute("align", "center");
       listitem.setAttribute("role", "checkbox");
       nameCell = document.createElement("label");
       nameCell.setAttribute("flex", "1");
       enabledCell = document.createElement("checkbox");
       enabledCell.setAttribute("style", "padding-inline-start: 25px;");
@@ -776,18 +746,17 @@ function rebuildFilterList()
   // If before rebuilding the list the searchbox was focused, focus it again.
   // In any other case, focus the list.
   if (searchBoxFocus)
     gSearchBox.focus();
   else
     gFilterListbox.focus();
 }
 
-function updateViewPosition(firstVisibleRowIndex)
-{
+function updateViewPosition(firstVisibleRowIndex) {
   if (firstVisibleRowIndex == -1)
     firstVisibleRowIndex = gFilterListbox.getIndexOfFirstVisibleRow();
 
   // Restore to the extent possible the scroll position.
   if (firstVisibleRowIndex && gFilterListbox.itemCount)
     gFilterListbox.scrollToIndex(Math.min(firstVisibleRowIndex,
                                           gFilterListbox.itemCount - 1));
 
@@ -805,18 +774,17 @@ function updateViewPosition(firstVisible
 
 /**
  * Try to only enable buttons that make sense
  *  - moving filters is currently only enabled for single selection
  *    also movement is restricted by searchBox and current selection position
  *  - edit only for single filters
  *  - delete / run only for one or more selected filters
  */
-function updateButtons()
-{
+function updateButtons() {
     var numFiltersSelected = gFilterListbox.selectedItems.length;
     var oneFilterSelected = (numFiltersSelected == 1);
 
     // "edit" is disabled when not exactly one filter is selected
     // or if we couldn't parse that filter
     let disabled = !oneFilterSelected || currentFilter().unparseable;
     gEditButton.disabled = disabled;
 
@@ -849,90 +817,82 @@ function updateButtons()
 /**
  * Given a selected folder, returns the folder where filters should
  *  be defined (the root folder except for news) if the server can
  *  accept filters.
  *
  * @param   nsIMsgFolder aFolder - selected folder, from window args
  * @returns an nsIMsgFolder where the filter is defined
  */
-function getFilterFolderForSelection(aFolder)
-{
+function getFilterFolderForSelection(aFolder) {
   let rootFolder = aFolder && aFolder.server ? aFolder.server.rootFolder : null;
   if (rootFolder && rootFolder.isServer && rootFolder.server.canHaveFilters)
     return (aFolder.server.type == "nntp") ? aFolder : rootFolder;
 
   return null;
 }
 
 /**
  * If the selected server cannot have filters, get the default server.
  * If the default server cannot have filters, check all accounts
  * and get a server that can have filters.
  *
  * @returns an nsIMsgIncomingServer
  */
-function getServerThatCanHaveFilters()
-{
+function getServerThatCanHaveFilters() {
     let defaultIncomingServer = MailServices.accounts.defaultAccount.incomingServer;
     // Check to see if default server can have filters.
     if (defaultIncomingServer.canHaveFilters)
       return defaultIncomingServer;
 
     // If it cannot, check all accounts to find a server
     // that can have filters.
     let allServers = MailServices.accounts.allServers;
-    for (let currentServer of fixIterator(allServers,
-                                          Ci.nsIMsgIncomingServer))
-    {
+    for (let currentServer of fixIterator(allServers, Ci.nsIMsgIncomingServer)) {
       if (currentServer.canHaveFilters)
         return currentServer;
     }
 
     return null;
 }
 
-function onFilterClick(event)
-{
+function onFilterClick(event) {
     // we only care about button 0 (left click) events
     if (event.button != 0) {
       return;
     }
 
     toggleFilter(this.parentNode, !this.checked);
 }
 
-function onFilterDoubleClick(event)
-{
+function onFilterDoubleClick(event) {
     // we only care about button 0 (left click) events
     if (event.button != 0)
       return;
 
     onEditFilter();
 }
 
-function onFilterListKeyPress(aEvent)
-{
+function onFilterListKeyPress(aEvent) {
   if (aEvent.keyCode) {
     switch (aEvent.keyCode) {
       case KeyEvent.DOM_VK_INSERT:
         if (!document.getElementById("newButton").disabled)
           onNewFilter();
         break;
       case KeyEvent.DOM_VK_DELETE:
         if (!document.getElementById("deleteButton").disabled)
           onDeleteFilter();
         break;
       case KeyEvent.DOM_VK_RETURN:
         if (!document.getElementById("editButton").disabled)
           onEditFilter();
         break;
     }
-  }
-  else if (!aEvent.ctrlKey && !aEvent.altKey && !aEvent.metaKey) {
+  } else if (!aEvent.ctrlKey && !aEvent.altKey && !aEvent.metaKey) {
     switch (aEvent.charCode) {
       case KeyEvent.DOM_VK_SPACE:
         for (let item of gFilterListbox.selectedItems) {
           toggleFilter(item);
         }
         break;
       default:
         gSearchBox.focus();
@@ -946,28 +906,26 @@ function onFilterListKeyPress(aEvent)
  *
  * @param  aFilter   nsIMsgFilter to check
  * @param  aKeyword  the string to find in the filter name
  *
  * @return  True if the filter name contains the searched keyword.
             Otherwise false. In the future this may be extended to match
             other filter attributes.
  */
-function filterSearchMatch(aFilter, aKeyword)
-{
-  return (aFilter.filterName.toLocaleLowerCase().includes(aKeyword))
+function filterSearchMatch(aFilter, aKeyword) {
+  return (aFilter.filterName.toLocaleLowerCase().includes(aKeyword));
 }
 
 /**
  * Called from rebuildFilterList when the list needs to be redrawn.
  * @return  Uses the search term in search box, to produce an array of
  *          row (filter) numbers (indexes) that match the search term.
  */
-function onFindFilter()
-{
+function onFindFilter() {
   let keyWord = gSearchBox.value.toLocaleLowerCase();
 
   // If searchbox is empty, just return and let rebuildFilterList
   // create an unfiltered list.
   if (!keyWord)
     return null;
 
   // Rematch everything in the list, remove what doesn't match the search box.
@@ -985,28 +943,26 @@ function onFindFilter()
 
 /**
  * Clear the search term in the search box if needed.
  *
  * @param aFilter  If this nsIMsgFilter matches the search term,
  *                 do not reset the box. If this is null,
  *                 reset unconditionally.
  */
-function resetSearchBox(aFilter)
-{
+function resetSearchBox(aFilter) {
   let keyword = gSearchBox.value.toLocaleLowerCase();
   if (keyword && (!aFilter || !filterSearchMatch(aFilter, keyword)))
     gSearchBox.reset();
 }
 
 /**
  * Display "1 item",  "11 items" or "4 of 10" if list is filtered via search box.
  */
-function updateCountBox()
-{
+function updateCountBox() {
   let countBox = document.getElementById("countBox");
   let sum = gCurrentFilterList.filterCount;
   let len = gFilterListbox.itemCount;
 
   if (len == sum) {
     // "N items"
     countBox.value = PluralForm.get(len, gFilterBundle.getString("filterCountItems"))
                                .replace("#1", len);
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -27,21 +27,19 @@ var gDataSourceSearchListener;
 var gViewSearchListener;
 
 var gSearchStopButton;
 
 // Should we try to search online?
 var gSearchOnline = false;
 
 // Controller object for search results thread pane
-var nsSearchResultsController =
-{
-    supportsCommand: function(command)
-    {
-        switch(command) {
+var nsSearchResultsController = {
+    supportsCommand(command) {
+        switch (command) {
         case "cmd_delete":
         case "cmd_shiftDelete":
         case "button_delete":
         case "cmd_open":
         case "file_message_button":
         case "open_in_folder_button":
         case "saveas_vf_button":
         case "cmd_selectAll":
@@ -49,18 +47,17 @@ var nsSearchResultsController =
         default:
             return false;
         }
     },
 
     // this controller only handles commands
     // that rely on items being selected in
     // the search results pane.
-    isCommandEnabled: function(command)
-    {
+    isCommandEnabled(command) {
         var enabled = true;
 
         switch (command) {
           case "open_in_folder_button":
             if (gFolderDisplay.selectedCount != 1)
               enabled = false;
             break;
           case "cmd_delete":
@@ -79,19 +76,18 @@ var nsSearchResultsController =
             if (gFolderDisplay.selectedCount <= 0)
               enabled = false;
             break;
         }
 
         return enabled;
     },
 
-    doCommand: function(command)
-    {
-        switch(command) {
+    doCommand(command) {
+        switch (command) {
         case "cmd_open":
             MsgOpenSelectedMessages();
             return true;
 
         case "cmd_delete":
         case "button_delete":
             MsgDeleteSelectedMessages(nsMsgViewCommandType.deleteMsg);
             return true;
@@ -114,73 +110,69 @@ var nsSearchResultsController =
             return true;
 
         default:
             return false;
         }
 
     },
 
-    onEvent: function(event)
-    {
-    }
-}
+    onEvent(event) {
+    },
+};
 
-function UpdateMailSearch(caller)
-{
-  document.commandDispatcher.updateCommands('mail-search');
+function UpdateMailSearch(caller) {
+  document.commandDispatcher.updateCommands("mail-search");
 }
 /**
  * FolderDisplayWidget currently calls this function when the command updater
  *  notification for updateCommandStatus is called.  We don't have a toolbar,
  *  but our 'mail-search' command set serves the same purpose.
  */
 var UpdateMailToolbar = UpdateMailSearch;
 
 /**
  * No-op clear message pane function for FolderDisplayWidget.
  */
 function ClearMessagePane() {
 }
 
-function SetAdvancedSearchStatusText(aNumHits)
-{
+function SetAdvancedSearchStatusText(aNumHits) {
 }
 
 /**
  * Subclass the FolderDisplayWidget to deal with UI specific to the search
  *  window.
  */
 function SearchFolderDisplayWidget(aMessageDisplay) {
   FolderDisplayWidget.call(this, /* no tab info */ null, aMessageDisplay);
 }
 
 SearchFolderDisplayWidget.prototype = {
   __proto__: FolderDisplayWidget.prototype,
 
-  /// folder display will want to show the thread pane; we need do nothing
-  _showThreadPane: function () {},
+  // folder display will want to show the thread pane; we need do nothing
+  _showThreadPane() {},
 
-  onSearching: function SearchFolderDisplayWidget_onSearch(aIsSearching) {
+  onSearching(aIsSearching) {
     if (aIsSearching) {
       // Search button becomes the "stop" button
       gSearchStopButton.setAttribute(
         "label", gSearchBundle.getString("labelForStopButton"));
       gSearchStopButton.setAttribute(
         "accesskey", gSearchBundle.getString("labelForStopButton.accesskey"));
 
       // update our toolbar equivalent
       UpdateMailSearch("new-search");
       // spin the meteors
       gStatusFeedback._startMeteors();
       // tell the user that we're searching
       gStatusFeedback.showStatusString(
         gSearchBundle.getString("searchingMessage"));
-    }
-    else {
+    } else {
       // Stop button resumes being the "search" button
       gSearchStopButton.setAttribute(
         "label", gSearchBundle.getString("labelForSearchButton"));
       gSearchStopButton.setAttribute(
         "accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
 
       // update our toolbar equivalent
       UpdateMailSearch("done-search");
@@ -190,43 +182,41 @@ SearchFolderDisplayWidget.prototype = {
       this.updateStatusResultText();
     }
   },
 
   /**
    * If messages were removed, we might have lost some search results and so
    *  should update our search result text.  Also, defer to our super-class.
    */
-  onMessagesRemoved: function SearchFolderDisplayWidget_onMessagesRemoved() {
+  onMessagesRemoved() {
     // result text is only for when we are not searching
     if (!this.view.searching)
       this.updateStatusResultText();
     this.__proto__.__proto__.onMessagesRemoved.call(this);
   },
 
-  updateStatusResultText: function() {
+  updateStatusResultText() {
     let rowCount = this.view.dbView.rowCount;
     let statusMsg;
 
     if (rowCount == 0) {
       statusMsg = gSearchBundle.getString("noMatchesFound");
-    }
-    else {
+    } else {
       statusMsg = PluralForm.get(rowCount,
                                  gSearchBundle.getString("matchesFound"));
       statusMsg = statusMsg.replace("#1", rowCount);
     }
 
     gStatusFeedback.showStatusString(statusMsg);
   },
 };
 
 
-function searchOnLoad()
-{
+function searchOnLoad() {
   initializeSearchWidgets();
   initializeSearchWindowWidgets();
   messenger = Cc["@mozilla.org/messenger;1"]
                 .createInstance(Ci.nsIMessenger);
 
   gSearchBundle = document.getElementById("bundle_search");
   gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton"));
   gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
@@ -252,27 +242,25 @@ function searchOnLoad()
       updateSearchFolderPicker(window.arguments[0].folder);
 
   // trigger searchTermOverlay.js to create the first criterion
   onMore(null);
   // make sure all the buttons are configured
   UpdateMailSearch("onload");
 }
 
-function searchOnUnload()
-{
+function searchOnUnload() {
   gFolderDisplay.close();
   top.controllers.removeController(nsSearchResultsController);
 
   // release this early because msgWindow holds a weak reference
   msgWindow.rootDocShell = null;
 }
 
-function initializeSearchWindowWidgets()
-{
+function initializeSearchWindowWidgets() {
     gFolderPicker = document.getElementById("searchableFolders");
     gSearchStopButton = document.getElementById("search-button");
     hideMatchAllItem();
 
     msgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
                   .createInstance(nsIMsgWindow);
     msgWindow.domWindow = window;
     msgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
@@ -292,66 +280,56 @@ function onSearchStop() {
 
 function onResetSearch(event) {
   onReset(event);
   gFolderDisplay.view.search.clear();
 
   gStatusFeedback.showStatusString("");
 }
 
-function updateSearchFolderPicker(folder)
-{
+function updateSearchFolderPicker(folder) {
   gCurrentFolder = folder;
   gFolderPicker.menupopup.selectFolder(folder);
 
   var searchOnline = document.getElementById("checkSearchOnline");
   // We will hide and disable the search online checkbox if we are offline, or
   // if the folder does not support online search.
 
   // Any offlineSupportLevel > 0 is an online server like IMAP or news.
-  if (gCurrentFolder.server.offlineSupportLevel &&
-      !Services.io.offline)
-  {
+  if (gCurrentFolder.server.offlineSupportLevel && !Services.io.offline) {
     searchOnline.hidden = false;
     searchOnline.disabled = false;
-  }
-  else
-  {
+  } else {
     searchOnline.hidden = true;
     searchOnline.disabled = true;
   }
   setSearchScope(GetScopeForFolder(gCurrentFolder));
 }
 
-function updateSearchLocalSystem()
-{
+function updateSearchLocalSystem() {
   setSearchScope(GetScopeForFolder(gCurrentFolder));
 }
 
-function UpdateAfterCustomHeaderChange()
-{
+function UpdateAfterCustomHeaderChange() {
   updateSearchAttributes();
 }
 
-function onEnterInSearchTerm()
-{
+function onEnterInSearchTerm() {
   // on enter
   // if not searching, start the search
   // if searching, stop and then start again
   if (gSearchStopButton.getAttribute("label") == gSearchBundle.getString("labelForSearchButton")) {
      onSearch();
-  }
-  else {
+  } else {
      onSearchStop();
      onSearch();
   }
 }
 
-function onSearch()
-{
+function onSearch() {
   let viewWrapper = gFolderDisplay.view;
   let searchTerms = getSearchTerms();
 
   viewWrapper.beginViewUpdate();
   viewWrapper.search.userTerms = searchTerms.length ? searchTerms : null;
   viewWrapper.search.onlineSearch = gSearchOnline;
   viewWrapper.searchFolders = getSearchFolders();
   viewWrapper.endViewUpdate();
@@ -411,40 +389,35 @@ function AddSubFolders(folder, outFolder
       if (!nextFolder.noSelect)
         outFolders.push(nextFolder);
 
       AddSubFolders(nextFolder, outFolders);
     }
   }
 }
 
-function AddSubFoldersToURI(folder)
-{
+function AddSubFoldersToURI(folder) {
   var returnString = "";
 
   var subFolders = folder.subFolders;
 
-  while (subFolders.hasMoreElements())
-  {
+  while (subFolders.hasMoreElements()) {
     var nextFolder =
       subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
 
-    if (!(nextFolder.flags & Ci.nsMsgFolderFlags.Virtual))
-    {
-      if (!nextFolder.noSelect && !nextFolder.isServer)
-      {
+    if (!(nextFolder.flags & Ci.nsMsgFolderFlags.Virtual)) {
+      if (!nextFolder.noSelect && !nextFolder.isServer) {
         if (returnString.length > 0)
-          returnString += '|';
+          returnString += "|";
         returnString += nextFolder.URI;
       }
       var subFoldersString = AddSubFoldersToURI(nextFolder);
-      if (subFoldersString.length > 0)
-      {
+      if (subFoldersString.length > 0) {
         if (returnString.length > 0)
-          returnString += '|';
+          returnString += "|";
         returnString += subFoldersString;
       }
     }
   }
   return returnString;
 }
 
 /**
@@ -457,39 +430,34 @@ function AddSubFoldersToURI(folder)
  *
  * The available search capabilities also depend on whether the user is
  *  currently online or offline. Although that is also checked by the server,
  *  we do it ourselves because we have a more complex response to offline
  *  than the server's searchScope attribute provides.
  *
  * This method only works for real folders.
  */
-function GetScopeForFolder(folder)
-{
+function GetScopeForFolder(folder) {
   let searchOnline = document.getElementById("checkSearchOnline");
-  if (!searchOnline.disabled && searchOnline.checked)
-  {
+  if (!searchOnline.disabled && searchOnline.checked) {
     gSearchOnline = true;
     return folder.server.searchScope;
   }
   gSearchOnline = false;
 
   // We are going to search offline. The proper search scope may depend on
   // whether we have the body and/or junk available or not.
   let localType;
-  try
-  {
+  try {
     localType = folder.server.localStoreType;
-  }
-  catch (e) {} // On error, we'll just assume the default mailbox type
+  } catch (e) {} // On error, we'll just assume the default mailbox type
 
   let hasBody = folder.getFlag(Ci.nsMsgFolderFlags.Offline);
   let nsMsgSearchScope = Ci.nsMsgSearchScope;
-  switch (localType)
-  {
+  switch (localType) {
     case "news":
       // News has four offline scopes, depending on whether junk and body
       // are available.
       let hasJunk =
         folder.getInheritedStringProperty("dobayes.mailnews@mozilla.org#junk")
                == "true";
       if (hasJunk && hasBody)
         return nsMsgSearchScope.localNewsJunkBody;
@@ -501,18 +469,17 @@ function GetScopeForFolder(folder)
       return nsMsgSearchScope.localNews;
 
     case "imap":
       // Junk is always enabled for imap, so the offline scope only depends on
       // whether the body is available.
 
       // If we are the root folder, use the server property for body rather
       // than the folder property.
-      if (folder.isServer)
-      {
+      if (folder.isServer) {
         let imapServer = folder.server
                                .QueryInterface(Ci.nsIImapIncomingServer);
         if (imapServer && imapServer.offlineDownload)
           hasBody = true;
       }
 
       if (!hasBody)
         return nsMsgSearchScope.onlineManual;
@@ -523,79 +490,72 @@ function GetScopeForFolder(folder)
 
 }
 
 var nsMsgViewSortType = Ci.nsMsgViewSortType;
 var nsMsgViewSortOrder = Ci.nsMsgViewSortOrder;
 var nsMsgViewFlagsType = Ci.nsMsgViewFlagsType;
 var nsMsgViewCommandType = Ci.nsMsgViewCommandType;
 
-function goUpdateSearchItems(commandset)
-{
-  for (var i = 0; i < commandset.childNodes.length; i++)
-  {
+function goUpdateSearchItems(commandset) {
+  for (var i = 0; i < commandset.childNodes.length; i++) {
     var commandID = commandset.childNodes[i].getAttribute("id");
-    if (commandID)
-    {
+    if (commandID) {
       goUpdateCommand(commandID);
     }
   }
 }
 
 // used to toggle functionality for Search/Stop button.
-function onSearchButton(event)
-{
+function onSearchButton(event) {
     if (event.target.label == gSearchBundle.getString("labelForSearchButton"))
         onSearch();
     else
         onSearchStop();
 }
 
-function MsgDeleteSelectedMessages(aCommandType)
-{
+function MsgDeleteSelectedMessages(aCommandType) {
     gFolderDisplay.hintAboutToDeleteMessages();
     gFolderDisplay.doCommand(aCommandType);
 }
 
-function MoveMessageInSearch(destFolder)
-{
+function MoveMessageInSearch(destFolder) {
   // Get the msg folder we're moving messages into.
   // If the id (uri) is not set, use file-uri which is set for
   // "File Here".
-  let destUri = destFolder.getAttribute('id');
+  let destUri = destFolder.getAttribute("id");
   if (destUri.length == 0)
-    destUri = destFolder.getAttribute('file-uri');
+    destUri = destFolder.getAttribute("file-uri");
 
   let destMsgFolder = MailUtils.getFolderForURI(destUri)
     .QueryInterface(Ci.nsIMsgFolder);
 
   gFolderDisplay.hintAboutToDeleteMessages();
   gFolderDisplay.doCommandWithFolder(nsMsgViewCommandType.moveMessages,
                                      destMsgFolder);
 }
 
-function OpenInFolder()
-{
+function OpenInFolder() {
   MailUtils.displayMessageInFolderTab(gFolderDisplay.selectedMessage);
 }
 
-function saveAsVirtualFolder()
-{
+function saveAsVirtualFolder() {
   var searchFolderURIs = gCurrentFolder.URI;
 
   var searchSubfolders = document.getElementById("checkSearchSubFolders").checked;
-  if (gCurrentFolder && (searchSubfolders || gCurrentFolder.isServer || gCurrentFolder.noSelect))
-  {
+  if (gCurrentFolder && (searchSubfolders || gCurrentFolder.isServer || gCurrentFolder.noSelect)) {
     var subFolderURIs = AddSubFoldersToURI(gCurrentFolder);
     if (subFolderURIs.length > 0)
-      searchFolderURIs += '|' + subFolderURIs;
+      searchFolderURIs += "|" + subFolderURIs;
   }
 
   var searchOnline = document.getElementById("checkSearchOnline");
   var doOnlineSearch = searchOnline.checked && !searchOnline.disabled;
 
-  var dialog = window.openDialog("chrome://messenger/content/virtualFolderProperties.xul", "",
-                                 "chrome,titlebar,modal,centerscreen",
-                                 {folder: window.arguments[0].folder,
-                                  searchTerms: getSearchTerms(),
-                                  searchFolderURIs: searchFolderURIs,
-                                  searchOnline: doOnlineSearch});
+  window.openDialog("chrome://messenger/content/virtualFolderProperties.xul", "",
+                    "chrome,titlebar,modal,centerscreen",
+                    {
+                      folder: window.arguments[0].folder,
+                      searchTerms: getSearchTerms(),
+                      searchFolderURIs,
+                      searchOnline: doOnlineSearch,
+                    });
 }
--- a/mail/base/content/aboutAddonsExtra.js
+++ b/mail/base/content/aboutAddonsExtra.js
@@ -1,13 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/* globals AddonManager, Services, gDetailView, gStrings */
+/* globals AddonManager, Services, gDetailView, gListView, gStrings */
 
 const { ExtensionSupport } = ChromeUtils.import("resource:///modules/extensionSupport.jsm", null);
 
 gStrings.mailExt =
   Services.strings.createBundle("chrome://messenger/locale/extensionsOverlay.properties");
 
 (function() {
   window.isCorrectlySigned = function() { return true; };
--- a/mail/base/content/aboutDialog-appUpdater.js
+++ b/mail/base/content/aboutDialog-appUpdater.js
@@ -17,18 +17,17 @@ function onUnload(aEvent) {
   if (gAppUpdater.isChecking)
     gAppUpdater.checker.stopCurrentCheck();
   // Safe to call even when there isn't a download in progress.
   gAppUpdater.removeDownloadListener();
   gAppUpdater = null;
 }
 
 
-function appUpdater()
-{
+function appUpdater() {
   this.updateDeck = document.getElementById("updateDeck");
   this.promiseAutoUpdateSetting;
 
   // Hide the update deck when there is already an update window open to avoid
   // syncing issues between them.
   if (Services.wm.getMostRecentWindow("Update:Wizard")) {
     this.updateDeck.hidden = true;
     return;
@@ -80,18 +79,17 @@ function appUpdater()
   // That leaves the options
   // "Check for updates, but let me choose whether to install them", and
   // "Automatically install updates".
   // In both cases, we check for updates without asking.
   // In the "let me choose" case, we ask before downloading though, in onCheckComplete.
   this.checkForUpdates();
 }
 
-appUpdater.prototype =
-{
+appUpdater.prototype = {
   // true when there is an update check in progress.
   isChecking: false,
 
   // true when there is an update already staged / ready to be applied.
   get isPending() {
     if (this.update) {
       return this.update.state == "pending" ||
              this.update.state == "pending-service" ||
@@ -135,17 +133,17 @@ appUpdater.prototype =
   },
 
   /**
    * Sets the panel of the updateDeck.
    *
    * @param  aChildID
    *         The id of the deck's child to select, e.g. "apply".
    */
-  selectPanel: function(aChildID) {
+  selectPanel(aChildID) {
     let panel = document.getElementById(aChildID);
 
     let button = panel.querySelector("button");
     if (button) {
       if (aChildID == "downloadAndInstall") {
         let updateVersion = gAppUpdater.update.displayVersion;
         // Include the build ID if this is an "a#" (nightly) build
         if (/a\d+$/.test(updateVersion)) {
@@ -166,17 +164,17 @@ appUpdater.prototype =
     } else {
       this.updateDeck.selectedPanel = panel;
     }
   },
 
   /**
    * Check for updates
    */
-  checkForUpdates: function() {
+  checkForUpdates() {
     // Clear prefs that could prevent a user from discovering available updates.
     if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_CANCELATIONS_OSX)) {
       Services.prefs.clearUserPref(PREF_APP_UPDATE_CANCELATIONS_OSX);
     }
     if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_ELEVATE_NEVER)) {
       Services.prefs.clearUserPref(PREF_APP_UPDATE_ELEVATE_NEVER);
     }
     this.selectPanel("checkingForUpdates");
@@ -184,54 +182,50 @@ appUpdater.prototype =
     this.checker.checkForUpdates(this.updateCheckListener, true);
     // after checking, onCheckComplete() is called
   },
 
   /**
    * Handles oncommand for the "Restart to Update" button
    * which is presented after the download has been downloaded.
    */
-  buttonRestartAfterDownload: function() {
+  buttonRestartAfterDownload() {
     if (!this.isPending && !this.isApplied) {
       return;
     }
 
     // Notify all windows that an application quit has been requested.
     let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
                      createInstance(Ci.nsISupportsPRBool);
     Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
 
     // Something aborted the quit process.
     if (cancelQuit.data) {
       return;
     }
 
-    let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
-                     getService(Ci.nsIAppStartup);
-
     // If already in safe mode restart in safe mode (bug 327119)
     if (Services.appinfo.inSafeMode) {
-      appStartup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit);
+      Services.startup.restartInSafeMode(Services.startup.eAttemptQuit);
       return;
     }
 
-    appStartup.quit(Ci.nsIAppStartup.eAttemptQuit |
-                    Ci.nsIAppStartup.eRestart);
+    Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
   },
 
   /**
    * Implements nsIUpdateCheckListener. The methods implemented by
    * nsIUpdateCheckListener are in a different scope from nsIIncrementalDownload
    * to make it clear which are used by each interface.
    */
   updateCheckListener: {
     /**
      * See nsIUpdateService.idl
      */
-    onCheckComplete: function(aRequest, aUpdates, aUpdateCount) {
+    onCheckComplete(aRequest, aUpdates, aUpdateCount) {
       gAppUpdater.isChecking = false;
       gAppUpdater.update = gAppUpdater.aus.
                            selectUpdate(aUpdates, aUpdates.length);
       if (!gAppUpdater.update) {
         gAppUpdater.selectPanel("noUpdatesFound");
         return;
       }
 
@@ -261,35 +255,34 @@ appUpdater.prototype =
           gAppUpdater.selectPanel("downloadAndInstall");
         }
       });
     },
 
     /**
      * See nsIUpdateService.idl
      */
-    onError: function(aRequest, aUpdate) {
+    onError(aRequest, aUpdate) {
       // Errors in the update check are treated as no updates found. If the
       // update check fails repeatedly without a success the user will be
       // notified with the normal app update user interface so this is safe.
       gAppUpdater.isChecking = false;
       gAppUpdater.selectPanel("noUpdatesFound");
-      return;
     },
 
     /**
      * See nsISupports.idl
      */
     QueryInterface: ChromeUtils.generateQI(["nsIUpdateCheckListener"]),
   },
 
   /**
    * Starts the download of an update mar.
    */
-  startDownload: function() {
+  startDownload() {
     if (!this.update)
       this.update = this.um.activeUpdate;
     this.update.QueryInterface(Ci.nsIWritablePropertyBag);
     this.update.setProperty("foregroundDownload", "true");
 
     this.aus.pauseDownload();
     let state = this.aus.downloadUpdate(this.update, false);
     if (state == "failed") {
@@ -298,40 +291,40 @@ appUpdater.prototype =
     }
 
     this.setupDownloadingUI();
   },
 
   /**
    * Switches to the UI responsible for tracking the download.
    */
-  setupDownloadingUI: function() {
+  setupDownloadingUI() {
     this.downloadStatus = document.getElementById("downloadStatus");
     this.downloadStatus.value =
       DownloadUtils.getTransferTotal(0, this.update.selectedPatch.size);
     this.selectPanel("downloading");
     this.aus.addDownloadListener(this);
   },
 
-  removeDownloadListener: function() {
+  removeDownloadListener() {
     if (this.aus) {
       this.aus.removeDownloadListener(this);
     }
   },
 
   /**
    * See nsIRequestObserver.idl
    */
-  onStartRequest: function(aRequest, aContext) {
+  onStartRequest(aRequest, aContext) {
   },
 
   /**
    * See nsIRequestObserver.idl
    */
-  onStopRequest: function(aRequest, aContext, aStatusCode) {
+  onStopRequest(aRequest, aContext, aStatusCode) {
     switch (aStatusCode) {
     case Cr.NS_ERROR_UNEXPECTED:
       if (this.update.selectedPatch.state == "download-failed" &&
           (this.update.isCompleteUpdate || this.update.patchCount != 2)) {
         // Verification error of complete patch, informational text is held in
         // the update object.
         this.removeDownloadListener();
         this.selectPanel("downloadFailed");
@@ -342,17 +335,16 @@ appUpdater.prototype =
       break;
     case Cr.NS_BINDING_ABORTED:
       // Do not remove UI listener since the user may resume downloading again.
       break;
     case Cr.NS_OK:
       this.removeDownloadListener();
       if (this.backgroundUpdateEnabled) {
         this.selectPanel("applying");
-        let update = this.um.activeUpdate;
         let self = this;
         Services.obs.addObserver(function selectPanelOnUpdate(aSubject, aTopic, aData) {
           // Update the UI when the background updater is finished
           let status = aData;
           if (status == "applied" || status == "applied-service" ||
               status == "pending" || status == "pending-service" ||
               status == "pending-elevate") {
             // If the update is successfully applied, or if the updater has
@@ -381,23 +373,23 @@ appUpdater.prototype =
       this.selectPanel("downloadFailed");
       break;
     }
   },
 
   /**
    * See nsIProgressEventSink.idl
    */
-  onStatus: function(aRequest, aContext, aStatus, aStatusArg) {
+  onStatus(aRequest, aContext, aStatus, aStatusArg) {
   },
 
   /**
    * See nsIProgressEventSink.idl
    */
-  onProgress: function(aRequest, aContext, aProgress, aProgressMax) {
+  onProgress(aRequest, aContext, aProgress, aProgressMax) {
     this.downloadStatus.value =
       DownloadUtils.getTransferTotal(aProgress, aProgressMax);
   },
 
   /**
    * See nsISupports.idl
    */
   QueryInterface: ChromeUtils.generateQI(["nsIProgressEventSink",
--- a/mail/base/content/aboutDialog.js
+++ b/mail/base/content/aboutDialog.js
@@ -3,18 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 // Services = object with smart getters for common XPCOM services
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
-function init(aEvent)
-{
+function init(aEvent) {
   if (aEvent.target != document)
     return;
 
   try {
     var distroId = Services.prefs.getCharPref("distribution.id");
     if (distroId) {
       var distroVersion = Services.prefs.getCharPref("distribution.version");
 
@@ -24,24 +23,22 @@ function init(aEvent)
 
       try {
         // This is in its own try catch due to bug 895473 and bug 900925.
         var distroAbout = Services.prefs.getComplexValue("distribution.about",
           Ci.nsISupportsString);
         var distroField = document.getElementById("distribution");
         distroField.value = distroAbout;
         distroField.style.display = "block";
-      }
-      catch (ex) {
+      } catch (ex) {
         // Pref is unset
         Cu.reportError(ex);
       }
     }
-  }
-  catch (e) {
+  } catch (e) {
     // Pref is unset
   }
 
   // XXX FIXME
   // Include the build ID and display warning if this is an "a#" (nightly) build
   let versionField = document.getElementById("version");
   let version = Services.appinfo.version;
   if (/a\d+$/.test(version)) {
@@ -88,19 +85,17 @@ function init(aEvent)
     // it may not be sized at this point, and we need its width to calculate its position
     window.sizeToContent();
     window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5);
   }
 }
 
 // This function is used to open about: tabs. The caller should ensure the url
 // is only an about: url.
-function openAboutTab(url)
-{
-  let tabmail;
+function openAboutTab(url) {
   // Check existing windows
   let mailWindow = Services.wm.getMostRecentWindow("mail:3pane");
   if (mailWindow) {
     mailWindow.focus();
     mailWindow.document.getElementById("tabmail")
               .openTab("contentTab", {contentPage: url,
                                       clickHandler: "specialTabs.aboutClickHandler(event);"});
     return;
@@ -108,18 +103,17 @@ function openAboutTab(url)
 
   // No existing windows.
   window.openDialog("chrome://messenger/content/", "_blank",
                     "chrome,dialog=no,all", null,
                     { tabType: "contentTab",
                       tabParams: {contentPage: url, clickHandler: "specialTabs.aboutClickHandler(event);"} });
 }
 
-function openUILink(url, event)
-{
+function openUILink(url, event) {
   if (!event.button) {
-    let m = ("messenger" in window) ? messenger :
+    let m = ("messenger" in window) ? window.messenger :
       Cc["@mozilla.org/messenger;1"]
         .createInstance(Ci.nsIMessenger);
     m.launchExternalURL(url);
     event.preventDefault();
   }
 }
--- a/mail/base/content/browserRequest.js
+++ b/mail/base/content/browserRequest.js
@@ -9,47 +9,47 @@ var reporterListener = {
   get securityButton() {
     delete this.securityButton;
     return this.securityButton = document.getElementById("security-button");
   },
 
   QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
                                           "nsISupportsWeakReference"]),
 
-  onStateChange: function(/*in nsIWebProgress*/ aWebProgress,
-                     /*in nsIRequest*/ aRequest,
-                     /*in unsigned long*/ aStateFlags,
-                     /*in nsresult*/ aStatus) {
+  onStateChange(/* in nsIWebProgress*/ aWebProgress,
+                /* in nsIRequest*/ aRequest,
+                /* in unsigned long*/ aStateFlags,
+                /* in nsresult*/ aStatus) {
   },
 
-  onProgressChange: function(/*in nsIWebProgress*/ aWebProgress,
-                        /*in nsIRequest*/ aRequest,
-                        /*in long*/ aCurSelfProgress,
-                        /*in long */aMaxSelfProgress,
-                        /*in long */aCurTotalProgress,
-                        /*in long */aMaxTotalProgress) {
+  onProgressChange(/* in nsIWebProgress*/ aWebProgress,
+                   /* in nsIRequest*/ aRequest,
+                   /* in long*/ aCurSelfProgress,
+                   /* in long */aMaxSelfProgress,
+                   /* in long */aCurTotalProgress,
+                   /* in long */aMaxTotalProgress) {
   },
 
-  onLocationChange: function(/*in nsIWebProgress*/ aWebProgress,
-                        /*in nsIRequest*/ aRequest,
-                        /*in nsIURI*/ aLocation) {
+  onLocationChange(/* in nsIWebProgress*/ aWebProgress,
+                   /* in nsIRequest*/ aRequest,
+                   /* in nsIURI*/ aLocation) {
     document.getElementById("headerMessage").textContent = aLocation.spec;
   },
 
-  onStatusChange: function(/*in nsIWebProgress*/ aWebProgress,
-                      /*in nsIRequest*/ aRequest,
-                      /*in nsresult*/ aStatus,
-                      /*in wstring*/ aMessage) {
+  onStatusChange(/* in nsIWebProgress*/ aWebProgress,
+                 /* in nsIRequest*/ aRequest,
+                 /* in nsresult*/ aStatus,
+                 /* in wstring*/ aMessage) {
   },
 
-  onSecurityChange: function(/*in nsIWebProgress*/ aWebProgress,
-                        /*in nsIRequest*/ aRequest,
-                        /*in unsigned long*/ aOldState,
-                        /*in unsigned long*/ aState,
-                        /*in AString*/ aContentBlockingLogJSON) {
+  onSecurityChange(/* in nsIWebProgress*/ aWebProgress,
+                   /* in nsIRequest*/ aRequest,
+                   /* in unsigned long*/ aOldState,
+                   /* in unsigned long*/ aState,
+                   /* in AString*/ aContentBlockingLogJSON) {
     const wpl_security_bits = wpl.STATE_IS_SECURE |
                               wpl.STATE_IS_BROKEN |
                               wpl.STATE_IS_INSECURE |
                               wpl.STATE_SECURE_HIGH |
                               wpl.STATE_SECURE_MED |
                               wpl.STATE_SECURE_LOW;
     var browser = document.getElementById("requestFrame");
     var level;
@@ -70,36 +70,32 @@ var reporterListener = {
       this.securityButton.setAttribute("level", level);
       this.securityButton.hidden = false;
     } else {
       this.securityButton.hidden = true;
       this.securityButton.removeAttribute("level");
     }
     this.securityButton.setAttribute("tooltiptext",
                                      browser.securityUI.tooltipText);
-  }
-}
+  },
+};
 
-function cancelRequest()
-{
+function cancelRequest() {
   reportUserClosed();
   window.close();
 }
 
-function reportUserClosed()
-{
+function reportUserClosed() {
   let request = window.arguments[0].wrappedJSObject;
   request.cancelled();
 }
 
-function loadRequestedUrl()
-{
+function loadRequestedUrl() {
   let request = window.arguments[0].wrappedJSObject;
   document.getElementById("headerMessage").textContent = request.promptText;
-  let account = request.account;
   if (request.iconURI != "")
     document.getElementById("headerImage").src = request.iconURI;
 
   var browser = document.getElementById("requestFrame");
   browser.addProgressListener(reporterListener,
                               Ci.nsIWebProgress.NOTIFY_ALL);
   var url = request.url;
   if (url != "") {
--- a/mail/base/content/commandglue.js
+++ b/mail/base/content/commandglue.js
@@ -1,54 +1,49 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Command-specific code. This stuff should be called by the widgets
  */
 
+var { MailViewConstants } = ChromeUtils.import("resource:///modules/MailViewManager.jsm", null);
 ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-function UpdateMailToolbar(caller)
-{
+function UpdateMailToolbar(caller) {
   // If we have a transient selection, we shouldn't update the toolbar. We'll
   // update it once we've restored the original selection.
   if ("gRightMouseButtonSavedSelection" in window &&
-      gRightMouseButtonSavedSelection)
+      window.gRightMouseButtonSavedSelection)
     return;
 
-  //dump("XXX update mail-toolbar " + caller + "\n");
-  document.commandDispatcher.updateCommands('mail-toolbar');
+  // dump("XXX update mail-toolbar " + caller + "\n");
+  document.commandDispatcher.updateCommands("mail-toolbar");
 
   // hook for extra toolbar items
   Services.obs.notifyObservers(window, "mail:updateToolbarItems");
 }
 
-function isNewsURI(uri)
-{
-    if (!uri || !uri.startsWith('n')) {
+function isNewsURI(uri) {
+    if (!uri) {
         return false;
     }
-    else {
-        return ((uri.startsWith("news:/")) || (uri.startsWith("news-message:/")));
-    }
+    return uri.startsWith("news:/") || uri.startsWith("news-message:/");
 }
 
-function SwitchView(command)
-{
+function SwitchView(command) {
   // when switching thread views, we might be coming out of quick search
   // or a message view.
   // first set view picker to all
-  if (gFolderDisplay.view.mailViewIndex != kViewItemAll)
-    gFolderDisplay.view.setMailView(kViewItemAll);
+  if (gFolderDisplay.view.mailViewIndex != MailViewConstants.kViewItemAll)
+    gFolderDisplay.view.setMailView(MailViewConstants.kViewItemAll);
 
-  switch(command)
-  {
+  switch (command) {
     // "All" threads and "Unread" threads don't change threading state
     case "cmd_viewAllMsgs":
       gFolderDisplay.view.showUnreadOnly = false;
       break;
     case "cmd_viewUnreadMsgs":
       gFolderDisplay.view.showUnreadOnly = true;
       break;
     // "Threads with Unread" and "Watched Threads with Unread" force threading
@@ -61,54 +56,50 @@ function SwitchView(command)
     // "Ignored Threads" toggles 'ignored' inclusion --
     //   but it also resets 'With Unread' views to 'All'
     case "cmd_viewIgnoredThreads":
       gFolderDisplay.view.showIgnored = !gFolderDisplay.view.showIgnored;
       break;
   }
 }
 
-function SetNewsFolderColumns()
-{
+function SetNewsFolderColumns() {
   var sizeColumn = document.getElementById("sizeCol");
   var bundle = document.getElementById("bundle_messenger");
 
   if (gDBView.usingLines) {
      sizeColumn.setAttribute("label", bundle.getString("linesColumnHeader"));
      sizeColumn.setAttribute("tooltiptext",
                              bundle.getString("linesColumnTooltip2"));
-  }
-  else {
+  } else {
      sizeColumn.setAttribute("label", bundle.getString("sizeColumnHeader"));
      sizeColumn.setAttribute("tooltiptext",
                              bundle.getString("sizeColumnTooltip2"));
   }
 }
 
 /**
  * For non-folder based tabs, message counts don't apply.
  * Therefore hide the counts for those folders. For folder based tabs
  * let the tab decide whether or not to show it in UpdateStatusMessageCounts().
  */
 var statusMessageCountsMonitor = {
-  onTabTitleChanged: function() {},
-  onTabSwitched: function statusMessageCountsMonitor_onTabSwitched(aTab, aOldTab) {
+  onTabTitleChanged() {},
+  onTabSwitched(aTab, aOldTab) {
     if (aTab.mode.name != "folder" && aTab.mode.name != "glodaSearch") {
       document.getElementById("unreadMessageCount").hidden = true;
       document.getElementById("totalMessageCount").hidden = true;
     }
-  }
-}
+  },
+};
 
-function UpdateStatusMessageCounts(folder)
-{
+function UpdateStatusMessageCounts(folder) {
   var unreadElement = document.getElementById("unreadMessageCount");
   var totalElement = document.getElementById("totalMessageCount");
-  if (folder && !folder.isServer && unreadElement && totalElement)
-  {
+  if (folder && !folder.isServer && unreadElement && totalElement) {
     var numSelected = gFolderDisplay.selectedCount;
     var bundle = document.getElementById("bundle_messenger");
 
     var numUnread = (numSelected > 1) ?
             bundle.getFormattedString("selectedMsgStatus", [numSelected]) :
             bundle.getFormattedString("unreadMsgStatus",
                                       [folder.getNumUnread(false)]);
     var numTotal = bundle.getFormattedString("totalMsgStatus",
@@ -117,56 +108,53 @@ function UpdateStatusMessageCounts(folde
     unreadElement.setAttribute("label", numUnread);
     totalElement.setAttribute("label", numTotal);
     unreadElement.hidden = false;
     totalElement.hidden = false;
   }
 }
 
 var gQuotaUICache;
-function UpdateStatusQuota(folder)
-{
+function UpdateStatusQuota(folder) {
   if (!(folder && // no folder selected
-        folder instanceof Ci.nsIMsgImapMailFolder)) // POP etc.
-  {
+        folder instanceof Ci.nsIMsgImapMailFolder)) { // POP etc.
     if (typeof(gQuotaUICache) == "object") // ever shown quota
       gQuotaUICache.panel.hidden = true;
     return;
   }
   folder = folder.QueryInterface(Ci.nsIMsgImapMailFolder);
 
   // get element references and prefs
-  if (typeof(gQuotaUICache) != "object")
-  {
-    gQuotaUICache = new Object();
+  if (typeof(gQuotaUICache) != "object") {
+    gQuotaUICache = {};
     gQuotaUICache.meter = document.getElementById("quotaMeter");
     gQuotaUICache.panel = document.getElementById("quotaPanel");
     gQuotaUICache.label = document.getElementById("quotaLabel");
     const kBranch = "mail.quota.mainwindow_threshold.";
     gQuotaUICache.showTreshold = Services.prefs.getIntPref(kBranch + "show");
     gQuotaUICache.warningTreshold = Services.prefs.getIntPref(kBranch + "warning");
     gQuotaUICache.criticalTreshold = Services.prefs.getIntPref(kBranch + "critical");
   }
 
   var valid = {value: null};
   var used = {value: null};
   var max = {value: null};
   try {
     // get data from backend
     folder.getQuota(valid, used, max);
-  } catch (e) { dump(e + "\n"); }
-  if (valid.value && max.value > 0)
-  {
+  } catch (e) {
+    dump(e + "\n");
+  }
+  if (valid.value && max.value > 0) {
     var percent = Math.round(used.value / max.value * 100);
 
     // show in UI
-    if (percent < gQuotaUICache.showTreshold)
+    if (percent < gQuotaUICache.showTreshold) {
       gQuotaUICache.panel.hidden = true;
-    else
-    {
+    } else {
       gQuotaUICache.panel.hidden = false;
       gQuotaUICache.meter.setAttribute("value", percent);
            // do not use value property, because that is imprecise (3%)
            // for optimization that we don't need here
       var bundle = document.getElementById("bundle_messenger");
       var label = bundle.getFormattedString("percent", [percent]);
       var tooltip = bundle.getFormattedString("quotaTooltip",
                                               [used.value, max.value]);
@@ -174,23 +162,22 @@ function UpdateStatusQuota(folder)
       gQuotaUICache.label.tooltipText = tooltip;
       if (percent < gQuotaUICache.warningTreshold)
         gQuotaUICache.panel.removeAttribute("alert");
       else if (percent < gQuotaUICache.criticalTreshold)
         gQuotaUICache.panel.setAttribute("alert", "warning");
       else
         gQuotaUICache.panel.setAttribute("alert", "critical");
     }
+  } else {
+    gQuotaUICache.panel.hidden = true;
   }
-  else
-    gQuotaUICache.panel.hidden = true;
 }
 
-function ConvertSortTypeToColumnID(sortKey)
-{
+function ConvertSortTypeToColumnID(sortKey) {
   var columnID;
 
   // Hack to turn this into an integer, if it was a string.
   // It would be a string if it came from XULStore.json.
   sortKey = sortKey - 0;
 
   switch (sortKey) {
     // In the case of None, we default to the date column
@@ -245,22 +232,20 @@ function ConvertSortTypeToColumnID(sortK
     case nsMsgViewSortType.byJunkStatus:
       columnID = "junkStatusCol";
       break;
     case nsMsgViewSortType.byAttachments:
       columnID = "attachmentCol";
       break;
     case nsMsgViewSortType.byCustom:
 
-      //TODO: either change try() catch to if (property exists) or restore the getColumnHandler() check
-      try //getColumnHandler throws an error when the ID is not handled
-      {
+      // TODO: either change try() catch to if (property exists) or restore the getColumnHandler() check
+      try { // getColumnHandler throws an error when the ID is not handled
         columnID = gDBView.curCustomColumn;
-      }
-      catch (err) { //error - means no handler
+      } catch (err) { // error - means no handler
         dump("ConvertSortTypeToColumnID: custom sort key but no handler for column '" + columnID + "'\n");
         columnID = "dateCol";
       }
 
       break;
     case nsMsgViewSortType.byCorrespondent:
       columnID = "correspondentCol";
       break;
@@ -279,54 +264,50 @@ var nsMsgViewCommandType = Ci.nsMsgViewC
 var nsMsgViewType = Ci.nsMsgViewType;
 var nsMsgNavigationType = Ci.nsMsgNavigationType;
 
 var gDBView = null;
 var gCurViewFlags;
 var gCurSortType;
 
 
-function ChangeMessagePaneVisibility(now_hidden)
-{
+function ChangeMessagePaneVisibility(now_hidden) {
   // We also have to disable the Message/Attachments menuitem.
   // It will be enabled when loading a message with attachments
   // (see messageHeaderSink.handleAttachment).
   var node = document.getElementById("msgAttachmentMenu");
   if (node && now_hidden)
     node.setAttribute("disabled", "true");
 
   gMessageDisplay.visible = !now_hidden;
 
-  var event = document.createEvent('Events');
+  var event = document.createEvent("Events");
   if (now_hidden) {
-    event.initEvent('messagepane-hide', false, true);
-  }
-  else {
-    event.initEvent('messagepane-unhide', false, true);
+    event.initEvent("messagepane-hide", false, true);
+  } else {
+    event.initEvent("messagepane-unhide", false, true);
   }
   document.getElementById("messengerWindow").dispatchEvent(event);
 }
 
-function OnMouseUpThreadAndMessagePaneSplitter()
-{
+function OnMouseUpThreadAndMessagePaneSplitter() {
   // The collapsed state is the state after we released the mouse,
   // so we take it as it is.
   ChangeMessagePaneVisibility(IsMessagePaneCollapsed());
 }
 
 /**
  * Our multiplexed tabbing model ends up sending synthetic folder pane
  *  selection change notifications.  We want to ignore these because the
  *  user may explicitly re-select a folder intentionally, and we want to
  *  be able to know that.  So we filter out the synthetics here.
  * The tabbing logic sets this global to help us out.
  */
 var gIgnoreSyntheticFolderPaneSelectionChange = false;
-function FolderPaneSelectionChange()
-{
+function FolderPaneSelectionChange() {
   let folders = GetSelectedMsgFolders();
   if (folders.length) {
     let msgFolder = folders[0];
     let locationItem = document.getElementById("locationFolders");
     if (locationItem) {
       locationItem.setAttribute("label", msgFolder.prettyName);
       document.getElementById("folderLocationPopup")
               ._setCssSelectors(msgFolder, locationItem);
@@ -348,17 +329,15 @@ function FolderPaneSelectionChange()
   // and we don't want to load the contents of the folder.
   if (!folderSelection.isSelected(folderSelection.currentIndex))
     return;
 
   gFolderDisplay.show(folders.length ? folders[0] : null);
   SetGetMsgButtonTooltip();
 }
 
-function Undo()
-{
+function Undo() {
     messenger.undo(msgWindow);
 }
 
-function Redo()
-{
+function Redo() {
     messenger.redo(msgWindow);
 }
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -11,84 +11,73 @@
    * we return the form action.
    *
    * @return href for the url being clicked
    */
 
   ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
   ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-  function hRefForClickEvent(aEvent, aDontCheckInputElement)
-  {
+  function hRefForClickEvent(aEvent, aDontCheckInputElement) {
     var href;
     var isKeyCommand = (aEvent.type == "command");
     var target =
       isKeyCommand ? document.commandDispatcher.focusedElement : aEvent.target;
 
     if (target instanceof HTMLAnchorElement ||
-        target instanceof HTMLAreaElement   ||
-        target instanceof HTMLLinkElement)
-    {
+        target instanceof HTMLAreaElement ||
+        target instanceof HTMLLinkElement) {
       if (target.hasAttribute("href"))
         href = target.href;
-    }
-    else if (target instanceof HTMLImageElement &&
-             target.hasAttribute("overflowing"))
-    {
+    } else if (target instanceof HTMLImageElement &&
+               target.hasAttribute("overflowing")) {
       // Return if an image is zoomed, otherwise fall through to see if it has
       // a link node.
       return href;
-    }
-    else if (!aDontCheckInputElement && ((target instanceof HTMLInputElement) ||
-                                         (target instanceof HTMLButtonElement)))
-    {
+    } else if (!aDontCheckInputElement && ((target instanceof HTMLInputElement) ||
+                                           (target instanceof HTMLButtonElement))) {
       if (target.form && target.form.action)
         href = target.form.action;
-    }
-    else
-    {
+    } else {
       // We may be nested inside of a link node.
       var linkNode = aEvent.originalTarget;
       while (linkNode && !(linkNode instanceof HTMLAnchorElement))
         linkNode = linkNode.parentNode;
 
       if (linkNode)
         href = linkNode.href;
     }
 
     return href;
   }
 
-function messagePaneOnResize(aEvent)
-{
+function messagePaneOnResize(aEvent) {
   // Scale any overflowing images, exclude http content.
   let browser = getBrowser();
   let doc = browser && browser.contentDocument ? browser.contentDocument : null;
   if (!doc || doc.URL.startsWith("http") || !doc.images)
     return;
 
-  for (let img of doc.images)
-  {
+  for (let img of doc.images) {
     if (img.clientWidth - doc.body.offsetWidth >= 0 &&
         (img.clientWidth <= img.naturalWidth || !img.naturalWidth))
       img.setAttribute("overflowing", true);
     else
       img.removeAttribute("overflowing");
   }
 }
 
 /**
  * Check whether the click target's or its ancestor's href
  * points to an anchor on the page.
  *
  * @param HTMLElement aTargetNode - the element node.
  * @return                        - true if link pointing to anchor.
  */
-function isLinkToAnchorOnPage(aTargetNode)
-{
+function isLinkToAnchorOnPage(aTargetNode) {
   let url = aTargetNode.ownerDocument.URL;
   if (!url.startsWith("http"))
     return false;
 
   let linkNode = aTargetNode;
   while (linkNode && !(linkNode instanceof HTMLAnchorElement))
     linkNode = linkNode.parentNode;
 
@@ -100,18 +89,17 @@ function isLinkToAnchorOnPage(aTargetNod
   if (makeURI(linkNode.href).specIgnoringRef != makeURI(url).specIgnoringRef)
     return false;
 
   return true;
 }
 
 // Called whenever the user clicks in the content area,
 // should always return true for click to go through.
-function contentAreaClick(aEvent)
-{
+function contentAreaClick(aEvent) {
   let target = aEvent.target;
 
   // If we've loaded a web page url, and the element's or its ancestor's href
   // points to an anchor on the page, let the click go through.
   // Otherwise fall through and open externally.
   if (isLinkToAnchorOnPage(target))
     return true;
 
@@ -167,28 +155,27 @@ function contentAreaClick(aEvent)
 }
 
 /**
  * Forces a url to open in an external application according to the protocol
  * service settings.
  *
  * @param url  A url string or an nsIURI containing the url to open.
  */
-function openLinkExternally(url)
-{
+function openLinkExternally(url) {
   let uri = url;
   if (!(uri instanceof Ci.nsIURI))
     uri = Services.io.newURI(url);
 
   // This can fail if there is a problem with the places database.
   PlacesUtils.history.insert({
     url, // accepts both string and nsIURI
     visits: [{
       date: new Date(),
-    }]
+    }],
   }).catch(Cu.reportError);
 
   Cc["@mozilla.org/uriloader/external-protocol-service;1"]
     .getService(Ci.nsIExternalProtocolService)
     .loadURI(uri);
 }
 
 /**
--- a/mail/base/content/editContactPanel.js
+++ b/mail/base/content/editContactPanel.js
@@ -8,54 +8,54 @@ ChromeUtils.import("resource://gre/modul
 
 var editContactInlineUI = {
   _overlayLoaded: false,
   _overlayLoading: false,
   _cardDetails: null,
   _writeable: true,
   _blockedCommands: ["cmd_close"],
 
-  _blockCommands: function () {
+  _blockCommands() {
     for (var i = 0; i < this._blockedCommands; ++i) {
       var elt = document.getElementById(this._blockedCommands[i]);
       // make sure not to permanetly disable this item
       if (elt.hasAttribute("wasDisabled"))
         continue;
 
-      if (elt.getAttribute("disabled") == "true")
+      if (elt.getAttribute("disabled") == "true") {
         elt.setAttribute("wasDisabled", "true");
-      else {
+      } else {
         elt.setAttribute("wasDisabled", "false");
         elt.setAttribute("disabled", "true");
       }
     }
   },
 
-  _restoreCommandsState: function () {
+  _restoreCommandsState() {
     for (var i = 0; i < this._blockedCommands; ++i) {
       var elt = document.getElementById(this._blockedCommands[i]);
       if (elt.getAttribute("wasDisabled") != "true")
         elt.removeAttribute("disabled");
       elt.removeAttribute("wasDisabled");
     }
     document.getElementById("editContactAddressBookList").disabled = false;
     document.getElementById("contactMoveDisabledText").collapsed = true;
   },
 
-  onPopupHidden: function (aEvent) {
+  onPopupHidden(aEvent) {
     if (aEvent.target == this.panel)
       this._restoreCommandsState();
   },
 
-  onPopupShown: function (aEvent) {
+  onPopupShown(aEvent) {
     if (aEvent.target == this.panel)
       document.getElementById("editContactName").focus();
   },
 
-  onKeyPress: function (aEvent, aHandleOnlyReadOnly) {
+  onKeyPress(aEvent, aHandleOnlyReadOnly) {
     // Escape should just close this panel
     if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) {
       this.panel.hidePopup();
       return;
     }
 
     // Return does the default button (done)
     if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
@@ -79,23 +79,23 @@ var editContactInlineUI = {
     delete this.panel;
     var element = document.getElementById("editContactPanel");
     // initially the panel is hidden to avoid impacting startup / new window
     // performance
     element.hidden = false;
     return this.panel = element;
   },
 
-  showEditContactPanel: function showEditContactPanel(aCardDetails, aAnchorElement) {
+  showEditContactPanel(aCardDetails, aAnchorElement) {
     this._cardDetails = aCardDetails;
     let position = "after_start";
     this._doShowEditContactPanel(aAnchorElement, position);
   },
 
-  _doShowEditContactPanel: function (aAnchorElement, aPosition) {
+  _doShowEditContactPanel(aAnchorElement, aPosition) {
     this._blockCommands(); // un-done in the popuphiding handler.
     var bundle = document.getElementById("bundle_editContact");
 
     // Is this address book writeable?
     this._writeable = !this._cardDetails.book.readOnly;
     var type = this._writeable ? "edit" : "view";
 
     // Update the labels accordingly.
@@ -115,18 +115,17 @@ var editContactInlineUI = {
       !this._writeable;
 
     var nameElement = document.getElementById("editContactName");
 
     // Set these to read only if we can't write to the directory.
     if (this._writeable) {
       nameElement.removeAttribute("readonly");
       nameElement.class = "editContactTextbox";
-    }
-    else {
+    } else {
       nameElement.readOnly = true;
       nameElement.class = "plain";
     }
 
     // Fill in the card details
     nameElement.value = this._cardDetails.card.displayName;
     document.getElementById("editContactEmail").value =
       aAnchorElement.getAttribute("emailAddress");
@@ -160,28 +159,28 @@ var editContactInlineUI = {
       document.getElementById("editContactAddressBookList").disabled = true;
 
     if (inMailList)
       document.getElementById("contactMoveDisabledText").collapsed = false;
 
     this.panel.openPopup(aAnchorElement, aPosition, -1, -1);
   },
 
-  editDetails: function() {
+  editDetails() {
     this.saveChanges();
 
     window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul",
                       "",
                       "chrome,modal,resizable=no,centerscreen",
                       { abURI: this._cardDetails.book.URI,
                         card: this._cardDetails.card });
 
   },
 
-  deleteContact: function() {
+  deleteContact() {
     if (this._cardDetails.book.readOnly)
       return; /* double check we can delete this */
 
     /* hide before the dialog or the panel takes the first click */
     this.panel.hidePopup();
 
     var bundle = document.getElementById("bundle_editContact");
     if (!Services.prompt.confirm(window,
@@ -191,17 +190,17 @@ var editContactInlineUI = {
 
     let cardArray = Cc["@mozilla.org/array;1"]
                       .createInstance(Ci.nsIMutableArray);
     cardArray.appendElement(this._cardDetails.card);
 
     MailServices.ab.getDirectory(this._cardDetails.book.URI).deleteCards(cardArray);
   },
 
-  saveChanges: function() {
+  saveChanges() {
     // If we're a popup dialog, just hide the popup and return
     if (!this._writeable) {
       this.panel.hidePopup();
       return;
     }
 
     let originalBook = this._cardDetails.book;
 
@@ -216,25 +215,24 @@ var editContactInlineUI = {
       this._cardDetails.card.displayName = newName;
       this._cardDetails.card.setProperty("PreferDisplayName", true);
     }
 
     // Save the card
     if (this._cardDetails.book.hasCard(this._cardDetails.card)) {
       // Address book wasn't changed.
       this._cardDetails.book.modifyCard(this._cardDetails.card);
-    }
-    else {
+    } else {
       // We changed address books for the card.
 
       // Add it to the chosen address book...
       this._cardDetails.book.addCard(this._cardDetails.card);
 
       // ...and delete it from the old place.
       let cardArray = Cc["@mozilla.org/array;1"]
                               .createInstance(Ci.nsIMutableArray);
       cardArray.appendElement(this._cardDetails.card);
       originalBook.deleteCards(cardArray);
     }
 
     this.panel.hidePopup();
-  }
-}
+  },
+};
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -37,40 +37,39 @@ var FolderDisplayListenerManager = {
    *   made active.
    *
    * - onActiveMessagesLoaded.  onMessagesLoaded deferred to when the
    *   tab is actually made active.  Use this if the actions you need to take
    *   are based on the folder display actually being visible, such as updating
    *   some UI widget, etc. Not all messages may have been loaded, but some.
    *
    */
-  registerListener: function FDLM_registerListener(aListener) {
+  registerListener(aListener) {
     this._listeners.push(aListener);
   },
 
   /**
    * Unregister a previously registered event listener.
    */
-  unregisterListener: function FDLM_unregisterListener(aListener) {
+  unregisterListener(aListener) {
     let idx = this._listeners.indexOf(aListener);
     if (idx >= 0) {
       this._listeners.splice(idx, 1);
     }
   },
 
   /**
    * For use by FolderDisplayWidget to trigger listener invocation.
    */
-  _fireListeners: function FDBLM__fireListeners(aEventName, aArgs) {
+  _fireListeners(aEventName, aArgs) {
     for (let listener of this._listeners) {
       if (aEventName in listener) {
         try {
           listener[aEventName].apply(listener, aArgs);
-        }
-        catch(e) {
+        } catch (e) {
           Cu.reportError(aEventName + " event listener FAILED; " +
                          e + " at: " + e.stack);
         }
       }
     }
   },
 };
 
@@ -90,18 +89,18 @@ var FolderDisplayListenerManager = {
  *  class does alter its behavior slightly for the benefit of the standalone
  *  message window.  If no tab info is provided, we avoid touching tabmail
  *  (which is good, because it won't exist!)  And now we guard against treeBox
  *  manipulations...
  */
 function FolderDisplayWidget(aTabInfo, aMessageDisplayWidget) {
   this._tabInfo = aTabInfo;
 
-  /// If the folder does not get handled by the DBViewWrapper, stash it here.
-  ///  ex: when isServer is true.
+  // If the folder does not get handled by the DBViewWrapper, stash it here.
+  //  ex: when isServer is true.
   this._nonViewFolder = null;
 
   this.view = new DBViewWrapper(this);
   this.messageDisplay = aMessageDisplayWidget;
   this.messageDisplay.folderDisplay = this;
 
   /**
    * The XUL tree node, as retrieved by getDocumentElementById.  The caller is
@@ -164,17 +163,17 @@ function FolderDisplayWidget(aTabInfo, a
   this._notificationsPendingActivation = [];
 
   // Create a DOM node for the fake tree box below.
   let domNode = document.createElementNS(
       "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "vbox");
 
   // We care about onselect events, so add a listener for that.
   let self = this;
-  domNode.addEventListener("select", function () {
+  domNode.addEventListener("select", function() {
     self.view.dbView.selectionChanged();
   });
 
   /**
    * Create a fake tree box object for if/when this folder is in the background.
    * We need to give it a DOM object to send events to, including the onselect
    * event we care about and for which we added a handler above, and all the
    * other events we don't care about.
@@ -221,18 +220,17 @@ FolderDisplayWidget.prototype = {
    */
   get treeSelection() {
     // If we haven't switched to this tab yet, dbView will exist but
     // dbView.selection won't, so use the fake tree selection instead.
     if (this._fakeTreeSelection)
       return this._fakeTreeSelection;
     if (this.view.dbView)
       return this.view.dbView.selection;
-    else
-      return null;
+    return null;
   },
 
   /**
    * Determine which pane currently has focus (one of the folder pane, thread
    * pane, or message pane). The message pane node is the common ancestor of
    * the single- and multi-message content windows. When changing focus to the
    * message pane, be sure to focus the appropriate content window in addition
    * to the messagepanebox (doing both is required in order to blur the
@@ -267,17 +265,17 @@ FolderDisplayWidget.prototype = {
    * @private
    */
   PERF_HEADER_CACHE_SIZE: 100,
 
   /**
    * @name Selection Persistence
    * @private
    */
-  //@{
+  // @{
 
   /**
    * An optional object, with the following properties:
    * - messages: This is a list where each item is an object with the following
    *       attributes sufficient to re-establish the selected items even in the
    *       face of folder renaming.
    *   - messageId: The value of the message's message-id header.
    *
@@ -303,81 +301,80 @@ FolderDisplayWidget.prototype = {
   /**
    * Save the current view selection for when we the view is getting destroyed
    *  or otherwise re-ordered in such a way that the nsITreeSelection will lose
    *  track of things (because it just has a naive view-index 'view' of the
    *  world.)  We just save each message's message-id header.  This is overkill
    *  and ambiguous in the face of duplicate messages (and expensive to
    *  restore), but is also the most reliable option for this use case.
    */
-  _saveSelection: function FolderDisplayWidget_saveSelection() {
+  _saveSelection() {
     this._savedSelection = {
       messages: this.selectedMessages.map(msgHdr => ({messageId: msgHdr.messageId})),
-      forceSelect: false
+      forceSelect: false,
     };
   },
 
   /**
    * Clear the saved selection.
    */
-  _clearSavedSelection: function FolderDisplayWidget_clearSavedSelection() {
+  _clearSavedSelection() {
     this._savedSelection = null;
   },
 
   /**
    * Restore the view selection if we have a saved selection.  We must be
    *  active!
    *
    * @return true if we were able to restore the selection and there was
    *     a selection, false if there was no selection (anymore).
    */
-  _restoreSelection: function FolderDisplayWidget_restoreSelection() {
+  _restoreSelection() {
     if (!this._savedSelection || !this._active)
       return false;
 
     // translate message IDs back to messages.  this is O(s(m+n)) where:
     // - s is the number of messages saved in the selection
     // - m is the number of messages in the view (from findIndexOfMsgHdr)
     // - n is the number of messages in the underlying folders (from
     //   DBViewWrapper.getMsgHdrForMessageID).
     // which ends up being O(sn)
-    var msgHdr;
     let messages =
       this._savedSelection.messages.
       map(savedInfo => this.view.getMsgHdrForMessageID(savedInfo.messageId)).
       filter(msgHdr => !!msgHdr);
 
     this.selectMessages(messages, this._savedSelection.forceSelect, true);
     this._savedSelection = null;
 
     return this.selectedCount != 0;
   },
 
   /**
    * Restore the last expandAll/collapseAll state, for both grouped and threaded
    * views. Not all views respect viewFlags, ie single folder non-virtual.
    */
-  restoreThreadState: function() {
+  restoreThreadState() {
     if (!this._active || !this.tree || !this.view.dbView.viewFolder)
       return;
 
     if (this.view._threadExpandAll &&
         !(this.view.dbView.viewFlags & nsMsgViewFlagsType.kExpandAll))
       this.view.dbView.doCommand(Ci.nsMsgViewCommandType.expandAll);
     if (!this.view._threadExpandAll &&
         this.view.dbView.viewFlags & nsMsgViewFlagsType.kExpandAll)
       this.view.dbView.doCommand(Ci.nsMsgViewCommandType.collapseAll);
   },
-  //@}
+  // @}
 
   /**
    * @name Columns
    * @protected Folder Display
    */
-  //@{
+  // @{
 
   /**
    * The map of all stock sortable columns and their sortType. The key must
    * match the column's xul <treecol> id.
    */
   COLUMNS_MAP: new Map([
     ["accountCol",       "byAccount"],
     ["attachmentCol",    "byAttachments"],
@@ -391,25 +388,25 @@ FolderDisplayWidget.prototype = {
     ["priorityCol",      "byPriority"],
     ["receivedCol",      "byReceived"],
     ["recipientCol",     "byRecipient"],
     ["sizeCol",          "bySize"],
     ["statusCol",        "byStatus"],
     ["subjectCol",       "bySubject"],
     ["tagsCol",          "byTags"],
     ["threadCol",        "byThread"],
-    ["unreadButtonColHeader", "byUnread"]
+    ["unreadButtonColHeader", "byUnread"],
   ]),
 
   /**
    * The map of stock non-sortable columns. The key must match the column's
    *  xul <treecol> id.
    */
   COLUMNS_MAP_NOSORT: new Set([
-    "totalCol", "unreadCol"
+    "totalCol", "unreadCol",
   ]),
 
   /**
    * The set of potential default columns in their default display order.  Each
    *  column in this list is checked against |COLUMN_DEFAULT_TESTERS| to see if
    *  it is actually an appropriate default for the folder type.
    */
   DEFAULT_COLUMNS: [
@@ -433,45 +430,45 @@ FolderDisplayWidget.prototype = {
    *  properties like isMailFolder/isIncomingFolder/isOutgoingFolder allow the
    *  constraint to be expressed concisely.  If a helper does not exist, add
    *  one! (If doing so is out of reach, than access viewWrapper.displayedFolder
    *  to get at the nsIMsgFolder.)
    * If a column does not have a function, it is assumed that it should be
    *  displayed by default.
    */
   COLUMN_DEFAULT_TESTERS: {
-    correspondentCol: function (viewWrapper) {
+    correspondentCol(viewWrapper) {
       if (Services.prefs.getBoolPref("mail.threadpane.use_correspondents")) {
         // Don't show the correspondent for news or RSS where it doesn't make sense.
         return viewWrapper.isMailFolder && !viewWrapper.isFeedFolder;
       }
       return false;
     },
-    senderCol: function (viewWrapper) {
+    senderCol(viewWrapper) {
       if (Services.prefs.getBoolPref("mail.threadpane.use_correspondents")) {
         // Show the sender even if correspondent is enabled for news and feeds.
         return viewWrapper.isNewsFolder || viewWrapper.isFeedFolder;
       }
       // senderCol = From. You only care in incoming folders.
       return viewWrapper.isIncomingFolder;
     },
-    recipientCol: function (viewWrapper) {
+    recipientCol(viewWrapper) {
       if (Services.prefs.getBoolPref("mail.threadpane.use_correspondents")) {
         // No recipient column if we use correspondent.
         return false;
       }
       // recipientCol = To. You only care in outgoing folders.
       return viewWrapper.isOutgoingFolder;
     },
     // Only show the location column for non-single-folder results
-    locationCol: function(viewWrapper) {
+    locationCol(viewWrapper) {
       return !viewWrapper.isSingleFolder;
     },
     // core UI does not provide an ability to mark newsgroup messages as spam
-    junkStatusCol: function(viewWrapper) {
+    junkStatusCol(viewWrapper) {
       return !viewWrapper.isNewsFolder;
     },
   },
 
   /**
    * The property name we use to store the column states on the
    *  dbFolderInfo.
    */
@@ -479,19 +476,17 @@ FolderDisplayWidget.prototype = {
 
   /**
    * Given a dbFolderInfo, extract the persisted state from it if there is any.
    *
    * @return null if there was no persisted state, the persisted state in object
    *     form otherwise.  (Ideally the state conforms to the documentation on
    *     |_savedColumnStates| but we can't stop people from doing bad things.)
    */
-  _depersistColumnStatesFromDbFolderInfo:
-      function FolderDisplayWidget__depersistColumnStatesFromDBFolderInfo(
-        aDbFolderInfo) {
+  _depersistColumnStatesFromDbFolderInfo(aDbFolderInfo) {
     let columnJsonString =
       aDbFolderInfo.getCharProperty(this.PERSISTED_COLUMN_PROPERTY_NAME);
     if (!columnJsonString)
       return null;
 
     return JSON.parse(columnJsonString);
   },
 
@@ -503,17 +498,17 @@ FolderDisplayWidget.prototype = {
    * The caller should only call this when they have reason to suspect that the
    *  column state has been changed.  This could be because there was no
    *  persisted state so we figured out a default one and want to save it.
    *  Otherwise this should be because the user explicitly changed up the column
    *  configurations.  You should not call this willy-nilly.
    *
    * @param aState State to persist.
    */
-  _persistColumnStates: function FolderDisplayWidget__persistColumnStates(aState) {
+  _persistColumnStates(aState) {
     if (this.view.isSynthetic) {
       let syntheticView = this.view._syntheticView;
       if ("setPersistedSetting" in syntheticView)
         syntheticView.setPersistedSetting("columns", aState);
       return;
     }
 
     if (!this.view.displayedFolder || !this.view.displayedFolder.msgDatabase)
@@ -527,28 +522,28 @@ FolderDisplayWidget.prototype = {
   },
 
   /**
    * Let us know that the state of the columns has changed.  This is either due
    *  to a re-ordering or hidden-ness being toggled.
    *
    * This method should only be called on (the active) gFolderDisplay.
    */
-  hintColumnsChanged: function FolderDisplayWidget_hintColumnsChanged() {
+  hintColumnsChanged() {
     // ignore this if we are the ones doing things
     if (this._touchingColumns)
       return;
     this._persistColumnStates(this.getColumnStates());
   },
 
   /**
    * Either inherit the column state of another folder or use heuristics to
    *  figure out the best column state for the current folder.
    */
-  _getDefaultColumnsForCurrentFolder: function(aDoNotInherit) {
+  _getDefaultColumnsForCurrentFolder(aDoNotInherit) {
     // If the view is synthetic, try asking it for its default columns. If it
     // fails, just return nothing, since most synthetic views don't care about
     // columns anyway.
     if (this.view.isSynthetic) {
       if ("getDefaultSetting" in this.view._syntheticView)
         return this.view._syntheticView.getDefaultSetting("columns");
       return {};
     }
@@ -592,18 +587,17 @@ FolderDisplayWidget.prototype = {
     let state = {};
     for (let colId of this.DEFAULT_COLUMNS) {
       let shouldShowColumn = true;
       if (colId in this.COLUMN_DEFAULT_TESTERS) {
         // This is potentially going to be used by extensions; avoid them
         //  killing us.
         try {
           shouldShowColumn = this.COLUMN_DEFAULT_TESTERS[colId](this.view);
-        }
-        catch (ex) {
+        } catch (ex) {
           shouldShowColumn = false;
           Cu.reportError(ex);
         }
       }
       state[colId] = {visible: shouldShowColumn};
     }
     return state;
   },
@@ -621,17 +615,17 @@ FolderDisplayWidget.prototype = {
    *     |_savedColumnStates|.  If ordinal attributes are omitted then no
    *     re-ordering will be performed.  This is intentional, but potentially a
    *     bad idea.  (Right now only gloda search underspecifies ordinals.)
    * @param [aPersistChanges=false] Should we persist the changes to the view?
    *     This only has an effect if we are active.
    *
    * @public
    */
-  setColumnStates: function(aColumnStates, aPersistChanges) {
+  setColumnStates(aColumnStates, aPersistChanges) {
     // If we are not active, just overwrite our current state with the provided
     //  state and bail.
     if (!this._active) {
       this._savedColumnStates = aColumnStates;
       return;
     }
 
     this._touchingColumns = true;
@@ -663,18 +657,17 @@ FolderDisplayWidget.prototype = {
           if (isHidden != shouldBeHidden) {
             if (shouldBeHidden)
               colChild.setAttribute("hidden", "true");
             else
               colChild.removeAttribute("hidden");
           }
         }
       }
-    }
-    finally {
+    } finally {
       this._touchingColumns = false;
     }
 
     if (aPersistChanges)
       this.hintColumnsChanged();
   },
 
   /**
@@ -688,17 +681,17 @@ FolderDisplayWidget.prototype = {
   _savedColumnStates: null,
 
   /**
    * Return a dictionary in the form of |_savedColumnStates| representing the
    *  current column states.
    *
    * @public
    */
-  getColumnStates: function FolderDisplayWidget_getColumnStates() {
+  getColumnStates() {
     if (!this._active)
       return this._savedColumnStates;
 
     let columnStates = {};
 
     let cols = document.getElementById("threadCols");
     let colChildren = cols.children;
     for (let iKid = 0; iKid < colChildren.length; iKid++) {
@@ -713,17 +706,17 @@ FolderDisplayWidget.prototype = {
 
     return columnStates;
   },
 
   /**
    * For now, just save the visible columns into a dictionary for use in a
    *  subsequent call to |setColumnStates|.
    */
-  _saveColumnStates: function FolderDisplayWidget__saveColumnStates() {
+  _saveColumnStates() {
     // In the actual nsITreeColumn, the index property indicates the column
     //  number.  This column number is a 0-based index with no gaps; it only
     //  increments the number each time it sees a column.
     // However, this is subservient to the 'ordinal' property which
     //  defines the _apparent content sequence_ provided by GetNextSibling.
     //  The underlying content ordering is still the same, which is how
     //  restoreNaturalOrder can reset things to their XUL definition sequence.
     //  The 'ordinal' stuff works because nsBoxFrame::RelayoutChildAtOrdinal
@@ -741,122 +734,119 @@ FolderDisplayWidget.prototype = {
     // restoreNaturalOrder invalidates the tree when it is done re-ordering; I'm
     //  not sure that's entirely necessary...
     this._savedColumnStates = this.getColumnStates();
   },
 
   /**
    * Restores the visible columns saved by |_saveColumnStates|.
    */
-  _restoreColumnStates: function FolderDisplayWidget__restoreColumnStates() {
+  _restoreColumnStates() {
     if (this._savedColumnStates) {
       this.setColumnStates(this._savedColumnStates);
       this._savedColumnStates = null;
     }
   },
-  //@}
+  // @}
 
   /**
    * @name What To Display
    * @protected
    */
-  //@{
-  showFolderUri: function FolderDisplayWidget_showFolderUri(aFolderURI) {
+  // @{
+  showFolderUri(aFolderURI) {
     return this.show(MailUtils.getFolderForURI(aFolderURI));
   },
 
   /**
    * Invoked by showFolder when it turns out the folder is in fact a server.
    * @private
    */
-  _showServer: function FolderDisplayWidget__showServer() {
+  _showServer() {
     // currently nothing to do.  makeActive handles everything for us (because
     //  what is displayed needs to be re-asserted each time we are activated
     //  too.)
   },
 
   /**
    * Select a folder for display.
    *
    * @param aFolder The nsIMsgDBFolder to display.
    */
-  show: function FolderDisplayWidget_show(aFolder) {
+  show(aFolder) {
     if (aFolder == null) {
       this._nonViewFolder = null;
       this.view.close();
-    }
-    else if (aFolder instanceof Ci.nsIMsgFolder) {
+    } else if (aFolder instanceof Ci.nsIMsgFolder) {
       if (aFolder.isServer) {
         this._nonViewFolder = aFolder;
         this._showServer();
         this.view.close();
         // A server is fully loaded immediately, for now.  (When we have the
         //  account summary, we might want to change this to wait for the page
         //  load to complete.)
         this._allMessagesLoaded = true;
-      }
-      else {
+      } else {
         this._nonViewFolder = null;
         this.view.open(aFolder);
       }
-    }
-    // it must be a synthetic view
-    else {
+    } else {
+      // it must be a synthetic view
       this.view.openSynthetic(aFolder);
     }
     if (this._active)
       this.makeActive();
 
     if (this._tabInfo)
-      document.getElementById('tabmail').setTabTitle(this._tabInfo);
+      document.getElementById("tabmail").setTabTitle(this._tabInfo);
   },
 
   /**
    * Clone an existing view wrapper as the basis for our display.
    */
-  cloneView: function FolderDisplayWidget_cloneView(aViewWrapper) {
+  cloneView(aViewWrapper) {
     this.view = aViewWrapper.clone(this);
     // generate a view created notification; this will cause us to do the right
     //  thing in terms of associating the view with the tree and such.
     this.onCreatedView();
     if (this._active)
       this.makeActive();
   },
 
   /**
    * Close resources associated with the currently displayed folder because you
    *  no longer care about this FolderDisplayWidget.
    */
-  close: function FolderDisplayWidget_close() {
+  close() {
     // Mark ourselves as inactive without doing any of the hard work of becoming
     //  inactive.  This saves us from trying to update things as they go away.
     this._active = false;
     // Tell the message display to close itself too.  We do this before we do
     //  anything else because closing the view could theoretically propagate
     //  down to the message display and we don't want it doing anything it
     //  doesn't have to do.
     this.messageDisplay._close();
 
     this.view.close();
     this.messenger.setWindow(null, null);
     this.messenger = null;
     this._fakeTreeBox = null;
     this._fakeTreeSelection = null;
   },
-  //@}
+  // @}
 
   /*   ===============================   */
   /* ===== IDBViewWrapper Listener ===== */
   /*   ===============================   */
 
   /**
    * @name IDBViewWrapperListener Interface
    * @private
    */
-  //@{
+  // @{
 
   /**
    * @return true if the mail view picker is visible.  This affects whether the
    *     DBViewWrapper will actually use the persisted mail view or not.
    */
   get shouldUseMailViews() {
     return ViewPickerBinding.isVisible;
   },
@@ -880,75 +870,74 @@ FolderDisplayWidget.prototype = {
   },
 
   /**
    * Let the viewWrapper know if it should mark the messages read when leaving
    *  the provided folder.
    *
    * @return true if the preference is set for the folder's server type.
    */
-  shouldMarkMessagesReadOnLeavingFolder:
-    function FolderDisplayWidget_crazyMarkOnReadChecker (aMsgFolder) {
+  shouldMarkMessagesReadOnLeavingFolder(aMsgFolder) {
       return Services.prefs.getBoolPref("mailnews.mark_message_read." +
                                         aMsgFolder.server.type);
   },
 
   /**
    * The view wrapper tells us when it starts loading a folder, and we set the
    *  cursor busy.  Setting the cursor busy on a per-tab basis is us being
    *  nice to the future. Loading a folder is a blocking operation that is going
    *  to make us unresponsive and accordingly make it very hard for the user to
    *  change tabs.
    */
-  onFolderLoading: function(aFolderLoading) {
+  onFolderLoading(aFolderLoading) {
     if (this._tabInfo)
       document.getElementById("tabmail").setTabBusy(this._tabInfo,
                                                     aFolderLoading);
 
     FolderDisplayListenerManager._fireListeners("onFolderLoading",
                                                 [this, aFolderLoading]);
   },
 
   /**
    * The view wrapper tells us when a search is active, and we mark the tab as
    *  thinking so the user knows something is happening.  'Searching' in this
    *  case is more than just a user-initiated search.  Virtual folders / saved
    *  searches, mail views, plus the more obvious quick search are all based off
    *  of searches and we will receive a notification for them.
    */
-  onSearching: function(aIsSearching) {
+  onSearching(aIsSearching) {
     if (this._tabInfo) {
       let searchBundle = document.getElementById("bundle_search");
       document.getElementById("tabmail").setTabThinking(
         this._tabInfo,
         aIsSearching && searchBundle.getString("searchingMessage"));
     }
 
     FolderDisplayListenerManager._fireListeners("onSearching",
                                                 [this, aIsSearching]);
   },
 
   /**
    * Things we do on creating a view:
    * - notify the observer service so that custom column handler providers can
    *   add their custom columns to our view.
    */
-  onCreatedView: function FolderDisplayWidget_onCreatedView() {
+  onCreatedView() {
     // All of our messages are not displayed if the view was just created.  We
     //  will get an onMessagesLoaded(true) nearly immediately if this is a local
     //  folder where view creation is synonymous with having all messages.
     this._allMessagesLoaded = false;
     this.messageDisplay.onCreatedView();
 
     FolderDisplayListenerManager._fireListeners("onCreatedView",
                                                 [this]);
 
     this._notifyWhenActive(this._activeCreatedView);
   },
-  _activeCreatedView: function() {
+  _activeCreatedView() {
     gDBView = this.view.dbView;
 
     // A change in view may result in changes to sorts, the view menu, etc.
     // Do this before we 'reroot' the dbview.
     this._updateThreadDisplay();
 
     // this creates a new selection object for the view.
     if (this.treeBox)
@@ -964,33 +953,31 @@ FolderDisplayWidget.prototype = {
     //  on creating a custom column assumes gDBView.)
     Services.obs.notifyObservers(this.displayedFolder, "MsgCreateDBView");
   },
 
   /**
    * If our view is being destroyed and it is coming back, we want to save the
    *  current selection so we can restore it when the view comes back.
    */
-  onDestroyingView: function FolderDisplayWidget_onDestroyingView(
-      aFolderIsComingBack) {
+  onDestroyingView(aFolderIsComingBack) {
     // try and persist the selection's content if we can
     if (this._active) {
       // If saving the selection throws an exception, we still want continue
       // destroying the view. Saving the selection can fail if an underlying
       // local folder has been compacted, invalidating the message keys.
       // See bug 536676 for more info.
       try {
         // If a new selection is coming up, there's no point in trying to
         // persist any selections.
         if (aFolderIsComingBack && !this._aboutToSelectMessage)
           this._saveSelection();
         else
           this._clearSavedSelection();
-      }
-      catch (ex) {
+      } catch (ex) {
         logException(ex);
       }
       gDBView = null;
     }
 
     FolderDisplayListenerManager._fireListeners("onDestroyingView",
                                                 [this, aFolderIsComingBack]);
 
@@ -1015,44 +1002,43 @@ FolderDisplayWidget.prototype = {
   },
 
   /**
    * Restore persisted information about what columns to display for the folder.
    *  If we have no persisted information, we leave/set _savedColumnStates null.
    *  The column states will be set to default values in onDisplayingFolder in
    *  that case.
    */
-  onLoadingFolder: function FolderDisplayWidget_onLoadingFolder(aDbFolderInfo) {
+  onLoadingFolder(aDbFolderInfo) {
     this._savedColumnStates =
       this._depersistColumnStatesFromDbFolderInfo(aDbFolderInfo);
 
     FolderDisplayListenerManager._fireListeners("onLoadingFolder",
                                                 [this, aDbFolderInfo]);
   },
 
   /**
    * We are entering the folder for display:
    * - set the header cache size.
    * - Setup the columns if we did not already depersist in |onLoadingFolder|.
    */
-  onDisplayingFolder: function FolderDisplayWidget_onDisplayingFolder() {
+  onDisplayingFolder() {
     let displayedFolder = this.view.displayedFolder;
     let msgDatabase = displayedFolder && displayedFolder.msgDatabase;
     if (msgDatabase) {
       msgDatabase.resetHdrCacheSize(this.PERF_HEADER_CACHE_SIZE);
     }
 
     // makeActive will restore the folder state
     if (!this._savedColumnStates) {
       if (this.view.isSynthetic &&
           "getPersistedSetting" in this.view._syntheticView) {
         let columns = this.view._syntheticView.getPersistedSetting("columns");
         this._savedColumnStates = columns;
-      }
-      else {
+      } else {
         // get the default for this folder
         this._savedColumnStates = this._getDefaultColumnsForCurrentFolder();
         // and save it so it doesn't wiggle if the inbox/prototype changes
         this._persistColumnStates(this._savedColumnStates);
       }
     }
 
     FolderDisplayListenerManager._fireListeners("onDisplayingFolder",
@@ -1062,17 +1048,17 @@ FolderDisplayWidget.prototype = {
       this.makeActive();
   },
 
   /**
    * Notification from DBViewWrapper that it is closing the folder.  This can
    *  happen for reasons other than our own 'close' method closing the view.
    *  For example, user deletion of the folder or underlying folder closes it.
    */
-  onLeavingFolder: function FolderDisplayWidget_onLeavingFolder() {
+  onLeavingFolder() {
     FolderDisplayListenerManager._fireListeners("onLeavingFolder",
                                                 [this]);
 
     // Keep the msgWindow's openFolder up-to-date; it powers nsMessenger's
     //  concept of history so that it can bring you back to the actual folder
     //  you were looking at, rather than just the underlying folder.
     if (this._active)
       msgWindow.openFolder = null;
@@ -1091,26 +1077,25 @@ FolderDisplayWidget.prototype = {
   /**
    * Things to do once some or all the messages that should show up in a folder
    *  have shown up.  For a real folder, this happens when the folder is
    *  entered. For a virtual folder, this happens when the search completes.
    *
    * What we do:
    * - Any scrolling required!
    */
-  onMessagesLoaded: function FolderDisplayWidget_onMessagesLoaded(aAll) {
+  onMessagesLoaded(aAll) {
     this._allMessagesLoaded = aAll;
 
     FolderDisplayListenerManager._fireListeners("onMessagesLoaded",
                                                 [this, aAll]);
 
     this._notifyWhenActive(this._activeMessagesLoaded);
   },
-  _activeMessagesLoaded:
-      function FolderDisplayWidget__activeMessagesLoaded() {
+  _activeMessagesLoaded() {
     FolderDisplayListenerManager._fireListeners("onActiveMessagesLoaded",
                                                 [this]);
 
     // - if a selectMessage's coming up, get out of here
     if (this._aboutToSelectMessage)
       return;
 
     // - restore user's last expand/collapse choice.
@@ -1180,46 +1165,46 @@ FolderDisplayWidget.prototype = {
     // - to the top, the coliseum
     this.ensureRowIsVisible(0);
   },
 
   /**
    * The DBViewWrapper tells us when someone (possibly the wrapper itself)
    *  changes the active mail view so that we can kick the UI to update.
    */
-  onMailViewChanged: function FolderDisplayWidget_onMailViewChanged() {
+  onMailViewChanged() {
     // only do this if we're currently active.  no need to queue it because we
     //  always update the mail view whenever we are made active.
     if (this.active) {
       // you cannot cancel a view change!
       window.dispatchEvent(new Event("MailViewChanged",
         { bubbles: false, cancelable: false }));
     }
   },
 
   /**
    * Just the sort or threading was changed, without changing other things.  We
    *  will not get this notification if the view was re-created, for example.
    */
-  onSortChanged: function FolderDisplayWidget_onSortChanged() {
+  onSortChanged() {
     if (this.active)
       UpdateSortIndicators(this.view.primarySortType,
                            this.view.primarySortOrder);
 
     FolderDisplayListenerManager._fireListeners("onSortChanged",
                                                 [this]);
   },
 
   /**
    * Messages (that may have been displayed) have been removed; this may impact
    * our message selection. We might know it's coming; if we do then
    * this._nextViewIndexAfterDelete should know what view index to select next.
    * For the imap mark-as-deleted we won't know beforehand.
    */
-  onMessagesRemoved: function FolderDisplayWidget_onMessagesRemoved() {
+  onMessagesRemoved() {
     FolderDisplayListenerManager._fireListeners("onMessagesRemoved",
                                                 [this]);
 
     if (this.messageDisplay.onMessagesRemoved())
       return;
 
     // - we saw this coming
     let rowCount = this.view.dbView.rowCount;
@@ -1274,51 +1259,50 @@ FolderDisplayWidget.prototype = {
       this.view.dbView.selectionChanged();
   },
 
   /**
    * Messages were not actually removed, but we were expecting that they would
    *  be.  Clean-up what onMessagesRemoved would have cleaned up, namely the
    *  next view index to select.
    */
-  onMessageRemovalFailed:
-      function FolderDisplayWidget_onMessageRemovalFailed() {
+  onMessageRemovalFailed() {
     this._nextViewIndexAfterDelete = null;
     FolderDisplayListenerManager._fireListeners("onMessagesRemovalFailed",
                                                 [this]);
   },
 
   /**
    * Update the status bar to reflect our exciting message counts.
    */
-  onMessageCountsChanged: function FolderDisplayWidget_onMessageCountsChaned() {
+  onMessageCountsChanged() {
     if (this.active)
       UpdateStatusMessageCounts(this.displayedFolder);
     FolderDisplayListenerManager._fireListeners("onMessageCountsChanged",
                                                 [this]);
   },
-  //@}
+  // @}
   /* ===== End IDBViewWrapperListener ===== */
 
   /*   ==================================   */
   /* ===== nsIMsgDBViewCommandUpdater ===== */
   /*   ==================================   */
 
   /**
    * @name nsIMsgDBViewCommandUpdater Interface
    * @private
    */
-  //@{
+  // @{
 
   /**
    * This gets called when the selection changes AND !suppressCommandUpdating
    *  AND (we're not removing a row OR we are now out of rows).
    * In response, we update the toolbar.
    */
-  updateCommandStatus: function FolderDisplayWidget_updateCommandStatus() {
+  updateCommandStatus() {
     // Do this only if we're active. If we aren't, we're going to take care of
     // this when we switch back to the tab.
     if (this._active)
       UpdateMailToolbar("FolderDisplayWidget command updater notification");
   },
 
   /**
    * This gets called by nsMsgDBView::UpdateDisplayMessage following a call
@@ -1335,18 +1319,17 @@ FolderDisplayWidget.prototype = {
    * - Update some toolbar buttons, why not.
    *
    * @param aFolder The display/view folder, as opposed to the backing folder.
    * @param aSubject The subject with "Re: " if it's got one, which makes it
    *     notably different from just directly accessing the message header's
    *     subject.
    * @param aKeywords The keywords, which roughly translates to message tags.
    */
-  displayMessageChanged: function FolderDisplayWidget_displayMessageChanged(
-      aFolder, aSubject, aKeywords) {
+  displayMessageChanged(aFolder, aSubject, aKeywords) {
     // Hide previous stale message to prevent brief threadpane selection and
     // content displayed mismatch, on both folder and tab changes.
     let browser = getBrowser();
     if (browser && browser.contentDocument && browser.contentDocument.body)
       browser.contentDocument.body.hidden = true;
 
     UpdateMailToolbar("FolderDisplayWidget displayed message changed");
     let selected = this.view.dbView.getSelectedMsgHdrs();
@@ -1371,18 +1354,17 @@ FolderDisplayWidget.prototype = {
   /**
    * This gets called as a hint that the currently selected message is junk and
    *  said junked message is going to be moved out of the current folder, or
    *  right before a header is removed from the db view.  The legacy behaviour
    *  is to retrieve the msgToSelectAfterDelete attribute off the db view,
    *  stashing it for benefit of the code that gets called when a message
    *  move/deletion is completed so that we can trigger its display.
    */
-  updateNextMessageAfterDelete:
-      function FolderDisplayWidget_updateNextMessageAfterDelete() {
+  updateNextMessageAfterDelete() {
     this.hintAboutToDeleteMessages();
   },
 
   /**
    * The most recent currentIndexes on the selection (from the last time
    *  summarizeSelection got called).  We use this in onMessagesRemoved if
    *  we get an unexpected notification.
    * We keep a maximum of 2 entries in this list.
@@ -1397,79 +1379,76 @@ FolderDisplayWidget.prototype = {
   _mostRecentSelectionCounts: undefined, // initialized in constructor
 
   /**
    * Always called by the db view when the selection changes in
    *  SelectionChanged.  This event will come after the notification to
    *  displayMessageChanged (if one happens), and before the notification to
    *  updateCommandStatus (if one happens).
    */
-  summarizeSelection: function FolderDisplayWidget_summarizeSelection() {
+  summarizeSelection() {
     // save the current index off in case the selection gets deleted out from
     //  under us and we want to have persistence of actually-having-something
     //  selected.
     let treeSelection = this.treeSelection;
     if (treeSelection) {
       this._mostRecentCurrentIndices.unshift(treeSelection.currentIndex);
       this._mostRecentCurrentIndices.splice(2);
       this._mostRecentSelectionCounts.unshift(treeSelection.count);
       this._mostRecentSelectionCounts.splice(2);
     }
     return this.messageDisplay.onSelectedMessagesChanged();
   },
-  //@}
+  // @}
   /* ===== End nsIMsgDBViewCommandUpdater ===== */
 
   /* ===== Hints from the command infrastructure ===== */
   /**
    * @name Command Infrastructure Hints
    * @protected
    */
-  //@{
+  // @{
 
   /**
    * doCommand helps us out by telling us when it is telling the view to delete
    *  some messages.  Ideally it should go through us / the DB View Wrapper to
    *  kick off the delete in the first place, but that's a thread I don't want
    *  to pull on right now.
    * We use this hint to figure out the next message to display once the
    *  deletion completes.  We do this before the deletion happens because the
    *  selection is probably going away (except in the IMAP delete model), and it
    *  might be too late to figure this out after the deletion happens.
    * Our automated complement (that calls us) is updateNextMessageAfterDelete.
    */
-  hintAboutToDeleteMessages:
-      function FolderDisplayWidget_hintAboutToDeleteMessages() {
+  hintAboutToDeleteMessages() {
     // save the value, even if it is nsMsgViewIndex_None.
     this._nextViewIndexAfterDelete = this.view.dbView.msgToSelectAfterDelete;
   },
 
   /**
    * The archive code tells us when it is starting to archive messages.  This
    *  is different from hinting about deletion because it will also tell us
    *  when it has completed its mass move.
    * The UI goal is that we do not immediately jump beyond the selected messages
    *  to the next message until all of the selected messages have been
    *  processed (moved).  Ideally we would also do this when deleting messages
    *  from a multiple-folder backed message view, but we don't know when the
    *  last job completes in that case (whereas in this case we do because of the
    *  call to hintMassMoveCompleted.)
    */
-  hintMassMoveStarting:
-      function FolderDisplayWidget_hintMassMoveStarting() {
+  hintMassMoveStarting() {
     this.hintAboutToDeleteMessages();
     this._massMoveActive = true;
   },
 
   /**
    * The archival has completed, we can finally let onMessagseRemoved run to
    *  completion.
    */
-  hintMassMoveCompleted:
-      function FolderDisplayWidget_hintMassMoveCompleted() {
+  hintMassMoveCompleted() {
     this._massMoveActive = false;
     this.onMessagesRemoved();
   },
 
   /**
    * When a right-click on the thread pane is going to alter our selection, we
    *  get this notification (currently from |ChangeSelectionWithoutContentLoad|
    *  in msgMail3PaneWindow.js), which lets us save our state.
@@ -1483,121 +1462,114 @@ FolderDisplayWidget.prototype = {
    *  the right-click itself may mutate the view (although we could try and get
    *  it to restore the selection before it gets to the mutation part).  Our
    *  only way to resolve this would be to create a 'tee' like fake selection
    *  that would proxy view change notifications to both sets of selections.
    *  That is hard.
    * So we just use the existing _saveSelection/_restoreSelection mechanism
    *  which is potentially very costly.
    */
-  hintRightClickPerturbingSelection:
-      function FolderDisplayWidget_hintRightClickPerturbingSelect() {
+  hintRightClickPerturbingSelection() {
     this._saveSelection();
   },
 
   /**
    * When a right-click on the thread pane altered our selection (which we
    *  should have received a call to |hintRightClickPerturbingSelection| for),
    *  we should receive this notification from
    *  |RestoreSelectionWithoutContentLoad| when it wants to put things back.
    */
-  hintRightClickSelectionPerturbationDone:
-      function FolderDisplayWidget_hintRightClickSelectionPerturbationDone() {
+  hintRightClickSelectionPerturbationDone() {
     this._restoreSelection();
   },
-  //@}
+  // @}
   /* ===== End hints from the command infrastructure ==== */
 
-  _updateThreadDisplay: function FolderDisplayWidget__updateThreadDisplay() {
+  _updateThreadDisplay() {
     if (this.active) {
       if (this.view.dbView) {
         UpdateSortIndicators(this.view.dbView.sortType,
                              this.view.dbView.sortOrder);
         SetNewsFolderColumns();
       }
     }
   },
 
   /**
    * Update the UI display apart from the thread tree because the folder being
    *  displayed has changed.  This can be the result of changing the folder in
    *  this FolderDisplayWidget, or because this FolderDisplayWidget is being
    *  made active.  _updateThreadDisplay handles the parts of the thread tree
    *  that need updating.
    */
-  _updateContextDisplay: function FolderDisplayWidget__updateContextDisplay() {
+  _updateContextDisplay() {
     if (this.active) {
       UpdateMailToolbar("FolderDisplayWidget updating context");
       UpdateStatusQuota(this.displayedFolder);
       UpdateStatusMessageCounts(this.displayedFolder);
 
       // - mail view combo-box.
       this.onMailViewChanged();
     }
   },
 
   /**
    * @name Activation Control
    * @protected
    */
-  //@{
+  // @{
 
   /**
    * Run the provided notification function right now if we are 'active' (the
    *  currently displayed tab), otherwise queue it to be run when we become
    *  active.  We do this because our tabbing model uses multiplexed (reused)
    *  widgets, and extensions likewise depend on these global/singleton things.
    * If the requested notification function is already queued, it will not be
    *  added a second time, and the original call ordering will be maintained.
    *  If a new call ordering is required, the list of notifications should
    *  probably be reset by the 'big bang' event (new view creation?).
    */
-  _notifyWhenActive:
-      function FolderDisplayWidget__notifyWhenActive(aNotificationFunc) {
+  _notifyWhenActive(aNotificationFunc) {
     if (this._active) {
       aNotificationFunc.call(this);
-    }
-    else {
-      if (!this._notificationsPendingActivation.includes(aNotificationFunc))
-        this._notificationsPendingActivation.push(aNotificationFunc);
+    } else if (!this._notificationsPendingActivation.includes(aNotificationFunc)) {
+      this._notificationsPendingActivation.push(aNotificationFunc);
     }
   },
 
   /**
    * Some notifications cannot run while the FolderDisplayWidget is inactive
    *  (presumbly because it is in a background tab).  We accumulate those in
    *  _notificationsPendingActivation and then this method runs them when we
    *  become active again.
    */
-  _runNotificationsPendingActivation:
-      function FolderDisplayWidget__runNotificationsPendingActivation() {
+  _runNotificationsPendingActivation() {
     if (!this._notificationsPendingActivation.length)
       return;
 
     let pendingNotifications = this._notificationsPendingActivation;
     this._notificationsPendingActivation = [];
     for (let notif of pendingNotifications) {
       notif.call(this);
     }
   },
 
-  /// This is not guaranteed to be up to date if the folder display is active
+  // This is not guaranteed to be up to date if the folder display is active
   _folderPaneVisible: null,
 
   /**
    * Whether the folder pane is visible. When we're inactive, we stash the value
    * in |this._folderPaneVisible|.
    */
   get folderPaneVisible() {
     if (this._active) {
       let folderPaneBox = document.getElementById("folderPaneBox");
       if (folderPaneBox)
         return !folderPaneBox.collapsed;
-    }
-    else {
+    } else {
       return this._folderPaneVisible;
     }
 
     return null;
   },
 
   /**
    * Sets the visibility of the folder pane. This should reflect reality and
@@ -1611,17 +1583,17 @@ FolderDisplayWidget.prototype = {
     return this._active;
   },
 
   /**
    * Make this FolderDisplayWidget the 'active' widget by updating globals and
    *  linking us up to the UI widgets.  This is intended for use by the tabbing
    *  logic.
    */
-  makeActive: function FolderDisplayWidget_makeActive(aWasInactive) {
+  makeActive(aWasInactive) {
     let wasInactive = !this._active;
 
     // -- globals
     // update per-tab globals that we own
     gFolderDisplay = this;
     gMessageDisplay = this.messageDisplay;
     gDBView = this.view.dbView;
     messenger = this.messenger;
@@ -1703,55 +1675,54 @@ FolderDisplayWidget.prototype = {
         mailTabType._setPaneStates(this._tabInfo.mode.legalPanes,
           {folder: folderPaneVisible,
            message: this.messageDisplay.visible});
 
       // update the columns and such that live inside the thread pane
       this._updateThreadDisplay();
 
       this.messageDisplay.makeActive(dontReloadMessage);
-    }
-    // account central stuff when we don't have a dbview
-    else {
+    } else {
+      // account central stuff when we don't have a dbview
       this._showAccountCentral();
       if (this._tabInfo)
         mailTabType._setPaneStates(this._tabInfo.mode.accountCentralLegalPanes,
           {folder: folderPaneVisible});
     }
 
     this._updateContextDisplay();
   },
 
   /**
    * Cause the displayDeck to display the thread pane.
    */
-  _showThreadPane: function FolderDisplayWidget__showThreadPane() {
+  _showThreadPane() {
     document.getElementById("displayDeck").selectedPanel =
       document.getElementById("threadPaneBox");
   },
 
   /**
    * Cause the displayDeck to display the (preference configurable) account
    *  central page.
    */
-  _showAccountCentral: function FolderDisplayWidget__showAccountCentral() {
+  _showAccountCentral() {
     var accountBox = document.getElementById("accountCentralBox");
     document.getElementById("displayDeck").selectedPanel = accountBox;
     var prefName = "mailnews.account_central_page.url";
     // oh yeah, 'pref' is a global all right.
     var acctCentralPage =
       Services.prefs.getComplexValue(prefName,
                                      Ci.nsIPrefLocalizedString).data;
-    window.frames["accountCentralPane"].location.href = acctCentralPage;
+    window.frames.accountCentralPane.location.href = acctCentralPage;
   },
 
   /**
    * Call this when the tab using us is being hidden.
    */
-  makeInactive: function FolderDisplayWidget_makeInactive() {
+  makeInactive() {
     // - things to do before we mark ourselves inactive (because they depend on
     //   us being active)
 
     // getColumnStates returns _savedColumnStates when we are inactive (and is
     //  used by _saveColumnStates) so we must do this before marking inactive.
     this._saveColumnStates();
 
     // - mark us inactive
@@ -1770,30 +1741,29 @@ FolderDisplayWidget.prototype = {
       this.messagePaneCollapsed =
         document.getElementById("messagepaneboxwrapper").collapsed;
 
       this.hookUpFakeTreeBox(true);
     }
 
     this.messageDisplay.makeInactive();
   },
-  //@}
+  // @}
 
   /**
    * Called when we want to "disable" the real treeBox for a while and hook up
    * the fake tree box to the db view. This also takes care of our
    * treeSelection object.
    *
    * @param aNullRealTreeBoxView true if we want to null out the real tree box.
    *          We don't want to null out the view if we're opening a background
    *          tab, for example.
    * @private
    */
-  hookUpFakeTreeBox: function FolderDisplayWidget_hookUpFakeTreeBox(
-                         aNullRealTreeBoxView) {
+  hookUpFakeTreeBox(aNullRealTreeBoxView) {
     // save off the tree selection object.  the nsTreeBodyFrame will make the
     //  view forget about it when our view is removed, so it's up to us to
     //  save it.
     // We use this.treeSelection instead of this.view.dbView.selection here,
     //  so that we get the fake tree selection if we have it.
     let treeSelection = this.treeSelection;
     // if we want to, make the tree forget about the view right now so we can
     //  tell the db view about its selection object so it can try and keep it
@@ -1807,86 +1777,84 @@ FolderDisplayWidget.prototype = {
     this._fakeTreeBox.view = this.view.dbView;
     this.view.dbView.setTree(this._fakeTreeBox);
     treeSelection.tree = this._fakeTreeBox;
   },
 
   /**
    * @name Command Support
    */
-  //@{
+  // @{
 
   /**
    * @return true if there is a db view and the command is enabled on the view.
    *  This function hides some of the XPCOM-odditities of the getCommandStatus
    *  call.
    */
-  getCommandStatus: function FolderDisplayWidget_getCommandStatus(
-      aCommandType, aEnabledObj, aCheckStatusObj) {
+  getCommandStatus(aCommandType, aEnabledObj, aCheckStatusObj) {
     // no view means not enabled
     if (!this.view.dbView)
       return false;
     let enabledObj = {}, checkStatusObj = {};
     this.view.dbView.getCommandStatus(aCommandType, enabledObj, checkStatusObj);
     return enabledObj.value;
   },
 
   /**
    * Make code cleaner by allowing peoples to call doCommand on us rather than
    *  having to do folderDisplayWidget.view.dbView.doCommand.
    *
    * @param aCommandName The command name to invoke.
    */
-  doCommand: function FolderDisplayWidget_doCommand(aCommandName) {
+  doCommand(aCommandName) {
     return this.view.dbView && this.view.dbView.doCommand(aCommandName);
   },
 
   /**
    * Make code cleaner by allowing peoples to call doCommandWithFolder on us
    *  rather than having to do:
    *  folderDisplayWidget.view.dbView.doCommandWithFolder.
    *
    * @param aCommandName The command name to invoke.
    * @param aFolder The folder context for the command.
    */
-  doCommandWithFolder: function FolderDisplayWidget_doCommandWithFolder(
-      aCommandName, aFolder) {
+  doCommandWithFolder(aCommandName, aFolder) {
     return this.view.dbView &&
            this.view.dbView.doCommandWithFolder(aCommandName, aFolder);
   },
-  //@}
+  // @}
 
   /**
    * @return true when account central is being displayed.
    * @groupName Displayed
    */
   get isAccountCentralDisplayed() {
     return (this.view.dbView == null);
   },
 
   /**
    * @name Navigation
    * @protected
    */
-  //@{
+  // @{
 
   /**
    * Navigate using nsMsgNavigationType rules and ensuring the resulting row is
    *  visible.  This is trickier than it used to be because we now support
    *  treating collapsed threads as the set of all the messages in the collapsed
    *  thread rather than just the root message in that thread.
    *
    * @param {nsMsgNavigationType} aNavType navigation command.
    * @param {Boolean} [aSelect=true] should we select the message if we find
    *     one?
    *
    * @return true if the navigation constraint matched anything, false if not.
    *     We will have navigated if true, we will have done nothing if false.
    */
-  navigate: function FolderDisplayWidget_navigate(aNavType, aSelect) {
+  navigate(aNavType, aSelect) {
     if (aSelect === undefined)
       aSelect = true;
     let resultKeyObj = {}, resultIndexObj = {}, threadIndexObj = {};
 
     let summarizeSelection = this.summarizeSelectionInFolder;
 
     let treeSelection = this.treeSelection; // potentially magic getter
     let currentIndex = treeSelection ? treeSelection.currentIndex : 0;
@@ -1897,18 +1865,17 @@ FolderDisplayWidget.prototype = {
     // the top level message, without using viewNavigate.
     if (summarizeSelection &&
         aNavType == nsMsgNavigationType.nextUnreadMessage &&
         currentIndex != -1 &&
         this.view.isCollapsedThreadAtIndex(currentIndex) &&
         !(this.view.dbView.getFlagsAt(currentIndex) &
           Ci.nsMsgMessageFlags.Read)) {
       viewIndex = currentIndex;
-    }
-    else {
+    } else {
       // always 'wrap' because the start index is relative to the selection.
       // (keep in mind that many forms of navigation do not care about the
       //  starting position or 'wrap' at all; for example, firstNew just finds
       //  the first new message.)
       // allegedly this does tree-expansion for us.
       this.view.dbView.viewNavigate(aNavType, resultKeyObj, resultIndexObj,
                                     threadIndexObj, true);
       viewIndex = resultIndexObj.value;
@@ -1932,35 +1899,35 @@ FolderDisplayWidget.prototype = {
     return true;
   },
 
   /**
    * Push a call to |navigate| to be what we do once we successfully open the
    *  next folder.  This is intended to be used by cross-folder navigation
    *  code.  It should call this method before triggering the folder change.
    */
-  pushNavigation: function FolderDisplayWidget_navigate(aNavType, aSelect) {
+  pushNavigation(aNavType, aSelect) {
     this._pendingNavigation = [aNavType, aSelect];
   },
 
   /**
    * @return true if we are able to navigate using the given navigation type at
    *  this time.
    */
-  navigateStatus: function FolderDisplayWidget_navigateStatus(aNavType) {
+  navigateStatus(aNavType) {
     if (!this.view.dbView)
       return false;
     return this.view.dbView.navigateStatus(aNavType);
   },
-  //@}
+  // @}
 
   /**
    * @name Selection
    */
-  //@{
+  // @{
 
   /**
    * @returns the message header for the first selected message, or null if
    *  there is no selected message.
    *
    * If the user has right-clicked on a message, this method will return that
    *  message and not the 'current index' (the dude with the dotted selection
    *  rectangle around him.)  If you instead always want the currently
@@ -2155,18 +2122,17 @@ FolderDisplayWidget.prototype = {
           this.displayedFolder.server
         );
 
         const nsIMsgIdentity = Ci.nsIMsgIdentity;
         let allEnabled = undefined;
         for (let identity of fixIterator(serverIdentities, nsIMsgIdentity)) {
           if (allEnabled === undefined) {
             allEnabled = identity.archiveEnabled;
-          }
-          else if (identity.archiveEnabled != allEnabled) {
+          } else if (identity.archiveEnabled != allEnabled) {
             allEnabled = undefined;
             break;
           }
         }
         if (allEnabled !== undefined)
           return allEnabled;
       }
     }
@@ -2196,58 +2162,56 @@ FolderDisplayWidget.prototype = {
     }
     return true;
   },
 
   /**
    * Clear the tree selection, making sure the message pane is cleared and
    *  the context display (toolbars, etc.) are updated.
    */
-  clearSelection: function FolderDisplayWidget_clearSelection() {
+  clearSelection() {
     let treeSelection = this.treeSelection; // potentially magic getter
     if (!treeSelection)
       return;
     treeSelection.clearSelection();
     this.messageDisplay.clearDisplay();
     this._updateContextDisplay();
   },
 
-  /// Whether we're about to select a message
+  // Whether we're about to select a message
   _aboutToSelectMessage: false,
 
   /**
    * This needs to be called to let us know that a selectMessage or equivalent
    * is coming  up right after a show() call, so that we know that a double
    * message load won't be happening.
    *
    * This can be assumed to be idempotent.
    */
-  selectMessageComingUp: function FolderDisplayWidget_selectMessageComingUp() {
+  selectMessageComingUp() {
     this._aboutToSelectMessage = true;
   },
 
   /**
    * Select a message for display by header.  Attempt to select the message
    *  right now.  If we were unable to find it, update our saved selection
    *  to want to display the message.  Threads are expanded to find the header.
    *
    * @param aMsgHdr The message header to select for display.
    * @param [aForceSelect] If the message is not in the view and this is true,
    *                       we will drop any applied view filters to look for the
    *                       message. The dropping of view filters is persistent,
    *                       so use with care. Defaults to false.
    */
-  selectMessage: function FolderDisplayWidget_selectMessage(aMsgHdr,
-      aForceSelect) {
+  selectMessage(aMsgHdr, aForceSelect) {
     let viewIndex = this.view.getViewIndexForMsgHdr(aMsgHdr, aForceSelect);
     if (viewIndex != nsMsgViewIndex_None) {
       this._savedSelection = null;
       this.selectViewIndex(viewIndex);
-    }
-    else {
+    } else {
       this._savedSelection = {messages: [{messageId: aMsgHdr.messageId}],
                               forceSelect: aForceSelect};
       // queue the selection to be restored once we become active if we are not
       //  active.
       if (!this.active)
         this._notifyWhenActive(this._restoreSelection);
     }
 
@@ -2269,39 +2233,37 @@ FolderDisplayWidget.prototype = {
    *                       message. The dropping of view filters is persistent,
    *                       so use with care. Defaults to false.
    * @param aDoNotNeedToFindAll If true (can be omitted and left undefined), we
    *     do not attempt to save the selection for future use.  This is intended
    *     for use by the _restoreSelection call which is the end-of-the-line for
    *     restoring the selection.  (Once it gets called all of our messages
    *     should have already been loaded.)
    */
-  selectMessages: function FolderDisplayWidget_selectMessages(
-      aMessages, aForceSelect, aDoNotNeedToFindAll) {
+  selectMessages(aMessages, aForceSelect, aDoNotNeedToFindAll) {
     let treeSelection = this.treeSelection; // potentially magic getter
     let foundAll = true;
     if (treeSelection) {
       let minRow = null, maxRow = null;
 
       treeSelection.selectEventsSuppressed = true;
       treeSelection.clearSelection();
 
       for (let msgHdr of aMessages) {
         let viewIndex = this.view.getViewIndexForMsgHdr(msgHdr, aForceSelect);
 
         if (viewIndex != nsMsgViewIndex_None) {
           if (minRow == null || viewIndex < minRow)
             minRow = viewIndex;
-          if (maxRow == null || viewIndex > maxRow )
+          if (maxRow == null || viewIndex > maxRow)
             maxRow = viewIndex;
           // nsTreeSelection is actually very clever about doing this
           //  efficiently.
           treeSelection.rangedSelect(viewIndex, viewIndex, true);
-        }
-        else {
+        } else {
           foundAll = false;
         }
 
         // make sure the selection is as visible as possible
         if (minRow != null)
           this.ensureRowRangeIsVisible(minRow, maxRow);
       }
 
@@ -2317,31 +2279,31 @@ FolderDisplayWidget.prototype = {
 
     // Two cases.
     // 1. The tree selection isn't there at all.
     // 2. The tree selection is there, and we needed to find all messages, but
     //    we didn't.
     if (!treeSelection || (!aDoNotNeedToFindAll && !foundAll)) {
       this._savedSelection = {
         messages: aMessages.map(msgHdr => ({messageId: msgHdr.messageId})),
-        forceSelect: aForceSelect
+        forceSelect: aForceSelect,
       };
       if (!this.active)
         this._notifyWhenActive(this._restoreSelection);
     }
   },
 
   /**
    * Select the message at view index.
    *
    * @param aViewIndex The view index to select.  This will be bounds-checked
    *     and if it is outside the bounds, we will clear the selection and
    *     bail.
    */
-  selectViewIndex: function FolderDisplayWidget_selectViewIndex(aViewIndex) {
+  selectViewIndex(aViewIndex) {
     let treeSelection = this.treeSelection;
     // if we have no selection, we can't select something
     if (!treeSelection)
       return;
     let rowCount = this.view.dbView.rowCount;
     if ((aViewIndex == nsMsgViewIndex_None) ||
         (aViewIndex < 0) || (aViewIndex >= rowCount)) {
       this.clearSelection();
@@ -2361,26 +2323,25 @@ FolderDisplayWidget.prototype = {
         ((treeSelection.currentIndex == aViewIndex) ||
          treeSelection.isSelected(aViewIndex))) {
       // Make sure the index we just selected is also the current index.
       //  This can happen when the tree selection adjusts itself as a result of
       //  changes to the tree as a result of deletion.  This will not trigger
       //  a notification.
       treeSelection.select(aViewIndex);
       this.view.dbView.selectionChanged();
-    }
-    // Previous code was concerned about avoiding updating commands on the
-    //  assumption that only the selection count mattered.  We no longer
-    //  make this assumption.
-    // Things that may surprise you about the call to treeSelection.select:
-    // 1) This ends up calling the onselect method defined on the XUL 'tree'
-    //    tag.  For the 3pane this is the ThreadPaneSelectionChanged method in
-    //    threadPane.js.  That code checks a global to see if it is dealing
-    //    with a right-click, and ignores it if so.
-    else {
+    } else {
+      // Previous code was concerned about avoiding updating commands on the
+      //  assumption that only the selection count mattered.  We no longer
+      //  make this assumption.
+      // Things that may surprise you about the call to treeSelection.select:
+      // 1) This ends up calling the onselect method defined on the XUL 'tree'
+      //    tag.  For the 3pane this is the ThreadPaneSelectionChanged method in
+      //    threadPane.js.  That code checks a global to see if it is dealing
+      //    with a right-click, and ignores it if so.
       treeSelection.select(aViewIndex);
     }
 
     if (this._active)
       this.ensureRowIsVisible(aViewIndex);
 
     // The saved selection is invalidated, since we've got something newer
     this._savedSelection = null;
@@ -2392,18 +2353,17 @@ FolderDisplayWidget.prototype = {
   /**
    * For every selected message in the display that is part of a (displayed)
    *  thread and is not the root message, de-select it and ensure that the
    *  root message of the thread is selected.
    * This is primarily intended to be used when collapsing visible threads.
    *
    * We do nothing if we are not in a threaded display mode.
    */
-  selectSelectedThreadRoots:
-      function FolderDisplayWidget_selectSelectedThreadRoots() {
+  selectSelectedThreadRoots() {
     if (!this.view.showThreaded)
       return;
 
     // There are basically two implementation strategies available to us:
     // 1) For each selected view index with a level > 0, keep walking 'up'
     //    (numerically smaller) until we find a message with level 0.
     //    The inefficiency here is the potentially large number of JS calls
     //    into XPCOM space that will be required.
@@ -2420,22 +2380,22 @@ FolderDisplayWidget.prototype = {
       let thread = dbView.getThreadContainingIndex(index);
       // We use getChildHdrAt instead of getRootHdr because getRootHdr has
       //  a useless out-param and just calls getChildHdrAt anyways.
       newSelectedMessages.push(thread.getChildHdrAt(0));
     }
     this.selectMessages(newSelectedMessages);
   },
 
-  //@}
+  // @}
 
   /**
    * @name Ensure Visibility
    */
-  //@{
+  // @{
 
   /**
    * Minimum number of lines to display between the 'focused' message and the
    *  top / bottom of the thread pane.
    */
   get visibleRowPadding() {
     let topPadding, bottomPadding;
 
@@ -2447,18 +2407,18 @@ FolderDisplayWidget.prototype = {
       let bottomPercentPadding = Services.prefs.getIntPref(
                                  "mail.threadpane.padding.bottom_percent");
 
       // Assume the bottom row is half-visible and should generally be ignored.
       // (We could actually do the legwork to see if there is a partial one...)
       let paneHeight = this.treeBox.getPageLength() - 1;
 
       // Convert from percentages to absolute row counts.
-      topPadding = Math.ceil((topPercentPadding / 100)  * paneHeight);
-      bottomPadding = Math.ceil((bottomPercentPadding / 100)  * paneHeight);
+      topPadding = Math.ceil((topPercentPadding / 100) * paneHeight);
+      bottomPadding = Math.ceil((bottomPercentPadding / 100) * paneHeight);
 
       // We need one visible row not counted in either padding, for the actual
       //  target message. Also helps correct for rounding errors.
       if (topPadding + bottomPadding > paneHeight) {
         if (topPadding > bottomPadding)
           topPadding--;
         else
           bottomPadding--;
@@ -2479,18 +2439,17 @@ FolderDisplayWidget.prototype = {
    * By padding, we mean that the index will not be the first or last message
    *  displayed, but rather have messages on either side.
    * We have the concept of a 'lip' when we are at the end of the message
    *  display.  If we are near the end of the display, we want to show an
    *  empty row (at the bottom) so the user knows they are at the end.  Also,
    *  if a message shows up that is new and things are sorted ascending, this
    *  turns out to be useful.
    */
-  ensureRowIsVisible: function FolderDisplayWidget_ensureRowIsVisible(
-      aViewIndex, aBounced) {
+  ensureRowIsVisible(aViewIndex, aBounced) {
     // Dealing with the tree view layout is a nightmare, let's just always make
     //  sure we re-schedule ourselves.  The most particular rationale here is
     //  that the message pane may be toggling its state and it's much simpler
     //  and reliable if we ensure that all of FolderDisplayWidget's state
     //  change logic gets to run to completion before we run ourselves.
     if (!aBounced) {
       let dis = this;
       window.setTimeout(function() {
@@ -2536,19 +2495,17 @@ FolderDisplayWidget.prototype = {
    *  displayed in the thread pane, we bias towards showing the min row (with
    *  padding).
    *
    * @param aMinRow The numerically smallest row index defining the start of
    *     the inclusive range.
    * @param aMaxRow The numberically largest row index defining the end of the
    *     inclusive range.
    */
-  ensureRowRangeIsVisible:
-      function FolderDisplayWidget_ensureRowRangeIsVisible(aMinRow, aMaxRow,
-                                                           aBounced) {
+  ensureRowRangeIsVisible(aMinRow, aMaxRow, aBounced) {
     // Dealing with the tree view layout is a nightmare, let's just always make
     //  sure we re-schedule ourselves.  The most particular rationale here is
     //  that the message pane may be toggling its state and it's much simpler
     //  and reliable if we ensure that all of FolderDisplayWidget's state
     //  change logic gets to run to completion before we run ourselves.
     if (!aBounced) {
       let dis = this;
       window.setTimeout(function() {
@@ -2583,38 +2540,37 @@ FolderDisplayWidget.prototype = {
       target = aMinRow - halfSpare - topPadding;
     }
     treeBox.scrollToRow(target);
   },
 
   /**
    * Ensure that the selection is visible to the extent possible.
    */
-  ensureSelectionIsVisible:
-      function FolderDisplayWidget_ensureSelectionIsVisible() {
+  ensureSelectionIsVisible() {
     let treeSelection = this.treeSelection; // potentially magic getter
     if (!treeSelection || !treeSelection.count)
       return;
 
     let minRow = null, maxRow = null;
 
     let rangeCount = treeSelection.getRangeCount();
     for (let iRange = 0; iRange < rangeCount; iRange++) {
       let rangeMinObj = {}, rangeMaxObj = {};
       treeSelection.getRangeAt(iRange, rangeMinObj, rangeMaxObj);
       let rangeMin = rangeMinObj.value, rangeMax = rangeMaxObj.value;
       if (minRow == null || rangeMin < minRow)
         minRow = rangeMin;
-      if (maxRow == null || rangeMax > maxRow )
+      if (maxRow == null || rangeMax > maxRow)
         maxRow = rangeMax;
     }
 
     this.ensureRowRangeIsVisible(minRow, maxRow);
-  }
-  //@}
+  },
+  // @}
 };
 
 /**
  * Implement a fake nsITreeBoxObject so that we can keep the view
  *  nsITreeSelection selections 'live' when they are in the background.  We need
  *  to do this because nsTreeSelection changes its behaviour (and gets ornery)
  *  if it does not have a box object.
  * This does not need to exist once we abandon multiplexed tabbing.
@@ -2626,82 +2582,82 @@ FolderDisplayWidget.prototype = {
  *  whenever nsTreeSelection QIs us to nsIBoxObject.
  */
 function FakeTreeBoxObject(aDOMNode) {
   this.domNode = aDOMNode;
   this.view = null;
 }
 FakeTreeBoxObject.prototype = {
   view: null,
-  ensureRowIsVisible: function FakeTreeBoxObject_ensureRowIsVisible() {
+  ensureRowIsVisible() {
     // NOP
   },
   /**
    * No need to actually invalidate, as when we re-root the view this will
    *  happen.
    */
-  invalidate: function FakeTreeBoxObject_invalidate() {
+  invalidate() {
     // NOP
   },
-  invalidateRange: function FakeTreeBoxObject_invalidateRange() {
+  invalidateRange() {
     // NOP
   },
-  invalidateRow: function FakeTreeBoxObject_invalidateRow() {
+  invalidateRow() {
     // NOP
   },
-  beginUpdateBatch: function FakeTreeBoxObject_beginUpdateBatch() {
+  beginUpdateBatch() {
 
   },
-  endUpdateBatch: function FakeTreeBoxObject_endUpdateBatch() {
+  endUpdateBatch() {
 
   },
   /**
    * We're going to make an exception to our NOP rule here, as this is rather
    * important for us to pass on. The db view calls this if a row's been
    * inserted or deleted. Without this, the selection's going to be out of sync
    * with the view.
    *
    * @param aIndex the index where the rows have been inserted or deleted
    * @param aCount the number of rows inserted or deleted (negative for
    *               deleted)
    */
-  rowCountChanged: function FakeTreeBoxObject_rowCountChanged(aIndex, aCount) {
+  rowCountChanged(aIndex, aCount) {
     if (aCount == 0 || !this.view)
       // Nothing to do
       return;
 
     let selection = this.view.selection;
     if (selection)
       selection.adjustSelection(aIndex, aCount);
   },
-  get element() {return this.domNode;},
-  get x() {return this.domNode.boxObject.x},
-  get y() {return this.domNode.boxObject.y},
-  get screenX() {return this.domNode.boxObject.screenX},
-  get screenY() {return this.domNode.boxObject.screenY},
-  get width() {return this.domNode.boxObject.width},
-  get height()  {return this.domNode.boxObject.height},
-  get parentBox() {return this.domNode.boxObject.parentBox},
-  get firstChild() {return this.domNode.boxObject.firstChild},
-  get lastChild() {return this.domNode.boxObject.lastChild},
-  get nextSibling() {return this.domNode.boxObject.nextSibling},
-  get previousSibling() {return this.domNode.boxObject.previousSibling},
-  getPropertyAsSupports : function FakeTreeBoxObject_getPropertyAsSupports(propertyName) {
+  get element() { return this.domNode; },
+  get x() { return this.domNode.boxObject.x; },
+  get y() { return this.domNode.boxObject.y; },
+  get screenX() { return this.domNode.boxObject.screenX; },
+  get screenY() { return this.domNode.boxObject.screenY; },
+  get width() { return this.domNode.boxObject.width; },
+  get height() { return this.domNode.boxObject.height; },
+  get parentBox() { return this.domNode.boxObject.parentBox; },
+  get firstChild() { return this.domNode.boxObject.firstChild; },
+  get lastChild() { return this.domNode.boxObject.lastChild; },
+  get nextSibling() { return this.domNode.boxObject.nextSibling; },
+  get previousSibling() { return this.domNode.boxObject.previousSibling; },
+  getPropertyAsSupports(propertyName) {
     return this.domNode.boxObject.getPropertyAsSupports(propertyName);
   },
-  setPropertyAsSupports : function FakeTreeBoxObject_setPropertyAsSupports(propertyName, value) {
+  setPropertyAsSupports(propertyName, value) {
     this.domNode.boxObject.setPropertyAsSupports(propertyName, value);
   },
-  getProperty : function FakeTreeBoxObject_getProperty(propertyName) {
+  getProperty(propertyName) {
     return this.domNode.boxObject.getProperty(propertyName);
   },
-  setProperty : function FakeTreeBoxObject_setProperty(propertyName, value) {
+  setProperty(propertyName, value) {
     return this.domNode.boxObject.setProperty(propertyName, value);
   },
-  removeProperty : function FakeTreeBoxObject_removeProperty(propertyName) {
+  removeProperty(propertyName) {
     return this.domNode.boxObject.removeProperty(propertyName);
   },
   QueryInterface: ChromeUtils.generateQI(["nsIBoxObject",
                                           "nsITreeBoxObject"]),
 };
 /*
  * Provide attribute and function implementations that complain very loudly if
  *  they are used.  Now, XPConnect will return an error to callers if we don't
@@ -2712,35 +2668,32 @@ FakeTreeBoxObject.prototype = {
  */
 function FTBO_stubOutAttributes(aObj, aAttribNames) {
   for (let attrName of aAttribNames) {
     let myAttrName = attrName;
     aObj.__defineGetter__(attrName,
       function() {
         let msg = "Read access to stubbed attribute " + myAttrName;
         dump(msg + "\n");
-        debugger;
         throw new Error(msg);
       });
     aObj.__defineSetter__(attrName,
       function() {
         let msg = "Write access to stubbed attribute " + myAttrName;
         dump(msg + "\n");
-        debugger;
         throw new Error(msg);
       });
   }
 }
 function FTBO_stubOutMethods(aObj, aMethodNames) {
   for (let methodName of aMethodNames) {
     let myMethodName = methodName;
     aObj[myMethodName] = function() {
       let msg = "Call to stubbed method " + myMethodName;
       dump(msg + "\n");
-      debugger;
       throw new Error(msg);
     };
   }
 }
 FTBO_stubOutAttributes(FakeTreeBoxObject.prototype, [
   "columns",
   "focused",
   "treeBody",
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -3,17 +3,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Implements a tree of folders. It shows icons depending on folder type
 // and other fancy styling.
 // This is used in the main folder pane, but also some dialogs that need
 // to show a nice list of folders.
 
 ChromeUtils.import("resource:///modules/folderUtils.jsm");
-ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
+var {
+  fixIterator,
+  toXPCOMArray,
+} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 ChromeUtils.import("resource:///modules/IOUtils.js");
 ChromeUtils.import("resource:///modules/FeedUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 if (typeof FeedMessageHandler != "object")
   Services.scriptloader.loadSubScript("chrome://messenger-newsblog/content/newsblogOverlay.js");
@@ -43,17 +46,17 @@ var IFolderTreeMode = {
    * Generates the folder map for this mode.
    *
    * @param aFolderTreeView The gFolderTreeView for which this mode is being
    *     activated.
    *
    * @returns An array containing ftvItem instances representing the top-level
    *     folders in this view.
    */
-  generateMap: function IFolderTreeMode_generateMap(aFolderTreeView) {
+  generateMap(aFolderTreeView) {
     return null;
   },
 
   /**
    * Given an nsIMsgFolder, returns its parent in the map. The default behaviour
    * is to return the folder's actual parent (aFolder.parent). Folder tree modes
    * may decide to override it.
    *
@@ -63,17 +66,17 @@ var IFolderTreeMode = {
    *
    * @returns an nsIMsgFolder representing the parent of the folder in the view,
    *     or null if the folder is a top-level folder in the map. It is expected
    *     that the returned parent will have the given folder as one of its
    *     children.
    * @note This function need not guarantee that either the folder or its parent
    *       is actually in the view.
    */
-  getParentOfFolder: function IFolderTreeMode_getParentOfFolder(aFolder) {
+  getParentOfFolder(aFolder) {
     return aFolder.parent;
   },
 
   /**
    * Given an nsIMsgDBHdr, returns the folder it is considered to be contained
    * in, in this mode. This is usually just the physical folder it is contained
    * in (aMsgHdr.folder), but some modes may decide to override this. For
    * example, combined views like Smart Folders return the smart inbox for any
@@ -82,78 +85,78 @@ var IFolderTreeMode = {
    * The folder returned doesn't need to be in the view.
 
    * @returns The folder the message header is considered to be contained in, in
    *     this mode. The returned folder may or may not actually be in the view
    *     -- however, given a valid nsIMsgDBHdr, it is expected that a) a
    *     non-null folder is returned, and that b) the folder that is returned
    *     actually does contain the message header.
    */
-  getFolderForMsgHdr: function IFolderTreeMode_getFolderForMsgHdr(aMsgHdr) {
+  getFolderForMsgHdr(aMsgHdr) {
     return aMsgHdr.folder;
   },
 
   /**
    * Notified when a folder is added. The default behavior is to add it as a
    * child of the parent item, but some views may decide to override this. For
    * example, combined views like Smart Folders add any new inbox as a child of
    * the smart inbox.
    *
    * @param aParent The parent of the folder that was added.
    * @param aFolder The folder that was added.
    */
-  onFolderAdded: function IFolderTreeMode_onFolderAdded(aParent, aFolder) {
+  onFolderAdded(aParent, aFolder) {
     gFolderTreeView.addFolder(aParent, aFolder);
   },
 
   /**
    * Notified when a folder int property is changed.
    *
    * Returns true if the event was processed inside the function and no further
    * default handling should be done in the caller. Otherwise false.
    *
    * @param aItem      The folder with a change.
    * @param aProperty  The changed property string.
    * @param aOld       The old value of the property.
    * @param aNew       The new value of the property.
    */
-  handleChangedIntProperty: function(aItem, aProperty, aOld, aNew) {
+  handleChangedIntProperty(aItem, aProperty, aOld, aNew) {
     return false;
-  }
+  },
 };
 
 /**
  * This is our controller for the folder-tree. It includes our nsITreeView
  * implementation, as well as other control functions.
  */
 var gFolderTreeView = {
   messengerBundle: null,
 
   /**
    * Called when the window is initially loaded.  This function initializes the
    * folder-pane to the view last shown before the application was closed.
    */
-  load: function ftv_load(aTree, aJSONFile) {
+  load(aTree, aJSONFile) {
     this._treeElement = aTree;
     this.messengerBundle = document.getElementById("bundle_messenger");
 
     // the folder pane can be used for other trees which may not have these elements.
     if (document.getElementById("folderpane_splitter"))
       document.getElementById("folderpane_splitter").collapsed = false;
     if (document.getElementById("folderPaneBox"))
       document.getElementById("folderPaneBox").collapsed = false;
 
     try {
       // Normally our tree takes care of keeping the last selected by itself.
       // However older versions of TB stored this in a preference, which we need
       // to migrate
       let modeIndex = Services.prefs.getIntPref("mail.ui.folderpane.view");
       this._mode = this._modeNames[modeIndex];
       Services.prefs.deleteBranch("mail.ui.folderpane");
-    } catch(ex) {
+    } catch (ex) {
       // This is ok.  If we've already migrated we'll end up here
     }
 
     if (aJSONFile) {
       // Parse our persistent-open-state json file
       let data = IOUtils.loadFileToString(aJSONFile);
       if (data) {
         try {
@@ -179,17 +182,17 @@ var gFolderTreeView = {
     // Add this listener so that we can update the tree when things change
     MailServices.mailSession.AddFolderListener(this, Ci.nsIFolderListener.all);
   },
 
   /**
    * Called when the window is being torn down.  Here we undo everything we did
    * onload.  That means removing our listener and serializing our JSON.
    */
-  unload: function ftv_unload(aJSONFile) {
+  unload(aJSONFile) {
     // Remove our listener
     MailServices.mailSession.RemoveFolderListener(this);
 
     if (aJSONFile) {
       // Write out our json file...
       let data = JSON.stringify(this._persistOpenMap);
       IOUtils.saveStringToFile(aJSONFile, data);
     }
@@ -197,103 +200,100 @@ var gFolderTreeView = {
 
   /**
    * Extensions can use this function to add a new mode to the folder pane.
    *
    * @param aCommonName  an internal name to identify this mode. Must be unique
    * @param aMode An implementation of |IFolderTreeMode| for this mode.
    * @param aDisplayName  a localized name for this mode
    */
-  registerFolderTreeMode: function ftv_registerFolderTreeMode(aCommonName,
-                                                              aMode,
-                                                              aDisplayName) {
+  registerFolderTreeMode(aCommonName, aMode, aDisplayName) {
     this._modeNames.push(aCommonName);
     this._modes[aCommonName] = aMode;
     this._modeDisplayNames[aCommonName] = aDisplayName;
   },
 
   /**
    * Unregisters a previously registered mode. Since common-names must be unique
    * this is all that need be provided to unregister.
    * @param aCommonName  the common-name with which the mode was previously
    *                     registered
    */
-  unregisterFolderTreeMode: function ftv_unregisterFolderTreeMode(aCommonName) {
+  unregisterFolderTreeMode(aCommonName) {
     this._modeNames.splice(this._modeNames.indexOf(aCommonName), 1);
     delete this._modes[aCommonName];
     delete this._modeDisplayNames[aCommonName];
     if (this._mode == aCommonName)
       this.mode = kDefaultMode;
   },
 
   /**
    * Retrieves a specific mode object
    * @param aCommonName  the common-name with which the mode was previously
    *                     registered
    */
-  getFolderTreeMode: function ftv_getFolderTreeMode(aCommonName) {
+  getFolderTreeMode(aCommonName) {
     return this._modes[aCommonName];
   },
 
   /**
    * Called to move to the next/prev folder-mode in the list
    *
    * @param aForward  whether or not we should move forward in the list
    */
-  cycleMode: function ftv_cycleMode(aForward) {
+  cycleMode(aForward) {
     let index = this._modeNames.indexOf(this.mode);
     let offset = aForward ? 1 : this._modeNames.length - 1;
     index = (index + offset) % this._modeNames.length;
 
     this.mode = this._modeNames[index];
   },
 
   /**
    * If the hidden pref is set, then double-clicking on a folder should open it
    *
    * @param event  the double-click event
    */
-  onDoubleClick: function ftv_onDoubleClick(aEvent) {
+  onDoubleClick(aEvent) {
     if (aEvent.button != 0 || aEvent.originalTarget.localName == "twisty" ||
         aEvent.originalTarget.localName == "slider" ||
         aEvent.originalTarget.localName == "scrollbarbutton")
       return;
 
     let row = gFolderTreeView._treeElement.treeBoxObject.getRowAt(aEvent.clientX,
                                                                   aEvent.clientY);
     let folderItem = gFolderTreeView._rowMap[row];
     if (folderItem)
       folderItem.command();
 
     // Don't let the double-click toggle the open state of the folder here
     aEvent.stopPropagation();
   },
 
-  getFolderAtCoords: function ftv_getFolderAtCoords(aX, aY) {
+  getFolderAtCoords(aX, aY) {
     let row = gFolderTreeView._treeElement.treeBoxObject.getRowAt(aX, aY);
     if (row in gFolderTreeView._rowMap)
       return gFolderTreeView._rowMap[row]._folder;
     return null;
   },
 
   /**
    * Toggle displaying the headers of columns in the folder pane.
    * @param aSetup  Set to true if the columns should be set up according
    *                to the pref, not toggle them.
    */
-  toggleCols: function(aSetup = false) {
+  toggleCols(aSetup = false) {
     if (this._treeElement.getAttribute("simplelist") == "true")
       return;
     let hide = Services.prefs.getBoolPref("mail.folderpane.showColumns");
     if (aSetup)
       hide = !hide;
     this._treeElement.setAttribute("hidecolumnpicker", hide ? "true" : "false");
     for (let columnName of ["folderNameCol", "folderUnreadCol",
-                            "folderTotalCol", "folderSizeCol"])
-    {
+                            "folderTotalCol", "folderSizeCol"]) {
       let column = document.getElementById(columnName);
       if (!column)
         continue;
       if (hide) {
         column.setAttribute("hideheader", "true");
         column.removeAttribute("label");
         if (columnName != "folderNameCol") {
           if (!aSetup) {
@@ -327,28 +327,28 @@ var gFolderTreeView = {
       Services.prefs.setBoolPref("mail.folderpane.showColumns", !hide);
   },
 
   /**
    * Toggles the compact view of the current mode.
    *
    * @param aCompact  Boolean telling whether compact view should be enabled.
    */
-  toggleCompact: function(aCompact) {
+  toggleCompact(aCompact) {
     let targetMode = this.fullMode(this.baseMode(), aCompact);
     this.mode = targetMode;
   },
 
   /**
    * Toggles the folder mode, but tries to keep the "compact" variant the same
    * as the previous mode.
    *
    * @param aMode  The base name of the new mode selected.
    */
-  toggleMode: function(aMode) {
+  toggleMode(aMode) {
     // Take the base name and add compact variant according to the state of the
     // "Compact" checkbox in the UI.
     let userMode = this.fullMode(aMode,
         document.getElementById("appmenu_compactFolderView").hasAttribute("checked"));
 
     // Some combinations of user selection and "Compact view" checkbox are not supported.
     // In that case fall back to a version of this mode that exists.
     if (!(userMode in this._modes)) {
@@ -364,17 +364,17 @@ var gFolderTreeView = {
 
   /**
    * Update state of checkboxes according to currently selected mode.
    * Synchronize the state of our 2 "compact" menuitems and decide if they
    * should be disabled.
    *
    * @param aMode  The current folder mode.
    */
-  _updateCompactState: function(aMode) {
+  _updateCompactState(aMode) {
     let checked = aMode.endsWith("_compact");
     let menuitem = document.getElementById("menu_compactFolderView");
     let appmenuitem = document.getElementById("appmenu_compactFolderView");
     if (checked) {
       if (menuitem)
        menuitem.setAttribute("checked", "true");
       if (appmenuitem)
         appmenuitem.setAttribute("checked", "true");
@@ -427,40 +427,40 @@ var gFolderTreeView = {
   },
 
   /**
    * Name of the mode without the _compact suffix, used e.g. in the menulists.
    *
    * @param aMode  If set, construct the base name from this mode name instead
    *               of the currently active one.
    */
-  baseMode: function(aMode) {
+  baseMode(aMode) {
     if (!aMode)
       aMode = this.mode;
 
     return aMode.replace(/_compact$/, "");
   },
 
   /**
    * Name of the mode including the _compact suffix if appropriate.
    *
    * @param aMode  If set, construct the base name from this mode name instead
    *               of the currently active one.
    * @param aCOmpact  Bool value whether to force adding the suffix or not.
    */
-  fullMode: function(aMode, aCompact) {
+  fullMode(aMode, aCompact) {
     if (!aMode)
       aMode = this.mode;
     if (aCompact == undefined)
       aCompact = aMode.endsWith("_compact");
 
     return this.baseMode(aMode) + (aCompact ? "_compact" : "");
   },
 
-  _initFolderModeSelector: function() {
+  _initFolderModeSelector() {
     // Populate the mode selector menulist on the toolbar.
     let fullModes = [];
     let compactModes = [];
     for (let mode of this._modeNames) {
       let array = mode.endsWith("_compact") ? compactModes : fullModes;
       array.push(mode);
     }
 
@@ -493,17 +493,17 @@ var gFolderTreeView = {
 
     if ((fullModes.length > 0) && (compactModes.length > 0))
       modeSelector.menupopup.appendChild(document.createElement("menuseparator"));
 
     for (let mode of compactModes)
       appendMode(mode);
   },
 
-  _selectModeInSelector: function(aMode) {
+  _selectModeInSelector(aMode) {
     // Show the mode in the mode selector, if it is on a toolbar.
     let modeSelector = document.getElementById("folderpane-mode-selector");
     if (modeSelector) {
       if (!modeSelector.querySelector('[value="' + aMode + '"]'))
         this._initFolderModeSelector();
       modeSelector.firstChild.value = aMode;
     }
   },
@@ -515,17 +515,17 @@ var gFolderTreeView = {
    *
    * @param aFolder  the nsIMsgFolder to select
    * @param [aForceSelect] Whether we should switch to the default mode to
    *      select the folder in case we didn't find the folder in the current
    *      view. Defaults to false.
    * @returns true if the folder selection was successful, false if it failed
    *     (probably because the folder isn't in the view at all)
    */
-  selectFolder: function ftv_selectFolder(aFolder, aForceSelect = false) {
+  selectFolder(aFolder, aForceSelect = false) {
     // "this" inside the nested function refers to the function...
     // Also note that openIfNot is recursive.
     let tree = this;
     let folderTreeMode = this._modes[this._mode];
     function openIfNot(aFolderToOpen) {
       let index = tree.getIndexOfFolder(aFolderToOpen);
       if (index != null) {
         if (!tree._rowMap[index].open)
@@ -572,77 +572,77 @@ var gFolderTreeView = {
   /**
    * Returns the index of a folder in the current display.
    *
    * @param aFolder  the folder whose index should be returned.
    * @returns The index of the folder in the view (a number).
    * @note If the folder is not in the display (perhaps because one of its
    *       anscetors is collapsed), this function returns null.
    */
-  getIndexOfFolder: function ftv_getIndexOfFolder(aFolder) {
+  getIndexOfFolder(aFolder) {
     for (let [iRow, row] of this._rowMap.entries()) {
       if (row.id == aFolder.URI)
         return iRow;
     }
     return null;
   },
 
   /**
    * Returns the folder for an index in the current display.
    *
    * @param aIndex the index for which the folder should be returned.
    * @note If the index is out of bounds, this function returns null.
    */
-  getFolderForIndex: function ftv_getFolderForIndex(aIndex) {
+  getFolderForIndex(aIndex) {
     if (aIndex < 0 || aIndex >= this._rowMap.length)
       return null;
     return this._rowMap[aIndex]._folder;
   },
 
   /**
    * Returns the parent of a folder in the current view. This may be, but is not
    * necessarily, the actual parent of the folder (aFolder.parent). In
    * particular, in the smart view, special folders are usually children of the
    * smart folder of that kind.
    *
    * @param aFolder The folder to get the parent of.
    * @returns The parent of the folder, or null if the parent wasn't found.
    * @note This function does not guarantee that either the folder or its parent
    *       is actually in the view.
    */
-  getParentOfFolder: function ftv_getParentOfFolder(aFolder) {
+  getParentOfFolder(aFolder) {
     return this._modes[this._mode].getParentOfFolder(aFolder);
   },
 
   /**
    * Given an nsIMsgDBHdr, returns the folder it is considered to be contained
    * in, in the current mode. This is usually, but not necessarily, the actual
    * folder the message is in (aMsgHdr.folder). For more details, see
    * |IFolderTreeMode.getFolderForMsgHdr|.
    */
-  getFolderForMsgHdr: function ftv_getFolderForMsgHdr(aMsgHdr) {
+  getFolderForMsgHdr(aMsgHdr) {
     return this._modes[this._mode].getFolderForMsgHdr(aMsgHdr);
   },
 
   /**
    * Returns the |ftvItem| for an index in the current display. Intended for use
    * by folder tree mode implementers.
    *
    * @param aIndex The index for which the ftvItem should be returned.
    * @note If the index is out of bounds, this function returns null.
    */
-  getFTVItemForIndex: function ftv_getFTVItemForIndex(aIndex) {
+  getFTVItemForIndex(aIndex) {
     return this._rowMap[aIndex];
   },
 
   /**
    * Returns an array of nsIMsgFolders corresponding to the current selection
    * in the tree
    */
-  getSelectedFolders: function ftv_getSelectedFolders() {
+  getSelectedFolders() {
     let selection = this.selection;
     if (!selection)
       return [];
 
     let folderArray = [];
     let rangeCount = selection.getRangeCount();
     for (let i = 0; i < rangeCount; i++) {
       let startIndex = {};
@@ -660,30 +660,31 @@ var gFolderTreeView = {
    * Adds a new child |ftvItem| to the given parent |ftvItem|. Intended for use
    * by folder tree mode implementers.
    *
    * @param aParentItem The parent ftvItem. It is assumed that this is visible
    *     in the view.
    * @param aParentIndex The index of the parent ftvItem in the view.
    * @param aItem The item to add.
    */
-  addChildItem: function ftv_addChildItem(aParentItem, aParentIndex, aItem) {
+  addChildItem(aParentItem, aParentIndex, aItem) {
     this._addChildToView(aParentItem, aParentIndex, aItem);
   },
 
   // ****************** Start of nsITreeView implementation **************** //
 
   get rowCount() {
     return this._rowMap.length;
   },
 
   /**
    * drag drop interfaces
    */
-  canDrop: function ftv_canDrop(aRow, aOrientation) {
+  /* eslint-disable complexity */
+  canDrop(aRow, aOrientation) {
     let targetFolder = gFolderTreeView._rowMap[aRow]._folder;
     if (!targetFolder)
       return false;
     let dt = this._currentTransfer;
     let types = Array.from(dt.mozTypesAt(0));
     if (types.includes("text/x-moz-message")) {
       if (aOrientation != Ci.nsITreeView.DROP_ON)
         return false;
@@ -696,32 +697,31 @@ var gFolderTreeView = {
       let messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
       for (let i = 0; i < dt.mozItemCount; i++) {
         let msgHdr = messenger.msgHdrFromURI(dt.mozGetDataAt("text/x-moz-message", i));
         // Don't allow drop onto original folder.
         if (msgHdr.folder == targetFolder)
           return false;
       }
       return true;
-    }
-    else if (types.includes("text/x-moz-folder")) {
+    } else if (types.includes("text/x-moz-folder")) {
       if (aOrientation != Ci.nsITreeView.DROP_ON)
         return false;
       // If cannot create subfolders then don't allow drop here.
       if (!targetFolder.canCreateSubfolders)
         return false;
       for (let i = 0; i < dt.mozItemCount; i++) {
         let folder = dt.mozGetDataAt("text/x-moz-folder", i)
                        .QueryInterface(Ci.nsIMsgFolder);
         // Don't allow to drop on itself.
         if (targetFolder == folder)
           return false;
         // Don't copy within same server.
         if ((folder.server == targetFolder.server) &&
-             (dt.dropEffect == 'copy'))
+             (dt.dropEffect == "copy"))
           return false;
         // Don't allow immediate child to be dropped onto its parent.
         if (targetFolder == folder.parent)
           return false;
         // Don't allow dragging of virtual folders across accounts.
         if ((folder.getFlag(Ci.nsMsgFolderFlags.Virtual)) &&
             folder.server != targetFolder.server)
           return false;
@@ -730,18 +730,17 @@ var gFolderTreeView = {
           return false;
         // If there is a folder that can't be renamed, don't allow it to be
         // dropped if it is not to "Local Folders" or is to the same account.
         if (!folder.canRename && (targetFolder.server.type != "none" ||
                                   folder.server == targetFolder.server))
           return false;
       }
       return true;
-    }
-    else if (types.includes("text/x-moz-newsfolder")) {
+    } else if (types.includes("text/x-moz-newsfolder")) {
       // Don't allow dragging onto element.
       if (aOrientation == Ci.nsITreeView.DROP_ON)
         return false;
       // Don't allow drop onto server itself.
       if (targetFolder.isServer)
         return false;
       for (let i = 0; i < dt.mozItemCount; i++) {
         let folder = dt.mozGetDataAt("text/x-moz-newsfolder", i)
@@ -755,65 +754,64 @@ var gFolderTreeView = {
         // Don't allow dragging newsgroup to before item after or
         // after item before.
         let row = aRow + aOrientation;
         if (row in gFolderTreeView._rowMap &&
             (gFolderTreeView._rowMap[row]._folder == folder))
           return false;
       }
       return true;
-    }
-    // Allow subscribing to feeds by dragging an url to a feed account.
-    else if (targetFolder.server.type == "rss" && dt.mozItemCount == 1)
-      return FeedUtils.getFeedUriFromDataTransfer(dt) ? true : false;
-    else if (types.includes("application/x-moz-file")) {
+    } else if (targetFolder.server.type == "rss" && dt.mozItemCount == 1) {
+      // Allow subscribing to feeds by dragging an url to a feed account.
+      return !!FeedUtils.getFeedUriFromDataTransfer(dt);
+    } else if (types.includes("application/x-moz-file")) {
       if (aOrientation != Ci.nsITreeView.DROP_ON)
         return false;
       // Don't allow drop onto server itself.
       if (targetFolder.isServer)
         return false;
       // Don't allow drop into a folder that cannot take messages.
       if (!targetFolder.canFileMessages)
         return false;
       for (let i = 0; i < dt.mozItemCount; i++) {
         let extFile = dt.mozGetDataAt("application/x-moz-file", i)
                         .QueryInterface(Ci.nsIFile);
         return extFile.isFile();
       }
     }
     return false;
   },
-  drop: function ftv_drop(aRow, aOrientation) {
+  /* eslint-enable complexity */
+  drop(aRow, aOrientation) {
     let targetFolder = gFolderTreeView._rowMap[aRow]._folder;
 
     let dt = this._currentTransfer;
     let count = dt.mozItemCount;
     let cs = MailServices.copy;
 
     // This is a potential rss feed.  A link image as well as link text url
     // should be handled; try to extract a url from non moz apps as well.
     let feedUri = targetFolder.server.type == "rss" && count == 1 ?
                     FeedUtils.getFeedUriFromDataTransfer(dt) : null;
 
     // we only support drag of a single flavor at a time.
     let types = Array.from(dt.mozTypesAt(0));
     if (types.includes("text/x-moz-folder")) {
       for (let i = 0; i < count; i++) {
-        let folders = new Array;
+        let folders = [];
         folders.push(dt.mozGetDataAt("text/x-moz-folder", i)
                        .QueryInterface(Ci.nsIMsgFolder));
         let array = toXPCOMArray(folders, Ci.nsIMutableArray);
         cs.CopyFolders(array, targetFolder,
                       (folders[0].server == targetFolder.server), null,
                        msgWindow);
       }
-    }
-    else if (types.includes("text/x-moz-newsfolder")) {
+    } else if (types.includes("text/x-moz-newsfolder")) {
       // Start by getting folders into order.
-      let folders = new Array;
+      let folders = [];
       for (let i = 0; i < count; i++) {
         let folder = dt.mozGetDataAt("text/x-moz-newsfolder", i)
                        .QueryInterface(Ci.nsIMsgFolder);
         folders[this.getIndexOfFolder(folder)] = folder;
       }
       let newsFolder = targetFolder.rootFolder
                                    .QueryInterface(Ci.nsIMsgNewsFolder);
       // When moving down, want to insert first one last.
@@ -822,18 +820,17 @@ var gFolderTreeView = {
       while (i >= 0 && i < folders.length) {
         let folder = folders[i];
         if (folder) {
           newsFolder.moveFolder(folder, targetFolder, aOrientation);
           this.selection.toggleSelect(this.getIndexOfFolder(folder));
         }
         i -= aOrientation;
       }
-    }
-    else if (types.includes("text/x-moz-message")) {
+    } else if (types.includes("text/x-moz-message")) {
       let array = Cc["@mozilla.org/array;1"]
                     .createInstance(Ci.nsIMutableArray);
       let sourceFolder;
       let messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
       for (let i = 0; i < count; i++) {
         let msgHdr = messenger.msgHdrFromURI(dt.mozGetDataAt("text/x-moz-message", i));
         if (!i)
           sourceFolder = msgHdr.folder;
@@ -847,87 +844,84 @@ var gFolderTreeView = {
         isMove = false;
 
       prefBranch.setCharPref("last_msg_movecopy_target_uri", targetFolder.URI);
       prefBranch.setBoolPref("last_msg_movecopy_was_move", isMove);
       // ### ugh, so this won't work with cross-folder views. We would
       // really need to partition the messages by folder.
       cs.CopyMessages(sourceFolder, array, targetFolder, isMove, null,
                         msgWindow, true);
-    }
-    else if (feedUri) {
+    } else if (feedUri) {
       Cc["@mozilla.org/newsblog-feed-downloader;1"]
          .getService(Ci.nsINewsBlogFeedDownloader)
          .subscribeToFeed(feedUri.spec, targetFolder, msgWindow);
-    }
-    else if (types.includes("application/x-moz-file")) {
+    } else if (types.includes("application/x-moz-file")) {
       for (let i = 0; i < count; i++) {
         let extFile = dt.mozGetDataAt("application/x-moz-file", i)
                         .QueryInterface(Ci.nsIFile);
         if (extFile.isFile()) {
           let len = extFile.leafName.length;
           if (len > 4 && extFile.leafName.toLowerCase().endsWith(".eml"))
             cs.CopyFileMessage(extFile, targetFolder, null, false, 1, "", null, msgWindow);
         }
       }
     }
   },
 
-  _onDragStart: function ftv_dragStart(aEvent) {
+  _onDragStart(aEvent) {
     // Ugh, this is ugly but necessary
     let view = gFolderTreeView;
 
     if (aEvent.originalTarget.localName != "treechildren")
       return;
 
     let folders = view.getSelectedFolders();
     folders = folders.filter(function(f) { return !f.isServer; });
     for (let i in folders) {
       let flavor = folders[i].server.type == "nntp" ? "text/x-moz-newsfolder" :
                                                       "text/x-moz-folder";
       aEvent.dataTransfer.mozSetDataAt(flavor, folders[i], i);
     }
     aEvent.dataTransfer.effectAllowed = "copyMove";
     aEvent.dataTransfer.addElement(aEvent.originalTarget);
-    return;
   },
 
-  _onDragOver: function ftv_onDragOver(aEvent) {
+  _onDragOver(aEvent) {
     this._currentTransfer = aEvent.dataTransfer;
   },
 
-  _onDragDrop: function ftv_onDragDrop(aEvent) {
+  _onDragDrop(aEvent) {
     this._currentTransfer = aEvent.dataTransfer;
   },
 
   /**
    * CSS files will cue off of these.  Note that we reach into the rowMap's
    * items so that custom data-displays can define their own properties
    */
-  getCellProperties: function ftv_getCellProperties(aRow, aCol) {
+  getCellProperties(aRow, aCol) {
     return this._rowMap[aRow].getProperties(aCol);
   },
 
   /**
    * The actual text to display in the tree
    */
-  getCellText: function ftv_getCellText(aRow, aCol) {
+  getCellText(aRow, aCol) {
     if ((aCol.id == "folderNameCol") ||
         (aCol.id == "folderUnreadCol") ||
         (aCol.id == "folderTotalCol") ||
         (aCol.id == "folderSizeCol"))
       return this._rowMap[aRow].getText(aCol.id);
     return "";
   },
 
   /**
    * For feed folders get, cache, and return a favicon. Otherwise return "" to
    * let css set the image per nsITreeView requirements.
    */
-  getImageSrc: function(aRow, aCol) {
+  getImageSrc(aRow, aCol) {
     if (aCol.id != "folderNameCol")
       return "";
 
     let rowItem = gFolderTreeView._rowMap[aRow];
     let folder = rowItem._folder;
     if (folder.server.type != "rss" || folder.isServer)
       return "";
 
@@ -945,117 +939,119 @@ var gFolderTreeView = {
     });
 
     // Cache empty string initially to return default while getting favicon,
     // so as to never return here. Alternatively, a blank image could be cached.
     this.setFolderCacheProperty(folder, "favicon", "");
 
 
     if (this._treeElement.getAttribute("simplelist") == "true")
-      return;
+      return "";
 
     // On startup, allow the ui to paint first before spawning potentially
     // many requests for favicons, even though they are async.
     setTimeout(() => {
       FeedUtils.getFavicon(folder, null, favicon, window, callback);
     }, 0);
+
+    return "";
   },
 
   /**
    * The ftvItems take care of assigning this when created.
    */
-  getLevel: function ftv_getLevel(aIndex) {
+  getLevel(aIndex) {
     return this._rowMap[aIndex].level;
   },
 
   /**
    * The ftvItems take care of assigning this when building children lists
    */
-  getServerNameAdded: function ftv_getServerNameAdded(aIndex) {
+  getServerNameAdded(aIndex) {
     return this._rowMap[aIndex].addServerName;
   },
 
   /**
    * This is easy since the ftv items assigned the _parent property when making
    * the child lists
    */
-  getParentIndex: function ftv_getParentIndex(aIndex) {
+  getParentIndex(aIndex) {
     return this._rowMap.indexOf(this._rowMap[aIndex]._parent);
   },
 
   /**
    * This is duplicative for our normal ftv views, but custom data-displays may
    * want to do something special here
    */
-  getRowProperties: function ftv_getRowProperties(aRow) {
+  getRowProperties(aRow) {
     return this._rowMap[aRow].getProperties();
   },
 
   /**
    * Check whether there are any more rows with our level before the next row
    * at our parent's level
    */
-  hasNextSibling: function ftv_hasNextSibling(aIndex, aNextIndex) {
+  hasNextSibling(aIndex, aNextIndex) {
     var currentLevel = this._rowMap[aIndex].level;
     for (var i = aNextIndex + 1; i < this._rowMap.length; i++) {
       if (this._rowMap[i].level == currentLevel)
         return true;
       if (this._rowMap[i].level < currentLevel)
         return false;
     }
     return false;
   },
 
   /**
    * All folders are containers, so we can drag drop messages to them.
    */
-  isContainer: function ftv_isContainer(aIndex) {
+  isContainer(aIndex) {
     return true;
   },
 
-  isContainerEmpty: function ftv_isContainerEmpty(aIndex) {
+  isContainerEmpty(aIndex) {
     // If the folder has no children, the container is empty.
     return !this._rowMap[aIndex].children.length;
   },
 
   /**
    * Just look at the ftvItem here
    */
-  isContainerOpen: function ftv_isContainerOpen(aIndex) {
+  isContainerOpen(aIndex) {
     return this._rowMap[aIndex].open;
   },
-  getSummarizedCounts: function(aIndex, aColName) {
+  getSummarizedCounts(aIndex, aColName) {
     return this._rowMap[aIndex]._summarizedCounts.get(aColName);
   },
-  isEditable: function ftv_isEditable(aRow, aCol) {
+  isEditable(aRow, aCol) {
     // We don't support editing rows in the tree yet.  We may want to later as
     // an easier way to rename folders.
     return false;
   },
-  isSeparator: function ftv_isSeparator(aIndex) {
+  isSeparator(aIndex) {
     // There are no separators in our trees
     return false;
   },
-  isSorted: function ftv_isSorted() {
+  isSorted() {
     // We do our own customized sorting
     return false;
   },
-  setTree: function ftv_setTree(aTree) {
+  setTree(aTree) {
     this._tree = aTree;
   },
 
   /**
    * Opens or closes a folder with children.  The logic here is a bit hairy, so
    * be very careful about changing anything.
    */
-  toggleOpenState: function ftv_toggleOpenState(aIndex) {
+  toggleOpenState(aIndex) {
     this._toggleRow(aIndex, true);
   },
 
-  recursivelyAddToMap: function ftv_recursivelyAddToMap(aChild, aNewIndex) {
+  recursivelyAddToMap(aChild, aNewIndex) {
     // When we add sub-children, we're going to need to increase our index
     // for the next add item at our own level.
     let count = 0;
     if (aChild.children.length && aChild.open) {
       for (let [i, child] of Array.from(this._rowMap[aNewIndex].children).entries()) {
         count++;
         let index = Number(aNewIndex) + Number(i) + 1;
         this._rowMap.splice(index, 0, child);
@@ -1064,18 +1060,17 @@ var gFolderTreeView = {
         count += kidsAdded;
         // Somehow the aNewIndex turns into a string without this.
         aNewIndex = Number(aNewIndex) + kidsAdded;
       }
     }
     return count;
   },
 
-  _toggleRow: function toggleRow(aIndex, aExpandServer)
-  {
+  _toggleRow(aIndex, aExpandServer) {
     // Ok, this is a bit tricky.
     this._rowMap[aIndex].open = !this._rowMap[aIndex].open;
     if (!this._rowMap[aIndex].open) {
       // We're closing the current container.  Remove the children
 
       // Note that we can't simply splice out children.length, because some of
       // them might have children too.  Find out how many items we're actually
       // going to splice
@@ -1122,44 +1117,41 @@ var gFolderTreeView = {
         if (folder.isServer)
           folder.server.performExpand(msgWindow);
         else if (folder instanceof Ci.nsIMsgImapMailFolder)
           folder.performExpand(msgWindow);
       }
     }
   },
 
-  _subFoldersWithStringProperty: function ftv_subFoldersWithStringProperty(folder, folders, aFolderName, deep)
-  {
+  _subFoldersWithStringProperty(folder, folders, aFolderName, deep) {
     for (let child of fixIterator(folder.subFolders, Ci.nsIMsgFolder)) {
       // if the folder selection is based on a string property, use that
       if (aFolderName == getSmartFolderName(child)) {
         folders.push(child);
         // Add sub-folders if requested.
         if (deep)
           this.addSubFolders(child, folders);
-      }
-      else
+      } else {
         // if this folder doesn't have a property set, check Its children
         this._subFoldersWithStringProperty(child, folders, aFolderName, deep);
+      }
     }
   },
 
-  _allFoldersWithStringProperty: function ftv_getAllFoldersWithProperty(accounts, aFolderName, deep)
-  {
+  _allFoldersWithStringProperty(accounts, aFolderName, deep) {
     let folders = [];
     for (let acct of accounts) {
       let folder = acct.incomingServer.rootFolder;
       this._subFoldersWithStringProperty(folder, folders, aFolderName, deep);
     }
     return folders;
   },
 
-  _allFoldersWithFlag: function ftv_getAllFolders(accounts, aFolderFlag, deep)
-  {
+  _allFoldersWithFlag(accounts, aFolderFlag, deep) {
     let folders = [];
     for (let acct of accounts) {
       let foldersWithFlag = acct.incomingServer.rootFolder.getFoldersWithFlags(aFolderFlag);
       if (foldersWithFlag.length > 0) {
         for (let folderWithFlag of fixIterator(foldersWithFlag,
                                                Ci.nsIMsgFolder)) {
           folders.push(folderWithFlag);
           // Add sub-folders of Sent and Archive to the result.
@@ -1169,17 +1161,17 @@ var gFolderTreeView = {
       }
     }
     return folders;
   },
 
   /**
    * get folders by flag or property based on the value of flag
    */
-  _allSmartFolders: function ftv_allSmartFolders(accounts, flag, folderName, deep) {
+  _allSmartFolders(accounts, flag, folderName, deep) {
     return flag ?
       gFolderTreeView._allFoldersWithFlag(accounts, flag, deep) :
       gFolderTreeView._allFoldersWithStringProperty(accounts, folderName, deep);
   },
 
   /**
    * Add a smart folder for folders with the passed flag set. But if there's
    * only one folder with the flag set, just put it at the top level.
@@ -1188,19 +1180,17 @@ var gFolderTreeView = {
    * @param accounts array of accounts.
    * @param smartRootFolder root folder of the smart folders server
    * @param flag folder flag to create smart folders for
    * @param folderName name to give smart folder
    * @param position optional place to put folder item in map. If not specified,
    *                 folder item will be appended at the end of map.
    * @returns The smart folder's ftvItem if one was added, null otherwise.
    */
-  _addSmartFoldersForFlag: function ftv_addSFForFlag(map, accounts, smartRootFolder,
-                                                     flag, folderName, position)
-  {
+  _addSmartFoldersForFlag(map, accounts, smartRootFolder, flag, folderName, position) {
     // If there's only one subFolder, just put it at the root.
     let subFolders = gFolderTreeView._allSmartFolders(accounts, flag, folderName, false);
     if (flag && subFolders.length == 1) {
       let folderItem = new ftvItem(subFolders[0]);
       folderItem._level = 0;
       if (flag & Ci.nsMsgFolderFlags.Inbox)
         folderItem.__defineGetter__("children", () => []);
       if (position == undefined)
@@ -1212,23 +1202,23 @@ var gFolderTreeView = {
     }
 
     let smartFolder;
     try {
       let folderUri = smartRootFolder.URI + "/" + encodeURI(folderName);
       smartFolder = smartRootFolder.getChildWithURI(folderUri, false, true);
     } catch (ex) {
         smartFolder = null;
-    };
+    }
     if (!smartFolder) {
       let searchFolders = gFolderTreeView._allSmartFolders(accounts, flag, folderName, true);
       let searchFolderURIs = "";
       for (let searchFolder of searchFolders) {
         if (searchFolderURIs.length)
-          searchFolderURIs += '|';
+          searchFolderURIs += "|";
         searchFolderURIs +=  searchFolder.URI;
       }
       if (!searchFolderURIs.length)
         return null;
       smartFolder = gFolderTreeView._createVFFolder(folderName, smartRootFolder,
                                                     searchFolderURIs, flag);
     }
 
@@ -1245,83 +1235,81 @@ var gFolderTreeView = {
 
     let prevChild = null;
     // Each child is a level one below the smartFolder
     for (let child of smartFolderItem._children) {
       child._level = smartFolderItem._level + 1;
       child._parent = smartFolderItem;
       // don't show sub-folders of the inbox, but I think Archives/Sent, etc
       // should have the sub-folders.
-      if (flag & Ci.nsMsgFolderFlags.Inbox)
+      if (flag & Ci.nsMsgFolderFlags.Inbox) {
         child.__defineGetter__("children", () => []);
+      }
       // If we have consecutive children with the same server, then both
       // should display as folder - server.
       if (prevChild && (child._folder.server == prevChild._folder.server)) {
         child.addServerName = true;
         prevChild.addServerName = true;
         prevChild.useServerNameOnly = false;
-      }
-      else if (flag)
+      } else if (flag) {
         child.useServerNameOnly = true;
-      else
+      } else {
         child.addServerName = true;
+      }
       prevChild = child;
     }
     // new custom folders from addons may contain lots of children, sort them
     if (flag == 0)
       sortFolderItems(smartFolderItem._children);
     return smartFolderItem;
   },
-  _createVFFolder: function ftv_createVFFolder(newName, parentFolder,
-                                               searchFolderURIs, folderFlag)
-  {
+  _createVFFolder(newName, parentFolder, searchFolderURIs, folderFlag) {
     let newFolder;
     try {
-      if (parentFolder instanceof(Ci.nsIMsgLocalMailFolder))
+      if (parentFolder instanceof Ci.nsIMsgLocalMailFolder)
         newFolder = parentFolder.createLocalSubfolder(newName);
       else
         newFolder = parentFolder.addSubfolder(newName);
       newFolder.setFlag(Ci.nsMsgFolderFlags.Virtual);
       // provide a way to make the top level folder just a container, not
       // a search folder
-      let type = this._modes["smart"].getSmartFolderTypeByName(newName);
+      let type = this._modes.smart.getSmartFolderTypeByName(newName);
       if (type[3]) { // isSearch
         let vfdb = newFolder.msgDatabase;
         let dbFolderInfo = vfdb.dBFolderInfo;
         // set the view string as a property of the db folder info
         // set the original folder name as well.
         dbFolderInfo.setCharProperty("searchStr", "ALL");
         dbFolderInfo.setCharProperty("searchFolderUri", searchFolderURIs);
         dbFolderInfo.setUint32Property("searchFolderFlag", folderFlag);
         dbFolderInfo.setBooleanProperty("searchOnline", true);
         vfdb.summaryValid = true;
         vfdb.Close(true);
       }
       parentFolder.NotifyItemAdded(newFolder);
       MailServices.accounts.saveVirtualFolders();
-    }
-    catch(e) {
-       throw(e);
-       dump ("Exception : creating virtual folder \n");
+    } catch (e) {
+      dump("Exception : creating virtual folder \n");
+      throw e;
     }
     return newFolder;
   },
 
   // We don't implement any of these at the moment
-  performAction: function ftv_performAction(aAction) {},
-  performActionOnCell: function ftv_performActionOnCell(aAction, aRow, aCol) {},
-  performActionOnRow: function ftv_performActionOnRow(aAction, aRow) {},
-  selectionChanged: function ftv_selectionChanged() {},
-  setCellText: function ftv_setCellText(aRow, aCol, aValue) {},
-  setCellValue: function ftv_setCellValue(aRow, aCol, aValue) {},
-  getCellValue: function ftv_getCellValue(aRow, aCol) {},
-  getColumnProperties: function ftv_getColumnProperties(aCol) { return ""; },
-  getProgressMode: function ftv_getProgressMode(aRow, aCol) {},
-  cycleCell: function ftv_cycleCell(aRow, aCol) {},
-  cycleHeader: function ftv_cycleHeader(aCol) {},
+  performAction(aAction) {},
+  performActionOnCell(aAction, aRow, aCol) {},
+  performActionOnRow(aAction, aRow) {},
+  selectionChanged() {},
+  setCellText(aRow, aCol, aValue) {},
+  setCellValue(aRow, aCol, aValue) {},
+  getCellValue(aRow, aCol) {},
+  getColumnProperties(aCol) { return ""; },
+  getProgressMode(aRow, aCol) {},
+  cycleCell(aRow, aCol) {},
+  cycleHeader(aCol) {},
 
   // ****************** End of nsITreeView implementation **************** //
 
   //
   // WARNING: Everything below this point is considered private.  Touch at your
   //          own risk.
 
   /**
@@ -1342,17 +1330,17 @@ var gFolderTreeView = {
    * persist their state over-time.  It is designed to be used as a JSON object.
    */
   _persistOpenMap: {},
   _notPersistedModes: ["unread", "unread_compact", "favorite", "favorite_compact", "recent_compact"],
 
   /**
    * Iterate over the persistent list and open the items (folders) stored in it.
    */
-  _restoreOpenStates: function ftv__persistOpenStates() {
+  _restoreOpenStates() {
     let mode = this.mode;
     // Remove any saved state of modes where open state should not be persisted.
     // This is mostly for migration from older profiles that may have the info stored.
     if (this._notPersistedModes.includes(mode)) {
       delete this._persistOpenMap[mode];
     }
 
     let curLevel = 0;
@@ -1384,17 +1372,17 @@ var gFolderTreeView = {
   },
 
   /**
    * Remove the item from the persistent list, meaning the item should
    * be persisted as closed in the tree.
    *
    * @param aItemId  The URI of the folder item.
    */
-  _persistItemClosed: function ftv_unpersistItem(aItemId) {
+  _persistItemClosed(aItemId) {
     let mode = this.mode;
     if (this._notPersistedModes.includes(mode))
       return;
 
     // If the whole mode is not in the map yet,
     // we can silently ignore the folder removal.
     if (!this._persistOpenMap[mode])
       return;
@@ -1405,17 +1393,17 @@ var gFolderTreeView = {
   },
 
   /**
    * Add the item from the persistent list, meaning the item should
    * be persisted as open (expanded) in the tree.
    *
    * @param aItemId  The URI of the folder item.
    */
-  _persistItemOpen: function ftv_persistItem(aItemId) {
+  _persistItemOpen(aItemId) {
     let mode = this.mode;
     if (this._notPersistedModes.includes(mode))
       return;
 
     if (!this._persistOpenMap[mode])
       this._persistOpenMap[mode] = [];
 
     if (!this._persistOpenMap[mode].includes(aItemId))
@@ -1428,58 +1416,57 @@ var gFolderTreeView = {
    * An array of ftvItems, where each item corresponds to a row in the tree
    */
   _rowMap: null,
 
   /**
    * Completely discards the current tree and rebuilds it based on current
    * settings
    */
-  _rebuild: function ftv__rebuild() {
+  _rebuild() {
     let newRowMap;
     try {
       newRowMap = this._modes[this.mode].generateMap(this);
-    } catch(ex) {
+    } catch (ex) {
       Services.console.logStringMessage("generator " + this.mode + " failed with exception: " + ex);
       this.mode = kDefaultMode;
       newRowMap = this._modes[this.mode].generateMap(this);
     }
     let selectedFolders = this.getSelectedFolders();
     if (this.selection)
       this.selection.clearSelection();
     // There's a chance the call to the map generator altered this._rowMap, so
     // evaluate oldCount after calling it rather than before
     let oldCount = this._rowMap ? this._rowMap.length : null;
     this._rowMap = newRowMap;
 
     this._treeElement.dispatchEvent(new Event("mapRebuild",  // Introduced in bug 474822 for add-ons.
       { bubbles: true, cancelable: false }));
 
-    if (this._tree)
-    {
+    if (this._tree) {
       if (oldCount !== null)
           this._tree.rowCountChanged(0, this._rowMap.length - oldCount);
       this._tree.invalidate();
     }
     this._restoreOpenStates();
     // restore selection.
     for (let folder of selectedFolders) {
       if (folder) {
         let index = this.getIndexOfFolder(folder);
         if (index != null)
           this.selection.toggleSelect(index);
       }
     }
   },
 
-  _sortedAccounts: function ftv_getSortedAccounts() {
+  _sortedAccounts() {
     let accounts = allAccountsSorted(true);
 
     // Don't show deferred pop accounts.
-    accounts = accounts.filter(function isNotDeferred(a) {
+    accounts = accounts.filter(function(a) {
       let server = a.incomingServer;
       return !(server instanceof Ci.nsIPop3IncomingServer &&
                server.deferredToAccount);
     });
 
     return accounts;
   },
 
@@ -1492,34 +1479,34 @@ var gFolderTreeView = {
 
   /**
    * Update a folder property in the session cache.
    *
    * @param  nsIMsgFolder aFolder   - folder.
    * @param  string aProperty       - property, currently in "favicon".
    * @param  aValue                 - string or object value.
    */
-  setFolderCacheProperty: function(aFolder, aProperty, aValue) {
+  setFolderCacheProperty(aFolder, aProperty, aValue) {
     if (!aFolder || !aProperty)
       return;
 
     if (!this._cache[aFolder.URI])
       this._cache[aFolder.URI] = {};
 
     this._cache[aFolder.URI][aProperty] = aValue;
   },
 
   /**
    * Get a folder property from the session cache.
    *
    * @param  nsIMsgFolder aFolder   - folder.
    * @param  string aProperty       - property key.
    * @return value or null          - null indicates uninitialized.
    */
-  getFolderCacheProperty: function(aFolder, aProperty) {
+  getFolderCacheProperty(aFolder, aProperty) {
     if (!aFolder || !aProperty)
       return null;
 
     if (!(aFolder.URI in this._cache) ||
         !(aProperty in this._cache[aFolder.URI]))
       return null;
 
     return this._cache[aFolder.URI][aProperty];
@@ -1532,77 +1519,77 @@ var gFolderTreeView = {
    */
   _modes: {
     /**
      * The all mode returns all folders, arranged in a hierarchy
      */
     all: {
       __proto__: IFolderTreeMode,
 
-      generateMap: function ftv_all_generateMap(ftv) {
+      generateMap(ftv) {
         let accounts = gFolderTreeView._sortedAccounts();
         // force each root folder to do its local subfolder discovery.
         MailUtils.discoverFolders();
 
         return accounts.map(acct => new ftvItem(acct.incomingServer.rootFolder));
-      }
+      },
     },
 
     /**
      * The unread mode returns all folders that are not root-folders and that
      * have unread items. Also always keep the currently selected folder
      * so it doesn't disappear under the user.
      * It also includes parent folders of the Unread folders so the hierarchy
      * shown.
      */
     unread: {
       __proto__: IFolderTreeMode,
 
-      generateMap: function ftv_unread_generateMap(ftv) {
-        let filterUnread = function filterUnread(aFolder) {
+      generateMap(ftv) {
+        let filterUnread = function(aFolder) {
           let currentFolder = gFolderTreeView.getSelectedFolders()[0];
           return ((aFolder.getNumUnread(true) > 0) ||
                   (aFolder == currentFolder));
-        }
+        };
 
         let accounts = gFolderTreeView._sortedAccounts();
         // Force each root folder to do its local subfolder discovery.
         MailUtils.discoverFolders();
 
         let unreadRootFolders = [];
         for (let acct of accounts) {
           let rootFolder = acct.incomingServer.rootFolder;
           // Add rootFolders of accounts that contain at least one Favorite folder.
           if (rootFolder.getNumUnread(true) > 0)
             unreadRootFolders.push(new ftvItem(rootFolder, filterUnread));
         }
 
         return unreadRootFolders;
       },
 
-      handleChangedIntProperty: function(aItem, aProperty, aOld, aNew) {
+      handleChangedIntProperty(aItem, aProperty, aOld, aNew) {
         // We want to rebuild only if we have a newly unread folder
         // and we didn't already have the folder.
         if (aProperty == "TotalUnreadMessages" && aOld == 0 && aNew > 0 &&
             gFolderTreeView.getIndexOfFolder(aItem) == null) {
           gFolderTreeView._rebuild();
           return true;
         }
         return false;
-      }
+      },
     },
 
     /**
      * A variant of the 'unread' mode above. This does not include the parent folders
      * and the unread folders are shown in a flat list with no hierarchy.
      */
     unread_compact: {
       __proto__: IFolderTreeMode,
 
-      generateMap: function(ftv) {
+      generateMap(ftv) {
         let map = [];
         let currentFolder = gFolderTreeView.getSelectedFolders()[0];
         for (let folder of ftv._enumerateFolders) {
           if ((!folder.isServer && folder.getNumUnread(false) > 0) ||
               (folder == currentFolder))
             map.push(new ftvItem(folder));
         }
 
@@ -1610,81 +1597,81 @@ var gFolderTreeView = {
         for (let folder of map) {
           folder.__defineGetter__("children", () => []);
           folder.addServerName = true;
         }
         sortFolderItems(map);
         return map;
       },
 
-      getParentOfFolder: function(aFolder) {
+      getParentOfFolder(aFolder) {
         // This is a flat view, so no folders have parents.
         return null;
       },
 
-      handleChangedIntProperty: function(aItem, aProperty, aOld, aNew) {
+      handleChangedIntProperty(aItem, aProperty, aOld, aNew) {
         // We want to rebuild only if we have a newly unread folder
         // and we didn't already have the folder.
         if (aProperty == "TotalUnreadMessages" && aOld == 0 && aNew > 0 &&
             gFolderTreeView.getIndexOfFolder(aItem) == null) {
           gFolderTreeView._rebuild();
           return true;
         }
         return false;
-      }
+      },
     },
 
     /**
      * The favorites mode returns all folders whose flags are set to include
      * the favorite flag.
      * It also includes parent folders of the Unread folders so the hierarchy
      * shown.
      */
     favorite: {
       __proto__: IFolderTreeMode,
 
-      generateMap: function ftv_favorite_generateMap(ftv) {
+      generateMap(ftv) {
         let accounts = gFolderTreeView._sortedAccounts();
         // Force each root folder to do its local subfolder discovery.
         MailUtils.discoverFolders();
 
         let favRootFolders = [];
-        let filterFavorite = function filterFavorite(aFolder) {
+        let filterFavorite = function(aFolder) {
           return aFolder.getFolderWithFlags(Ci.nsMsgFolderFlags.Favorite) != null;
-        }
+        };
         for (let acct of accounts) {
           let rootFolder = acct.incomingServer.rootFolder;
           // Add rootFolders of accounts that contain at least one Favorite folder.
           if (filterFavorite(rootFolder))
             favRootFolders.push(new ftvItem(rootFolder, filterFavorite));
         }
 
         return favRootFolders;
       },
 
-      handleChangedIntProperty: function(aItem, aProperty, aOld, aNew) {
+      handleChangedIntProperty(aItem, aProperty, aOld, aNew) {
         // We want to rebuild if the favorite status of a folder changed.
         if (aProperty == "FolderFlag" &&
             ((aOld & Ci.nsMsgFolderFlags.Favorite) !=
             (aNew & Ci.nsMsgFolderFlags.Favorite))) {
           gFolderTreeView._rebuild();
           return true;
         }
         return false;
-      }
+      },
     },
 
     /**
      * A variant of the 'favorite' mode above. This does not include the parent folders
      * and the unread folders are shown in a compact list with no hierarchy.
      */
     favorite_compact: {
       __proto__: IFolderTreeMode,
 
-      generateMap: function(ftv) {
+      generateMap(ftv) {
         let faves = [];
         for (let folder of ftv._enumerateFolders) {
           if (folder.getFlag(Ci.nsMsgFolderFlags.Favorite))
             faves.push(new ftvItem(folder));
         }
 
         // We want to display the account name alongside folders that have
         // duplicated folder names.
@@ -1705,47 +1692,47 @@ var gFolderTreeView = {
           let name = item._folder.abbreviatedName.toLocaleLowerCase();
           item.__defineGetter__("children", () => []);
           item.addServerName = dupeNames.has(name);
         }
         sortFolderItems(faves);
         return faves;
       },
 
-      getParentOfFolder: function(aFolder) {
+      getParentOfFolder(aFolder) {
         // This is a flat view, so no folders have parents.
         return null;
       },
 
-      handleChangedIntProperty: function(aItem, aProperty, aOld, aNew) {
+      handleChangedIntProperty(aItem, aProperty, aOld, aNew) {
         // We want to rebuild if the favorite status of a folder changed.
         if (aProperty == "FolderFlag" &&
             ((aOld & Ci.nsMsgFolderFlags.Favorite) !=
             (aNew & Ci.nsMsgFolderFlags.Favorite))) {
           gFolderTreeView._rebuild();
           return true;
         }
         return false;
-      }
+      },
     },
 
     recent_compact: {
       __proto__: IFolderTreeMode,
 
-      generateMap: function(ftv) {
+      generateMap(ftv) {
         const MAXRECENT = 15;
 
         // Get 15 (MAXRECENT) most recently accessed folders.
         let recentFolders = getMostRecentFolders(ftv._enumerateFolders,
                                                  MAXRECENT,
                                                  "MRUTime",
                                                  null);
 
         // Sort the folder names alphabetically.
-        recentFolders.sort(function rf_sort(a, b){
+        recentFolders.sort(function(a, b) {
           let aLabel = a.prettyName;
           let bLabel = b.prettyName;
           if (aLabel == bLabel) {
             aLabel = a.server.prettyName;
             bLabel = b.server.prettyName;
           }
           return folderNameCompare(aLabel, bLabel);
         });
@@ -1758,38 +1745,37 @@ var gFolderTreeView = {
         for (let folder of items) {
           folder.__defineGetter__("children", () => []);
           folder.addServerName = true;
         }
 
         return items;
       },
 
-      getParentOfFolder: function(aFolder) {
+      getParentOfFolder(aFolder) {
         // This is a flat view, so no folders have parents.
         return null;
-      }
+      },
     },
 
     /**
      * The smart folder mode combines special folders of a particular type
      * across accounts into a single cross-folder saved search.
      */
     smart: {
       __proto__: IFolderTreeMode,
 
       /**
        * The smart server. This will create the server if it doesn't exist.
        */
       get _smartServer() {
         let smartServer;
         try {
           smartServer = MailServices.accounts.FindServer("nobody", "smart mailboxes", "none");
-        }
-        catch (ex) {
+        } catch (ex) {
           smartServer = MailServices.accounts.createIncomingServer("nobody", "smart mailboxes", "none");
           // We don't want the "smart" server/account leaking out into the ui in
           // other places, so set it as hidden.
           smartServer.hidden = true;
           let account = MailServices.accounts.createAccount();
           account.incomingServer = smartServer;
         }
         delete this._smartServer;
@@ -1805,112 +1791,112 @@ var gFolderTreeView = {
       _flagNameList: [
         [Ci.nsMsgFolderFlags.Inbox, "Inbox", false, true],
         [Ci.nsMsgFolderFlags.Drafts, "Drafts", false, true],
         [Ci.nsMsgFolderFlags.SentMail, "Sent", true, true],
         [Ci.nsMsgFolderFlags.Trash, "Trash", true, true],
         [Ci.nsMsgFolderFlags.Templates, "Templates", false, true],
         [Ci.nsMsgFolderFlags.Archive, "Archives", true, true],
         [Ci.nsMsgFolderFlags.Junk, "Junk", false, true],
-        [Ci.nsMsgFolderFlags.Queue, "Outbox", true, true]
+        [Ci.nsMsgFolderFlags.Queue, "Outbox", true, true],
       ],
 
       /**
        * support for addons to add special folder types, this must be called
        * prior to onload.
        *
        * @param aFolderName  name of the folder
        * @param isDeep  include subfolders
        * @param folderOptions  object with searchStr and searchOnline options, or null
        */
-      addSmartFolderType: function ftv_addSmartFolderType(aFolderName, isDeep, isSearchFolder) {
+      addSmartFolderType(aFolderName, isDeep, isSearchFolder) {
         this._flagNameList.push([0, aFolderName, isDeep, isSearchFolder]);
       },
 
       /**
        * Returns an array of 4 elements describing the smart folder
        * if the given folder is a special folder, else returns null.
        */
-      getSmartFolderTypeByName: function ftv_smart__getSmartFolderType(aName) {
+      getSmartFolderTypeByName(aName) {
         for (let type of this._flagNameList) {
           if (type[1] == aName)
             return type;
         }
         return null;
       },
       /**
        * check to see if a folder is a smart folder
        */
-      isSmartFolder: function ftv_smart__isSmartFolder(aFolder) {
+      isSmartFolder(aFolder) {
         if (aFolder.flags & this._allSmartFlags)
             return true;
         // Also check the folder name itself, as containers do not
         // have the smartFolderName property.  We check all folders here, since
         // a "real" folder might be marked as a child of a smart folder.
         let smartFolderName = getSmartFolderName(aFolder);
         return smartFolderName && this.getSmartFolderTypeByName(smartFolderName) ||
             this.getSmartFolderTypeByName(aFolder.name);
       },
 
       /**
        * All the flags above, bitwise ORed.
        */
       get _allSmartFlags() {
         delete this._allSmartFlags;
         return this._allSmartFlags = this._flagNameList.reduce(
-          (res, [flag,, isDeep,]) => res | flag, 0);
+          (res, [flag,, isDeep]) => res | flag, 0);
       },
 
       /**
        * All the "shallow" flags above (isDeep set to false), bitwise ORed.
        */
       get _allShallowFlags() {
         delete this._allShallowFlags;
         return this._allShallowFlags = this._flagNameList.reduce(
-          (res, [flag,, isDeep,]) => isDeep ? res : (res | flag), 0);
+          (res, [flag,, isDeep]) => isDeep ? res : (res | flag), 0);
       },
 
       /**
        * Returns an array of 4 elements describing the smart folder
        * if the given folder is a special folder, else returns null.
        */
-      _getSmartFolderType: function ftv_smart__getSmartFolderType(aFolder) {
+      _getSmartFolderType(aFolder) {
         let smartFolderName = getSmartFolderName(aFolder);
         for (let type of this._flagNameList) {
           if (smartFolderName) {
             if (type[1] == smartFolderName)
               return type;
             continue;
           }
           if (aFolder.flags & type[0])
             return type;
         }
         return null;
       },
 
       /**
        * Returns the smart folder with the given name.
        */
-      _getSmartFolderNamed: function ftv_smart__getSmartFolderNamed(aName) {
+      _getSmartFolderNamed(aName) {
         let smartRoot = this._smartServer.rootFolder;
         return smartRoot.getChildWithURI(smartRoot.URI + "/" + encodeURI(aName), false,
                                          true);
       },
 
-      generateMap: function ftv_smart_generateMap(ftv) {
+      generateMap(ftv) {
         let map = [];
         let accounts = gFolderTreeView._sortedAccounts();
         let smartServer = this._smartServer;
         smartServer.prettyName = gFolderTreeView.messengerBundle
                                                 .getString("unifiedAccountName");
         smartServer.canHaveFilters = false;
 
         let smartRoot = smartServer.rootFolder;
         let smartChildren = [];
-        for (let [flag, name,,] of this._flagNameList) {
+        for (let [flag, name] of this._flagNameList) {
           gFolderTreeView._addSmartFoldersForFlag(smartChildren, accounts,
                                                   smartRoot, flag, name);
         }
 
         sortFolderItems(smartChildren);
         for (let smartChild of smartChildren)
           map.push(smartChild);
 
@@ -1929,17 +1915,17 @@ var gFolderTreeView = {
        * - For one of the special folders, it is the smart folder of that kind
        *   if we're showing it (this happens when there's more than one folder
        *   of the kind). Otherwise it's a top-level folder, so there isn't a
        *   parent.
        * - For a child of a "shallow" special folder (see |_flagNameList| for
        *   the definition), it is the account.
        * - Otherwise it is simply the folder's actual parent.
        */
-      getParentOfFolder: function ftv_smart_getParentOfFolder(aFolder) {
+      getParentOfFolder(aFolder) {
         let smartServer = this._smartServer;
         if (aFolder.server == smartServer)
           // This is a smart mailbox
           return null;
 
         let smartType = this._getSmartFolderType(aFolder);
         if (smartType) {
           // This is a special folder
@@ -1960,17 +1946,17 @@ var gFolderTreeView = {
         return parent;
       },
 
       /**
        * For a folder of a particular type foo, this returns the smart folder of
        * that type (if it's displayed). Otherwise this returns the folder the
        * message is in.
        */
-      getFolderForMsgHdr: function ftv_smart_getFolderForMsgHdr(aMsgHdr) {
+      getFolderForMsgHdr(aMsgHdr) {
         let folder = aMsgHdr.folder;
 
         let smartType = this._getSmartFolderType(folder);
         if (smartType) {
           let smartFolder = this._getSmartFolderNamed(smartType[1]);
           if (smartFolder &&
               gFolderTreeView.getIndexOfFolder(smartFolder) != null)
             return smartFolder;
@@ -1982,50 +1968,48 @@ var gFolderTreeView = {
        * Handles the case of a new folder being added.
        *
        * - If a new special folder is added, we need to add it as a child of the
        *   corresponding smart folder.
        * - If the parent is a shallow special folder, we need to add it as a
        *   top-level folder in its account.
        * - Otherwise, we need to add it as a child of its parent (as normal).
        */
-      onFolderAdded: function ftv_smart_onFolderAdded(aParent, aFolder) {
+      onFolderAdded(aParent, aFolder) {
         if (aFolder.flags & this._allSmartFlags) {
           // add as child of corresponding smart folder
           let smartServer = this._smartServer;
           let smartRoot = smartServer.rootFolder;
           // In theory, a folder can have multiple flags set, so we need to
           // check each flag separately.
-          for (let [flag, name,,] of this._flagNameList) {
+          for (let [flag, name] of this._flagNameList) {
             if (aFolder.flags & flag)
               gFolderTreeView._addSmartSubFolder(aFolder, smartRoot, name, flag);
           }
-        }
-        else if (aParent.isSpecialFolder(this._allShallowFlags, false)) {
+        } else if (aParent.isSpecialFolder(this._allShallowFlags, false)) {
           // add as a child of the account
           let rootIndex = gFolderTreeView.getIndexOfFolder(
             aFolder.server.rootFolder);
           let root = gFolderTreeView._rowMap[rootIndex];
           if (!root)
             return;
 
           let newChild = new ftv_SmartItem(aFolder);
           root.children.push(newChild);
           newChild._level = root._level + 1;
           newChild._parent = root;
           sortFolderItems(root._children);
 
           gFolderTreeView._addChildToView(root, rootIndex, newChild);
-        }
-        else {
+        } else {
           // add as normal
           gFolderTreeView.addFolder(aParent, aFolder);
         }
-      }
-    }
+      },
+    },
   },
 
   /**
    * This is a helper attribute that simply returns a flat list of all folders
    */
   get _enumerateFolders() {
     let folders = [];
 
@@ -2044,54 +2028,52 @@ var gFolderTreeView = {
 
   /**
    * This is a recursive function to add all subfolders to the array. It
    * assumes that the passed in folder itself has already been added.
    *
    * @param aFolder  the folder whose subfolders should be added
    * @param folders  the array to add the folders to.
    */
-  addSubFolders : function ftv_addSubFolders (folder, folders) {
+  addSubFolders(folder, folders) {
     for (let f of fixIterator(folder.subFolders, Ci.nsIMsgFolder)) {
       folders.push(f);
       this.addSubFolders(f, folders);
     }
   },
 
   /**
    * This updates the rowmap and invalidates the right row(s) in the tree
    */
-  _addChildToView: function ftl_addChildToView(aParent, aParentIndex, aNewChild) {
+  _addChildToView(aParent, aParentIndex, aNewChild) {
     if (aParent.open) {
       let newChildIndex;
       let newChildNum = aParent._children.indexOf(aNewChild);
       // only child - go right after our parent
       if (newChildNum == 0) {
-        newChildIndex = Number(aParentIndex) + 1
-      }
-      // if we're not the last child, insert ourselves before the next child.
-      else if (newChildNum < aParent._children.length - 1) {
+        newChildIndex = Number(aParentIndex) + 1;
+      } else if (newChildNum < aParent._children.length - 1) {
+        // if we're not the last child, insert ourselves before the next child.
         newChildIndex = this.getIndexOfFolder(aParent._children[Number(newChildNum) + 1]._folder);
-      }
-      // otherwise, go after the last child
-      else {
+      } else {
+        // otherwise, go after the last child
         let lastChild = aParent._children[newChildNum - 1];
         let lastChildIndex = this.getIndexOfFolder(lastChild._folder);
         newChildIndex = Number(lastChildIndex) + 1;
         while (newChildIndex < this.rowCount &&
                this._rowMap[newChildIndex].level > this._rowMap[lastChildIndex].level)
           newChildIndex++;
       }
       this._rowMap.splice(newChildIndex, 0, aNewChild);
       this._tree.rowCountChanged(newChildIndex, 1);
     } else {
       this._tree.invalidateRow(aParentIndex);
     }
   },
-  _addSmartSubFolder: function ftl_addSmartSubFolder(aItem, aSmartRoot, aName, aFlag) {
+  _addSmartSubFolder(aItem, aSmartRoot, aName, aFlag) {
     let smartFolder = aSmartRoot.getChildWithURI(aSmartRoot.URI + "/" + encodeURI(aName),
                                                  false, true);
     let parent = null;
     let parentIndex = -1;
     let newChild;
     let newChildIndex = 0;
     if (!smartFolder || this.getIndexOfFolder(smartFolder) == null) {
       newChild = new ftv_SmartItem(aItem);
@@ -2116,45 +2098,45 @@ var gFolderTreeView = {
 
       newChild = new ftv_SmartItem(aItem);
       parent.children.push(newChild);
       newChild._level = parent._level + 1;
       newChild._parent = parent;
       sortFolderItems(parent._children);
       newChild.useServerNameOnly = true;
     }
-    if (aItem.getFlag(Ci.nsMsgFolderFlags.Inbox))
+    if (aItem.getFlag(Ci.nsMsgFolderFlags.Inbox)) {
       newChild.__defineGetter__("children", () => []);
-    if (parent)
+    }
+    if (parent) {
       this._addChildToView(parent, parentIndex, newChild);
-    else {
+    } else {
       this._rowMap.splice(newChildIndex, 0, newChild);
       this._tree.rowCountChanged(newChildIndex, 1);
     }
   },
   /**
    * This is our implementation of nsIMsgFolderListener to watch for changes
    */
-  OnItemAdded: function ftl_add(aParentItem, aItem) {
+  OnItemAdded(aParentItem, aItem) {
     // Ignore this item if it's not a folder, or we knew about it.
     if (!(aItem instanceof Ci.nsIMsgFolder) ||
         this.getIndexOfFolder(aItem) != null)
       return;
 
     // if no parent, this is an account, so let's rebuild.
     if (!aParentItem) {
       if (!aItem.server.hidden) // ignore hidden server items
         this._rebuild();
       return;
     }
     this._modes[this._mode].onFolderAdded(
       aParentItem.QueryInterface(Ci.nsIMsgFolder), aItem);
   },
-  addFolder: function ftl_add_folder(aParentItem, aItem)
-  {
+  addFolder(aParentItem, aItem) {
     // This intentionally adds any new folder even if it would not pass the
     // _filterFunction. The idea is that the user can add new folders even
     // in modes like "unread" or "favorite" and could wonder why they
     // are not appearing (forgetting they do not meet the criteria of the view).
     // The folders will be hidden properly next time the view is rebuilt.
     let parentIndex = this.getIndexOfFolder(aParentItem);
     let parent = this._rowMap[parentIndex];
     if (!parent)
@@ -2189,17 +2171,17 @@ var gFolderTreeView = {
       if (newChild._folder.getFlag(Ci.nsMsgFolderFlags.SpecialUse)) {
         this._toggleRow(parentIndex, false);
         return;
       }
     }
     this._addChildToView(parent, parentIndex, newChild);
   },
 
-  OnItemRemoved: function ftl_remove(aRDFParentItem, aItem) {
+  OnItemRemoved(aRDFParentItem, aItem) {
     if (!(aItem instanceof Ci.nsIMsgFolder))
       return;
 
     this._persistItemClosed(aItem.URI);
 
     let index = this.getIndexOfFolder(aItem);
     if (index == null)
       return;
@@ -2213,18 +2195,18 @@ var gFolderTreeView = {
       walker++;
       kidCount++;
     }
     this._rowMap.splice(index, kidCount);
     this._tree.rowCountChanged(index, -1 * kidCount);
     this._tree.invalidateRow(index);
   },
 
-  OnItemPropertyChanged: function(aItem, aProperty, aOld, aNew) {},
-  OnItemIntPropertyChanged: function(aItem, aProperty, aOld, aNew) {
+  OnItemPropertyChanged(aItem, aProperty, aOld, aNew) {},
+  OnItemIntPropertyChanged(aItem, aProperty, aOld, aNew) {
     // First try mode specific handling of the changed property.
     if (this._modes[this.mode].handleChangedIntProperty(aItem, aProperty, aOld, aNew))
       return;
 
     if (aItem instanceof Ci.nsIMsgFolder) {
       let index = this.getIndexOfFolder(aItem);
       let folder = aItem;
       let folderTreeMode = this._modes[this._mode];
@@ -2235,34 +2217,34 @@ var gFolderTreeView = {
           break;
         index = this.getIndexOfFolder(folder);
       }
       if (index != null)
         this._tree.invalidateRow(index);
     }
   },
 
-  OnItemBoolPropertyChanged: function(aItem, aProperty, aOld, aNew) {
+  OnItemBoolPropertyChanged(aItem, aProperty, aOld, aNew) {
     let index = this.getIndexOfFolder(aItem);
     if (index != null)
       this._tree.invalidateRow(index);
   },
 
-  OnItemUnicharPropertyChanged: function(aItem, aProperty, aOld, aNew) {
+  OnItemUnicharPropertyChanged(aItem, aProperty, aOld, aNew) {
     let index = this.getIndexOfFolder(aItem);
     if (index != null)
       this._tree.invalidateRow(index);
   },
 
-  OnItemPropertyFlagChanged: function(aItem, aProperty, aOld, aNew) {},
-  OnItemEvent: function(aFolder, aEvent) {
+  OnItemPropertyFlagChanged(aItem, aProperty, aOld, aNew) {},
+  OnItemEvent(aFolder, aEvent) {
     let index = this.getIndexOfFolder(aFolder);
     if (index != null)
       this._tree.invalidateRow(index);
-  }
+  },
 };
 
 /**
  * The ftvItem object represents a single row in the tree view. Because I'm lazy
  * I'm just going to define the expected interface here.  You are free to return
  * an alternative object, provided that it matches this interface:
  *
  * id (attribute) - a unique string for this object. Must persist over sessions
@@ -2313,19 +2295,19 @@ ftvItem.prototype = {
     gFolderStatsHelpers.sumSubfolders = gFolderStatsHelpers.sumSubfoldersPref &&
                           (gFolderTreeView.mode == kDefaultMode) &&
                           this._folder.hasSubFolders && !this.open;
 
     this._summarizedCounts.delete(aColName);
     switch (aColName) {
       case "folderNameCol":
         let text;
-        if (this.useServerNameOnly)
+        if (this.useServerNameOnly) {
           text = this._folder.server.prettyName;
-        else {
+        } else {
           text = this._folder.abbreviatedName;
           if (this.addServerName) {
             text = gFolderTreeView.messengerBundle.getFormattedString(
               "folderWithAccount", [text, this._folder.server.prettyName]);
           }
         }
 
         // In a simple list tree we don't care for attributes other than folder name.
@@ -2393,17 +2375,17 @@ ftvItem.prototype = {
         return "";
     }
   },
 
   get level() {
     return this._level;
   },
 
-  getProperties: function (aColumn) {
+  getProperties(aColumn) {
     if (aColumn && aColumn.id != "folderNameCol")
       return "";
 
     // From folderUtils.jsm
     let properties = getFolderProperties(this._folder, this.open);
     if (this._folder.getFlag(Ci.nsMsgFolderFlags.Virtual)) {
       properties += " specialFolder-Smart";
       // a second possibility for customized smart folders
@@ -2418,31 +2400,31 @@ ftvItem.prototype = {
     if (FeedMessageHandler.isFeedFolder(this._folder)) {
       properties += FeedUtils.getFolderProperties(this._folder, null);
       gFolderTreeView.setFolderCacheProperty(this._folder, "properties", properties);
     }
 
     return properties;
   },
 
-  command: function fti_command() {
+  command() {
     if (!Services.prefs.getBoolPref("mailnews.reuse_thread_window2"))
       MsgOpenNewWindowForFolder(this._folder.URI, -1 /* key */);
   },
 
   _children: null,
   get children() {
     // We're caching our child list to save perf.
     if (!this._children) {
       let iter;
       try {
         iter = fixIterator(this._folder.subFolders, Ci.nsIMsgFolder);
       } catch (ex) {
         Services.console.logStringMessage("Discovering children for " + this._folder.URI +
-                                          " failed with " + "exception: " + ex);
+                                          " failed with exception: " + ex);
         iter = [];
       }
       this._children = [];
       // Out of all children, only keep those that match the _folderFilter
       // and those that contain such children.
       for (let folder of iter) {
         if (!this._folderFilter || this._folderFilter(folder)) {
           this._children.push(new ftvItem(folder, this._folderFilter));
@@ -2451,31 +2433,31 @@ ftvItem.prototype = {
       sortFolderItems(this._children);
       // Each child is a level one below us
       for (let child of this._children) {
         child._level = this._level + 1;
         child._parent = this;
       }
     }
     return this._children;
-  }
+  },
 };
 
 /**
  * This handles the invocation of most commands dealing with folders, based off
  * of the current selection, or a passed in folder.
  */
 var gFolderTreeController = {
   /**
    * Opens the dialog to create a new sub-folder, and creates it if the user
    * accepts
    *
    * @param aParent (optional)  the parent for the new subfolder
    */
-  newFolder: function ftc_newFolder(aParent) {
+  newFolder(aParent) {
     let folder = aParent || gFolderTreeView.getSelectedFolders()[0];
 
     // Make sure we actually can create subfolders
     if (!folder.canCreateSubfolders) {
       // Check if we can create them at the root
       let rootMsgFolder = folder.server.rootMsgFolder;
       if (rootMsgFolder.canCreateSubfolders)
         folder = rootMsgFolder;
@@ -2494,49 +2476,49 @@ var gFolderTreeController = {
       // nsMsgLocalMailFolder::CreateSubfolderInternal to here (bug 831190#c16).
       if (aName)
         aFolder.createSubfolder(aName, msgWindow);
     }
 
     window.openDialog("chrome://messenger/content/newFolderDialog.xul",
                       "",
                       "chrome,modal,resizable=no,centerscreen",
-                      {folder: folder, dualUseFolders: dualUseFolders,
+                      {folder, dualUseFolders,
                        okCallback: newFolderCallback});
   },
 
   /**
    * Opens the dialog to edit the properties for a folder
    *
    * @param aTabID  (optional) the tab to show in the dialog
    * @param aFolder (optional) the folder to edit, if not the selected one
    */
-  editFolder: function ftc_editFolder(aTabID, aFolder) {
+  editFolder(aTabID, aFolder) {
     let folder = aFolder || gFolderTreeView.getSelectedFolders()[0];
 
     // If this is actually a server, send it off to that controller
     if (folder.isServer) {
       MsgAccountManager(null, folder.server);
       return;
     }
 
     if (folder.getFlag(Ci.nsMsgFolderFlags.Virtual)) {
       this.editVirtualFolder(folder);
       return;
     }
     let title = gFolderTreeView.messengerBundle
                                .getString("folderProperties");
 
-    //xxx useless param
+    // xxx useless param
     function editFolderCallback(aNewName, aOldName, aUri) {
       if (aNewName != aOldName)
         folder.rename(aNewName, msgWindow);
     }
 
-    //xxx useless param
+    // xxx useless param
     function rebuildSummary(aFolder) {
       // folder is already introduced in our containing function and is
       //  lexically captured and available to us.
       if (folder.locked) {
         folder.throwAlertMsg("operationFailedFolderBusy", msgWindow);
         return;
       }
       if (folder.supportsOffline) {
@@ -2554,46 +2536,45 @@ var gFolderTreeController = {
                                        null);
 
       folder.msgDatabase.summaryValid = false;
 
       var msgDB = folder.msgDatabase;
       msgDB.summaryValid = false;
       try {
         folder.closeAndBackupFolderDB("");
-      }
-      catch(e) {
+      } catch (e) {
         // In a failure, proceed anyway since we're dealing with problems
         folder.ForceDBClosed();
       }
       folder.updateFolder(msgWindow);
       gFolderDisplay.show(folder);
     }
 
     window.openDialog("chrome://messenger/content/folderProps.xul",
                       "",
                       "chrome,modal,centerscreen",
-                      {folder: folder, serverType: folder.server.type,
-                       msgWindow: msgWindow, title: title,
+                      {folder, serverType: folder.server.type,
+                       msgWindow, title,
                        okCallback: editFolderCallback,
                        tabID: aTabID, name: folder.prettyName,
                        rebuildSummaryCallback: rebuildSummary});
   },
 
   /**
    * Opens the dialog to rename a particular folder, and does the renaming if
    * the user clicks OK in that dialog
    *
    * @param aFolder (optional)  the folder to rename, if different than the
    *                            currently selected one
    */
-  renameFolder: function ftc_rename(aFolder) {
+  renameFolder(aFolder) {
     let folder = aFolder || gFolderTreeView.getSelectedFolders()[0];
 
-    //xxx no need for uri now
+    // xxx no need for uri now
     let controller = this;
     function renameCallback(aName, aUri) {
       if (aUri != folder.URI)
         Cu.reportError("got back a different folder to rename!");
 
       controller._tree.view.selection.clearSelection();
 
       // Actually do the rename
@@ -2607,17 +2588,17 @@ var gFolderTreeController = {
   },
 
   /**
    * Deletes a folder from its parent. Also handles unsubscribe from newsgroups
    * if the selected folder/s happen to be nntp.
    *
    * @param aFolder (optional) the folder to delete, if not the selected one
    */
-  deleteFolder: function ftc_delete(aFolder) {
+  deleteFolder(aFolder) {
     let folders = aFolder ? [aFolder] : gFolderTreeView.getSelectedFolders();
     let folder = folders[0];
 
     // For newsgroups, "delete" means "unsubscribe".
     if (folder.server.type == "nntp" && !folder.getFlag(Ci.nsMsgFolderFlags.Virtual)) {
       MsgUnsubscribe(folders);
       return;
     }
@@ -2647,17 +2628,17 @@ var gFolderTreeController = {
   /**
    * Prompts the user to confirm and empties the trash for the selected folder.
    * The folder and its children are only emptied if it has the proper Trash flag.
    *
    * @param aFolder (optional)  the trash folder to empty
    * @note Calling this function on a non-trash folder will result in strange
    *       behavior!
    */
-  emptyTrash: function ftc_emptyTrash(aFolder) {
+  emptyTrash(aFolder) {
     let folder = aFolder || gFolderTreeView.getSelectedFolders()[0];
 
     if (!folder)
       return;
 
     if (!this._checkConfirmationPrompt("emptyTrash", folder))
       return;
 
@@ -2665,29 +2646,28 @@ var gFolderTreeController = {
       // to empty all the trash folders.
       if (folder.server.hostName == "smart mailboxes" &&
           folder.parent.isServer) {
         let subFolders = gFolderTreeView
                            ._allFoldersWithFlag(gFolderTreeView._sortedAccounts(),
                             Ci.nsMsgFolderFlags.Trash, false);
         for (let trash of subFolders)
           trash.emptyTrash(msgWindow, null);
-      }
-      else {
+      } else {
         folder.emptyTrash(msgWindow, null);
       }
   },
 
   /**
    * Deletes everything (folders and messages) in the selected folder.
    * The folder is only emptied if it has the proper Junk flag.
    *
    * @param aFolder (optional)  the folder to empty
    */
-  emptyJunk: function ftc_emptyJunk(aFolder) {
+  emptyJunk(aFolder) {
     let folder = aFolder || gFolderTreeView.getSelectedFolders()[0];
 
     if (!folder || !folder.getFlag(Ci.nsMsgFolderFlags.Junk))
       return;
 
     if (!this._checkConfirmationPrompt("emptyJunk", folder))
       return;
 
@@ -2703,17 +2683,17 @@ var gFolderTreeController = {
   },
 
   /**
    * Compacts either particular folder/s, or selected folders.
    *
    * @param aFolders (optional) the folders to compact, if different than the
    *                            currently selected ones
    */
-  compactFolders: function ftc_compactFolders(aFolders) {
+  compactFolders(aFolders) {
     let folders = aFolders || gFolderTreeView.getSelectedFolders();
     for (let i = 0; i < folders.length; i++) {
       // Can't compact folders that have just been compacted.
       if (folders[i].server.type != "imap" && !folders[i].expungedBytes)
         continue;
 
       folders[i].compact(null, msgWindow);
     }
@@ -2722,95 +2702,95 @@ var gFolderTreeController = {
   /**
    * Compacts all folders for accounts that the given folders belong
    * to, or all folders for accounts of the currently selected folders.
    *
    * @param aFolders (optional) the folders for whose accounts we should compact
    *                            all folders, if different than the currently
    *                            selected ones
    */
-  compactAllFoldersForAccount: function ftc_compactAllFoldersOfAccount(aFolders) {
+  compactAllFoldersForAccount(aFolders) {
     let folders = aFolders || gFolderTreeView.getSelectedFolders();
     for (let i = 0; i < folders.length; i++) {
       folders[i].compactAll(null, msgWindow, folders[i].server.type == "imap" ||
                                              folders[i].server.type == "nntp");
     }
   },
 
   /**
    * Opens the dialog to create a new virtual folder
    *
    * @param aName - the default name for the new folder
    * @param aSearchTerms - the search terms associated with the folder
    * @param aParent - the folder to run the search terms on
    */
-  newVirtualFolder: function ftc_newVFolder(aName, aSearchTerms, aParent) {
+  newVirtualFolder(aName, aSearchTerms, aParent) {
     let folder = aParent || gFolderTreeView.getSelectedFolders()[0];
     if (!folder)
       folder = GetDefaultAccountRootFolder();
 
     let name = folder.prettyName;
     if (aName)
       name += "-" + aName;
 
     window.openDialog("chrome://messenger/content/virtualFolderProperties.xul",
                       "",
                       "chrome,modal,centerscreen",
-                      {folder: folder, searchTerms: aSearchTerms,
+                      {folder, searchTerms: aSearchTerms,
                        newFolderName: name});
   },
 
-  editVirtualFolder: function ftc_editVirtualFolder(aFolder) {
+  editVirtualFolder(aFolder) {
     let folder = aFolder || gFolderTreeView.getSelectedFolders()[0];
 
-    //xxx should pass the folder object
+    // xxx should pass the folder object
     function editVirtualCallback(aURI) {
       // we need to reload the folder if it is the currently loaded folder...
       if (gFolderDisplay.displayedFolder &&
           aURI == gFolderDisplay.displayedFolder.URI)
         FolderPaneSelectionChange();
     }
     window.openDialog("chrome://messenger/content/virtualFolderProperties.xul",
                       "",
                       "chrome,modal,centerscreen",
-                      {folder: folder, editExistingFolder: true,
+                      {folder, editExistingFolder: true,
                        onOKCallback: editVirtualCallback,
-                       msgWindow: msgWindow});
+                       msgWindow});
   },
 
   /**
    * Opens a search window with the given folder, or the selected one if none
    * is given.
    *
    * @param [aFolder] the folder to open the search window for, if different
    *                  from the selected one
    */
-  searchMessages: function ftc_searchMessages(aFolder) {
+  searchMessages(aFolder) {
     MsgSearchMessages(aFolder || gFolderTreeView.getSelectedFolders()[0]);
   },
 
   /**
    * Prompts for confirmation, if the user hasn't already chosen the "don't ask
    * again" option.
    *
    * @param aCommand  the command to prompt for
    * @param aFolder   The folder for which the confirmation is requested.
    */
-  _checkConfirmationPrompt: function ftc_confirm(aCommand, aFolder) {
+  _checkConfirmationPrompt(aCommand, aFolder) {
     // If no folder was specified, reject the operation.
     if (!aFolder)
       return false;
 
     let showPrompt = true;
     try {
       showPrompt = !Services.prefs.getBoolPref("mailnews." + aCommand + ".dontAskAgain");
     } catch (ex) {}
 
     if (showPrompt) {
-      let checkbox = {value:false};
+      let checkbox = {value: false};
       let title = gFolderTreeView.messengerBundle
         .getFormattedString(aCommand + "FolderTitle", [aFolder.prettyName]);
       let msg = gFolderTreeView.messengerBundle.getString(aCommand + "FolderMessage");
       let ok = Services.prompt.confirmEx(window,
                                          title,
                                          msg,
                                          Services.prompt.STD_YES_NO_BUTTONS,
                                          null, null, null,
@@ -2823,67 +2803,65 @@ var gFolderTreeController = {
     }
     return true;
   },
 
   get _tree() {
     let tree = document.getElementById("folderTree");
     delete this._tree;
     return this._tree = tree;
-  }
+  },
 };
 
 /**
  * Constructor for ftv_SmartItem. This is a top level item in the "smart"
  * (a.k.a. "Unified") folder mode.
  */
-function ftv_SmartItem(aFolder)
-{
+function ftv_SmartItem(aFolder) {
   ftvItem.call(this, aFolder); // call super constructor
   this._level = 0;
 }
 
 ftv_SmartItem.prototype = {
   __proto__: ftvItem.prototype,
   get children() {
     let smartMode = gFolderTreeView.getFolderTreeMode("smart");
 
     // We're caching our child list to save perf.
     if (!this._children) {
       this._children = [];
       let iter = fixIterator(this._folder.subFolders, Ci.nsIMsgFolder);
       for (let folder of iter) {
         if (!smartMode.isSmartFolder(folder)) {
           this._children.push(new ftv_SmartItem(folder));
-        }
-        else if (folder.getFlag(Ci.nsMsgFolderFlags.Inbox)) {
+        } else if (folder.getFlag(Ci.nsMsgFolderFlags.Inbox)) {
           let subIter = fixIterator(folder.subFolders, Ci.nsIMsgFolder);
           for (let subfolder of subIter) {
             if (!smartMode.isSmartFolder(subfolder))
               this._children.push(new ftv_SmartItem(subfolder));
           }
         }
       }
       sortFolderItems(this._children);
       // Each child is a level one below us
       for (let child of this._children) {
         child._level = this._level + 1;
         child._parent = this;
       }
     }
     return this._children;
-  }
-}
+  },
+};
 
 /**
  * Sorts the passed in array of folder items using the folder sort key
  *
  * @param aFolders - the array of ftvItems to sort.
  */
-function sortFolderItems (aFtvItems) {
+function sortFolderItems(aFtvItems) {
   function sorter(a, b) {
     return a._folder.compareSortKeys(b._folder);
   }
   aFtvItems.sort(sorter);
 }
 
 /**
  * An extension wishing to set a folderpane tree property must use
@@ -2912,17 +2890,17 @@ function setSmartFolderName(aFolder, aNa
 var gFolderStatsHelpers = {
     kUnknownSize: "-",
     sumSubfoldersPref: false,
     sumSubfolders: false,
     sizeUnits: "",
     kiloUnit: "KB",
     megaUnit: "MB",
 
-    init: function() {
+    init() {
       // We cache these values because the cells in the folder pane columns
       // using these helpers can be redrawn often.
       this.sumSubfoldersPref = Services.prefs.getBoolPref("mail.folderpane.sumSubfolders");
       this.sizeUnits = Services.prefs.getCharPref("mail.folderpane.sizeUnits");
       this.kiloUnit = gFolderTreeView.messengerBundle.getString("kiloByteAbbreviation2");
       this.megaUnit = gFolderTreeView.messengerBundle.getString("megaByteAbbreviation2");
     },
 
@@ -2932,17 +2910,17 @@ var gFolderStatsHelpers = {
      * folders when they are shown expanded (due to rounding to a unit).
      * E.g. folder1 600bytes -> 1KB, folder2 700bytes -> 1KB
      * summarized at parent folder: 1300bytes -> 1KB
      *
      * @param aValue                  The value to be displayed.
      * @param aSubfoldersContributed  Boolean indicating whether subfolders
      *                                contributed to the accumulated total value.
      */
-    addSummarizedPrefix: function(aValue, aSubfoldersContributed) {
+    addSummarizedPrefix(aValue, aSubfoldersContributed) {
       if (!this.sumSubfolders)
         return aValue;
 
       if (!aSubfoldersContributed)
         return aValue;
 
       return gFolderTreeView.messengerBundle
         .getFormattedString("folderSummarizedSymbolValue", [aValue]);
@@ -2952,47 +2930,47 @@ var gFolderStatsHelpers = {
      * nsIMsgFolder uses -1 as a magic number to mean "I don't know". In those
      * cases we indicate it to the user. The user has to open the folder
      * so that the property is initialized from the DB.
      *
      * @param aNumber                 The number to translate for the user.
      * @param aSubfoldersContributed  Boolean indicating whether subfolders
      *                                contributed to the accumulated total value.
      */
-    fixNum: function(aNumber, aSubfoldersContributed) {
+    fixNum(aNumber, aSubfoldersContributed) {
       if (aNumber < 0)
         return this.kUnknownSize;
 
       return (aNumber == 0 ? "" : this.addSummarizedPrefix(aNumber,
                                                            aSubfoldersContributed));
     },
 
     /**
      * Get the size of the specified folder.
      *
      * @param aFolder  The nsIMsgFolder to analyze.
      */
-    getFolderSize: function(aFolder) {
+    getFolderSize(aFolder) {
       let folderSize = 0;
       try {
         folderSize = aFolder.sizeOnDisk;
         if (folderSize < 0)
           return this.kUnknownSize;
-      } catch(ex) {
+      } catch (ex) {
         return this.kUnknownSize;
       }
       return folderSize;
     },
 
     /**
      * Get the total size of all subfolders of the specified folder.
      *
      * @param aFolder  The nsIMsgFolder to analyze.
      */
-    getSubfoldersSize: function(aFolder) {
+    getSubfoldersSize(aFolder) {
       let folderSize = 0;
       if (aFolder.hasSubFolders) {
         let subFolders = aFolder.subFolders;
         while (subFolders.hasMoreElements()) {
           let subFolder = subFolders.getNext()
             .QueryInterface(Ci.nsIMsgFolder);
           let subSize = this.getFolderSize(subFolder);
           let subSubSize = this.getSubfoldersSize(subFolder);
@@ -3009,23 +2987,23 @@ var gFolderStatsHelpers = {
      * Format the given folder size into a string with an appropriate unit.
      *
      * @param aSize  The size in bytes to format.
      * @param aUnit  Optional unit to use for the format.
      *               Possible values are "KB" or "MB".
      * @return       An array with 2 values. First is the resulting formatted strings.
      *               The second one is the final unit used to format the string.
      */
-    formatFolderSize: function(aSize, aUnit = gFolderStatsHelpers.sizeUnits) {
+    formatFolderSize(aSize, aUnit = gFolderStatsHelpers.sizeUnits) {
       let size = Math.round(aSize / 1024);
       let unit = gFolderStatsHelpers.kiloUnit;
       // If size is non-zero try to show it in a unit that fits in 3 digits,
       // but if user specified a fixed unit, use that.
       if (aUnit != "KB" && (size > 999 || aUnit == "MB")) {
         size = Math.round(size / 1024);
         unit = gFolderStatsHelpers.megaUnit;
         aUnit = "MB";
       }
       // This needs to be updated if the "%.*f" placeholder string
       // in "*ByteAbbreviation2" in messenger.properties changes.
-      return [unit.replace("%.*f", size).replace(" ",""), aUnit];
-    }
+      return [unit.replace("%.*f", size).replace(" ", ""), aUnit];
+    },
 };
--- a/mail/base/content/foldersummary.js
+++ b/mail/base/content/foldersummary.js
@@ -36,17 +36,17 @@ class MozFolderSummary extends MozXULEle
         (folder.server instanceof Ci.nsINntpIncomingServer)) {
       return false;
     }
 
     let folderArray = [];
     let msgDatabase;
     try {
       msgDatabase = folder.msgDatabase;
-    } catch(e) {
+    } catch (e) {
       // The database for this folder may be missing (e.g. outdated/missing .msf),
       // so just skip this folder.
       return false;
     }
 
     if (folder.flags & Ci.nsMsgFolderFlags.Virtual) {
       let srchFolderUri = msgDatabase.dBFolderInfo.getCharProperty("searchFolderUri");
       let folderUris = srchFolderUri.split("|");
@@ -61,17 +61,17 @@ class MozFolderSummary extends MozXULEle
       folderArray.push(folder);
     }
 
     let foundNewMsg = false;
     for (let folder of folderArray) {
       // now get the database
       try {
         msgDatabase = folder.msgDatabase;
-      } catch(e) {
+      } catch (e) {
         // The database for this folder may be missing (e.g. outdated/missing .msf),
         // then just skip this folder.
         continue;
       }
 
       folder.msgDatabase = null;
       let msgKeys = {};
       let numMsgKeys = {};
--- a/mail/base/content/glodaFacetBindings.xml
+++ b/mail/base/content/glodaFacetBindings.xml
@@ -29,17 +29,17 @@
 
         let dis = this;
         let spanify = function(aText, aClass) {
           let span = document.createElement("span");
           span.setAttribute("class", aClass);
           span.textContent = aText;
           dis.appendChild(span);
           return span;
-        }
+        };
 
         let searchLabel = glodaFacetStrings.get(
           "glodaFacetView.search.label");
         spanify(searchLabel, "explanation-fulltext-label");
 
         let criteriaText = glodaFacetStrings.get(
           "glodaFacetView.constraints.query.fulltext." +
           (aMsgSearcher.andTerms ? "and" : "or") + "JoinWord");
@@ -59,43 +59,43 @@
 
         let dis = this;
         let spanify = function(aText, aClass) {
           let span = document.createElement("span");
           span.setAttribute("class", aClass);
           span.textContent = aText;
           dis.appendChild(span);
           return span;
-        }
+        };
 
         let label = glodaFacetStrings.get(
           "glodaFacetView.search.label");
         spanify(label, "explanation-query-label");
 
         let constraintStrings = [];
         for (let constraint of aMsgQuery._constraints) {
           if (constraint[0] != 1) return; // no idea what this is about
-          if (constraint[1].attributeName == 'involves') {
+          if (constraint[1].attributeName == "involves") {
             let involvesLabel = glodaFacetStrings.get(
               "glodaFacetView.constraints.query.involves.label");
-            involvesLabel = involvesLabel.replace("#1", constraint[2].value)
+            involvesLabel = involvesLabel.replace("#1", constraint[2].value);
             spanify(involvesLabel, "explanation-query-involves");
-          } else if (constraint[1].attributeName == 'tag') {
+          } else if (constraint[1].attributeName == "tag") {
             let tagLabel = glodaFacetStrings.get(
               "glodaFacetView.constraints.query.tagged.label");
             let tag = constraint[2];
             let tagNode = document.createElement("span");
             let colorClass = "blc-" + MailServices.tags.getColorForKey(tag.key).substr(1);
             tagNode.setAttribute("class", "message-tag tag " + colorClass);
             tagNode.textContent = tag.tag;
             spanify(tagLabel, "explanation-query-tagged");
             this.appendChild(tagNode);
           }
         }
-        label = label + constraintStrings.join(', '); // XXX l10n?
+        label = label + constraintStrings.join(", "); // XXX l10n?
       } catch (e) {
         logException(e);
       }
       ]]></body>
     </method>
   </implementation>
 </binding>
 
@@ -174,17 +174,17 @@
       this.checkbox = document.getAnonymousElementByAttribute(this, "anonid",
                                                               "checkbox");
       this.labelNode = document.getAnonymousElementByAttribute(this, "anonid",
                                                                "label");
       this.countNode = document.getAnonymousElementByAttribute(this, "anonid",
                                                                "count");
 
       let dis = this;
-      this.bubble.addEventListener("click", function (event) {
+      this.bubble.addEventListener("click", function(event) {
         return dis.bubbleClicked(event);
       }, true);
 
       this.extraSetup();
 
       if ("faceter" in this)
         this.build(true);
     ]]></constructor>
@@ -192,18 +192,17 @@
     <property name="disabled">
       <getter><![CDATA[
         return this.getAttribute("disabled") == "true";
       ]]></getter>
       <setter><![CDATA[
         if (val) {
           this.setAttribute("disabled", "true");
           this.checkbox.setAttribute("disabled", true);
-        }
-        else {
+        } else {
           this.removeAttribute("disabled");
           this.checkbox.removeAttribute("disabled");
         }
       ]]></setter>
     </property>
     <property name="checked">
       <getter><![CDATA[
         return this.getAttribute("checked") == "true";
@@ -216,18 +215,17 @@
           // the XBL inherits magic appears to fail if we explicitly check the
           //  box itself rather than via our click handler, presumably because
           //  we unshadow something.  So manually apply changes ourselves.
           this.setAttribute("checked", "true");
           this.checkbox.setAttribute("checked", "true");
           if (!this.disabled)
             FacetContext.addFacetConstraint(this.faceter, true,
                                             this.trueGroups);
-        }
-        else {
+        } else {
           this.removeAttribute("checked");
           this.checkbox.removeAttribute("checked");
           if (!this.disabled)
             FacetContext.removeFacetConstraint(this.faceter, true,
                                                this.trueGroups);
         }
         this.checkStateChanged();
       ]]></setter>
@@ -248,26 +246,25 @@
           this.checkbox.setAttribute("aria-label",
                                      this.facetDef.strings.facetNameLabel);
           this.trueValues = [];
         }
 
         // If we do not currently have a constraint applied and there is only
         //  one (or no) group, then: disable us, but reflect the underlying
         //  state of the data (checked or non-checked)
-        if (!this.faceter.constraint && (this.orderedGroups.length <= 1)){
+        if (!this.faceter.constraint && (this.orderedGroups.length <= 1)) {
           this.disabled = true;
           let count = 0;
           if (this.orderedGroups.length) {
             // true case?
             if (this.orderedGroups[0][0]) {
               count = this.orderedGroups[0][1].length;
               this.checked = true;
-            }
-            else {
+            } else {
               this.checked = false;
             }
           }
           this.countNode.textContent = count.toLocaleString();
           return;
         }
         // if we were disabled checked before, clear ourselves out
         if (this.disabled && this.checked)
@@ -275,17 +272,17 @@
         this.disabled = false;
 
         // if we are here, we have our 2 groups, find true...
         // (note: it is possible to get jerked around by null values
         //  currently, so leave a reasonable failure case)
         this.trueValues = [];
         this.trueGroups = [true];
         for (let groupPair of this.orderedGroups) {
-          if (groupPair[0] == true)
+          if (groupPair[0])
             this.trueValues = groupPair[1];
         }
 
         this.countNode.textContent = this.trueValues.length.toLocaleString();
       ]]></body>
     </method>
     <method name="bubbleClicked">
       <parameter name="event" />
@@ -384,19 +381,19 @@
         this.trueGroups = [];
         // the real true groups is the actual true values for our explicit
         //  filtering
         this.realTrueGroups = [];
         this.trueValues = [];
         this.falseValues = [];
         let selectNodes = [];
         for (let groupPair of this.orderedGroups) {
-          if (groupPair[0] == null)
+          if (groupPair[0] === null) {
             this.falseValues.push.apply(this.falseValues, groupPair[1]);
-          else {
+          } else {
             this.trueValues.push.apply(this.trueValues, groupPair[1]);
 
             let groupValue = groupPair[0];
             let selNode = document.createElement("option");
             selNode.textContent = groupValue[this.groupDisplayProperty];
             selNode.setAttribute("value", this.realTrueGroups.length);
             if (this.selectedValue == groupValue.category)
               selNode.setAttribute("selected", "selected");
@@ -426,18 +423,17 @@
       <parameter name="event" />
       <body><![CDATA[
         if (!this.checked)
           return;
         if (this.filterNode.value == "all") {
           this.selectedValue = "all";
           FacetContext.addFacetConstraint(this.faceter, true,
                                           this.trueGroups, false, true);
-        }
-        else {
+        } else {
           let groupValue = this.realTrueGroups[parseInt(this.filterNode.value)];
           this.selectedValue = groupValue.category;
           FacetContext.addFacetConstraint(this.faceter, true,
                                           [groupValue], false, true);
         }
       ]]></body>
     </method>
   </implementation>
@@ -486,26 +482,25 @@
                                                      "undo-item");
     ]]></constructor>
     <method name="_getLabel">
       <parameter name="facetDef"/>
       <parameter name="facetValue"/>
       <parameter name="groupValue"/>
       <parameter name="stringName"/>
       <body><![CDATA[
-        let label, labelFormat;
+        let labelFormat;
         if (stringName in facetDef.strings)
           labelFormat = facetDef.strings[stringName];
         else
           labelFormat = glodaFacetStrings.get(
-              "glodaFacetView.facets."+stringName+".fallbackLabel");
+              `glodaFacetView.facets.${stringName}.fallbackLabel`);
         if (!labelFormat.includes("#1"))
           return labelFormat;
-        else
-          return labelFormat.replace("#1", facetValue);
+        return labelFormat.replace("#1", facetValue);
       ]]></body>
     </method>
     <method name="build">
       <parameter name="facetDef"/>
       <parameter name="facetValue"/>
       <parameter name="groupValue"/>
       <body><![CDATA[
       try {
@@ -533,18 +528,16 @@
       ]]>
       </body>
     </method>
     <method name="moveFocus">
       <parameter name="event"/>
       <parameter name="delta"/>
       <body><![CDATA[
       try {
-        let parent = document.getAnonymousElementByAttribute(this,
-          "anonid", "parent");
         // We probably want something quite generic in the long term, but that
         // is way too much for now (needs to skip over invisible items, etc)
         let focused = document.activeElement;
         if (focused == this.includeNode)
           this.excludeNode.focus();
         else if (focused == this.excludeNode)
           this.includeNode.focus();
         event.preventDefault();
@@ -581,17 +574,17 @@
           this.node = barNode;
           this.facetNode = facetNode;
           let facetDef = facetNode.facetDef;
           let groupValue = barNode.groupValue;
           let variety = barNode.getAttribute("variety");
           let label = barNode.querySelector(".bar-link").textContent;
           this.build(facetDef, label, groupValue);
           this.node.setAttribute("selected", "true");
-          var rtl = window.getComputedStyle(this, null).direction == "rtl";
+          var rtl = window.getComputedStyle(this).direction == "rtl";
           /* We show different menus if we're on an "unselected" facet value,
              or if we're on a preselected facet value, whether included or
              excluded. The variety attribute handles that through CSS */
           this.setAttribute("variety", variety);
           let rect = barNode.getBoundingClientRect();
           let X, Y;
           if (event.type == "click") {
             // center the menu on the mouse click
@@ -757,18 +750,17 @@
                             this, "anonid", "content-box");
 
 
         // -- House-cleaning
         // -- All/Top mode decision
         this.modes = ["all"];
         if (this.maxDisplayRows >= this.orderedGroups.length) {
           this.mode = "all";
-        }
-        else {
+        } else {
           // top mode must be used
           this.modes.push("top");
           this.mode = "top";
           this.topGroups = FacetUtils.makeTopGroups(this.attrDef,
                                                     this.orderedGroups,
                                                     this.maxDisplayRows);
           // setup the more button string
           let groupCount = this.orderedGroups.length;
@@ -831,17 +823,17 @@
         //  then re-call for the long name.  We could be smarter by building
         //  a list of the input values that resulted in the output string and
         //  then using that to back-update the id map, but it's more compelx and
         //  the performance difference is unlikely to be meaningful.
         let ambiguousKeyValues;
         if ("userVisibleString" in nounDef) {
           ambiguousKeyValues = {};
           for (let groupPair of useGroups) {
-            let [groupValue, groupItems] = groupPair;
+            let [groupValue] = groupPair;
 
             // skip null values, they are handled by the none special-case
             if (groupValue == null)
               continue;
 
             let groupStr = nounDef.userVisibleString(groupValue, false);
             // We use hasOwnProperty because it is possible that groupStr could
             //  be the same as the name of one of the attributes on
@@ -887,51 +879,45 @@
           label.addEventListener("mouseleave", function() {
             rootBinding.setAttribute("title", "");
           });
 
           // The null value is a special indicator for 'none'
           if (groupValue == null) {
             label.textContent =
               glodaFacetStrings.get("glodaFacetView.facets.noneLabel");
-          }
-          // Otherwise stringify the group object
-          else {
+          } else {
+            // Otherwise stringify the group object
             let labelStr;
             if (ambiguousKeyValues) {
               labelStr = nounDef.userVisibleString(groupValue, false);
               if (ambiguousKeyValues[labelStr])
                 labelStr = nounDef.userVisibleString(groupValue, true);
-            }
-            else if ("labelFunc" in this.facetDef) {
+            } else if ("labelFunc" in this.facetDef) {
               labelStr = this.facetDef.labelFunc(groupValue);
-            }
-            else {
+            } else {
               labelStr = groupValue.toLocaleString().substring(0, 80);
             }
             label.textContent = labelStr;
           }
           li.appendChild(label);
 
           // root it under the appropriate list
           if (constraint) {
             if (constraint.isIncludedGroup(groupValue)) {
               li.setAttribute("variety", "include");
               includeList.appendChild(li);
-            }
-            else if (constraint.isExcludedGroup(groupValue)) {
+            } else if (constraint.isExcludedGroup(groupValue)) {
               li.setAttribute("variety", "exclude");
               excludeList.appendChild(li);
-            }
-            else {
+            } else {
               li.setAttribute("variety", "remainder");
               remainderList.appendChild(li);
             }
-          }
-          else {
+          } else {
             li.setAttribute("variety", "remainder");
             remainderList.appendChild(li);
           }
         }
 
         this.updateHeaderStates();
       ]]></body>
     </method>
@@ -1006,19 +992,19 @@
       <body><![CDATA[
         function getRect(aElement) {
           let box = aElement.getBoundingClientRect();
           let documentElement = aElement.ownerDocument.documentElement;
           return {
             top: box.top + window.pageYOffset - documentElement.clientTop,
             left: box.left + window.pageXOffset - documentElement.clientLeft,
             width: box.width,
-            height: box.height
+            height: box.height,
           };
-        };
+        }
         // figure out our origin location prior to adding the target or it
         //  will shift us down.
         let origin = getRect(aBarNode);
 
         // clone the node into its target location
         let targetNode = aBarNode.cloneNode(true);
         targetNode.groupValue = aBarNode.groupValue;
         targetNode.groupItems = aBarNode.groupItems;
@@ -1048,19 +1034,19 @@
         flyingNode.style.top = origin.top + "px";
         flyingNode.style.left = origin.left + "px";
         flyingNode.style.zIndex = 1000;
 
         flyingNode.style.transitionDuration = (Math.abs(dest.top - origin.top) * 2) + "ms";
         flyingNode.style.transitionProperty = "top, left";
 
         flyingNode.addEventListener("transitionend", function() {
-          aBarNode.parentNode.removeChild(aBarNode);
+          aBarNode.remove();
           targetNode.style.display = "block";
-          flyingNode.parentNode.removeChild(flyingNode);
+          flyingNode.remove();
 
           if (aCallback)
             setTimeout(aCallback, 50);
         });
 
         document.body.appendChild(flyingNode);
 
         // animate the flying clone... flying!
@@ -1078,51 +1064,48 @@
         delete aBarNode.groupItems;
       ]]></body>
     </method>
     <method name="barClicked">
       <parameter name="aBarNode" />
       <parameter name="aVariety" />
       <body><![CDATA[
         let groupValue = aBarNode.groupValue;
-        let groupItems = aBarNode.groupItems;
         let dis = this;
         // These determine what goAnimate actually does.
         // flyAway allows us to cancel flying in the case the constraint is
         //  being fully dropped and so the facet is just going to get rebuilt
         let flyAway = true;
 
         function goAnimate() {
-          setTimeout(function () {
+          setTimeout(function() {
             if (flyAway) {
               dis.afterListVisible(aVariety, function() {
                 dis._flyBarAway(aBarNode, aVariety, function() {
                   dis.updateHeaderStates();
                 });
               });
             }
           }, 0);
-        };
+        }
 
         // Immediately apply the facet change, triggering the animation after
         //  the faceting completes.
         if (aVariety == "remainder") {
           let currentVariety = aBarNode.getAttribute("variety");
           let constraintGone = FacetContext.removeFacetConstraint(
                                  this.faceter,
                                  currentVariety == "include",
                                  [groupValue],
                                  goAnimate);
           // we will automatically rebuild if the constraint is gone, so
           //  just make the animation a no-op.
           if (constraintGone)
             flyAway = false;
-        }
-        // include/exclude
-        else {
+        } else { // include/exclude
           let revalidate = FacetContext.addFacetConstraint(
                              this.faceter,
                              aVariety == "include",
                              [groupValue],
                              false, false, goAnimate);
           // revalidate means we need to blow away the other dudes, in which
           //  case it makes the most sense to just trigger a rebuild of ourself
           if (revalidate) {
@@ -1191,23 +1174,23 @@
           // of it, or perhaps the facet-more button, or maybe something
           // else that we'll handle in the next version.  We walk up its
           // parent chain until we get to the right level of the DOM
           // hierarchy, or the facet-content which seems to be the root.
           if (this.currentNode)
             this.currentNode.removeAttribute("selected");
 
           let node = event.originalTarget;
-          while ((! (node && node.hasAttribute && node.hasAttribute("class"))) ||
+          while ((!(node && node.hasAttribute && node.hasAttribute("class"))) ||
                  (!node.classList.contains("bar") &&
                   !node.classList.contains("facet-more") &&
                   !node.classList.contains("facet-content")))
             node = node.parentNode;
 
-          if (! (node && node.hasAttribute && node.hasAttribute("class")))
+          if (!(node && node.hasAttribute && node.hasAttribute("class")))
             return false;
 
           this.currentNode = node;
           node.setAttribute("selected", "true");
           if (node.classList.contains("bar"))
             document.getElementById("popup-menu").show(event, this, node);
           else if (node.classList.contains("facet-more"))
             this.changeMode("all");
@@ -1300,17 +1283,17 @@
           "glodaFacetView.results.header.countLabel.ofN");
         let groupingFormat = glodaFacetStrings.get(
           "glodaFacetView.results.header.countLabel.grouping");
 
         let displayCount = aMessages.length;
         let totalCount = FacetContext.activeSet.length;
 
         // set the count so CSS selectors can know what the results look like
-        this.setAttribute("state", (totalCount <= 0)? "empty" : "some");
+        this.setAttribute("state", (totalCount <= 0) ? "empty" : "some");
 
         let topMessagesStr = PluralForm.get(displayCount,
                                             topMessagesPluralFormat)
                                        .replace("#1",
                                                 displayCount.toLocaleString());
         let outOfStr = PluralForm.get(totalCount,
                                       outOfPluralFormat)
                                  .replace("#1", totalCount.toLocaleString());
@@ -1324,59 +1307,59 @@
         let visible = aMessages.some(m => m instanceof GlodaMessage);
         showNode.style.display = visible ? "inline" : "none";
         showNode.textContent = glodaFacetStrings.get(
           "glodaFacetView.results.message.openEmailAsList.label");
         showNode.setAttribute("title", glodaFacetStrings.get(
           "glodaFacetView.results.message.openEmailAsList.tooltip"));
         showNode.onkeypress = function(event) {
           if (event.charCode == KeyEvent.DOM_VK_SPACE) {
-            FacetContext.showActiveSetInTab()
+            FacetContext.showActiveSetInTab();
             event.preventDefault();
           }
-        }
+        };
 
         let sortLabelNode = document.getAnonymousElementByAttribute(
                           this, "anonid", "sort-label");
         sortLabelNode.textContent = glodaFacetStrings.get(
           "glodaFacetView.results.message.sort.label");
 
         let sortRelevanceNode = document.getAnonymousElementByAttribute(
                           this, "anonid", "sort-relevance");
         sortRelevanceNode.textContent = glodaFacetStrings.get(
           "glodaFacetView.results.message.sort.relevance");
 
         let dis = this;
         sortRelevanceNode.onclick = function() {
-          FacetContext.sortBy = '-dascore';
+          FacetContext.sortBy = "-dascore";
           dis.updateSortLabels();
-        }
+        };
         sortRelevanceNode.onkeypress = function(event) {
           if (event.charCode == KeyEvent.DOM_VK_SPACE) {
-            FacetContext.sortBy = '-dascore';
+            FacetContext.sortBy = "-dascore";
             dis.updateSortLabels();
             event.preventDefault();
           }
-        }
+        };
 
         let sortDateNode = document.getAnonymousElementByAttribute(
                           this, "anonid", "sort-date");
         sortDateNode.textContent = glodaFacetStrings.get(
           "glodaFacetView.results.message.sort.date");
         sortDateNode.onclick = function() {
-          FacetContext.sortBy = '-date';
+          FacetContext.sortBy = "-date";
           dis.updateSortLabels();
-        }
+        };
         sortDateNode.onkeypress = function(event) {
           if (event.charCode == KeyEvent.DOM_VK_SPACE) {
-            FacetContext.sortBy = '-date';
+            FacetContext.sortBy = "-date";
             dis.updateSortLabels();
             event.preventDefault();
           }
-        }
+        };
 
         this.updateSortLabels(FacetContext.sortBy);
 
         let messagesNode = document.getAnonymousElementByAttribute(
                              this, "anonid", "messages");
         while (messagesNode.hasChildNodes())
           messagesNode.lastChild.remove();
       try {
@@ -1393,17 +1376,17 @@
       ]]></body>
     </method>
     <method name="ensureNodeVisible">
       <parameter name="messageIndex"/>
       <body><![CDATA[
         let messagesNode = document.getAnonymousElementByAttribute(
                              this, "anonid", "messages");
         let message = messagesNode.childNodes[messageIndex];
-        window.scrollTo(0, $(message).position()['top'] + $(window).scrollTop());
+        window.scrollTo(0, $(message).position().top + $(window).scrollTop());
       ]]></body>
     </method>
 
     <method name="updateSortLabels">
       <body><![CDATA[
       try {
         let sortBy = FacetContext.sortBy;
         let sortRelevanceNode = document.getAnonymousElementByAttribute(
@@ -1413,17 +1396,17 @@
 
         if (sortBy == "-dascore") {
           sortRelevanceNode.setAttribute("selected", "true");
           sortDateNode.removeAttribute("selected");
         } else if (sortBy == "-date") {
           sortRelevanceNode.removeAttribute("selected");
           sortDateNode.setAttribute("selected", "true");
         }
-      } catch (e ) {
+      } catch (e) {
         logException(e);
       }
       ]]></body>
     </method>
   </implementation>
 </binding>
 
 <binding id="result-message">
@@ -1470,42 +1453,42 @@
         // -- eventify
         subject.onclick = function(aEvent) {
           FacetContext.showConversationInTab(this,
                                              aEvent.button == 1);
         }.bind(this);
         subject.onkeypress = function(aEvent) {
           if (aEvent.keyCode == aEvent.DOM_VK_RETURN)
             FacetContext.showConversationInTab(this,
-                                               aEvent.shiftKey == true);
+                                               aEvent.shiftKey);
         }.bind(this);
 
         // -- Content Poking
         if (message.subject.trim() == "")
           subject.textContent = glodaFacetStrings.get("glodaFacetView.result.message.noSubject");
         else
           subject.textContent = message.subject;
         let authorNode = anonElem("author");
         authorNode.setAttribute("title", message.from.value);
-        authorNode.textContent = message.from.contact.name
+        authorNode.textContent = message.from.contact.name;
         let toNode = anonElem("to");
         toNode.textContent = glodaFacetStrings.get("glodaFacetView.result.message.toLabel");
 
-        //anonElem("author").textContent = ;
+        // anonElem("author").textContent = ;
         anonElem("date").textContent = makeFriendlyDateAgo(message.date);
 
         // - Recipients
       try {
         let recipientsNode = anonElem("recipients");
         if (message.recipients) {
           let recipientCount = 0;
           const MAX_RECIPIENTS = 3;
           let totalRecipientCount = message.recipients.length;
           let recipientSeparator = glodaFacetStrings.get(
-              "glodaFacetView.results.message.recipientSeparator")
+            "glodaFacetView.results.message.recipientSeparator");
           for (let index in message.recipients) {
             let recipNode = document.createElement("span");
             recipNode.setAttribute("class", "message-recipient");
             recipNode.textContent = message.recipients[index].contact.name;
             recipientsNode.appendChild(recipNode);
             recipientCount++;
             if (recipientCount == MAX_RECIPIENTS)
               break;
@@ -1517,32 +1500,32 @@
               recipientsNode.appendChild(sepNode);
             }
           }
           if (totalRecipientCount > MAX_RECIPIENTS) {
             let nOthers = totalRecipientCount - recipientCount;
             let andNOthers = document.createElement("span");
             andNOthers.setAttribute("class", "message-recipients-andothers");
 
-            let andOthersLabel= PluralForm.get(nOthers, glodaFacetStrings.get(
-                              "glodaFacetView.results.message.andOthers"))
-                             .replace("#1", nOthers);
+            let andOthersLabel = PluralForm.get(
+              nOthers, glodaFacetStrings.get("glodaFacetView.results.message.andOthers")
+            ).replace("#1", nOthers);
 
             andNOthers.textContent = andOthersLabel;
             recipientsNode.appendChild(andNOthers);
           }
         }
       } catch (e) {
         logException(e);
       }
 
         // - Starred
         let starNode = anonElem("star");
         if (message.starred) {
-          starNode.setAttribute("starred", "true")
+          starNode.setAttribute("starred", "true");
         }
 
         // - Attachments
         if (message.attachmentNames) {
           let attachmentsNode = anonElem("attachments");
           let imgNode = document.createElement("div");
           imgNode.setAttribute("class", "message-attachment-icon");
           attachmentsNode.appendChild(imgNode);
@@ -1605,18 +1588,24 @@
             let charCodeToByteCount = function(c) {
               // UTF-8 stores:
               // - code points below U+0080 on 1 byte,
               // - code points below U+0800 on 2 bytes,
               // - code points U+D800 through U+DFFF are UTF-16 surrogate halves
               // (they indicate that JS has split a 4 bytes UTF-8 character
               // in two halves of 2 bytes each),
               // - other code points on 3 bytes.
-              return c < 0x80 ? 1 : (c < 0x800 || (c >= 0xD800 && c <= 0xDFFF)) ? 2 : 3;
-            }
+              if (c < 0x80) {
+                return 1;
+              }
+              if (c < 0x800 || (c >= 0xD800 && c <= 0xDFFF)) {
+                return 2;
+              }
+              return 3;
+            };
             let byteOffset = 0;
             let offset = 0;
             for (let match of matches) {
               while (byteOffset < match[0])
                 byteOffset += charCodeToByteCount(bodyText.charCodeAt(offset++));
               match[0] = offset;
               for (let i = offset; i < offset + match[1]; ++i) {
                 let size = charCodeToByteCount(bodyText.charCodeAt(i));
@@ -1654,19 +1643,19 @@
               ++startIndex;
             bodyText = ellipses + bodyText.substring(startIndex);
             // The first line will only contain the ellipsis as the character
             // at startIndex is always \n, so we show an additional line.
             ++maxLineCount;
           }
 
           for (let newlineCount = 0; newlineCount < maxLineCount; newlineCount++) {
-            idxNewline = bodyText.indexOf("\n", idxNewline+1);
+            idxNewline = bodyText.indexOf("\n", idxNewline + 1);
             if (idxNewline == -1) {
-              ellipses = '';
+              ellipses = "";
               break;
             }
           }
           let snippet = "";
           if (idxNewline > -1)
             snippet = bodyText.substring(0, idxNewline);
           else
             snippet = bodyText;
--- a/mail/base/content/glodaFacetTab.js
+++ b/mail/base/content/glodaFacetTab.js
@@ -12,20 +12,20 @@ var glodaFacetTabType = {
   name: "glodaFacet",
   perTabPanel: "vbox",
   lastTabId: 0,
   strings:
     new StringBundle("chrome://messenger/locale/glodaFacetView.properties"),
   modes: {
     glodaFacet: {
       // this is what get exposed on the tab for icon purposes
-      type: "glodaSearch"
-    }
+      type: "glodaSearch",
+    },
   },
-  openTab: function glodaFacetTabType_openTab(aTab, aArgs) {
+  openTab(aTab, aArgs) {
     // we have no browser until our XUL document loads
     aTab.browser = null;
 
     // First clone the page and set up the basics.
     let clone = document.getElementById("glodaTab")
                         .firstChild
                         .cloneNode(true);
 
@@ -38,33 +38,31 @@ var glodaFacetTabType = {
     searchInput.focus();
 
     if ("query" in aArgs) {
       aTab.query = aArgs.query;
       aTab.collection = aTab.query.getCollection();
 
       aTab.title = this.strings.get("glodaFacetView.tab.query.label");
       aTab.searchString = null;
-    }
-    else if ("searcher" in aArgs) {
+    } else if ("searcher" in aArgs) {
       aTab.searcher = aArgs.searcher;
       aTab.collection = aTab.searcher.getCollection();
       aTab.query = aTab.searcher.query;
       if ("IMSearcher" in aArgs) {
         aTab.IMSearcher = aArgs.IMSearcher;
         aTab.IMCollection = aArgs.IMSearcher.getCollection();
         aTab.IMQuery = aTab.IMSearcher.query;
       }
 
       let searchString = aTab.searcher.searchString;
       aTab.searchInputValue = aTab.searchString = searchString;
       aTab.title = searchString ? searchString
                    : this.strings.get("glodaFacetView.tab.search.label");
-    }
-    else if ("collection" in aArgs) {
+    } else if ("collection" in aArgs) {
       aTab.collection = aArgs.collection;
 
       aTab.title = this.strings.get("glodaFacetView.tab.query.label");
       aTab.searchString = null;
     }
 
     function xulLoadHandler() {
       aTab.iframe.contentWindow.tab = aTab;
@@ -74,21 +72,21 @@ var glodaFacetTabType = {
     }
 
     aTab.iframe.contentWindow.addEventListener("load", xulLoadHandler, {capture: false, once: true});
     aTab.iframe.setAttribute("src",
       "chrome://messenger/content/glodaFacetViewWrapper.xul");
 
     this.lastTabId++;
   },
-  closeTab: function glodaFacetTabType_closeTab(aTab) {
+  closeTab(aTab) {
   },
-  saveTabState: function glodaFacetTabType_saveTabState(aTab) {
+  saveTabState(aTab) {
     // nothing to do; we are not multiplexed
   },
-  showTab: function glodaFacetTabType_showTab(aTab) {
+  showTab(aTab) {
     // nothing to do; we are not multiplexed
   },
-  getBrowser: function(aTab) {
+  getBrowser(aTab) {
     return aTab.browser;
-  }
+  },
 };
 
--- a/mail/base/content/glodaFacetView.js
+++ b/mail/base/content/glodaFacetView.js
@@ -34,17 +34,17 @@ var glodaFacetStrings =
 function ActiveSingularConstraint(aFaceter, aRanged) {
   this.faceter = aFaceter;
   this.attrDef = aFaceter.attrDef;
   this.facetDef = aFaceter.facetDef;
   this.ranged = Boolean(aRanged);
   this.clear();
 }
 ActiveSingularConstraint.prototype = {
-  _makeQuery: function() {
+  _makeQuery() {
     // have the faceter make the query and the invert decision for us if it
     //  implements the makeQuery method.
     if ("makeQuery" in this.faceter) {
       [this.query, this.invertQuery] = this.faceter.makeQuery(this.groupValues,
                                                               this.inclusive);
       return;
     }
 
@@ -67,17 +67,17 @@ ActiveSingularConstraint.prototype = {
    *  Mainly, if the inclusive flag is the same as what we already have, we
    *  just append the new values to the existing set of values.  If it is not
    *  the same, we replace them.
    *
    * @return true if the caller needs to revalidate their understanding of the
    *     constraint because we have flipped whether we are inclusive or
    *     exclusive and have thrown away some constraints as a result.
    */
-  constrain: function(aInclusive, aGroupValues) {
+  constrain(aInclusive, aGroupValues) {
     if (aInclusive == this.inclusive) {
       this.groupValues = this.groupValues.concat(aGroupValues);
       this._makeQuery();
       return false;
     }
 
     let needToRevalidate = (this.inclusive != null);
     this.inclusive = aInclusive;
@@ -87,17 +87,17 @@ ActiveSingularConstraint.prototype = {
     return needToRevalidate;
   },
   /**
    * Relax something we previously constrained.  Remove it, some might say.  It
    *  is possible after relaxing that we will no longer be an active constraint.
    *
    * @return true if we are no longer constrained at all.
    */
-  relax: function(aInclusive, aGroupValues) {
+  relax(aInclusive, aGroupValues) {
     if (aInclusive != this.inclusive)
       throw new Error("You can't relax a constraint that isn't possible.");
 
     for (let groupValue of aGroupValues) {
       let index = this.groupValues.indexOf(groupValue);
       if (index == -1)
         throw new Error("Tried to relax a constraint that was not in force.");
       this.groupValues.splice(index, 1);
@@ -114,52 +114,52 @@ ActiveSingularConstraint.prototype = {
    * Indicate whether this constraint is actually doing anything anymore.
    */
   get isConstrained() {
     return this.inclusive != null;
   },
   /**
    * Clear the constraint so that the next call to adjust initializes it.
    */
-  clear: function() {
+  clear() {
     this.inclusive = null;
     this.groupValues = null;
     this.query = null;
     this.invertQuery = null;
   },
   /**
    * Filter the items against our constraint.
    */
-  sieve: function(aItems) {
+  sieve(aItems) {
     let query = this.query;
     let expectedResult = !this.invertQuery;
     return aItems.filter(item => query.test(item) == expectedResult);
   },
-  isIncludedGroup: function(aGroupValue) {
+  isIncludedGroup(aGroupValue) {
     if (!this.inclusive)
       return false;
     return this.groupValues.includes(aGroupValue);
   },
-  isExcludedGroup: function(aGroupValue) {
+  isExcludedGroup(aGroupValue) {
     if (this.inclusive)
       return false;
     return this.groupValues.includes(aGroupValue);
-  }
+  },
 };
 
 function ActiveNonSingularConstraint(aFaceter, aRanged) {
   this.faceter = aFaceter;
   this.attrDef = aFaceter.attrDef;
   this.facetDef = aFaceter.facetDef;
   this.ranged = Boolean(aRanged);
 
   this.clear();
 }
 ActiveNonSingularConstraint.prototype = {
-  _makeQuery: function(aInclusive, aGroupValues) {
+  _makeQuery(aInclusive, aGroupValues) {
     // have the faceter make the query and the invert decision for us if it
     //  implements the makeQuery method.
     if ("makeQuery" in this.faceter) {
       // returns [query, invertQuery] directly
       return this.faceter.makeQuery(aGroupValues, aInclusive);
     }
 
     let query = Gloda.newQuery(Gloda.NOUN_MESSAGE);
@@ -178,17 +178,17 @@ ActiveNonSingularConstraint.prototype = 
   },
 
   /**
    * Adjust the constraint given the incoming faceting constraint desired.
    *  Mainly, if the inclusive flag is the same as what we already have, we
    *  just append the new values to the existing set of values.  If it is not
    *  the same, we replace them.
    */
-  constrain: function(aInclusive, aGroupValues) {
+  constrain(aInclusive, aGroupValues) {
     let groupIdAttr = this.attrDef.objectNounDef.isPrimitive ? null
                         : this.facetDef.groupIdAttr;
     let idMap = aInclusive ? this.includedGroupIds
                            : this.excludedGroupIds;
     let valList = aInclusive ? this.includedGroupValues
                              : this.excludedGroupValues;
     for (let groupValue of aGroupValues) {
       let valId = (groupIdAttr !== null && groupValue != null) ?
@@ -206,17 +206,17 @@ ActiveNonSingularConstraint.prototype = 
     return false;
   },
   /**
    * Relax something we previously constrained.  Remove it, some might say.  It
    *  is possible after relaxing that we will no longer be an active constraint.
    *
    * @return true if we are no longer constrained at all.
    */
-  relax: function(aInclusive, aGroupValues) {
+  relax(aInclusive, aGroupValues) {
     let groupIdAttr = this.attrDef.objectNounDef.isPrimitive ? null
                         : this.facetDef.groupIdAttr;
     let idMap = aInclusive ? this.includedGroupIds
                            : this.excludedGroupIds;
     let valList = aInclusive ? this.includedGroupValues
                              : this.excludedGroupValues;
     for (let groupValue of aGroupValues) {
       let valId = (groupIdAttr !== null && groupValue != null) ?
@@ -229,18 +229,17 @@ ActiveNonSingularConstraint.prototype = 
       valList.splice(index, 1);
     }
 
     if (valList.length == 0) {
       if (aInclusive)
         this.includeQuery = null;
       else
         this.excludeQuery = null;
-    }
-    else {
+    } else {
       let [query, invertQuery] = this._makeQuery(aInclusive, valList);
       if (aInclusive && !invertQuery)
         this.includeQuery = query;
       else
         this.excludeQuery = query;
     }
 
     return this.includeQuery == null && this.excludeQuery == null;
@@ -249,42 +248,42 @@ ActiveNonSingularConstraint.prototype = 
    * Indicate whether this constraint is actually doing anything anymore.
    */
   get isConstrained() {
     return this.includeQuery == null && this.excludeQuery == null;
   },
   /**
    * Clear the constraint so that the next call to adjust initializes it.
    */
-  clear: function() {
+  clear() {
     this.includeQuery = null;
     this.includedGroupIds = {};
     this.includedGroupValues = [];
 
     this.excludeQuery = null;
     this.excludedGroupIds = {};
     this.excludedGroupValues = [];
   },
   /**
    * Filter the items against our constraint.
    */
-  sieve: function(aItems) {
+  sieve(aItems) {
     let includeQuery = this.includeQuery;
     let excludeQuery = this.excludeQuery;
     return aItems.filter(item => (!includeQuery || includeQuery.test(item)) &&
                                  (!excludeQuery || !excludeQuery.test(item)));
   },
-  isIncludedGroup: function(aGroupValue) {
+  isIncludedGroup(aGroupValue) {
     let valId = aGroupValue[this.facetDef.groupIdAttr];
     return (valId in this.includedGroupIds);
   },
-  isExcludedGroup: function(aGroupValue) {
+  isExcludedGroup(aGroupValue) {
     let valId = aGroupValue[this.facetDef.groupIdAttr];
     return (valId in this.excludedGroupIds);
-  }
+  },
 };
 
 var FacetContext = {
   facetDriver: new FacetDriver(Gloda.lookupNounDef("message"), window),
 
   /**
    * The root collection which our active set is a subset of.  We hold onto this
    *  for garbage collection reasons, although the tab that owns us should also
@@ -322,52 +321,52 @@ var FacetContext = {
 
   /**
    * fullSet is a special attribute which is passed a set of items that we're
    * displaying, but the order of which is determined by the sortBy property.
    * On setting the fullSet, we compute both sorted lists, and then on getting,
    * we return the appropriate one.
    */
   get fullSet() {
-    return (this._sortBy == '-dascore' ?
+    return (this._sortBy == "-dascore" ?
             this._relevantSortedItems :
             this._dateSortedItems);
   },
 
   set fullSet(items) {
     let scores;
     if (this.searcher && this.searcher.scores)
       scores = this.searcher.scores;
     else
       scores = Gloda.scoreNounItems(items);
     let scoredItems = items.map(function(item, index) { return [scores[index], item]; });
-    scoredItems.sort((a, b) => b[0]-a[0]);
+    scoredItems.sort((a, b) => b[0] - a[0]);
     this._relevantSortedItems = scoredItems.map(scoredItem => scoredItem[1]);
 
     this._dateSortedItems =
-      this._relevantSortedItems.concat().sort((a, b) => b.date-a.date);
+      this._relevantSortedItems.concat().sort((a, b) => b.date - a.date);
   },
 
-  initialBuild: function() {
+  initialBuild() {
     let queryExplanation = document.getElementById("query-explanation");
     if (this.searcher)
       queryExplanation.setFulltext(this.searcher);
     else
       queryExplanation.setQuery(this.collection.query);
     // we like to sort them so should clone the list
     this.faceters = this.facetDriver.faceters.concat();
 
     this._timelineShown = !Services.prefs.getBoolPref("gloda.facetview.hidetimeline");
 
     this.everFaceted = false;
     this._activeConstraints = {};
     if (this.searcher)
-      this._sortBy = '-dascore';
+      this._sortBy = "-dascore";
     else
-      this._sortBy = '-date';
+      this._sortBy = "-date";
     this.fullSet = this._removeDupes(this._collection.items.concat());
     if ("IMCollection" in this)
       this.fullSet = this.fullSet.concat(this.IMCollection.items);
     this.build(this.fullSet);
   },
 
   /**
    * Remove duplicate messages from search results.
@@ -377,17 +376,17 @@ var FacetContext = {
    *
    * Some IMAP servers (here's looking at you, Gmail) will create message
    * duplicates unbeknownst to the user.  We'd like to deal with them earlier
    * in the pipeline, but that's a bit hard right now.  So as a workaround
    * we'd rather not show them in the Search Results UI.  The simplest way
    * of doing that is just to cull (from the display) messages with have the
    * Message-ID of a message already displayed.
    */
-  _removeDupes: function(aItems) {
+  _removeDupes(aItems) {
     let deduped = [];
     let msgIdsSeen = {};
     for (let item of aItems) {
       if (item.headerMessageID in msgIdsSeen)
         continue;
       deduped.push(item);
       msgIdsSeen[item.headerMessageID] = true;
     }
@@ -395,54 +394,54 @@ var FacetContext = {
   },
 
   /**
    * Kick-off a new faceting pass.
    *
    * @param aNewSet the set of items to facet.
    * @param aCallback the callback to invoke when faceting is completed.
    */
-  build: function(aNewSet, aCallback) {
+  build(aNewSet, aCallback) {
     this._activeSet = aNewSet;
     this._callbackOnFacetComplete = aCallback;
     this.facetDriver.go(this._activeSet, this.facetingCompleted, this);
   },
 
   /**
    * Attempt to figure out a reasonable number of rows to limit each facet to
    *  display.  While the number will ordinarily be dominated by the maximum
    *  number of rows we believe the user can easily scan, this may also be
    *  impacted by layout concerns (since we want to avoid scrolling).
    */
-  planLayout: function() {
+  planLayout() {
     // XXX arbitrary!
     this.maxDisplayRows = 8;
     this.maxMessagesToShow = 10;
   },
 
   /**
    * Clean up the UI in preparation for a new query to come in.
    */
-  _resetUI: function() {
+  _resetUI() {
     for (let faceter of this.faceters) {
       if (faceter.xblNode && !faceter.xblNode.explicit)
         faceter.xblNode.remove();
       faceter.xblNode = null;
       faceter.constraint = null;
     }
   },
 
-  _groupCountComparator: function(a, b) {
+  _groupCountComparator(a, b) {
     return b.groupCount - a.groupCount;
   },
   /**
    * Tells the UI about all the facets when notified by the |facetDriver| when
    *  it is done faceting everything.
    */
-  facetingCompleted: function() {
+  facetingCompleted() {
     this.planLayout();
 
     let uiFacets = document.getElementById("facets");
 
     if (!this.everFaceted) {
       this.everFaceted = true;
       this.faceters.sort(this._groupCountComparator);
       for (let faceter of this.faceters) {
@@ -473,114 +472,108 @@ var FacetContext = {
 
         // ignore facets that do not vary!
         if (faceter.groupCount <= 1) {
           faceter.xblNode = null;
           continue;
         }
 
         faceter.xblNode = uiFacets.addFacet(faceter.type, faceter.attrDef, {
-          faceter: faceter,
+          faceter,
           facetDef: faceter.facetDef,
           orderedGroups: faceter.orderedGroups,
           maxDisplayRows: this.maxDisplayRows,
-          explicit: false
+          explicit: false,
         });
       }
-    }
-    else {
+    } else {
       for (let faceter of this.faceters) {
         // Do not bother with un-displayed facets, or that are locked by a
         //  constraint.  But do bother if the widget can be updated without
         //  losing important data.
         if (!faceter.xblNode ||
             (faceter.constraint && !faceter.xblNode.canUpdate))
           continue;
 
         // hide things that have 0/1 groups now and are not constrained and not
         //  explicit
         if (faceter.groupCount <= 1 && !faceter.constraint &&
-            (!faceter.xblNode.explicit || faceter.type == "date"))
+            (!faceter.xblNode.explicit || faceter.type == "date")) {
           faceter.xblNode.style.display = "none";
-        // otherwise, update
-        else {
+        } else { // otherwise, update
           faceter.xblNode.orderedGroups = faceter.orderedGroups;
           faceter.xblNode.build(false);
           faceter.xblNode.style.display = "block";
         }
       }
     }
 
-    if (! this._timelineShown)
+    if (!this._timelineShown)
       this._hideTimeline(true);
 
     this._showResults();
 
     if (this._callbackOnFacetComplete) {
       let callback = this._callbackOnFacetComplete;
       this._callbackOnFacetComplete = null;
       callback();
     }
   },
 
-  _showResults: function()
-  {
+  _showResults() {
     let results = document.getElementById("results");
     let numMessageToShow = Math.min(this.maxMessagesToShow * this._numPages,
                                     this._activeSet.length);
     results.setMessages(this._activeSet.slice(0, numMessageToShow));
 
     let showLoading = document.getElementById("showLoading");
     showLoading.style.display = "none"; /* hide spinner, we're done thinking */
 
     let showEmpty = document.getElementById("showEmpty");
     let dateToggle = document.getElementById("date-toggle");
     /* check for no messages at all */
     if (this._activeSet.length == 0) {
       showEmpty.style.display = "block";
       dateToggle.style.display = "none";
-    }
-    else {
+    } else {
       showEmpty.style.display = "none";
       dateToggle.style.display = "block";
     }
 
     let showMore = document.getElementById("showMore");
     if (this._activeSet.length > numMessageToShow)
       showMore.style.display = "block";
     else
       showMore.style.display = "none";
   },
 
-  showMore: function() {
+  showMore() {
     this._numPages += 1;
     this._showResults();
-    let results = document.getElementById("results");
   },
 
-
-  zoomOut: function() {
-    let facetDate = document.getElementById('facet-date');
-    this.removeFacetConstraint(facetDate.faceter, true, facetDate.vis.constraints)
+  zoomOut() {
+    let facetDate = document.getElementById("facet-date");
+    this.removeFacetConstraint(facetDate.faceter, true, facetDate.vis.constraints);
     facetDate.setAttribute("zoomedout", "true");
   },
 
-  toggleTimeline: function() {
+  toggleTimeline() {
     try {
-      this._timelineShown = ! this._timelineShown;
+      this._timelineShown = !this._timelineShown;
       if (this._timelineShown)
         this._showTimeline();
       else
         this._hideTimeline(false);
     } catch (e) {
       logException(e);
     }
   },
 
-  _showTimeline: function() {
+  _showTimeline() {
     let facetDate = document.getElementById("facet-date");
     if (facetDate.style.display == "none") {
       facetDate.style.display = "inherit";
       // Force binding attachment so the transition to the
       // visible state actually happens.
       facetDate.getBoundingClientRect();
     }
     let listener = () => {
@@ -590,17 +583,17 @@ var FacetContext = {
       facetDate.removeAttribute("style");
     };
     facetDate.addEventListener("transitionend", listener, {once: true});
     facetDate.removeAttribute("hide");
     document.getElementById("date-toggle").removeAttribute("tucked");
     Services.prefs.setBoolPref("gloda.facetview.hidetimeline", false);
   },
 
-  _hideTimeline: function(immediate) {
+  _hideTimeline(immediate) {
     let facetDate = document.getElementById("facet-date");
     if (immediate)
       facetDate.style.display = "none";
     facetDate.style.overflow = "hidden";
     facetDate.setAttribute("hide", "true");
     document.getElementById("date-toggle").setAttribute("tucked", "true");
     Services.prefs.setBoolPref("gloda.facetview.hidetimeline", true);
   },
@@ -613,47 +606,47 @@ var FacetContext = {
   fakeResultAttr: {},
 
   _numPages: 1,
   _HOVER_STABILITY_DURATION_MS: 100,
   _brushedFacet: null,
   _brushedGroup: null,
   _brushedItems: null,
   _brushTimeout: null,
-  hoverFacet: function(aFaceter, aAttrDef, aGroupValue, aGroupItems) {
+  hoverFacet(aFaceter, aAttrDef, aGroupValue, aGroupItems) {
     // bail if we are already brushing this item
     if (this._brushedFacet == aFaceter && this._brushedGroup == aGroupValue)
       return;
 
     this._brushedFacet = aFaceter;
     this._brushedGroup = aGroupValue;
     this._brushedItems = aGroupItems;
 
     if (this._brushTimeout != null)
       clearTimeout(this._brushTimeout);
     this._brushTimeout = setTimeout(this._timeoutHoverWrapper,
                                     this._HOVER_STABILITY_DURATION_MS, this);
 
   },
-  _timeoutHover: function() {
+  _timeoutHover() {
     this._brushTimeout = null;
     for (let faceter of this.faceters) {
       if (faceter == this._brushedFacet || !faceter.xblNode)
         continue;
 
       if (this._brushedItems != null)
         faceter.xblNode.brushItems(this._brushedItems);
       else
         faceter.xblNode.clearBrushedItems();
     }
   },
-  _timeoutHoverWrapper: function(aThis) {
+  _timeoutHoverWrapper(aThis) {
     aThis._timeoutHover();
   },
-  unhoverFacet: function(aFaceter, aAttrDef, aGroupValue, aGroupItems) {
+  unhoverFacet(aFaceter, aAttrDef, aGroupValue, aGroupItems) {
     // have we already brushed from some other source already?  ignore then.
     if (this._brushedFacet != aFaceter || this._brushedGroup != aGroupValue)
       return;
 
     // reuse hover facet to null everyone out
     this.hoverFacet(null, null, null, null);
   },
 
@@ -687,30 +680,28 @@ var FacetContext = {
    *     a date constraint applied.)
    * @param [aCallback] The callback to call once (re-)faceting has completed.
    *
    * @return true if the caller needs to revalidate because the constraint has
    *     changed in a way other than explicitly requested.  This can occur if
    *     a singular constraint flips its inclusive state and throws away
    *     constraints.
    */
-  addFacetConstraint: function(aFaceter, aInclusive, aGroupValues,
-                               aRanged, aNukeExisting, aCallback) {
+  addFacetConstraint(aFaceter, aInclusive, aGroupValues, aRanged, aNukeExisting, aCallback) {
     let attrName = aFaceter.attrDef.attributeName;
 
     let constraint;
     let needToSieveAll = false;
     if (attrName in this._activeConstraints) {
       constraint = this._activeConstraints[attrName];
 
       needToSieveAll = true;
       if (aNukeExisting)
         constraint.clear();
-    }
-    else {
+    } else {
       let constraintClass = aFaceter.attrDef.singular ? ActiveSingularConstraint
                               : ActiveNonSingularConstraint;
       constraint = this._activeConstraints[attrName] =
         new constraintClass(aFaceter, aRanged);
       aFaceter.constraint = constraint;
     }
     let needToRevalidate = constraint.constrain(aInclusive, aGroupValues);
 
@@ -739,18 +730,17 @@ var FacetContext = {
    * @param aGroupValues The list of group values to remove.
    * @param aCallback The callback to call once all facets have been updated.
    *
    * @return true if the constraint has been completely removed.  Under the
    *     current regime, this will likely cause the binding that is calling us
    *     to be rebuilt, so be aware if you are trying to do any cool animation
    *     that might no longer make sense.
    */
-  removeFacetConstraint: function(aFaceter, aInclusive, aGroupValues,
-                                  aCallback) {
+  removeFacetConstraint(aFaceter, aInclusive, aGroupValues, aCallback) {
     let attrName = aFaceter.attrDef.attributeName;
     let constraint = this._activeConstraints[attrName];
 
     let constraintGone = false;
 
     if (constraint.relax(aInclusive, aGroupValues)) {
       delete this._activeConstraints[attrName];
       aFaceter.constraint = null;
@@ -762,99 +752,99 @@ var FacetContext = {
 
     return constraintGone;
   },
 
   /**
    * Sieve the items from the underlying collection against all constraints,
    *  returning the value.
    */
-  _sieveAll: function() {
+  _sieveAll() {
     let items = this.fullSet;
 
     for (let elem in this._activeConstraints) {
       items = this._activeConstraints[elem].sieve(items);
     }
 
     return items;
   },
 
-  toggleFulltextCriteria: function() {
+  toggleFulltextCriteria() {
     this.tab.searcher.andTerms = !this.tab.searcher.andTerms;
     this._resetUI();
     this.collection = this.tab.searcher.getCollection(this);
   },
 
   /**
    * Show the active message set in a glodaList tab.
    */
-  showActiveSetInTab: function() {
+  showActiveSetInTab() {
     let tabmail = this.rootWin.document.getElementById("tabmail");
     tabmail.openTab("glodaList", {
       collection: Gloda.explicitCollection(Gloda.NOUN_MESSAGE, this.activeSet),
-      title: this.tab.title
+      title: this.tab.title,
     });
   },
 
   /**
    * Show the conversation in a new glodaList tab.
    *
    * @param {glodaFacetBindings.xml#result-message} aResultMessage The
    *     result the user wants to see in more details.
    * @param {Boolean} [aBackground] Whether it should be in the background.
    */
-  showConversationInTab: function(aResultMessage, aBackground) {
+  showConversationInTab(aResultMessage, aBackground) {
     let tabmail = this.rootWin.document.getElementById("tabmail");
     let message = aResultMessage.message;
     if ("IMCollection" in this &&
         message instanceof Gloda.lookupNounDef("im-conversation").clazz) {
       tabmail.openTab("chat", {
         convType: "log",
         conv: message,
         searchTerm: aResultMessage.firstMatchText,
-        background: aBackground
+        background: aBackground,
       });
       return;
     }
     tabmail.openTab("glodaList", {
       conversation: message.conversation,
-      message: message,
+      message,
       title: message.conversation.subject,
-      background: aBackground
+      background: aBackground,
     });
   },
 
   /**
    * Show the message in a new tab.
    *
    * @param {GlodaMessage} aMessage The message to show.
    * @param {Boolean} [aBackground] Whether it should be in the background.
    */
-  showMessageInTab: function(aMessage, aBackground) {
+  showMessageInTab(aMessage, aBackground) {
     let tabmail = this.rootWin.document.getElementById("tabmail");
     let msgHdr = aMessage.folderMessage;
     if (!msgHdr)
       throw new Error("Unable to translate gloda message to message header.");
     tabmail.openTab("message", {
-      msgHdr: msgHdr,
-      background: aBackground
+      msgHdr,
+      background: aBackground,
     });
   },
 
-  onItemsAdded: function(aItems, aCollection) {
+  onItemsAdded(aItems, aCollection) {
   },
-  onItemsModified: function(aItems, aCollection) {
+  onItemsModified(aItems, aCollection) {
   },
-  onItemsRemoved: function(aItems, aCollection) {
+  onItemsRemoved(aItems, aCollection) {
   },
-  onQueryCompleted: function(aCollection) {
+  onQueryCompleted(aCollection) {
     if (this.tab.query.completed &&
         (!("IMQuery" in this.tab) || this.tab.IMQuery.completed))
       this.initialBuild();
-  }
+  },
 };
 
 /**
  * addEventListener betrayals compel us to establish our link with the
  *  outside world from inside.  NeilAway suggests the problem might have
  *  been the registration of the listener prior to initiating the load.  Which
  *  is odd considering it works for the XUL case, but I could see how that might
  *  differ.  Anywho, this works for now and is a delightful reference to boot.
@@ -876,28 +866,27 @@ function reachOutAndTouchFrame() {
   //  removal notifications are required.
   if ("searcher" in aTab) {
     FacetContext.searcher = aTab.searcher;
     aTab.searcher.listener = FacetContext;
     if ("IMSearcher" in aTab) {
       FacetContext.IMSearcher = aTab.IMSearcher;
       aTab.IMSearcher.listener = FacetContext;
     }
-  }
-  else {
+  } else {
     FacetContext.searcher = null;
     aTab.collection.listener = FacetContext;
   }
   FacetContext.collection = aTab.collection;
   if ("IMCollection" in aTab)
     FacetContext.IMCollection = aTab.IMCollection;
 
   // if it has already completed, we need to prod things
   if (aTab.query.completed && (!("IMQuery" in aTab) || aTab.IMQuery.completed))
     FacetContext.initialBuild();
 }
 
 function clickOnBody(event) {
   if (event.bubbles) {
-    document.getElementById('popup-menu').hide();
+    document.getElementById("popup-menu").hide();
   }
   return 0;
 }
--- a/mail/base/content/glodaFacetVis.js
+++ b/mail/base/content/glodaFacetVis.js
@@ -14,22 +14,22 @@
 function DateFacetVis(aBinding, aCanvasNode) {
   this.binding = aBinding;
   this.canvasNode = aCanvasNode;
 
   this.faceter = aBinding.faceter;
   this.attrDef = this.faceter.attrDef;
 }
 DateFacetVis.prototype = {
-  build: function() {
+  build() {
     let resultsBarRect = document.getElementById("results").getBoundingClientRect();
     this.allowedSpace = resultsBarRect.right - resultsBarRect.left;
     this.render();
   },
-  rebuild: function() {
+  rebuild() {
     this.render();
   },
 
   _MIN_BAR_SIZE_PX: 9,
   _BAR_SPACING_PX: 1,
 
   _MAX_BAR_SIZE_PX: 44,
 
@@ -51,24 +51,24 @@ DateFacetVis.prototype = {
    * Because of our love of sharpness, we will potentially under-use the space
    *  allocated to us.
    *
    * @param aPixels The number of linear content pixels we have to work with.
    *     You are in charge of the borders and such, so you subtract that off
    *     before you pass it in.
    * @return An object with attributes:
    */
-  makeIdealScaleGivenSpace: function(aPixels) {
+  makeIdealScaleGivenSpace(aPixels) {
     let facet = this.faceter;
     // build a scale and have it grow the edges based on the span
     let scale = pv.Scales.dateTime(facet.oldest, facet.newest);
 
     const Span = pv.Scales.DateTimeScale.Span;
-    const MS_MIN = 60*1000, MS_HOUR = 60*MS_MIN, MS_DAY = 24*MS_HOUR,
-          MS_WEEK = 7*MS_DAY, MS_MONTHISH = 31*MS_DAY, MS_YEARISH = 366*MS_DAY;
+    const MS_MIN = 60 * 1000, MS_HOUR = 60 * MS_MIN, MS_DAY = 24 * MS_HOUR,
+          MS_WEEK = 7 * MS_DAY, MS_MONTHISH = 31 * MS_DAY, MS_YEARISH = 366 * MS_DAY;
     const roughMap = {};
     roughMap[Span.DAYS] = MS_DAY;
     roughMap[Span.WEEKS] = MS_WEEK;
     // we overestimate since we want to slightly underestimate pixel usage
     //  in enoughPix's rough estimate
     roughMap[Span.MONTHS] = MS_MONTHISH;
     roughMap[Span.YEARS] = MS_YEARISH;
 
@@ -112,78 +112,73 @@ DateFacetVis.prototype = {
     let labelTiers = [];
     // add year spans in all cases, although whether we draw bars depends on if
     //  we are in year mode or not
     labelTiers.push({
       rules: (span == Span.YEARS) ? rules : scale.ruleValues(Span.YEARS, true),
       // We should not hit the null member of the array...
       label: [{ year: "numeric" }, { year: "2-digit" }, null],
       boost: (span == Span.YEARS),
-      noFringe: (span == Span.YEARS)
+      noFringe: (span == Span.YEARS),
     });
     // add month spans if we are days or weeks...
     if (spandex < 2) {
       labelTiers.push({
         rules: scale.ruleValues(Span.MONTHS, true),
         // try to use the full month, falling back to the short month
         label: [{ month: "long" }, { month: "short" }, null],
-        boost: false
+        boost: false,
       });
     }
     // add week spans if our granularity is days...
     if (span == Span.DAYS) {
       let numDays = delta / MS_DAY;
 
       // find out how many days we are talking about and add days if it's small
       //  enough, display both the date and the day of the week
       if (numDays <= this._MAX_DAY_COUNT_LABEL_DISPLAY) {
         labelTiers.push({
-          rules: rules,
+          rules,
           label: [{ day: "numeric" }, null],
-          boost: true, noFringe: true
+          boost: true, noFringe: true,
         });
         labelTiers.push({
-          rules: rules,
+          rules,
           label: [{ weekday: "short" }, null],
-          boost: true, noFringe: true
+          boost: true, noFringe: true,
         });
-      }
-      // show the weeks since we're at greater than a day time-scale
-      else {
+      } else {
+        // show the weeks since we're at greater than a day time-scale
         labelTiers.push({
           rules: scale.ruleValues(Span.WEEKS, true),
           // labeling weeks is nonsensical; no one understands ISO weeks
           //  numbers.
           label: [null],
-          boost: false
+          boost: false,
         });
       }
     }
 
-    return {
-      scale: scale, span: span, rules: rules, barPixBudget: barPixBudget,
-      labelTiers: labelTiers
-    };
+    return { scale, span, rules, barPixBudget, labelTiers };
   },
 
-  render: function() {
-    let {scale: scale, span: span, rules: rules, barPixBudget: barPixBudget,
-         labelTiers: labelTiers} =
+  render() {
+    let { scale, span, rules, barPixBudget, labelTiers } =
       this.makeIdealScaleGivenSpace(this.allowedSpace);
 
     barPixBudget = Math.floor(barPixBudget);
 
     let minBarPix = this._MIN_BAR_SIZE_PX + this._BAR_SPACING_PX;
     let maxBarPix = this._MAX_BAR_SIZE_PX + this._BAR_SPACING_PX;
 
     let barPix = Math.max(minBarPix, Math.min(maxBarPix, barPixBudget));
     let width = barPix * (rules.length - 1);
 
     let totalAxisLabelHeight = 0;
-    let isRTL = window.getComputedStyle(this.binding, null).direction == "rtl";
+    let isRTL = window.getComputedStyle(this.binding).direction == "rtl";
 
     // we need to do some font-metric calculations, so create a canvas...
     let fontMetricCanvas = document.createElement("canvas");
     let ctx = fontMetricCanvas.getContext("2d");
 
     // do the labeling logic,
     for (let labelTier of labelTiers) {
       let labelRules = labelTier.rules;
@@ -235,17 +230,16 @@ DateFacetVis.prototype = {
                                   this._AXIS_VERT_SPACING_PX;
 
           break;
         }
       }
     }
 
     let barWidth = barPix - this._BAR_SPACING_PX;
-    let barSpacing = this._BAR_SPACING_PX;
 
     width = barPix * (rules.length - 1);
     // we ideally want this to be the same size as the max rows translates to...
     let height = 100;
     let ch = height - totalAxisLabelHeight;
 
     let [bins, maxBinSize] = this.binBySpan(scale, span, rules);
 
@@ -271,18 +265,17 @@ DateFacetVis.prototype = {
       .left(function() { return isRTL ? null : (this.index * barPix); })
       .right(function() { return isRTL ? (this.index * barPix) : null; })
       .fillStyle("var(--barColor)")
       .event("mouseover", function(d) { return this.fillStyle("var(--barHlColor)"); })
       .event("mouseout", function(d) { return this.fillStyle("var(--barColor)"); })
       .event("click", function(d) {
           dis.constraints = [[d.startDate, d.endDate]];
           dis.binding.setAttribute("zoomedout", "false");
-          FacetContext.addFacetConstraint(faceter, true, dis.constraints,
-                                          true, true);
+          FacetContext.addFacetConstraint(faceter, true, dis.constraints, true, true);
         }
       );
 
     this.hotBars = vis.add(pv.Bar)
       .data(this.emptyBins)
       .bottom(0)
       .height(d => Math.floor(d * binScale))
       .width(() => barWidth)
@@ -298,72 +291,71 @@ DateFacetVis.prototype = {
         .right(d => isRTL ? Math.floor(width * d[0]) : null)
         .width(d => Math.floor(width * d[1]) - Math.floor(width * d[0]) - 1)
         .fillStyle("var(--dateColor)")
         .event("mouseover", function(d) { return this.fillStyle("var(--dateHLColor)"); })
         .event("mouseout", function(d) { return this.fillStyle("var(--dateColor)"); })
         .event("click", function(d) {
           dis.constraints = [[d[3], d[4]]];
           dis.binding.setAttribute("zoomedout", "false");
-          FacetContext.addFacetConstraint(faceter, true, dis.constraints,
-                                          true, true)
+          FacetContext.addFacetConstraint(faceter, true, dis.constraints, true, true);
         });
 
       if (labelTier.displayLabel) {
         labelBar.anchor("top").add(pv.Label)
           .font(this._AXIS_FONT)
           .textAlign("center")
           .textBaseline("top")
           .textStyle("black")
           .text(d => d[2]);
       }
     }
 
 
     vis.render();
   },
 
-  hoverItems: function(aItems) {
+  hoverItems(aItems) {
     let itemToBin = this.itemToBin;
     let bins = this.emptyBins.concat();
     for (let item of aItems) {
       if (item.id in itemToBin)
         bins[itemToBin[item.id]]++;
     }
     this.hotBars.data(bins);
     this.vis.render();
   },
 
-  clearHover: function() {
+  clearHover() {
     this.hotBars.data(this.emptyBins);
     this.vis.render();
   },
 
   /**
    * Bin items at the given span granularity with the set of rules generated
    *  for the given span.  This could equally as well be done as a pre-built
    *  array of buckets with a linear scan of items and a calculation of what
    *  bucket they should be placed in.
    */
-  binBySpan: function(aScale, aSpan, aRules, aItems) {
+  binBySpan(aScale, aSpan, aRules, aItems) {
     let bins = [];
     let maxBinSize = 0;
     let binCount = aRules.length - 1;
     let itemToBin = this.itemToBin = {};
 
     // We used to break this out by case, but that was a lot of code, and it was
     //  somewhat ridiculous.  So now we just do the simple, if somewhat more
     //  expensive thing.  Reviewer, feel free to thank me.
     // We do a pass through the rules, mapping each rounded rule to a bin.  We
     //  then do a pass through all of the items, rounding them down and using
     //  that to perform a lookup against the map.  We could special-case the
     //  rounding, but I doubt it's worth it.
     let binMap = {};
     for (let iRule = 0; iRule < binCount; iRule++) {
-      let binStartDate = aRules[iRule], binEndDate = aRules[iRule+1];
+      let binStartDate = aRules[iRule], binEndDate = aRules[iRule + 1];
       binMap[binStartDate.valueOf().toString()] = iRule;
       bins.push({items: [],
                  startDate: binStartDate,
                  endDate: binEndDate});
     }
     let attrKey = this.attrDef.boundName;
     for (let item of this.faceter.validItems) {
       let val = item[attrKey];
@@ -374,11 +366,11 @@ DateFacetVis.prototype = {
       itemToBin[item.id] = itemBin;
       bins[itemBin].items.push(item);
     }
     for (let bin of bins) {
       maxBinSize = Math.max(bin.items.length, maxBinSize);
     }
 
     return [bins, maxBinSize];
-  }
+  },
 
 };
--- a/mail/base/content/hiddenWindow.js
+++ b/mail/base/content/hiddenWindow.js
@@ -1,66 +1,65 @@
 /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-function hiddenWindowStartup()
-{
+function hiddenWindowStartup() {
   // Disable menus which are not appropriate
   let disabledItems = [
-      'menu_newFolder', 'newMailAccountMenuItem', 'newAccountMenuItem',
-      'menu_close', 'menu_saveAs', 'menu_saveAsFile', 'menu_newVirtualFolder',
-      'menu_find', 'menu_findCmd', 'menu_findAgainCmd', 'menu_sendunsentmsgs',
-      'menu_subscribe', 'menu_deleteFolder', 'menu_renameFolder', 'menu_select',
-      'menu_selectAll', 'menu_selectThread', 'menu_favoriteFolder',
-      'menu_properties', 'menu_Toolbars', 'menu_MessagePaneLayout',
-      'menu_showMessage', 'menu_showFolderPane', 'menu_FolderViews',
-      'viewSortMenu', 'groupBySort', 'viewMessageViewMenu',
-      'mailviewCharsetMenu', 'viewMessagesMenu', 'menu_expandAllThreads',
-      'collapseAllThreads', 'viewheadersmenu', 'viewBodyMenu',
-      'viewAttachmentsInlineMenuitem', 'viewFullZoomMenu', 'goNextMenu',
-      'menu_nextMsg', 'menu_nextUnreadMsg', 'menu_nextUnreadThread',
-      'goPreviousMenu', 'menu_prevMsg', 'menu_prevUnreadMsg', 'menu_goForward',
-      'menu_goBack', 'goStartPage', 'newMsgCmd', 'replyMainMenu',
-      'replySenderMainMenu', 'replyNewsgroupMainMenu', 'menu_replyToAll',
-      'menu_replyToList', 'menu_forwardMsg', 'forwardAsMenu',
-      'menu_editMsgAsNew', 'openMessageWindowMenuitem',
-      'openConversationMenuitem', 'moveMenu', 'copyMenu', 'moveToFolderAgain',
-      'tagMenu', 'markMenu', 'markReadMenuItem', 'menu_markThreadAsRead',
-      'menu_markReadByDate', 'menu_markAllRead', 'markFlaggedMenuItem',
-      'menu_markAsJunk', 'menu_markAsNotJunk', 'createFilter', 'killThread',
-      'killSubthread', 'watchThread', 'applyFilters', 'runJunkControls',
-      'deleteJunk', 'menu_import', 'searchMailCmd', 'searchAddressesCmd',
-      'filtersCmd', 'cmd_close', 'minimizeWindow', 'appmenu_markMenu',
-      'zoomWindow', 'appmenu_replyMainMenu', 'appmenu_replyNewsgroupMainMenu',
-      'appmenu_newFolder', 'appmenu_newMailAccountMenuItem', 'appmenu_close',
-      'appmenu_newAccountMenuItem', 'appmenu_saveAs', 'appmenu_saveAsFile',
-      'appmenu_newVirtualFolder', 'appmenu_viewBodyMenu', 'appmenu_goNextMenu',
-      'appmenu_findAgainCmd', 'appmenu_sendUnsentMsgs', 'appmenu_charsetMenu',
-      'appmenu_deleteFolder', 'appmenu_renameFolder', 'appmenu_favoriteFolder',
-      'appmenu_properties', 'appmenu_MessagePaneLayout', 'appmenu_showMessage',
-      'appmenu_showFolderPane', 'appmenu_FolderViews', 'appmenu_viewSortMenu',
-      'appmenu_groupBySort', 'appmenu_viewMessageViewMenu', 'appmenu_subscribe',
-      'appmenu_viewMessagesMenu', 'appmenu_expandAllThreads', 'appmenu_findCmd',
-      'appmenu_collapseAllThreads', 'appmenu_viewHeadersMenu', 'appmenu_find',
-      'appmenu_viewAttachmentsInlineMenuitem', 'appmenu_replySenderMainMenu',
-      'appmenu_nextMsg', 'appmenu_nextUnreadMsg', 'appmenu_nextUnreadThread',
-      'appmenu_goPreviousMenu', 'appmenu_prevMsg', 'appmenu_prevUnreadMsg',
-      'appmenu_goForward', 'appmenu_goBack', 'appmenu_goStartPage',
-      'appmenu_newMsgCmd', 'appmenu_viewFullZoomMenu', 'appmenu_replyToAll',
-      'appmenu_replyToList', 'appmenu_forwardMsg', 'appmenu_forwardAsMenu',
-      'appmenu_editMsgAsNew', 'appmenu_tagMenu', 'appmenu_moveToFolderAgain',
-      'appmenu_openMessageWindowMenuitem', 'appmenu_openConversationMenuitem',
-      'appmenu_moveMenu', 'appmenu_copyMenu', 'appmenu_createFilter',
-      'appmenu_killThread', 'appmenu_killSubthread'];
+    "menu_newFolder", "newMailAccountMenuItem", "newAccountMenuItem",
+    "menu_close", "menu_saveAs", "menu_saveAsFile", "menu_newVirtualFolder",
+    "menu_find", "menu_findCmd", "menu_findAgainCmd", "menu_sendunsentmsgs",
+    "menu_subscribe", "menu_deleteFolder", "menu_renameFolder", "menu_select",
+    "menu_selectAll", "menu_selectThread", "menu_favoriteFolder",
+    "menu_properties", "menu_Toolbars", "menu_MessagePaneLayout",
+    "menu_showMessage", "menu_showFolderPane", "menu_FolderViews",
+    "viewSortMenu", "groupBySort", "viewMessageViewMenu",
+    "mailviewCharsetMenu", "viewMessagesMenu", "menu_expandAllThreads",
+    "collapseAllThreads", "viewheadersmenu", "viewBodyMenu",
+    "viewAttachmentsInlineMenuitem", "viewFullZoomMenu", "goNextMenu",
+    "menu_nextMsg", "menu_nextUnreadMsg", "menu_nextUnreadThread",
+    "goPreviousMenu", "menu_prevMsg", "menu_prevUnreadMsg", "menu_goForward",
+    "menu_goBack", "goStartPage", "newMsgCmd", "replyMainMenu",
+    "replySenderMainMenu", "replyNewsgroupMainMenu", "menu_replyToAll",
+    "menu_replyToList", "menu_forwardMsg", "forwardAsMenu",
+    "menu_editMsgAsNew", "openMessageWindowMenuitem",
+    "openConversationMenuitem", "moveMenu", "copyMenu", "moveToFolderAgain",
+    "tagMenu", "markMenu", "markReadMenuItem", "menu_markThreadAsRead",
+    "menu_markReadByDate", "menu_markAllRead", "markFlaggedMenuItem",
+    "menu_markAsJunk", "menu_markAsNotJunk", "createFilter", "killThread",
+    "killSubthread", "watchThread", "applyFilters", "runJunkControls",
+    "deleteJunk", "menu_import", "searchMailCmd", "searchAddressesCmd",
+    "filtersCmd", "cmd_close", "minimizeWindow", "appmenu_markMenu",
+    "zoomWindow", "appmenu_replyMainMenu", "appmenu_replyNewsgroupMainMenu",
+    "appmenu_newFolder", "appmenu_newMailAccountMenuItem", "appmenu_close",
+    "appmenu_newAccountMenuItem", "appmenu_saveAs", "appmenu_saveAsFile",
+    "appmenu_newVirtualFolder", "appmenu_viewBodyMenu", "appmenu_goNextMenu",
+    "appmenu_findAgainCmd", "appmenu_sendUnsentMsgs", "appmenu_charsetMenu",
+    "appmenu_deleteFolder", "appmenu_renameFolder", "appmenu_favoriteFolder",
+    "appmenu_properties", "appmenu_MessagePaneLayout", "appmenu_showMessage",
+    "appmenu_showFolderPane", "appmenu_FolderViews", "appmenu_viewSortMenu",
+    "appmenu_groupBySort", "appmenu_viewMessageViewMenu", "appmenu_subscribe",
+    "appmenu_viewMessagesMenu", "appmenu_expandAllThreads", "appmenu_findCmd",
+    "appmenu_collapseAllThreads", "appmenu_viewHeadersMenu", "appmenu_find",
+    "appmenu_viewAttachmentsInlineMenuitem", "appmenu_replySenderMainMenu",
+    "appmenu_nextMsg", "appmenu_nextUnreadMsg", "appmenu_nextUnreadThread",
+    "appmenu_goPreviousMenu", "appmenu_prevMsg", "appmenu_prevUnreadMsg",
+    "appmenu_goForward", "appmenu_goBack", "appmenu_goStartPage",
+    "appmenu_newMsgCmd", "appmenu_viewFullZoomMenu", "appmenu_replyToAll",
+    "appmenu_replyToList", "appmenu_forwardMsg", "appmenu_forwardAsMenu",
+    "appmenu_editMsgAsNew", "appmenu_tagMenu", "appmenu_moveToFolderAgain",
+    "appmenu_openMessageWindowMenuitem", "appmenu_openConversationMenuitem",
+    "appmenu_moveMenu", "appmenu_copyMenu", "appmenu_createFilter",
+    "appmenu_killThread", "appmenu_killSubthread",
+  ];
 
   let element;
-  for (let id of disabledItems)
-  {
+  for (let id of disabledItems) {
     element = document.getElementById(id);
     if (element)
       element.setAttribute("disabled", "true");
   }
 
   // Also hide the window-list separator if it exists.
   element = document.getElementById("sep-window-list");
   if (element)
--- a/mail/base/content/macMessengerMenu.js
+++ b/mail/base/content/macMessengerMenu.js
@@ -46,49 +46,44 @@ function PrefWindowObserver() {
   };
 }
 
 /**
  * Show the Dock Options sub-dialog hanging from the Preferences window.
  * If Preference window was already opened, this will select General pane before
  * opening Dock Options sub-dialog.
  */
-function openDockOptions()
-{
+function openDockOptions() {
   let win = Services.wm.getMostRecentWindow("Mail:Preferences");
 
   if (win) {
     openOptionsDialog("paneGeneral");
     win.document.documentElement
        .openSubDialog("chrome://messenger/content/preferences/dockoptions.xul",
                       "", null);
   } else {
       Services.ww.registerNotification(new PrefWindowObserver());
       openOptionsDialog("paneGeneral");
   }
 }
 
 /**
  * Open a new window for writing a new message
  */
-function writeNewMessageDock()
-{
+function writeNewMessageDock() {
   // Default identity will be used as sender for the new message.
   MailServices.compose.OpenComposeWindow(null, null, null,
     Ci.nsIMsgCompType.New,
     Ci.nsIMsgCompFormat.Default, null, null);
 }
 
 /**
  * Open the address book window
  */
-function openAddressBookDock()
-{
+function openAddressBookDock() {
   let win = Services.wm.getMostRecentWindow("mail:addressbook");
   if (win) {
     win.focus();
   } else {
-    let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
-                                getService(Ci.nsIWindowWatcher);
-    ww.openWindow(null, "chrome://messenger/content/addressbook/addressbook.xul", null,
-                  "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", null);
+    Services.ww.openWindow(null, "chrome://messenger/content/addressbook/addressbook.xul", null,
+                           "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", null);
   }
 }
--- a/mail/base/content/mail-compacttheme.js
+++ b/mail/base/content/mail-compacttheme.js
@@ -63,10 +63,10 @@ var CompactTheme = {
   },
 
   uninit() {
     Services.obs.removeObserver(this, "lightweight-theme-styling-update");
     // If the getter still exists, remove it.
     if (Object.getOwnPropertyDescriptor(this, "styleSheet").get)
       delete this.styleSheet;
     this.styleSheet = null;
-  }
+  },
 };
--- a/mail/base/content/mail-offline.js
+++ b/mail/base/content/mail-offline.js
@@ -4,236 +4,213 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var MailOfflineMgr = {
   offlineManager: null,
   offlineBundle: null,
 
-  init: function()
-  {
+  init() {
     Services.obs.addObserver(this, "network:offline-status-changed");
 
     this.offlineManager = Cc["@mozilla.org/messenger/offline-manager;1"]
                         .getService(Ci.nsIMsgOfflineManager);
     this.offlineBundle = document.getElementById("bundle_offlinePrompts");
 
     // initialize our offline state UI
     this.updateOfflineUI(!this.isOnline());
   },
 
-  uninit: function()
-  {
+  uninit() {
     Services.obs.removeObserver(this, "network:offline-status-changed");
   },
 
   /**
    * @return true if we are online
    */
-   isOnline: function()
-   {
+   isOnline() {
      return (!Services.io.offline);
    },
 
   /**
    * Toggles the online / offline state, initiated by the user. Depending on user settings
    * we may prompt the user to send unsent messages when going online or to download messages for
    * offline use when going offline.
    */
-  toggleOfflineStatus: function()
-  {
+  toggleOfflineStatus() {
     // the offline manager(goOnline and synchronizeForOffline) actually does the dirty work of
     // changing the offline state with the networking service.
-    if (!this.isOnline())
-    {
+    if (!this.isOnline()) {
       // We do the go online stuff in our listener for the online state change.
       Services.io.offline = false;
       // resume managing offline status now that we are going back online.
       Services.io.manageOfflineStatus = Services.prefs.getBoolPref("offline.autoDetect");
-    }
-    else // going offline
-    {
+    } else { // going offline
       // Stop automatic management of the offline status since the user has
       // decided to go offline.
       Services.io.manageOfflineStatus = false;
       var prefDownloadMessages = Services.prefs.getIntPref("offline.download.download_messages");
       // 0 == Ask, 1 == Always Download, 2 == Never Download
       var downloadForOfflineUse = (prefDownloadMessages == 0 && this.confirmDownloadMessagesForOfflineUse())
                                   || prefDownloadMessages == 1;
       this.offlineManager.synchronizeForOffline(downloadForOfflineUse, downloadForOfflineUse, false, true, msgWindow);
     }
   },
 
-  observe: function (aSubject, aTopic, aState)
-  {
+  observe(aSubject, aTopic, aState) {
     if (aTopic == "network:offline-status-changed")
       this.mailOfflineStateChanged(aState == "offline");
   },
 
   /**
    * @return true if there are unsent messages
    */
-  haveUnsentMessages: function()
-  {
+  haveUnsentMessages() {
     return Cc["@mozilla.org/messengercompose/sendlater;1"]
              .getService(Ci.nsIMsgSendLater)
              .hasUnsentMessages();
   },
 
   /**
    * open the offline panel in the account manager for the currently loaded
    * account.
    */
-  openOfflineAccountSettings: function()
-  {
-    window.parent.MsgAccountManager('am-offline.xul');
+  openOfflineAccountSettings() {
+    window.parent.MsgAccountManager("am-offline.xul");
   },
 
   /**
    * Prompt the user about going online to send unsent messages, and then send them
    * if appropriate. Puts the app back into online mode.
    *
    * @param aMsgWindow the msg window to be used when going online
    */
-  goOnlineToSendMessages: function(aMsgWindow)
-  {
+  goOnlineToSendMessages(aMsgWindow) {
     let goOnlineToSendMsgs = Services.prompt.confirm(window,
-      this.offlineBundle.getString('sendMessagesOfflineWindowTitle1'),
-      this.offlineBundle.getString('sendMessagesOfflineLabel1'));
+      this.offlineBundle.getString("sendMessagesOfflineWindowTitle1"),
+      this.offlineBundle.getString("sendMessagesOfflineLabel1"));
 
     if (goOnlineToSendMsgs)
       this.offlineManager.goOnline(true /* send unsent messages*/, false, aMsgWindow);
   },
 
   /**
    * Prompts the user to confirm sending of unsent messages. This is different from
    * goOnlineToSendMessages which involves going online to send unsent messages.
    *
    * @return true if the user wants to send unsent messages
    */
-  confirmSendUnsentMessages: function()
-  {
+  confirmSendUnsentMessages() {
     let alwaysAsk = {value: true};
     let sendUnsentMessages = Services.prompt.confirmEx(window,
-      this.offlineBundle.getString('sendMessagesWindowTitle1'),
-      this.offlineBundle.getString('sendMessagesLabel2'),
+      this.offlineBundle.getString("sendMessagesWindowTitle1"),
+      this.offlineBundle.getString("sendMessagesLabel2"),
       (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) +
       (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1),
-      this.offlineBundle.getString('sendMessagesNow2'),
-      this.offlineBundle.getString('processMessagesLater2'),
+      this.offlineBundle.getString("sendMessagesNow2"),
+      this.offlineBundle.getString("processMessagesLater2"),
       null,
-      this.offlineBundle.getString('sendMessagesCheckboxLabel1'),
+      this.offlineBundle.getString("sendMessagesCheckboxLabel1"),
       alwaysAsk) == 0;
 
     // if the user changed the ask me setting then update the global pref based on their yes / no answer
     if (!alwaysAsk.value)
       Services.prefs.setIntPref("offline.send.unsent_messages", sendUnsentMessages ? 1 : 2);
 
     return sendUnsentMessages;
   },
 
   /**
    * Should we send unsent messages? Based on the value of
    * offline.send.unsent_messages, this method may prompt the user.
    * @return true if we should send unsent messages
    */
-  shouldSendUnsentMessages: function()
-  {
+  shouldSendUnsentMessages() {
     var sendUnsentWhenGoingOnlinePref = Services.prefs.getIntPref("offline.send.unsent_messages");
-    if(sendUnsentWhenGoingOnlinePref == 2) // never send
+    if (sendUnsentWhenGoingOnlinePref == 2) { // never send
       return false;
-
-    // if we we have unsent messages, then honor the offline.send.unsent_messages pref.
-    else if (this.haveUnsentMessages())
-    {
+    } else if (this.haveUnsentMessages()) {
+      // if we we have unsent messages, then honor the offline.send.unsent_messages pref.
       if ((sendUnsentWhenGoingOnlinePref == 0 && this.confirmSendUnsentMessages())
            || sendUnsentWhenGoingOnlinePref == 1)
         return true;
     }
     return false;
   },
 
   /**
    * Prompts the user to download messages for offline use before going offline.
    * May update the value of offline.download.download_messages
    *
    * @return true if the user wants to download messages for offline use.
    */
-  confirmDownloadMessagesForOfflineUse: function()
-  {
+  confirmDownloadMessagesForOfflineUse() {
     let alwaysAsk = {value: true};
     let downloadMessages = Services.prompt.confirmEx(window,
-      this.offlineBundle.getString('downloadMessagesWindowTitle1'),
-      this.offlineBundle.getString('downloadMessagesLabel1'),
+      this.offlineBundle.getString("downloadMessagesWindowTitle1"),
+      this.offlineBundle.getString("downloadMessagesLabel1"),
       (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) +
       (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1),
-      this.offlineBundle.getString('downloadMessagesNow2'),
-      this.offlineBundle.getString('processMessagesLater2'),
+      this.offlineBundle.getString("downloadMessagesNow2"),
+      this.offlineBundle.getString("processMessagesLater2"),
       null,
-      this.offlineBundle.getString('downloadMessagesCheckboxLabel1'),
+      this.offlineBundle.getString("downloadMessagesCheckboxLabel1"),
       alwaysAsk) == 0;
 
     // if the user changed the ask me setting then update the global pref based on their yes / no answer
     if (!alwaysAsk.value)
       Services.prefs.setIntPref("offline.download.download_messages", downloadMessages ? 1 : 2);
     return downloadMessages;
   },
 
   /**
    *  Get New Mail When Offline
    *  Prompts the user about going online in order to download new messages.
    *  Based on the response, will move us back to online mode.
    *
    * @return true if the user confirms going online.
    */
-  getNewMail: function()
-  {
+  getNewMail() {
     let goOnline = Services.prompt.confirm(window,
-      this.offlineBundle.getString('getMessagesOfflineWindowTitle1'),
-      this.offlineBundle.getString('getMessagesOfflineLabel1'));
+      this.offlineBundle.getString("getMessagesOfflineWindowTitle1"),
+      this.offlineBundle.getString("getMessagesOfflineLabel1"));
 
     if (goOnline)
       this.offlineManager.goOnline(this.shouldSendUnsentMessages(),
                                    false /* playbackOfflineImapOperations */, msgWindow);
     return goOnline;
   },
 
   /**
    * Private helper method to update the state of the Offline menu item
    * and the offline status bar indicator
    */
-  updateOfflineUI: function(aIsOffline)
-  {
+  updateOfflineUI(aIsOffline) {
     document.getElementById("goOfflineMenuItem").setAttribute("checked", aIsOffline);
     if (document.getElementById("appmenu_goOffline"))
       document.getElementById("appmenu_goOffline").setAttribute("checked", aIsOffline);
     var statusBarPanel = document.getElementById("offline-status");
-    if (aIsOffline)
-    {
+    if (aIsOffline) {
       statusBarPanel.setAttribute("offline", "true");
       statusBarPanel.setAttribute("tooltiptext", this.offlineBundle.getString("offlineTooltip"));
-    }
-    else
-    {
+    } else {
       statusBarPanel.removeAttribute("offline");
       statusBarPanel.setAttribute("tooltiptext", this.offlineBundle.getString("onlineTooltip"));
     }
   },
 
   /**
    * private helper method called whenever we detect a change to the offline state
    */
-  mailOfflineStateChanged: function (aGoingOffline)
-  {
+  mailOfflineStateChanged(aGoingOffline) {
     this.updateOfflineUI(aGoingOffline);
-    if (!aGoingOffline)
-    {
+    if (!aGoingOffline) {
       let prefSendUnsentMessages = Services.prefs.getIntPref("offline.send.unsent_messages");
       // 0 == Ask, 1 == Always Send, 2 == Never Send
       let sendUnsentMessages = (prefSendUnsentMessages == 0 &&
                                 this.haveUnsentMessages() &&
                                 this.confirmSendUnsentMessages()) ||
                                prefSendUnsentMessages == 1;
       this.offlineManager.goOnline(sendUnsentMessages, true, msgWindow);
     }
-  }
+  },
 };
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -8,22 +8,19 @@
  */
 
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 ChromeUtils.import("resource:///modules/MailUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 
 // Controller object for folder pane
-var FolderPaneController =
-{
-  supportsCommand: function(command)
-  {
-    switch ( command )
-    {
+var FolderPaneController = {
+  supportsCommand(command) {
+    switch (command) {
       case "cmd_delete":
       case "cmd_shiftDelete":
       case "button_delete":
       case "button_shiftDelete":
         // Even if the folder pane has focus, don't do a folder delete if
         // we have a selected message, but do a message delete instead.
         // Return false here supportsCommand and let the command fall back
         // to the DefaultController.
@@ -35,20 +32,18 @@ var FolderPaneController =
       case "cmd_paste":
         return true;
 
       default:
         return false;
     }
   },
 
-  isCommandEnabled: function(command)
-  {
-    switch ( command )
-    {
+  isCommandEnabled(command) {
+    switch (command) {
       case "cmd_cut":
       case "cmd_copy":
       case "cmd_paste":
         return false;
       case "cmd_delete":
       case "cmd_shiftDelete":
       case "button_delete":
       case "button_shiftDelete":
@@ -56,71 +51,62 @@ var FolderPaneController =
         // Make sure the button doesn't show "Undelete" for folders.
         UpdateDeleteToolbarButton();
         let folders = gFolderTreeView.getSelectedFolders();
         if (folders.length) {
           // XXX Figure out some better way/place to update the folder labels.
           UpdateDeleteLabelsFromFolderCommand(folders[0], command);
           return CanDeleteFolder(folders[0]) && folders[0].isCommandEnabled(command);
         }
-        else
-          return false;
+        return false;
       }
       default:
         return false;
     }
   },
 
-  doCommand: function(command)
-  {
+  doCommand(command) {
     // if the user invoked a key short cut then it is possible that we got here for a command which is
     // really disabled. kick out if the command should be disabled.
     if (!this.isCommandEnabled(command)) return;
 
-    switch ( command )
-    {
+    switch (command) {
       case "cmd_delete":
       case "cmd_shiftDelete":
       case "button_delete":
       case "button_shiftDelete":
       case "cmd_deleteFolder":
         gFolderTreeController.deleteFolder();
         break;
     }
   },
 
-  onEvent: function(event)
-  {
-  }
+  onEvent(event) {
+  },
 };
 
-function UpdateDeleteLabelsFromFolderCommand(folder, command)
-{
+function UpdateDeleteLabelsFromFolderCommand(folder, command) {
   if (command != "cmd_delete")
     return;
 
   if (folder.getFlag(Ci.nsMsgFolderFlags.Virtual)) {
     goSetMenuValue(command, "valueFolder");
-  }
-  else if (folder.server.type == "nntp") {
+  } else if (folder.server.type == "nntp") {
     goSetMenuValue(command, "valueNewsgroup");
     goSetAccessKey(command, "valueNewsgroupAccessKey");
-  }
-  else {
+  } else {
     goSetMenuValue(command, "valueFolder");
   }
 }
 
 // DefaultController object (handles commands when one of the trees does not have focus)
-var DefaultController =
-{
-  supportsCommand: function(command)
-  {
-    switch ( command )
-    {
+var DefaultController = {
+  /* eslint-disable complexity */
+  supportsCommand(command) {
+    switch (command) {
       case "cmd_createFilterFromPopup":
       case "cmd_archive":
       case "button_archive":
       case "cmd_newMessage":
       case "cmd_reply":
       case "button_reply":
       case "cmd_replySender":
       case "cmd_replyGroup":
@@ -265,20 +251,18 @@ var DefaultController =
       case "cmd_chatStatus":
         return !!chatHandler;
 
       default:
         return false;
     }
   },
 
-  isCommandEnabled: function(command)
-  {
-    switch (command)
-    {
+  isCommandEnabled(command) {
+    switch (command) {
       case "cmd_delete":
         UpdateDeleteCommand();
         // fall through
       case "button_delete":
         UpdateDeleteToolbarButton();
         return gFolderDisplay.getCommandStatus(nsMsgViewCommandType.deleteMsg);
       case "cmd_shiftDelete":
       case "button_shiftDelete":
@@ -338,40 +322,38 @@ var DefaultController =
       case "cmd_editTemplateMsg":
       case "cmd_openMessage":
       case "button_print":
       case "cmd_print":
       case "cmd_viewPageSource":
       case "cmd_reload":
       case "cmd_applyFiltersToSelection":
         let numSelected = gFolderDisplay.selectedCount;
-        if (command == "cmd_applyFiltersToSelection")
-        {
+        if (command == "cmd_applyFiltersToSelection") {
           var whichText = "valueMessage";
           if (numSelected > 1)
             whichText = "valueSelection";
           goSetMenuValue(command, whichText);
           goSetAccessKey(command, whichText + "AccessKey");
         }
-        if (numSelected > 0)
-        {
+        if (numSelected > 0) {
           if (!gFolderDisplay.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody))
             return false;
 
           // Check if we have a collapsed thread selected and are summarizing it.
           // If so, selectedIndices.length won't match numSelected. Also check
           // that we're not displaying a message, which handles the case
           // where we failed to summarize the selection and fell back to
           // displaying a message.
           if (gFolderDisplay.selectedIndices.length != numSelected &&
               command != "cmd_applyFiltersToSelection" &&
               gDBView && gDBView.currentlyDisplayedMessage == nsMsgViewIndex_None)
             return false;
           if (command == "cmd_reply" || command == "button_reply" ||
-              command == "cmd_replyall" ||command == "button_replyall")
+              command == "cmd_replyall" || command == "button_replyall")
             return IsReplyEnabled();
           if (command == "cmd_replylist" || command == "button_replylist")
             return IsReplyListEnabled();
           return true;
         }
         return false;
       case "cmd_printpreview":
         if (gFolderDisplay.selectedCount == 1)
@@ -524,49 +506,48 @@ var DefaultController =
       {
         let folder = GetSelectedMsgFolders()[0];
         return folder && folder.server.canEmptyTrashOnExit ?
                          IsMailFolderSelected() : false;
       }
       case "button_compact":
       {
         let folders = gFolderTreeView.getSelectedFolders();
-        let canCompact = function canCompact(folder) {
+        let canCompact = function(folder) {
           return !folder.isServer &&
             !(folder.getFlag(Ci.nsMsgFolderFlags.Virtual)) &&
             (folder.server.type != "imap" || folder.server.canCompactFoldersOnServer) &&
             folder.isCommandEnabled("button_compact");
-        }
+        };
         return folders && folders.every(canCompact);
       }
       case "cmd_compactFolder":
       {
         let folders = gFolderTreeView.getSelectedFolders();
-        let canCompactAll = function canCompactAll(folder) {
+        let canCompactAll = function(folder) {
           return (folder.server.type != "imap" ||
                   folder.server.canCompactFoldersOnServer) &&
-                  folder.isCommandEnabled("cmd_compactFolder") ;
-        }
+                  folder.isCommandEnabled("cmd_compactFolder");
+        };
         return folders && folders.every(canCompactAll);
       }
       case "cmd_setFolderCharset":
         return IsFolderCharsetEnabled();
       case "cmd_downloadFlagged":
-        return(IsFolderSelected() && MailOfflineMgr.isOnline());
+        return (IsFolderSelected() && MailOfflineMgr.isOnline());
       case "cmd_downloadSelected":
         return (IsFolderSelected() && MailOfflineMgr.isOnline() && gFolderDisplay.selectedCount > 0);
       case "cmd_synchronizeOffline":
         return MailOfflineMgr.isOnline();
       case "cmd_settingsOffline":
         return IsAccountOfflineEnabled();
       case "cmd_moveToFolderAgain":
         // Disable "Move to <folder> Again" for news and other read only
         // folders since we can't really move messages from there - only copy.
-        if (Services.prefs.getBoolPref("mail.last_msg_movecopy_was_move"))
-        {
+        if (Services.prefs.getBoolPref("mail.last_msg_movecopy_was_move")) {
           let loadedFolder = gFolderTreeView.getSelectedFolders()[0];
           if (loadedFolder && !loadedFolder.canDeleteMessages)
             return false;
         }
         let targetURI = Services.prefs.getCharPref("mail.last_msg_movecopy_target_uri");
         if (!targetURI)
           return false;
         let targetFolder = MailUtils.getFolderForURI(targetURI);
@@ -588,32 +569,27 @@ var DefaultController =
       case "cmd_newVirtualFolder":
         return !!gFolderTreeController;
       case "cmd_goFolder":
         return !!gFolderTreeView;
       case "cmd_joinChat":
       case "cmd_addChatBuddy":
       case "cmd_chatStatus":
         return !!chatHandler;
-
-      default:
-        return false;
     }
     return false;
   },
 
-  doCommand: function(command, aTab)
-  {
+  doCommand(command, aTab) {
     // If the user invoked a key short cut then it is possible that we got here
     // for a command which is really disabled. Kick out if the command should be disabled.
     if (!this.isCommandEnabled(command))
       return;
 
-    switch ( command )
-    {
+    switch (command) {
       case "button_getNewMessages":
       case "cmd_getNewMessages":
         MsgGetMessage();
         break;
       case "cmd_getMsgsForAuthAccounts":
         MsgGetMessagesForAllAuthenticatedAccounts();
         break;
       case "cmd_getNextNMessages":
@@ -694,31 +670,29 @@ var DefaultController =
         break;
       case "cmd_deleteFolder":
         gFolderTreeController.deleteFolder();
         break;
       case "cmd_killThread":
         if (!gFolderDisplay.selectedMessageIsNews) {
           if (!gFolderDisplay.selectedMessageThreadIgnored) {
             ShowIgnoredMessageNotification(gFolderDisplay.selectedMessages, false);
-          }
-          else {
+          } else {
             document.getElementById("msg-footer-notification-box")
                     .removeTransientNotifications();
           }
         }
         // kill thread kills the thread and then does a next unread
         GoNextMessage(nsMsgNavigationType.toggleThreadKilled, true);
         break;
       case "cmd_killSubthread":
         if (!gFolderDisplay.selectedMessageIsNews) {
           if (!gFolderDisplay.selectedMessageSubthreadIgnored) {
             ShowIgnoredMessageNotification(gFolderDisplay.selectedMessages, true);
-          }
-          else {
+          } else {
             document.getElementById("msg-footer-notification-box")
                     .removeTransientNotifications();
           }
         }
         GoNextMessage(nsMsgNavigationType.toggleSubthreadKilled, true);
         break;
       case "cmd_watchThread":
         gFolderDisplay.doCommand(nsMsgViewCommandType.toggleThreadWatched);
@@ -1019,26 +993,25 @@ var DefaultController =
       case "cmd_joinChat":
         chatHandler.joinChat();
         break;
       case "cmd_addChatBuddy":
         chatHandler.addBuddy();
         break;
     }
   },
+  /* eslint-enable complexity */
 
-  onEvent: function(event)
-  {
+  onEvent(event) {
     // on blur events set the menu item texts back to the normal values
-    if ( event == 'blur' )
-    {
-      goSetMenuValue('cmd_undo', 'valueDefault');
-      goSetMenuValue('cmd_redo', 'valueDefault');
+    if (event == "blur") {
+      goSetMenuValue("cmd_undo", "valueDefault");
+      goSetMenuValue("cmd_redo", "valueDefault");
     }
-  }
+  },
 };
 
 /**
  * Show a notification in the message pane footer, allowing the user to learn
  * more about the ignore thread feature, and also allowing undo ignore thread.
  * @param aMsgs the messages that were ignore
  * @param aSubThread only boolean indicating if it was ignore subthread or
  *                   ignore thread
@@ -1049,96 +1022,90 @@ function ShowIgnoredMessageNotification(
 
   let bundle = new StringBundle("chrome://messenger/locale/messenger.properties");
 
   let buttons = [
     {
       label:     bundle.get("learnMoreAboutIgnoreThread"),
       accessKey: bundle.get("learnMoreAboutIgnoreThreadAccessKey"),
       popup:     null,
-      callback:  function(aNotificationBar, aButton) {
+      callback(aNotificationBar, aButton) {
         let url = Services.prefs.getCharPref("mail.ignore_thread.learn_more_url");
         openContentTab(url);
         return true; // keep notification open
-      }
+      },
     },
     {
-      label:     bundle.get(!aSubthreadOnly ? "undoIgnoreThread":
+      label:     bundle.get(!aSubthreadOnly ? "undoIgnoreThread" :
                                               "undoIgnoreSubthread"),
-      accessKey: bundle.get(!aSubthreadOnly ? "undoIgnoreThreadAccessKey":
+      accessKey: bundle.get(!aSubthreadOnly ? "undoIgnoreThreadAccessKey" :
                                               "undoIgnoreSubthreadAccessKey"),
       isDefault: true,
       popup:     null,
-      callback:  function(aNotificationBar, aButton) {
+      callback(aNotificationBar, aButton) {
         aMsgs.forEach(function(msg) {
           let msgDb = msg.folder.msgDatabase;
           if (aSubthreadOnly) {
             msgDb.MarkHeaderKilled(msg, false, gDBView);
-          }
-          else {
+          } else {
             let thread = msgDb.GetThreadContainingMsgHdr(msg);
             msgDb.MarkThreadIgnored(thread, thread.threadKey, false, gDBView);
           }
         });
         return false; // close notification
-      }
-    }
+      },
+    },
   ];
 
   let threadIds = new Set();
   aMsgs.forEach(function(msg) {
     if (!threadIds.has(msg.threadId))
       threadIds.add(msg.threadId);
   });
   let nbrOfThreads = threadIds.size;
 
   if (nbrOfThreads == 1) {
     let ignoredThreadText = bundle.get(!aSubthreadOnly ?
-      "ignoredThreadFeedback": "ignoredSubthreadFeedback");
+      "ignoredThreadFeedback" : "ignoredSubthreadFeedback");
     let subj = aMsgs[0].mime2DecodedSubject || "";
     if (subj.length > 45)
       subj = subj.substring(0, 45) + "…";
     let text = ignoredThreadText.replace("#1", subj);
 
-    let notification = notifyBox.appendNotification(
+    notifyBox.appendNotification(
       text, "ignoreThreadInfo", null,
       notifyBox.PRIORITY_INFO_MEDIUM, buttons);
-  }
-  else {
+  } else {
     let ignoredThreadText = bundle.get(!aSubthreadOnly ?
-      "ignoredThreadsFeedback": "ignoredSubthreadsFeedback");
+      "ignoredThreadsFeedback" : "ignoredSubthreadsFeedback");
     let text = PluralForm.get(nbrOfThreads, ignoredThreadText).replace("#1", nbrOfThreads);
-    let notification = notifyBox.appendNotification(
+    notifyBox.appendNotification(
       text, "ignoreThreadsInfo", null,
       notifyBox.PRIORITY_INFO_MEDIUM, buttons);
   }
 }
 
-function CloseTabOrWindow()
-{
-  let tabmail = document.getElementById('tabmail');
+function CloseTabOrWindow() {
+  let tabmail = document.getElementById("tabmail");
   if (tabmail.tabInfo.length == 1) {
     if (Services.prefs.getBoolPref("mail.tabs.closeWindowWithLastTab"))
       window.close();
-  }
-  else {
+  } else {
     tabmail.removeCurrentTab();
   }
 }
 
-function GetNumSelectedMessages()
-{
+function GetNumSelectedMessages() {
   // This global function is only for mailnews/ compatibility.
   return gFolderDisplay.selectedCount;
 }
 
-var gLastFocusedElement=null;
+var gLastFocusedElement = null;
 
-function FocusRingUpdate_Mail()
-{
+function FocusRingUpdate_Mail() {
   if (!gFolderDisplay)
     return;
 
   // if the focusedElement is null, we're here on a blur.
   // nsFocusController::Blur() calls nsFocusController::SetFocusedElement(null),
   // which will update any commands listening for "focus".
   // we really only care about nsFocusController::Focus() happens,
   // which calls nsFocusController::SetFocusedElement(element)
@@ -1156,40 +1123,36 @@ function FocusRingUpdate_Mail()
     // since we just changed the pane with focus we need to update the toolbar to reflect this
     // XXX TODO
     // can we optimize
     // and just update cmd_delete and button_delete?
     UpdateMailToolbar("focus");
   }
 }
 
-function RestoreFocusAfterHdrButton()
-{
+function RestoreFocusAfterHdrButton() {
   // I would love to really restore the focus to the pane that had
   // focus before the user clicked on the hdr button, and gLastFocusedElement
   // would almost do that, except that clicking on the hdr button sets
   // gLastFocusedElement to the message pane. What I need is
   // gPenultimateFocusedElement.
   SetFocusThreadPane();
 }
 
-function SetupCommandUpdateHandlers()
-{
+function SetupCommandUpdateHandlers() {
   // folder pane
   var widget = document.getElementById("folderTree");
-  if ( widget )
+  if (widget)
     widget.controllers.appendController(FolderPaneController);
 }
 
-function UnloadCommandUpdateHandlers()
-{
+function UnloadCommandUpdateHandlers() {
 }
 
-function IsSendUnsentMsgsEnabled(unsentMsgsFolder)
-{
+function IsSendUnsentMsgsEnabled(unsentMsgsFolder) {
   // If no account has been configured, there are no messages for sending.
   if (MailServices.accounts.accounts.length == 0)
     return false;
 
   var msgSendlater =
     Cc["@mozilla.org/messengercompose/sendlater;1"]
       .getService(Ci.nsIMsgSendLater);
 
@@ -1216,18 +1179,17 @@ function IsSendUnsentMsgsEnabled(unsentM
     identity = MailServices.accounts.defaultAccount.defaultIdentity;
 
   return msgSendlater.hasUnsentMessages(identity);
 }
 
 /**
  * Determine whether there exists any server for which to show the Subscribe dialog.
  */
-function IsSubscribeEnabled()
-{
+function IsSubscribeEnabled() {
   // If there are any IMAP or News servers, we can show the dialog any time and
   // it will properly show those.
   let servers = MailServices.accounts.allServers;
   for (let server of fixIterator(servers,
                                  Ci.nsIMsgIncomingServer)) {
     if (server.type == "imap" || server.type == "nntp")
       return true;
   }
@@ -1236,69 +1198,62 @@ function IsSubscribeEnabled()
   // such an account is selected.
   let preselectedFolder = GetFirstSelectedMsgFolder();
   if (preselectedFolder && preselectedFolder.server.type == "rss")
     return true;
 
   return false;
 }
 
-function IsFolderCharsetEnabled()
-{
+function IsFolderCharsetEnabled() {
   return IsFolderSelected();
 }
 
-function IsPropertiesEnabled(command)
-{
+function IsPropertiesEnabled(command) {
   var folders = GetSelectedMsgFolders();
   if (!folders.length)
     return false;
   var folder = folders[0];
 
   // when servers are selected it should be "Edit | Properties..."
   if (folder.isServer)
     goSetMenuValue(command, "valueGeneric");
   else if (folder.getFlag(Ci.nsMsgFolderFlags.Virtual))
     goSetMenuValue(command, "valueFolder");
   else
     goSetMenuValue(command, isNewsURI(folder.URI) ? "valueNewsgroup" : "valueFolder");
 
    return (folders.length == 1);
 }
 
-function IsViewNavigationItemEnabled()
-{
+function IsViewNavigationItemEnabled() {
   return IsFolderSelected();
 }
 
-function IsFolderSelected()
-{
+function IsFolderSelected() {
   var folders = GetSelectedMsgFolders();
   return folders.length == 1 && !folders[0].isServer;
 }
 
-function SetFocusThreadPaneIfNotOnMessagePane()
-{
+function SetFocusThreadPaneIfNotOnMessagePane() {
   var focusedElement = gFolderDisplay.focusedPane;
 
-  if((focusedElement != GetThreadTree()) &&
-     (focusedElement != GetMessagePane()))
-     SetFocusThreadPane();
+  if ((focusedElement != GetThreadTree()) && (focusedElement != GetMessagePane()))
+    SetFocusThreadPane();
 }
 
 // 3pane related commands.  Need to go in own file.  Putting here for the moment.
 
 /**
  * Cycle through the various panes in the 3pane window (in reverse if the shift
  * key is being held down).
  *
  * @param event the event that triggered us
  */
-function SwitchPaneFocus(event)
-{
+function SwitchPaneFocus(event) {
   let messagePane = GetMessagePane();
 
   // First, build an array of panes to cycle through based on our current state.
   // This will usually be something like [threadPane, messagePane, folderPane].
   let panes = [GetThreadTree()];
 
   if (!IsMessagePaneCollapsed())
     panes.push(messagePane);
@@ -1309,97 +1264,86 @@ function SwitchPaneFocus(event)
   // Find our focused element in the array. If focus is not on one of the main
   // panes (it's probably on the toolbar), then act as if it's on the thread
   // tree.
   let focusedElement = gFolderDisplay.focusedPane;
   let focusedElementIndex = panes.indexOf(focusedElement);
   if (focusedElementIndex == -1)
     focusedElementIndex = 0;
 
-  if (event && event.shiftKey)
-  {
+  if (event && event.shiftKey) {
     focusedElementIndex--;
     if (focusedElementIndex == -1)
-      focusedElementIndex = panes.length-1;
-  }
-  else
-  {
+      focusedElementIndex = panes.length - 1;
+  } else {
     focusedElementIndex++;
     if (focusedElementIndex == panes.length)
       focusedElementIndex = 0;
   }
 
   let newElem = panes[focusedElementIndex];
 
   // We need to handle the message pane specially, since focusing it isn't as
   // simple as just calling focus(). See SetFocusMessagePane below for more
   // details.
   if (newElem == messagePane)
     SetFocusMessagePane();
   else
     newElem.focus();
 }
 
-function SetFocusThreadPane()
-{
+function SetFocusThreadPane() {
   var threadTree = GetThreadTree();
   threadTree.focus();
 }
 
 /**
  * Set the focus to the currently-active message pane (either the single- or
  * multi-message).
  */
-function SetFocusMessagePane()
-{
+function SetFocusMessagePane() {
   // Calling .focus() on content doesn't blur the previously focused chrome
   // element, so we shift focus to the XUL pane first, to not leave another
   // pane looking like it has focus.
   GetMessagePane().focus();
   if (gMessageDisplay.singleMessageDisplay)
     GetMessagePaneFrame().focus();
   else
     document.getElementById("multimessage").focus();
 }
 
 //
 // This function checks if the configured junk mail can be renamed or deleted.
 //
-function CanRenameDeleteJunkMail(aFolderUri)
-{
+function CanRenameDeleteJunkMail(aFolderUri) {
   if (!aFolderUri)
     return false;
 
   // Go through junk mail settings for all servers and see if the folder is set/used by anyone.
-  try
-  {
+  try {
     var allServers = accountManager.allServers;
 
-    for (var i = 0; i < allServers.length; i++)
-    {
+    for (var i = 0; i < allServers.length; i++) {
       var currentServer = allServers.queryElementAt(i, Ci.nsIMsgIncomingServer);
       var settings = currentServer.spamSettings;
       // If junk mail control or move junk mail to folder option is disabled then
       // allow the folder to be removed/renamed since the folder is not used in this case.
       if (!settings.level || !settings.moveOnSpam)
         continue;
       if (settings.spamFolderURI == aFolderUri)
         return false;
     }
-  }
-  catch(ex)
-  {
-      dump("Can't get all servers\n");
+  } catch (ex) {
+    dump("Can't get all servers\n");
   }
   return true;
 }
 
 /** Check if this is a folder the user is allowed to delete. */
-function CanDeleteFolder(folder)
-{
+function CanDeleteFolder(folder) {
   if (folder.isServer)
     return false;
 
   var specialFolder = getSpecialFolderString(folder);
 
   if (specialFolder == "Inbox" || specialFolder == "Trash" ||
       specialFolder == "Drafts" || specialFolder == "Sent" ||
       specialFolder == "Templates" || specialFolder == "Outbox" ||
--- a/mail/base/content/mailCommands.js
+++ b/mail/base/content/mailCommands.js
@@ -10,30 +10,29 @@ ChromeUtils.import("resource:///modules/
  * Get the identity that most likely is the best one to use, given the hint.
  * @param identities    nsIArray<nsIMsgIdentity> of identities
  * @param optionalHint  string containing comma separated mailboxes
  * @param useDefault    If true, use the default identity of the default
  *                      account as last choice. This is useful when all
  *                      identities are passed in. Otherwise, use the first
  *                      entity in the list.
  */
-function getBestIdentity(identities, optionalHint, useDefault = false)
-{
+function getBestIdentity(identities, optionalHint, useDefault = false) {
   let identityCount = identities.length;
   if (identityCount < 1)
     return null;
 
   // If we have more than one identity and a hint to help us pick one.
   if (identityCount > 1 && optionalHint) {
     // Normalize case on the optional hint to improve our chances of
     // finding a match.
     optionalHint = optionalHint.toLowerCase();
     let hints = optionalHint.toLowerCase().split(",");
 
-    for (let i = 0 ; i < hints.length; i++) {
+    for (let i = 0; i < hints.length; i++) {
       for (let identity of fixIterator(identities,
                                        Ci.nsIMsgIdentity)) {
         if (!identity.email)
           continue;
         if (hints[i].trim() == identity.email.toLowerCase() ||
             hints[i].includes("<" + identity.email.toLowerCase() + ">"))
           return identity;
       }
@@ -48,39 +47,37 @@ function getBestIdentity(identities, opt
     } catch (ex) {}
     if (defaultAccount && defaultAccount.defaultIdentity)
       return defaultAccount.defaultIdentity;
   }
 
   return identities.queryElementAt(0, Ci.nsIMsgIdentity);
 }
 
-function getIdentityForServer(server, optionalHint)
-{
+function getIdentityForServer(server, optionalHint) {
   var identities = accountManager.getIdentitiesForServer(server);
   return getBestIdentity(identities, optionalHint);
 }
 
 /**
  * Get the identity for the given header.
  * @param hdr nsIMsgHdr message header
  * @param type nsIMsgCompType compose type the identity ise used for.
  */
-function getIdentityForHeader(hdr, type)
-{
+function getIdentityForHeader(hdr, type) {
   function findDeliveredToIdentityEmail() {
     // This function reads from currentHeaderData, which is only useful if we're
     // looking at the currently-displayed message. Otherwise, just return
     // immediately so we don't waste time.
     if (hdr != gMessageDisplay.displayedMessage)
       return "";
 
     // Get the delivered-to headers.
     let key = "delivered-to";
-    let deliveredTos = new Array();
+    let deliveredTos = [];
     let index = 0;
     let header = "";
     while ((header = currentHeaderData[key])) {
       deliveredTos.push(header.headerValue.toLowerCase().trim());
       key = "delivered-to" + index++;
     }
 
     // Reverse the array so that the last delivered-to header will show at front.
@@ -135,18 +132,17 @@ function getIdentityForHeader(hdr, type)
 
   if (!identity)
     identity = getBestIdentity(accountManager.allIdentities,
                                hintForIdentity, true);
 
   return identity;
 }
 
-function GetNextNMessages(folder)
-{
+function GetNextNMessages(folder) {
   if (folder) {
     var newsFolder = folder.QueryInterface(
                      Ci.nsIMsgNewsFolder);
     if (newsFolder) {
       newsFolder.getNextNMessages(msgWindow);
     }
   }
 }
@@ -169,18 +165,18 @@ function GetMsgKeyFromURI(uri) {
 /**
  * Compose a message.
  *
  * @param type   nsIMsgCompType    Type of composition (new message, reply, draft, etc.)
  * @param format nsIMsgCompFormat  Requested format (plain text, html, default)
  * @param folder nsIMsgFolder      Folder where the original message is stored
  * @param messageArray             Array of messages to process, often only holding one element.
  */
-function ComposeMessage(type, format, folder, messageArray)
-{
+/* eslint-disable complexity */
+function ComposeMessage(type, format, folder, messageArray) {
   let msgComposeType = Ci.nsIMsgCompType;
   let ignoreQuote = false;
   let msgKey;
   if (messageArray && messageArray.length == 1) {
     msgKey = GetMsgKeyFromURI(messageArray[0]);
     if (msgKey != gMessageDisplay.keyForCharsetOverride) {
       msgWindow.charsetOverride = false;
     }
@@ -219,47 +215,41 @@ function ComposeMessage(type, format, fo
       }
     }
   }
   var identity = null;
   var newsgroup = null;
   var hdr;
 
   // dump("ComposeMessage folder=" + folder + "\n");
-  try
-  {
-    if (folder)
-    {
+  try {
+    if (folder) {
       // Get the incoming server associated with this uri.
       var server = folder.server;
 
       // If they hit new or reply and they are reading a newsgroup,
       // turn this into a new post or a reply to group.
-      if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New)
-      {
+      if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New) {
         type = msgComposeType.NewsPost;
         newsgroup = folder.folderURL;
       }
 
       identity = folder.customIdentity;
       if (!identity)
         identity = getIdentityForServer(server);
       // dump("identity = " + identity + "\n");
     }
-  }
-  catch (ex)
-  {
+  } catch (ex) {
     dump("failed to get an identity to pre-select: " + ex + "\n");
   }
 
   // dump("\nComposeMessage from XUL: " + identity + "\n");
 
-  switch (type)
-  {
-    case msgComposeType.New: //new message
+  switch (type) {
+    case msgComposeType.New: // new message
       // dump("OpenComposeWindow with " + identity + "\n");
 
       // If the addressbook sidebar panel is open and has focus, get
       // the selected addresses from it.
       if (document.commandDispatcher.focusedWindow &&
           document.commandDispatcher.focusedWindow
                   .document.documentElement.hasAttribute("selectedaddresses"))
         NewMessageToSelectedAddresses(type, format, identity);
@@ -268,58 +258,54 @@ function ComposeMessage(type, format, fo
                                                format, identity, msgWindow);
       return;
     case msgComposeType.NewsPost:
       // dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n");
       MailServices.compose.OpenComposeWindow(null, null, newsgroup, type,
                                              format, identity, msgWindow);
       return;
     case msgComposeType.ForwardAsAttachment:
-      if (messageArray && messageArray.length)
-      {
+      if (messageArray && messageArray.length) {
         // If we have more than one ForwardAsAttachment then pass null instead
         // of the header to tell the compose service to work out the attachment
         // subjects from the URIs.
         hdr = messageArray.length > 1 ? null : messenger.msgHdrFromURI(messageArray[0]);
-        MailServices.compose.OpenComposeWindow(null, hdr, messageArray.join(','),
+        MailServices.compose.OpenComposeWindow(null, hdr, messageArray.join(","),
                                                type, format, identity, msgWindow);
         return;
       }
     default:
       if (!messageArray)
         return;
 
       // Limit the number of new compose windows to 8. Why 8 ?
       // I like that number :-)
       if (messageArray.length > 8)
         messageArray.length = 8;
 
-      for (var i = 0; i < messageArray.length; ++i)
-      {
+      for (var i = 0; i < messageArray.length; ++i) {
         var messageUri = messageArray[i];
         hdr = messenger.msgHdrFromURI(messageUri);
-        if (FeedMessageHandler.isFeedMessage(hdr))
-        {
+        if (FeedMessageHandler.isFeedMessage(hdr)) {
           // Do not use the header derived identity for feeds, pass on only a
           // possible server identity from above.
           openComposeWindowForRSSArticle(null, hdr, messageUri, type,
                                          format, identity, msgWindow);
-        }
-        else
-        {
+        } else {
           // Replies come here.
           let hdrIdentity = getIdentityForHeader(hdr, type);
           if (ignoreQuote)
             type += msgComposeType.ReplyIgnoreQuote;
           MailServices.compose.OpenComposeWindow(null, hdr, messageUri, type,
                                                  format, hdrIdentity, msgWindow);
         }
       }
   }
 }
+/* eslint-enable complexity */
 
 function NewMessageToSelectedAddresses(type, format, identity) {
   var abSidebarPanel = document.commandDispatcher.focusedWindow;
   var abResultsTree = abSidebarPanel.document.getElementById("abResultsTree");
   var abResultsBoxObject = abResultsTree.treeBoxObject;
   var abView = abResultsBoxObject.view;
   abView = abView.QueryInterface(Ci.nsIAbView);
   var addresses = abView.selectedAddresses;
@@ -337,77 +323,68 @@ function NewMessageToSelectedAddresses(t
       }
       composeFields.to = addressList.join(",");
       params.composeFields = composeFields;
       MailServices.compose.OpenComposeWindowWithParams(null, params);
     }
   }
 }
 
-function Subscribe(preselectedMsgFolder)
-{
+function Subscribe(preselectedMsgFolder) {
   window.openDialog("chrome://messenger/content/subscribe.xul",
                     "subscribe", "chrome,modal,titlebar,resizable=yes",
-                    {folder:preselectedMsgFolder,
-                      okCallback:SubscribeOKCallback});
+                    {
+                      folder: preselectedMsgFolder,
+                      okCallback: SubscribeOKCallback,
+                    });
 }
 
-function SubscribeOKCallback(changeTable)
-{
+function SubscribeOKCallback(changeTable) {
   for (var serverURI in changeTable) {
     var folder = MailUtils.getFolderForURI(serverURI, true);
     var server = folder.server;
     var subscribableServer =
           server.QueryInterface(Ci.nsISubscribableServer);
 
     for (var name in changeTable[serverURI]) {
-      if (changeTable[serverURI][name] == true) {
+      if (changeTable[serverURI][name]) {
         try {
           subscribableServer.subscribe(name);
-        }
-        catch (ex) {
+        } catch (ex) {
           dump("failed to subscribe to " + name + ": " + ex + "\n");
         }
-      }
-      else if (changeTable[serverURI][name] == false) {
+      } else if (!changeTable[serverURI][name]) {
         try {
           subscribableServer.unsubscribe(name);
-        }
-        catch (ex) {
+        } catch (ex) {
           dump("failed to unsubscribe to " + name + ": " + ex + "\n");
         }
       }
-      else {
-        // no change
-      }
     }
 
     try {
       subscribableServer.commitSubscribeChanges();
-    }
-    catch (ex) {
+    } catch (ex) {
       dump("failed to commit the changes: " + ex + "\n");
     }
   }
 }
 
-function SaveAsFile(uris)
-{
+function SaveAsFile(uris) {
   if (uris.length == 1) {
     let uri = uris[0];
     let msgHdr = messenger.messageServiceFromURI(uri)
                           .messageURIToMsgHdr(uri);
     let name = msgHdr.mime2DecodedSubject;
     if (msgHdr.flags & Ci.nsMsgMessageFlags.HasRe)
       name = (name) ? "Re: " + name : "Re: ";
 
     let filename = GenerateValidFilename(name, ".eml");
     messenger.saveAs(uri, true, null, filename);
-  }
-  else {
+  } else {
     let filenames = [];
     for (let i = 0; i < uris.length; i++) {
       let msgHdr = messenger.messageServiceFromURI(uris[i])
                             .messageURIToMsgHdr(uris[i]);
 
       let nameBase = GenerateFilenameFromMsgHdr(msgHdr);
       let name = GenerateValidFilename(nameBase, ".eml");
 
@@ -420,49 +397,49 @@ function SaveAsFile(uris)
     }
     messenger.saveMessages(uris.length, filenames, uris);
   }
 }
 
 function GenerateFilenameFromMsgHdr(msgHdr) {
 
   function MakeIS8601ODateString(date) {
-    function pad(n) {return n < 10 ? "0" + n : n;}
+    function pad(n) { return n < 10 ? "0" + n : n; }
     return date.getFullYear() + "-" +
-           pad(date.getMonth() + 1)  + "-" +
-           pad(date.getDate())  + " " +
-           pad(date.getHours())  + "" +
+           pad(date.getMonth() + 1) + "-" +
+           pad(date.getDate()) + " " +
+           pad(date.getHours()) + "" +
            pad(date.getMinutes()) + "";
   }
 
   let filename;
   if (msgHdr.flags & Ci.nsMsgMessageFlags.HasRe)
     filename = (msgHdr.mime2DecodedSubject) ? "Re: " + msgHdr.mime2DecodedSubject : "Re: ";
   else
     filename = msgHdr.mime2DecodedSubject;
 
   filename += " - ";
-  filename += msgHdr.mime2DecodedAuthor  + " - ";
-  filename += MakeIS8601ODateString(new Date(msgHdr.date/1000));
+  filename += msgHdr.mime2DecodedAuthor + " - ";
+  filename += MakeIS8601ODateString(new Date(msgHdr.date / 1000));
 
   return filename;
 
 }
 
 function saveAsUrlListener(aUri, aIdentity) {
   this.uri = aUri;
   this.identity = aIdentity;
 }
 
 saveAsUrlListener.prototype = {
-  OnStartRunningUrl: function(aUrl) {
+  OnStartRunningUrl(aUrl) {
   },
-  OnStopRunningUrl: function(aUrl, aExitCode) {
+  OnStopRunningUrl(aUrl, aExitCode) {
     messenger.saveAs(this.uri, false, this.identity, null);
-  }
+  },
 };
 
 function SaveAsTemplate(uri) {
   if (uri) {
     let hdr = messenger.msgHdrFromURI(uri);
     let identity = getIdentityForHeader(hdr, Ci.nsIMsgCompType.Template);
     let templates = MailUtils.getFolderForURI(identity.stationeryFolder, false);
     if (!templates.parent) {
@@ -471,51 +448,46 @@ function SaveAsTemplate(uri) {
       templates.createStorageIfMissing(new saveAsUrlListener(uri, identity));
       if (isAsync)
         return;
     }
     messenger.saveAs(uri, false, identity, null);
   }
 }
 
-function MarkSelectedMessagesRead(markRead)
-{
+function MarkSelectedMessagesRead(markRead) {
   ClearPendingReadTimer();
   gDBView.doCommand(markRead ? nsMsgViewCommandType.markMessagesRead : nsMsgViewCommandType.markMessagesUnread);
 }
 
-function MarkSelectedMessagesFlagged(markFlagged)
-{
+function MarkSelectedMessagesFlagged(markFlagged) {
   gDBView.doCommand(markFlagged ? nsMsgViewCommandType.flagMessages : nsMsgViewCommandType.unflagMessages);
 }
 
-function ViewPageSource(messages)
-{
+function ViewPageSource(messages) {
   var numMessages = messages.length;
 
-  if (numMessages == 0)
-  {
+  if (numMessages == 0) {
     dump("MsgViewPageSource(): No messages selected.\n");
     return false;
   }
 
   var browser = getBrowser();
 
   try {
-    for (var i = 0; i < numMessages; i++)
-    {
+    for (var i = 0; i < numMessages; i++) {
       // Now, we need to get a URL from a URI
       var url = MailServices.mailSession.ConvertMsgURIToMsgURL(messages[i], msgWindow);
 
       // Strip out the message-display parameter to ensure that attached emails
       // display the message source, not the processed HTML.
       url = url.replace(/type=application\/x-message-display&/, "");
       window.openDialog("chrome://messenger/content/viewSource.xul",
                         "_blank", "all,dialog=no",
-                        {URL: url, browser: browser,
+                        {URL: url, browser,
                          outerWindowID: browser.outerWindowID});
     }
     return true;