Bug 1509779 - Codify unwritten rules in ESLint configuration; r=aceman
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 29 Nov 2018 12:04:40 +1300
changeset 33807 f43611e42a795fadea6cd6d4695929588152098b
parent 33806 97d41ef7fee6a9ab617731c3d5519dd96f3d50c8
child 33808 8709d04aee9295aea108b7e20823b550d5d74017
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersaceman
bugs1509779
Bug 1509779 - Codify unwritten rules in ESLint configuration; r=aceman
.eslintrc.js
common/bindings/datetimepicker.xml
common/bindings/preferences.xml
common/bindings/textbox.xml
common/src/customizeToolbar.js
mail/base/content/mailCore.js
mail/base/content/tabmail.xml
mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
mail/components/about-support/aboutSupportMac.js
mail/components/about-support/aboutSupportUnix.js
mail/components/about-support/aboutSupportWin32.js
mail/components/about-support/content/aboutSupport.js
mail/components/about-support/content/accounts.js
mail/components/aboutRedirector.js
mail/components/accountcreation/content/emailWizard.js
mail/components/accountcreation/content/fetchhttp.js
mail/components/accountcreation/content/guessConfig.js
mail/components/accountcreation/content/util.js
mail/components/activity/content/activity.js
mail/components/activity/nsActivityManagerUI.js
mail/components/addrbook/content/abCard.js
mail/components/addrbook/content/abCardView.js
mail/components/addrbook/content/abTrees.js
mail/components/addrbook/content/addressbook.js
mail/components/cloudfile/cloudFileAccounts.js
mail/components/cloudfile/content/addAccountDialog.js
mail/components/cloudfile/nsBox.js
mail/components/cloudfile/nsHightail.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/compose/content/cloudAttachmentLinkManager.js
mail/components/extensions/test/xpcshell/.eslintrc.js
mail/components/im/content/addbuddy.js
mail/components/im/content/am-im.js
mail/components/im/content/chat-messenger.js
mail/components/im/content/imAccountWizard.js
mail/components/im/content/imAccounts.js
mail/components/im/content/imContextMenu.js
mail/components/im/content/imStatusSelector.js
mail/components/im/content/imconversation.xml
mail/components/im/content/joinchat.js
mail/components/im/messages/papersheets/Footer.html
mail/components/im/modules/index_im.jsm
mail/components/im/modules/search_im.jsm
mail/components/mailContentHandler.js
mail/components/mailGlue.js
mail/components/migration/content/migration.js
mail/components/newmailaccount/content/accountProvisioner.js
mail/components/newmailaccount/content/accountProvisionerTab.js
mail/components/preferences/applicationManager.js
mail/components/preferences/applications.js
mail/components/preferences/cookies.js
mail/components/preferences/display.js
mail/components/preferences/messagestyle.js
mail/components/preferences/preferences.js
mail/components/preferences/preferencesTab.js
mail/components/search/SearchIntegration.jsm
mail/components/wintaskbar/windowsJumpLists.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -10,25 +10,28 @@ module.exports = {
   ],
 
   // When adding items to this file please check for effects on sub-directories.
   "plugins": [
     "mozilla",
   ],
 
   "rules": {
+    "func-names": ["error", "never"],
     "no-multi-spaces": ["error", {
       exceptions: {
         "ArrayExpression": true,
         "AssignmentExpression": true,
         "ObjectExpression": true,
         "VariableDeclarator": true,
       },
       ignoreEOLComments: true,
     }],
+    "semi-spacing": ["error", {"before": false, "after": true}],
+    "space-in-parens": ["error", "never"],
   },
 
   // The html plugin is enabled via a command line option on eslint. To avoid
   // bad interactions with the xml preprocessor in eslint-plugin-mozilla, we
   // turn off processing of the html plugin for .xml files.
   "settings": {
     "html/xml-extensions": [ ".xhtml" ],
   },
--- a/common/bindings/datetimepicker.xml
+++ b/common/bindings/datetimepicker.xml
@@ -298,18 +298,19 @@
             return (this.hour >= 12);
           ]]>
         </getter>
         <setter>
           <![CDATA[
             if (val) {
               if (this.hour < 12)
                 this.hour += 12;
-            } else if (this.hour >= 12)
+            } else if (this.hour >= 12) {
               this.hour -= 12;
+            }
             return val;
           ]]>
         </setter>
       </property>
       <property name="hideSeconds">
         <getter>
           return (this.getAttribute("hideseconds") == "true");
         </getter>
--- a/common/bindings/preferences.xml
+++ b/common/bindings/preferences.xml
@@ -419,18 +419,19 @@
           case "file":
             var lf;
             if (typeof(val) == "string") {
               lf = Cc["@mozilla.org/file/local;1"]
                      .createInstance(Ci.nsIFile);
               lf.persistentDescriptor = val;
               if (!lf.exists())
                 lf.initWithPath(val);
-            } else
+            } else {
               lf = val.QueryInterface(Ci.nsIFile);
+            }
             this.preferences.rootBranch
                 .setComplexValue(this.name, Ci.nsIFile, lf);
             break;
           default:
             this._reportUnknownType();
           }
           if (!this.batching)
             this.preferences.service.savePrefFile(null);
@@ -477,28 +478,29 @@
            * constructor or property getters appropriately handle this state.
            */
           function setValue(element, attribute, value) {
             if (attribute in element)
               element[attribute] = value;
             else
               element.setAttribute(attribute, value);
           }
-          if (aElement.localName == "checkbox")
+          if (aElement.localName == "checkbox") {
             setValue(aElement, "checked", val);
-          else if (aElement.localName == "colorpicker")
+          } else if (aElement.localName == "colorpicker") {
             setValue(aElement, "color", val);
-          else if (aElement.localName == "textbox") {
+          } else if (aElement.localName == "textbox") {
             // XXXmano Bug 303998: Avoid a caret placement issue if either the
             // preference observer or its setter calls updateElements as a result
             // of the input event handler.
             if (aElement.value !== val)
               setValue(aElement, "value", val);
-          } else
+          } else {
             setValue(aElement, "value", val);
+          }
         ]]>
         </body>
       </method>
 
       <method name="getElementValue">
         <parameter name="aElement"/>
         <body>
         <![CDATA[
@@ -775,18 +777,19 @@
                 this._pane.loaded = true;
                 this._outer._fireEvent("paneload", this._pane);
                 this._outer._selectPane(this._pane);
               },
             };
 
             var obs = new OverlayLoadObserver(aPaneElement);
             document.loadOverlay(aPaneElement.src, obs);
-          } else
+          } else {
             this._selectPane(aPaneElement);
+          }
         ]]>
         </body>
       </method>
 
       <method name="_fireEvent">
         <parameter name="aEventName"/>
         <parameter name="aTarget"/>
         <body>
@@ -946,19 +949,19 @@
               this._currentHeight += increment;
             } else {
               aTimer.cancel();
               this._setUpFadeTimer();
             }
           } else if (aTimer == this._fadeTimer) {
             var elt = document.getElementById(this.lastSelected);
             var newOpacity = parseFloat(window.getComputedStyle(elt).opacity) + this._fadeIncrement;
-            if (newOpacity < 1.0)
+            if (newOpacity < 1.0) {
               elt.style.opacity = newOpacity;
-            else {
+            } else {
               aTimer.cancel();
               elt.style.opacity = 1.0;
             }
           }
         ]]>
         </body>
       </method>
 
--- a/common/bindings/textbox.xml
+++ b/common/bindings/textbox.xml
@@ -117,17 +117,17 @@
                                       onget="return this.inputField.selectionStart;"/>
       <property name="selectionEnd"   onset="this.inputField.selectionEnd = val; return val;"
                                       onget="return this.inputField.selectionEnd;"/>
 
       <method name="setSelectionRange">
         <parameter name="aSelectionStart"/>
         <parameter name="aSelectionEnd"/>
         <body>
-          this.inputField.setSelectionRange( aSelectionStart, aSelectionEnd );
+          this.inputField.setSelectionRange(aSelectionStart, aSelectionEnd);
         </body>
       </method>
 
       <method name="_setNewlineHandling">
         <body><![CDATA[
           var str = this.getAttribute("newlines");
           if (str && this.editor) {
             for (let x in Ci.nsIPlaintextEditor) {
--- a/common/src/customizeToolbar.js
+++ b/common/src/customizeToolbar.js
@@ -338,21 +338,21 @@ function buildPalette() {
  * Makes sure that an item that has been cloned from a template
  * is stripped of any attributes that may adversely affect its
  * appearance in the palette.
  */
 function cleanUpItemForPalette(aItem, aWrapper) {
   aWrapper.setAttribute("place", "palette");
   setWrapperType(aItem, aWrapper);
 
-  if (aItem.hasAttribute("title"))
+  if (aItem.hasAttribute("title")) {
     aWrapper.setAttribute("title", aItem.getAttribute("title"));
-  else if (aItem.hasAttribute("label"))
+  } else if (aItem.hasAttribute("label")) {
     aWrapper.setAttribute("title", aItem.getAttribute("label"));
-  else if (isSpecialItem(aItem)) {
+  } else if (isSpecialItem(aItem)) {
     var stringBundle = document.getElementById("stringBundle");
     // Remove the common "toolbar" prefix to generate the string name.
     var title = stringBundle.getString(aItem.localName.slice(7) + "Title");
     aWrapper.setAttribute("title", title);
   }
   aWrapper.setAttribute("tooltiptext", aWrapper.getAttribute("title"));
 
   // Remove attributes that screw up our appearance.
@@ -681,18 +681,19 @@ function onToolbarDragOver(aEvent) {
       dragAfter = aEvent.clientX > dropTargetCenter;
     else
       dragAfter = aEvent.clientX < dropTargetCenter;
 
     if (dragAfter) {
       gCurrentDragOverItem = dropTarget.nextSibling;
       if (!gCurrentDragOverItem)
         gCurrentDragOverItem = toolbar;
-    } else
+    } else {
       gCurrentDragOverItem = dropTarget;
+    }
   }
 
   if (previousDragItem && gCurrentDragOverItem != previousDragItem) {
     setDragActive(previousDragItem, false);
   }
 
   setDragActive(gCurrentDragOverItem, true);
 
--- a/mail/base/content/mailCore.js
+++ b/mail/base/content/mailCore.js
@@ -494,19 +494,19 @@ function openAddonPrefs(aURL, aOptionsTy
 
 function openActivityMgr() {
   Cc["@mozilla.org/activity-manager-ui;1"].
     getService(Ci.nsIActivityManagerUI).show(window);
 }
 
 function openIMAccountMgr() {
   var win = Services.wm.getMostRecentWindow("Messenger:Accounts");
-  if (win)
+  if (win) {
     win.focus();
-  else {
+  } else {
     win = Services.ww.openWindow(null,
                                  "chrome://messenger/content/chat/imAccounts.xul",
                                  "Accounts", "chrome,resizable,centerscreen",
                                  null);
   }
   return win;
 }
 
@@ -527,19 +527,19 @@ function openIMAccountWizard() {
   }
 
   window.openDialog(kUrl, kName, kFeatures);
 }
 
 function openSavedFilesWnd() {
   let tabmail = document.getElementById("tabmail");
   let downloadsBrowser = tabmail.getBrowserForDocumentId("aboutDownloads");
-  if (downloadsBrowser)
+  if (downloadsBrowser) {
     tabmail.switchToTab(downloadsBrowser);
-  else {
+  } else {
     tabmail.openTab("chromeTab",
                     { chromePage: "about:downloads",
                       clickHandler: "specialTabs.aboutClickHandler(event);" });
   }
 }
 
 function SetBusyCursor(window, enable) {
     // setCursor() is only available for chrome windows.
--- a/mail/base/content/tabmail.xml
+++ b/mail/base/content/tabmail.xml
@@ -346,19 +346,19 @@
           for (let [modeName, modeDetails] of Object.entries(aTabType.modes)) {
             modeDetails.name = modeName;
             modeDetails.tabType = aTabType;
             modeDetails.tabs = [];
             this.tabModes[modeName] = modeDetails;
             if (modeDetails.isDefault)
               this.defaultTabMode = modeDetails;
           }
-          if (aTabType.panelId)
+          if (aTabType.panelId) {
             aTabType.panel = document.getElementById(aTabType.panelId);
-          else if (!aTabType.perTabPanel) {
+          } else if (!aTabType.perTabPanel) {
             throw new Error("Trying to register a tab type with neither panelId " +
                             "nor perTabPanel attributes.");
           }
 
           setTimeout(() => {
             for (let modeName of Object.keys(aTabType.modes)) {
               for (let i = 0; i < this.unrestoredTabs.length;) {
                 let state = this.unrestoredTabs[i];
--- a/mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
+++ b/mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
@@ -15,27 +15,27 @@ ChromeUtils.import("resource:///modules/
 initViewWrapperTestUtils({mode: "imap", offline: false});
 
 /**
  * A custom search term, that just does Subject Contains
  */
 var gCustomSearchTermSubject = {
   id: "mailnews@mozilla.org#test",
   name: "Test-mailbase Subject",
-  getEnabled: function subject_getEnabled(scope, op) {
+  getEnabled(scope, op) {
     return true;
   },
-  getAvailable: function subject_getAvailable(scope, op) {
+  getAvailable(scope, op) {
     return true;
   },
-  getAvailableOperators: function subject_getAvailableOperators(scope, length) {
+  getAvailableOperators(scope, length) {
     length.value = 1;
     return [Ci.nsMsgSearchOp.Contains];
   },
-  match: function subject_match(aMsgHdr, aSearchValue, aSearchOp) {
+  match(aMsgHdr, aSearchValue, aSearchOp) {
     return (aMsgHdr.subject.includes(aSearchValue));
   },
   needsBody: false,
 };
 
 MailServices.filters.addCustomTerm(gCustomSearchTermSubject);
 
 /**
--- a/mail/components/about-support/aboutSupportMac.js
+++ b/mail/components/about-support/aboutSupportMac.js
@@ -4,13 +4,13 @@
 
 var EXPORTED_SYMBOLS = ["AboutSupportPlatform"];
 
 var AboutSupportPlatform = {
   /**
    * Given an nsIFile, gets the file system type. The type is returned as a
    * string. Possible values are "network", "local", "unknown" and null.
    */
-  getFileSystemType: function ASPMac_getFileSystemType(aFile) {
+  getFileSystemType(aFile) {
     // Not implemented
     return null;
   },
 };
--- a/mail/components/about-support/aboutSupportUnix.js
+++ b/mail/components/about-support/aboutSupportUnix.js
@@ -40,17 +40,17 @@ if (gLibsExist) {
   );
 }
 
 var AboutSupportPlatform = {
   /**
    * Given an nsIFile, gets the file system type. The type is returned as a
    * string. Possible values are "network", "local", "unknown" and null.
    */
-  getFileSystemType: function ASPUnix_getFileSystemType(aFile) {
+  getFileSystemType(aFile) {
     // Check if the libs exist.
     if (!gLibsExist)
       return "unknown";
 
     try {
       // Given a UTF-8 string, converts it to the current Glib locale.
       let g_filename_from_utf8 = glib.declare(
         "g_filename_from_utf8",
--- a/mail/components/about-support/aboutSupportWin32.js
+++ b/mail/components/about-support/aboutSupportWin32.js
@@ -11,17 +11,17 @@ var BOOL = ctypes.int32_t;
 var DRIVE_UNKNOWN = 0;
 var DRIVE_NETWORK = 4;
 
 var AboutSupportPlatform = {
   /**
    * Given an nsIFile, gets the file system type. The type is returned as a
    * string. Possible values are "network", "local", "unknown" and null.
    */
-  getFileSystemType: function ASPWin32_getFileSystemType(aFile) {
+  getFileSystemType(aFile) {
     let kernel32 = ctypes.open("kernel32.dll");
 
     try {
       // Returns the path of the volume a file is on.
       let GetVolumePathName = kernel32.declare(
         "GetVolumePathNameW",
         ctypes.winapi_abi,
         BOOL,                // return type: 1 indicates success, 0 failure
--- a/mail/components/about-support/content/aboutSupport.js
+++ b/mail/components/about-support/content/aboutSupport.js
@@ -53,17 +53,17 @@ window.addEventListener("load", function
   populateAccountsSection();
 });
 
 // Each property in this object corresponds to a property in Troubleshoot.jsm's
 // snapshot data.  Each function is passed its property's corresponding data,
 // and it's the function's job to update the page with it.
 var snapshotFormatters = {
 
-  application: function application(data) {
+  application(data) {
     let strings = stringBundle();
     $("application-box").textContent = data.name;
     $("useragent-box").textContent = data.userAgent;
     $("os-box").textContent = data.osVersion;
     $("supportLink").href = data.supportURL;
     let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
     if (data.vendor)
       version += " (" + data.vendor + ")";
@@ -160,17 +160,17 @@ var snapshotFormatters = {
       fsTextNode.textContent = fsText;
       profElem.appendChild(fsTextNode);
     } catch (x) {
       Cu.reportError(x);
     }
     // end of TB addition
   },
 
-  crashes: function crashes(data) {
+  crashes(data) {
     if (!AppConstants.MOZ_CRASHREPORTER)
       return;
 
     let strings = stringBundle();
     let daysRange = Troubleshoot.kMaxCrashAge / (24 * 60 * 60 * 1000);
     $("crashes-title").textContent =
       PluralForm.get(daysRange, strings.GetStringFromName("crashesTitle"))
                 .replace("#1", daysRange);
@@ -220,77 +220,77 @@ var snapshotFormatters = {
         $.new("td", [
           $.new("a", crash.id, null, {href: reportURL + crash.id}),
         ]),
         $.new("td", formattedDate),
       ]);
     }));
   },
 
-  extensions: function extensions(data) {
+  extensions(data) {
     $.append($("extensions-tbody"), data.map(function(extension) {
       return $.new("tr", [
         $.new("td", extension.name),
         $.new("td", extension.version),
         $.new("td", extension.isActive),
         $.new("td", extension.id),
       ]);
     }));
   },
 
-  securitySoftware: function securitySoftware(data) {
+  securitySoftware(data) {
     if (!AppConstants.isPlatformAndVersionAtLeast("win", "6.2")) {
       $("security-software-title").hidden = true;
       $("security-software-table").hidden = true;
       return;
     }
 
     $("security-software-antivirus").textContent = data.registeredAntiVirus;
     $("security-software-antispyware").textContent = data.registeredAntiSpyware;
     $("security-software-firewall").textContent = data.registeredFirewall;
   },
 
 /* Not used by TB
-  features: function features(data) {
+  features(data) {
     $.append($("features-tbody"), data.map(function(feature) {
       return $.new("tr", [
         $.new("td", feature.name),
         $.new("td", feature.version),
         $.new("td", feature.id),
       ]);
     }));
   },
 */
-  modifiedPreferences: function modifiedPreferences(data) {
+  modifiedPreferences(data) {
     $.append($("prefs-tbody"), sortedArrayFromObject(data).map(
       function([name, value]) {
         return $.new("tr", [
           $.new("td", name, "pref-name"),
           // Very long preference values can cause users problems when they
           // copy and paste them into some text editors.  Long values generally
           // aren't useful anyway, so truncate them to a reasonable length.
           $.new("td", String(value).substr(0, 120), "pref-value"),
         ]);
       }
     ));
   },
 
-  lockedPreferences: function lockedPreferences(data) {
+  lockedPreferences(data) {
     $.append($("locked-prefs-tbody"), sortedArrayFromObject(data).map(
       function([name, value]) {
         return $.new("tr", [
           $.new("td", name, "pref-name"),
           $.new("td", String(value).substr(0, 120), "pref-value"),
         ]);
       }
     ));
   },
 
   /* eslint-disable complexity */
-  graphics: function graphics(data) {
+  graphics(data) {
     let strings = stringBundle();
 
     function localizedMsg(msgArray) {
       let nameOrMsg = msgArray.shift();
       if (msgArray.length) {
         // formatStringFromName logs an NS_ASSERTION failure otherwise that says
         // "use GetStringFromName".  Lame.
         try {
@@ -655,17 +655,17 @@ var snapshotFormatters = {
       if (Array.isArray(value)) {
         value = localizedMsg(value);
       }
       addRow("diagnostics", key, value);
     }
   },
   /* eslint-enable complexity */
 
-  media: function media(data) {
+  media(data) {
     let strings = stringBundle();
 
     function insertBasicInfo(key, value) {
       function createRow(key, value) {
         let th = $.new("th", strings.GetStringFromName(key), "column");
         let td = $.new("td", value);
         td.style["white-space"] = "pre-wrap";
         td.colSpan = 8;
@@ -760,36 +760,36 @@ var snapshotFormatters = {
 
     // Output devices information
     insertDeviceInfo("output", data.audioOutputDevices);
 
     // Input devices information
     insertDeviceInfo("input", data.audioInputDevices);
   },
 
-  javaScript: function javaScript(data) {
+  javaScript(data) {
     $("javascript-incremental-gc").textContent = data.incrementalGCEnabled;
   },
 
-  accessibility: function accessibility(data) {
+  accessibility(data) {
     $("a11y-activated").textContent = data.isActive;
     $("a11y-force-disabled").textContent = data.forceDisabled || 0;
 
     let a11yHandlerUsed = $("a11y-handler-used");
     if (a11yHandlerUsed) {
       a11yHandlerUsed.textContent = data.handlerUsed;
     }
 
     let a11yInstantiator = $("a11y-instantiator");
     if (a11yInstantiator) {
       a11yInstantiator.textContent = data.instantiator;
     }
   },
 
-  libraryVersions: function libraryVersions(data) {
+  libraryVersions(data) {
     let strings = stringBundle();
     let trs = [
       $.new("tr", [
         $.new("th", ""),
         $.new("th", strings.GetStringFromName("minLibVersions")),
         $.new("th", strings.GetStringFromName("loadedLibVersions")),
       ]),
     ];
@@ -800,28 +800,28 @@ var snapshotFormatters = {
           $.new("td", val.minVersion),
           $.new("td", val.version),
         ]));
       }
     );
     $.append($("libversions-tbody"), trs);
   },
 
-  userJS: function userJS(data) {
+  userJS(data) {
     if (!data.exists)
       return;
     let userJSFile = Services.dirsvc.get("PrefD", Ci.nsIFile);
     userJSFile.append("user.js");
     $("prefs-user-js-link").href = Services.io.newFileURI(userJSFile).spec;
     $("prefs-user-js-section").style.display = "";
     // Clear the no-copy class
     $("prefs-user-js-section").className = "";
   },
 
-  sandbox: function sandbox(data) {
+  sandbox(data) {
     if (!AppConstants.MOZ_SANDBOX)
       return;
 
     let strings = stringBundle();
     let tbody = $("sandbox-tbody");
     for (let key in data) {
       // Simplify the display a little in the common case.
       if (key === "hasPrivilegedUserNamespaces" &&
@@ -857,17 +857,17 @@ var snapshotFormatters = {
         for (let arg of syscall.args) {
           cells.push($.new("td", arg, "integer"));
         }
         syscallBody.appendChild($.new("tr", cells));
       }
     }
   },
 
-  intl: function intl(data) {
+  intl(data) {
     $("intl-locale-requested").textContent =
       JSON.stringify(data.localeService.requested);
     $("intl-locale-available").textContent =
       JSON.stringify(data.localeService.available);
     $("intl-locale-supported").textContent =
       JSON.stringify(data.localeService.supported);
     $("intl-locale-regionalprefs").textContent =
       JSON.stringify(data.localeService.regionalPrefs);
@@ -878,32 +878,32 @@ var snapshotFormatters = {
       JSON.stringify(data.osPrefs.systemLocales);
     $("intl-osprefs-regionalprefs").textContent =
       JSON.stringify(data.osPrefs.regionalPrefsLocales);
   },
 };
 
 var $ = document.getElementById.bind(document);
 
-$.new = function $_new(tag, textContentOrChildren, className, attributes) {
+$.new = function(tag, textContentOrChildren, className, attributes) {
   let elt = document.createElement(tag);
   if (className)
     elt.className = className;
   if (attributes) {
     for (let attrName in attributes)
       elt.setAttribute(attrName, attributes[attrName]);
   }
   if (Array.isArray(textContentOrChildren))
     this.append(elt, textContentOrChildren);
   else
     elt.textContent = String(textContentOrChildren);
   return elt;
 };
 
-$.append = function $_append(parent, children) {
+$.append = function(parent, children) {
   children.forEach(c => parent.appendChild(c));
 };
 
 function stringBundle() {
   return Services.strings.createBundle(
            "chrome://global/locale/aboutSupport.properties");
 }
 
@@ -1061,18 +1061,19 @@ Serializer.prototype = {
     // all other elements
 
     let hasText = false;
     for (let child of elem.childNodes) {
       if (child.nodeType == Node.TEXT_NODE) {
         let text = this._nodeText(child);
         this._appendText(text);
         hasText = hasText || !!text.trim();
-      } else if (child.nodeType == Node.ELEMENT_NODE)
+      } else if (child.nodeType == Node.ELEMENT_NODE) {
         this._serializeElement(child);
+      }
     }
 
     // For headings, draw a "line" underneath them so they stand out.
     if (/^h[0-9]+$/.test(elem.localName)) {
       let headerText = (this._currentLine || "").trim();
       if (headerText) {
         this._startNewLine();
         this._appendText("-".repeat(headerText.length));
--- a/mail/components/about-support/content/accounts.js
+++ b/mail/components/about-support/content/accounts.js
@@ -47,17 +47,17 @@ var gAuthMethodProperties = new Map([
 
 var AboutSupport = {
   /**
    * Gets details about SMTP servers for a given nsIMsgAccount.
    *
    * @returns An array of records, each record containing the name and other details
    *          about one SMTP server.
    */
-  _getSMTPDetails: function AboutSupport__getSMTPDetails(aAccount) {
+  _getSMTPDetails(aAccount) {
     let identities = aAccount.identities;
     let defaultIdentity = aAccount.defaultIdentity;
     let smtpDetails = [];
 
     for (let identity of fixIterator(identities, Ci.nsIMsgIdentity)) {
       let isDefault = identity == defaultIdentity;
       let smtpServer = {};
       MailServices.smtp.getServerByIdentity(identity, smtpServer);
@@ -69,17 +69,17 @@ var AboutSupport = {
     }
 
     return smtpDetails;
   },
 
   /**
    * Returns account details as an array of records.
    */
-  getAccountDetails: function AboutSupport_getAccountDetails() {
+  getAccountDetails() {
     let accountDetails = [];
     let accounts = MailServices.accounts.accounts;
 
     for (let account of fixIterator(accounts, Ci.nsIMsgAccount)) {
       let server = account.incomingServer;
       accountDetails.push({
         key: account.key,
         name: server.prettyName,
@@ -112,17 +112,17 @@ var AboutSupport = {
     accountDetails.sort(idCompare);
     return accountDetails;
   },
 
   /**
    * Returns the corresponding text for a given socket type index. The text is
    * returned as a record with "localized" and "neutral" entries.
    */
-  getSocketTypeText: function AboutSupport_getSocketTypeText(aIndex) {
+  getSocketTypeText(aIndex) {
     let plainSocketType = (aIndex in gSocketTypes ?
                            gSocketTypes[aIndex] : aIndex);
     let prettySocketType;
     try {
       prettySocketType = gMessengerBundle.GetStringFromName(
         "smtpServer-ConnectionSecurityType-" + aIndex);
     } catch (e) {
       if (e.result == Cr.NS_ERROR_FAILURE) {
@@ -134,17 +134,17 @@ var AboutSupport = {
     }
     return {localized: prettySocketType, neutral: plainSocketType};
   },
 
   /**
    * Returns the corresponding text for a given authentication method index. The
    * text is returned as a record with "localized" and "neutral" entries.
    */
-  getAuthMethodText: function AboutSupport_getAuthMethodText(aIndex) {
+  getAuthMethodText(aIndex) {
     let prettyAuthMethod;
     let plainAuthMethod = (aIndex in gAuthMethods ?
                            gAuthMethods[aIndex] : aIndex);
     if (gAuthMethodProperties.has(parseInt(aIndex))) {
       prettyAuthMethod =
         gMessengerBundle.GetStringFromName(gAuthMethodProperties.get(parseInt(aIndex)));
     } else {
       prettyAuthMethod = plainAuthMethod;
--- a/mail/components/aboutRedirector.js
+++ b/mail/components/aboutRedirector.js
@@ -25,17 +25,17 @@ AboutRedirector.prototype = {
                     flags: Ci.nsIAboutModule.ALLOW_SCRIPT},
     "downloads": {url: "chrome://messenger/content/downloads/aboutDownloads.xul",
                   flags: Ci.nsIAboutModule.ALLOW_SCRIPT},
   },
 
   /**
    * Gets the module name from the given URI.
    */
-  _getModuleName: function AboutRedirector__getModuleName(aURI) {
+  _getModuleName(aURI) {
     // Strip out the first ? or #, and anything following it
     let name = (/[^?#]+/.exec(aURI.pathQueryRef))[0];
     return name.toLowerCase();
   },
 
   getURIFlags(aURI) {
     let name = this._getModuleName(aURI);
     if (!(name in this._redirMap))
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -113,17 +113,17 @@ function setLabelFromStringBundle(elemen
   e(elementID).label = gMessengerBundle.getString(stringName);
 }
 
 function EmailConfigWizard() {
   this._init();
 }
 EmailConfigWizard.prototype =
 {
-  _init: function EmailConfigWizard__init() {
+  _init() {
     gEmailWizardLogger.info("Initializing setup wizard");
     this._abortable = null;
   },
 
   onLoad() {
     /**
      * this._currentConfig is the config we got either from the XML file or
      * from guessing or from the user. Unless it's from the user, it contains
--- a/mail/components/accountcreation/content/fetchhttp.js
+++ b/mail/components/accountcreation/content/fetchhttp.js
@@ -161,20 +161,21 @@ FetchHTTP.prototype =
     // Callbacks
     if (success) {
       try {
         this._successCallback(this.result);
       } catch (e) {
         logException(e);
         this._error(e);
       }
-    } else if (exStored)
+    } else if (exStored) {
       this._error(exStored);
-    else
+    } else {
       this._error(new ServerException(errorStr, errorCode, this._url));
+    }
 
     if (this._finishedCallback) {
       try {
         this._finishedCallback(this);
       } catch (e) {
         logException(e);
         this._error(e);
       }
--- a/mail/components/accountcreation/content/guessConfig.js
+++ b/mail/components/accountcreation/content/guessConfig.js
@@ -510,20 +510,20 @@ HostDetector.prototype =
 
   _checkFinished() {
     var successfulTry = null;
     var successfulTryAlternative = null; // POP3
     var unfinishedBusiness = false;
     // this._hostsToTry is ordered by decreasing preference
     for (let i = 0; i < this._hostsToTry.length; i++) {
       let thisTry = this._hostsToTry[i];
-      if (thisTry.status == kNotTried || thisTry.status == kOngoing)
+      if (thisTry.status == kNotTried || thisTry.status == kOngoing) {
         unfinishedBusiness = true;
-      // thisTry is good, and all higher preference tries failed, so use this
-      else if (thisTry.status == kSuccess && !unfinishedBusiness) {
+      } else if (thisTry.status == kSuccess && !unfinishedBusiness) {
+        // thisTry is good, and all higher preference tries failed, so use this
         if (!successfulTry) {
           successfulTry = thisTry;
           if (successfulTry.protocol == SMTP)
             break;
         } else if (successfulTry.protocol != thisTry.protocol) {
           successfulTryAlternative = thisTry;
           break;
         }
@@ -681,17 +681,17 @@ CMDS[POP] = ["CAPA\r\n", "QUIT\r\n"];
 CMDS[SMTP] = ["EHLO we-guess.mozilla.org\r\n", "QUIT\r\n"];
 
 /**
  * Sort by preference of SSL, IMAP etc.
  * @param tries {Array of {HostTry}}
  * @returns {Array of {HostTry}}
  */
 function sortTriesByPreference(tries) {
-  return tries.sort(function __sortByPreference(a, b) {
+  return tries.sort(function(a, b) {
     // -1 = a is better; 1 = b is better; 0 = equal
     // Prefer SSL/TLS above all else
     if (a.ssl != NONE && b.ssl == NONE)
       return -1;
     if (b.ssl != NONE && a.ssl == NONE)
       return 1;
     // Prefer IMAP over POP
     if (a.protocol == IMAP && b.protocol == POP)
--- a/mail/components/accountcreation/content/util.js
+++ b/mail/components/accountcreation/content/util.js
@@ -239,20 +239,21 @@ function debugObject(obj, name, maxDepth
       if (typeof(obj[prop]) == "object") {
         if (obj[prop] && obj[prop].length != undefined)
           result += name + "." + prop + "=[probably array, length " +
                 obj[prop].length + "]\n";
         else
           result += name + "." + prop + "=[" + typeof(obj[prop]) + "]\n";
         result += debugObject(obj[prop], name + "." + prop,
                               maxDepth, curDepth + 1);
-      } else if (typeof(obj[prop]) == "function")
+      } else if (typeof(obj[prop]) == "function") {
         result += name + "." + prop + "=[function]\n";
-      else
+      } else {
         result += name + "." + prop + "=" + obj[prop] + "\n";
+      }
     } catch (e) {
       result += name + "." + prop + "-> Exception(" + e + ")\n";
     }
   }
   if (!i)
     result += name + " is empty\n";
   return result;
 }
--- a/mail/components/activity/content/activity.js
+++ b/mail/components/activity/content/activity.js
@@ -42,20 +42,20 @@ var activityObject = {
     return this._groupCache.get(aContextType + ":" + aContextObj);
   },
 
   /**
    * Inserts the given binding into the correct position on the
    * activity manager window.
    */
   placeActivityBinding(aBinding) {
-    if (aBinding.isGroup || aBinding.isProcess)
+    if (aBinding.isGroup || aBinding.isProcess) {
       this._activitiesView.insertBefore(aBinding,
                                         this._activitiesView.firstChild);
-    else {
+    } else {
       let next = this._activitiesView.firstChild;
       while (next && (next.isWarning || next.isProcess || next.isGroup))
         next = next.nextSibling;
       if (next)
         this._activitiesView.insertBefore(aBinding, next);
       else
         this._activitiesView.appendChild(aBinding);
     }
--- a/mail/components/activity/nsActivityManagerUI.js
+++ b/mail/components/activity/nsActivityManagerUI.js
@@ -8,17 +8,17 @@ ChromeUtils.import("resource://gre/modul
 const ACTIVITY_MANAGER_URL = "chrome://messenger/content/activity.xul";
 const PREF_FLASH_COUNT = "messenger.activity.manager.flashCount";
 
 function nsActivityManagerUI() {}
 
 nsActivityManagerUI.prototype = {
   classID: Components.ID("5fa5974e-09cb-40cc-9696-643f8a8d9a06"),
 
-  show: function show(aWindowContext, aID) {
+  show(aWindowContext, aID) {
     // First we see if it is already visible
     let window = this.recentWindow;
     if (window) {
       window.focus();
       return;
     }
 
     let parent = null;
--- a/mail/components/addrbook/content/abCard.js
+++ b/mail/components/addrbook/content/abCard.js
@@ -160,17 +160,17 @@ function OnLoadNewCard() {
   // FIX ME - looks like we need to focus on both the text field and the tab widget
   // probably need to do the same in the addressing widget
 
   // focus on first or last name based on the pref
   var focus = document.getElementById(gEditCard.displayLastNameFirst
                                       ? "LastName" : "FirstName");
   if (focus) {
     // XXX Using the setTimeout hack until bug 103197 is fixed
-    setTimeout( function(firstTextBox) { firstTextBox.focus(); }, 0, focus );
+    setTimeout(function(firstTextBox) { firstTextBox.focus(); }, 0, focus);
   }
 }
 
 /**
  * Get the source directory containing the card we are editing.
  */
 function getContainingDirectory() {
   let directory = GetDirectoryFromURI(gEditCard.abURI);
@@ -278,18 +278,19 @@ function OnLoadEditCard() {
   // if not disable all the fields
   if ("arguments" in window && window.arguments[0]) {
     if ("abURI" in window.arguments[0]) {
       var abURI = window.arguments[0].abURI;
       var directory = GetDirectoryFromURI(abURI);
 
       if (directory.readOnly) {
         // Set all the editable vcard fields to read only
-        for (var i = kVcardFields.length; i-- > 0; )
+        for (var i = kVcardFields.length; i-- > 0;) {
           document.getElementById(kVcardFields[i][0]).readOnly = true;
+        }
 
         // the birthday fields
         document.getElementById("Birthday").readOnly = true;
         document.getElementById("BirthYear").readOnly = true;
         document.getElementById("Age").readOnly = true;
 
         // the photo field and buttons
         document.getElementById("PhotoType").disabled        = true;
@@ -370,18 +371,19 @@ function NotifySaveListeners(directory) 
 
 function InitPhoneticFields() {
   var showPhoneticFields =
     Services.prefs.getComplexValue("mail.addr_book.show_phonetic_fields",
       Ci.nsIPrefLocalizedString).data;
 
   // show phonetic fields if indicated by the pref
   if (showPhoneticFields == "true") {
-    for (var i = kPhoneticFields.length; i-- > 0; )
+    for (var i = kPhoneticFields.length; i-- > 0;) {
       document.getElementById(kPhoneticFields[i]).hidden = false;
+    }
   }
 }
 
 function InitEditCard() {
   InitPhoneticFields();
 
   InitCommonJS();
 
@@ -446,17 +448,17 @@ function NewCardCancelButton() {
 function GetCardValues(cardproperty, doc) {
   if (!cardproperty)
     return;
 
   // Pass the nsIAbCard and the Document through the listeners
   // to give extensions a chance to populate custom fields.
   NotifyLoadListeners(cardproperty, doc);
 
-  for (var i = kVcardFields.length; i-- > 0; ) {
+  for (var i = kVcardFields.length; i-- > 0;) {
     doc.getElementById(kVcardFields[i][0]).value =
       cardproperty.getProperty(kVcardFields[i][1], "");
   }
 
   var birthday = doc.getElementById("Birthday");
   modifyDatepicker(birthday);
 
   // Get the year first, so that the following month/day
@@ -516,36 +518,39 @@ function GetCardValues(cardproperty, doc
 // when the ab card dialog is being loaded to show a vCard,
 // hide the fields which aren't supported
 // by vCard so the user does not try to edit them.
 function HideNonVcardFields() {
   document.getElementById("homeTabButton").hidden = true;
   document.getElementById("chatTabButton").hidden = true;
   document.getElementById("photoTabButton").hidden = true;
   var i;
-  for (i = kNonVcardFields.length; i-- > 0; )
+  for (i = kNonVcardFields.length; i-- > 0;) {
     document.getElementById(kNonVcardFields[i]).collapsed = true;
-  for (i = kPhoneticFields.length; i-- > 0; )
+  }
+  for (i = kPhoneticFields.length; i-- > 0;) {
     document.getElementById(kPhoneticFields[i]).collapsed = true;
+  }
 }
 
 // Move the data from the dialog to the cardproperty to be stored in the database
 // @Returns false - Some required data are missing (card values were not set);
 //          true - Card values were set, or there is no card to set values on.
 function CheckAndSetCardValues(cardproperty, doc, check) {
   // If requested, check the required data presence.
   if (check && !CheckCardRequiredDataPresence(document))
     return false;
 
   if (!cardproperty)
     return true;
 
-  for (var i = kVcardFields.length; i-- > 0; )
+  for (var i = kVcardFields.length; i-- > 0;) {
     cardproperty.setProperty(kVcardFields[i][1],
       doc.getElementById(kVcardFields[i][0]).value);
+  }
 
   // get the birthday information from the dialog
   var birthdayElem = doc.getElementById("Birthday");
   var birthMonth = birthdayElem.monthField.value;
   var birthDay = birthdayElem.dateField.value;
   var birthYear = doc.getElementById("BirthYear").value;
 
   // set the birth day, month, and year properties
@@ -691,18 +696,19 @@ function calculateAge(aEvent, aElement) 
 
   var year = yearElem.value;
   // if the year element's value is invalid set the year and age elements to null
   if (isNaN(year) || year < kMinYear || year > kMaxYear) {
     yearElem.value = null;
     ageElem.value = null;
     datepicker.year = kDefaultYear;
     return;
-  } else if (aElement == yearElem)
+  } else if (aElement == yearElem) {
     datepicker.year = year;
+  }
   // calculate the length of time between the event and now
   try {
     var event = new Date(datepicker.year, datepicker.month, datepicker.date);
     // if the year is only 2 digits, then the year won't be set correctly
     // using setFullYear fixes this issue
     event.setFullYear(datepicker.year);
     // get the difference between today and the event
     var age = new Date(new Date() - event);
@@ -787,17 +793,17 @@ function modifyDatepicker(aDatepicker) {
   else
     aDatepicker._separatorFirst.collapsed = true;
   // collapse the spinner element
   document.getAnonymousElementByAttribute(aDatepicker, "anonid", "buttons")
           .collapsed = true;
   // this modified constrain value function ignores values less than the minimum
   // to let the value be blank (null)
   // from: mozilla/toolkit/content/widgets/datetimepicker.xml#759
-  aDatepicker._constrainValue = function newConstrainValue(aField, aValue, aNoWrap) {
+  aDatepicker._constrainValue = function(aField, aValue, aNoWrap) {
     // if the value is less than one, make the field's value null
     if (aValue < 1) {
       aField.value = null;
       return null;
     }
     if (aNoWrap && aField == this.monthField)
       aValue--;
     // make sure the date is valid for the given month
@@ -810,17 +816,17 @@ function modifyDatepicker(aDatepicker) {
     var max = (aField == this.monthField) ? 11 : kMaxYear;
     // make sure the value isn't too high
     if (aValue > max)
       return aNoWrap ? max : min;
     return aValue;
   };
   // sets the specified field to the given value, but allows blank fields
   // from: mozilla/toolkit/content/widgets/datetimepicker.xml#698
-  aDatepicker._setFieldValue = function setValue(aField, aValue) {
+  aDatepicker._setFieldValue = function(aField, aValue) {
     if (aField == this.yearField && aValue >= kMinYear && aValue <= kMaxYear) {
       let oldDate = this._dateValue;
       this._dateValue.setFullYear(aValue);
       if (oldDate != this._dateValue) {
         this._dateValue.setDate(0);
         this._updateUI(this.dateField, this.date);
       }
     } else if (aField == this.monthField && aValue != null) {
@@ -1076,17 +1082,17 @@ function doDropPhoto(aEvent) {
  */
 var gPhotoDownloadUI = (function() {
   // UI DOM elements
   let elProgressbar;
   let elProgressLabel;
   let elPhotoType;
   let elProgressContainer;
 
-  window.addEventListener("load", function load(event) {
+  window.addEventListener("load", function(event) {
     if (!elProgressbar)
       elProgressbar = document.getElementById("PhotoDownloadProgress");
     if (!elProgressLabel)
       elProgressLabel = document.getElementById("PhotoStatus");
     if (!elPhotoType)
       elPhotoType = document.getElementById("PhotoType");
     if (!elProgressContainer)
       elProgressContainer = document.getElementById("ProgressContainer");
--- a/mail/components/addrbook/content/abCardView.js
+++ b/mail/components/addrbook/content/abCardView.js
@@ -431,26 +431,26 @@ function cvSetNodeWithLabel(node, label,
     return cvSetNode(node, text);
   }
   return cvSetNode(node, "");
 }
 
 function cvSetCityStateZip(node, city, state, zip) {
   let text = "";
 
-  if (city && state && zip)
+  if (city && state && zip) {
     text = gAddressBookBundle.getFormattedString("cityAndStateAndZip",
                                                  [city, state, zip]);
-  else if (city && state && !zip)
+  } else if (city && state && !zip) {
     text = gAddressBookBundle.getFormattedString("cityAndStateNoZip",
                                                  [city, state]);
-  else if (zip && ((!city && state) || (city && !state)))
+  } else if (zip && ((!city && state) || (city && !state))) {
     text = gAddressBookBundle.getFormattedString("cityOrStateAndZip",
                                                  [city + state, zip]);
-  else {
+  } else {
     // Only one of the strings is non-empty so contatenating them produces that string.
     text = city + state + zip;
   }
 
   return cvSetNode(node, text);
 }
 
 function cvSetNode(node, text) {
--- a/mail/components/addrbook/content/abTrees.js
+++ b/mail/components/addrbook/content/abTrees.js
@@ -78,17 +78,17 @@ function abSort(a, b) {
 /**
  * Each abDirTreeItem corresponds to one row in the tree view.
  */
 function abDirTreeItem(aDirectory) {
   this._directory = aDirectory;
 }
 
 abDirTreeItem.prototype = {
-  getText: function atv_getText() {
+  getText() {
     return this._directory.dirName;
   },
 
   get id() {
     return this._directory.URI;
   },
 
   _open: false,
@@ -124,17 +124,17 @@ abDirTreeItem.prototype = {
         this._children[this._children.length - 1]._parent = this;
       }
 
       this._children.sort(abSort);
     }
     return this._children;
   },
 
-  getProperties: function atv_getProps() {
+  getProperties() {
     let properties = [];
     if (this._directory.isMailList)
       properties.push("IsMailList-true");
     if (this._directory.isRemote)
       properties.push("IsRemote-true");
     if (this._directory.isSecure)
       properties.push("IsSecure-true");
     return properties.join(" ");
@@ -145,63 +145,63 @@ abDirTreeItem.prototype = {
  * Our actual implementation of nsITreeView.
  */
 function directoryTreeView() {}
 directoryTreeView.prototype = {
   __proto__: new PROTO_TREE_VIEW(),
 
   hasRemoteAB: false,
 
-  init: function dtv_init(aTree, aJSONFile) {
+  init(aTree, aJSONFile) {
     if (aJSONFile) {
       // Parse our persistent-open-state json file
       let data = IOUtils.loadFileToString(aJSONFile);
       if (data)
         this._persistOpenMap = JSON.parse(data);
     }
 
     this._rebuild();
     aTree.view = this;
   },
 
-  shutdown: function dtv_shutdown(aJSONFile) {
+  shutdown(aJSONFile) {
     // Write out the persistOpenMap to our JSON file
     if (aJSONFile) {
       // Write out our json file...
       let data = JSON.stringify(this._persistOpenMap);
       IOUtils.saveStringToFile(aJSONFile, data);
     }
   },
 
   // Override the dnd methods for those functions in abDragDrop.js
-  canDrop: function dtv_canDrop(aIndex, aOrientation, dataTransfer) {
+  canDrop(aIndex, aOrientation, dataTransfer) {
     return abDirTreeObserver.canDrop(aIndex, aOrientation, dataTransfer);
   },
 
-  drop: function dtv_drop(aRow, aOrientation, dataTransfer) {
+  drop(aRow, aOrientation, dataTransfer) {
     abDirTreeObserver.onDrop(aRow, aOrientation, dataTransfer);
   },
 
-  getDirectoryAtIndex: function dtv_getDirForIndex(aIndex) {
+  getDirectoryAtIndex(aIndex) {
     return this._rowMap[aIndex]._directory;
   },
 
   // Override jsTreeView's isContainer, since we want to be able
   // to react to drag-drop events for all items in the directory
   // tree.
-  isContainer: function dtv_isContainer(aIndex) {
+  isContainer(aIndex) {
     return true;
   },
 
   /**
    * NOTE: This function will result in indeterminate rows being selected.
    *       Callers should take care to re-select a desired row after calling
    *       this function.
    */
-  _rebuild: function dtv__rebuild() {
+  _rebuild() {
     var oldCount = this._rowMap.length;
     this._rowMap = [];
 
     // Make an entry for All Address Books.
     let rootAB = MailServices.ab.getDirectory(kAllDirectoryRoot + "?");
     rootAB.dirName = gAddressBookBundle.getString("allAddressBooks");
     this._rowMap.push(new abDirTreeItem(rootAB));
 
@@ -219,17 +219,17 @@ directoryTreeView.prototype = {
       if (this._rowMap[i].id == aId)
         return i;
     }
 
     return -1;
   },
 
   // nsIAbListener interfaces
-  onItemAdded: function dtv_onItemAdded(aParent, aItem) {
+  onItemAdded(aParent, aItem) {
     if (!(aItem instanceof Ci.nsIAbDirectory))
       return;
     // XXX we can optimize this later
     this._rebuild();
 
     if (!this._tree)
       return;
 
@@ -237,17 +237,17 @@ directoryTreeView.prototype = {
     for (var [i, row] of this._rowMap.entries()) {
       if (row.id == aItem.URI) {
         this.selection.select(i);
         break;
       }
     }
   },
 
-  onItemRemoved: function dtv_onItemRemoved(aParent, aItem) {
+  onItemRemoved(aParent, aItem) {
     if (!(aItem instanceof Ci.nsIAbDirectory))
       return;
     // XXX we can optimize this later
     this._rebuild();
 
     if (!this._tree)
       return;
 
@@ -262,17 +262,17 @@ directoryTreeView.prototype = {
     for (var [i, row] of this._rowMap.entries()) {
       if (row.id == aParent.URI) {
         this.selection.select(i);
         break;
       }
     }
   },
 
-  onItemPropertyChanged: function dtv_onItemProp(aItem, aProp, aOld, aNew) {
+  onItemPropertyChanged(aItem, aProp, aOld, aNew) {
     if (!(aItem instanceof Ci.nsIAbDirectory))
       return;
 
     for (let i in this._rowMap) {
       if (this._rowMap[i]._directory == aItem) {
         this._tree.invalidateRow(i);
         break;
       }
--- a/mail/components/addrbook/content/addressbook.js
+++ b/mail/components/addrbook/content/addressbook.js
@@ -491,25 +491,26 @@ function SetStatusText(total) {
     if (searchInput && searchInput.value) {
       if (total == 0) {
         statusText = gAddressBookBundle.getString("noMatchFound");
       } else {
         statusText = PluralForm
           .get(total, gAddressBookBundle.getString("matchesFound1"))
           .replace("#1", total);
       }
-    } else
+    } else {
       statusText =
         gAddressBookBundle.getFormattedString(
           "totalContactStatus",
           [getSelectedDirectory().dirName, total]);
+    }
 
     gStatusText.setAttribute("label", statusText);
   } catch (ex) {
-    Cu.reportError("ERROR: failed to set status text:  " + ex );
+    Cu.reportError("ERROR: failed to set status text: " + ex);
   }
 }
 
 function AbResultsPaneKeyPress(event) {
   if (event.keyCode == 13)
     AbEditSelectedCard();
 }
 
@@ -777,19 +778,19 @@ function AbOSXAddressBookExists() {
   var uriPresent = Preferences.get(kOSXPrefBase + ".uri", null) == kOSXDirectoryURI;
   var position = Preferences.get(kOSXPrefBase + ".position", 1);
 
   // Address book exists if the uri is correct and the position is not zero.
   return uriPresent && position != 0;
 }
 
 function AbShowHideOSXAddressBook() {
-  if (AbOSXAddressBookExists())
+  if (AbOSXAddressBookExists()) {
     MailServices.ab.deleteAddressBook(kOSXDirectoryURI);
-  else {
+  } else {
     MailServices.ab.newAddressBook(
       gAddressBookBundle.getString(kOSXPrefBase + ".description"),
       kOSXDirectoryURI, 3, kOSXPrefBase);
   }
 }
 
 var abResultsController = {
   commands: {
--- a/mail/components/cloudfile/cloudFileAccounts.js
+++ b/mail/components/cloudfile/cloudFileAccounts.js
@@ -107,18 +107,17 @@ var cloudFileAccounts = {
       return provider;
     } catch (e) {
       Services.prefs.deleteBranch(ACCOUNT_ROOT + key);
       throw e;
     }
   },
 
   // Set provider-specific prefs
-  _processExtraPrefs: function CFA__processExtraPrefs(aAccountKey,
-                                                      aExtraPrefs) {
+  _processExtraPrefs(aAccountKey, aExtraPrefs) {
     const kFuncMap = {
       "int": "setIntPref",
       "bool": "setBoolPref",
       "char": "setCharPref",
     };
 
     for (let prefKey in aExtraPrefs) {
       let type = aExtraPrefs[prefKey].type;
@@ -162,29 +161,29 @@ var cloudFileAccounts = {
     }
   },
 
   get accounts() {
     return this._accountKeys.filter(key => this.getAccount(key) != null).
       map(key => this.getAccount(key));
   },
 
-  getAccountsForType: function CFA_getAccountsForType(aType) {
+  getAccountsForType(aType) {
     let result = [];
 
     for (let accountKey of this._accountKeys) {
       let type = Services.prefs.getCharPref(ACCOUNT_ROOT + accountKey + ".type");
       if (type === aType)
         result.push(this.getAccount(accountKey));
     }
 
     return result;
   },
 
-  addAccountDialog: function CFA_addAccountDialog() {
+  addAccountDialog() {
     let params = {accountKey: null};
     Services.wm
             .getMostRecentWindow(null)
             .openDialog("chrome://messenger/content/cloudfile/"
                         + "addAccountDialog.xul",
                         "", "chrome, dialog, modal, resizable=yes",
                         params).focus();
     return params.accountKey;
--- a/mail/components/cloudfile/content/addAccountDialog.js
+++ b/mail/components/cloudfile/content/addAccountDialog.js
@@ -47,17 +47,17 @@ var addAccountDialog = {
   _accept: null,
   _strings: Services.strings
                     .createBundle("chrome://messenger/locale/cloudfile/addAccountDialog.properties"),
   // This blacklist is for providers who no longer want to be offered
   // as an option for a new Filelink provider, but still wants to
   // exist as a Filelink provider for pre-existing users.
   _blacklist: new Set(["YouSendIt"]),
 
-  onInit: function AAD_onInit() {
+  onInit() {
     this._settings = document.getElementById("accountSettings");
     this._accountType = document.getElementById("accountType");
     this._noAccountText = document.getElementById("noAccountText");
     this._accept = document.documentElement.getButton("accept");
     this._cancel = document.documentElement.getButton("cancel");
     this._messages = document.getElementById("messages");
     this._authSpinner = document.getElementById("authorizing");
     this._error = document.getElementById("error");
@@ -117,17 +117,17 @@ var addAccountDialog = {
       }
       case "select": {
         this.accountTypeSelected();
         break;
       }
     }
   },
 
-  onIFrameLoaded: function AAD_onIFrameLoaded(aEvent) {
+  onIFrameLoaded(aEvent) {
     let doc = this._settings.contentDocument;
 
     let links = doc.getElementsByTagName("a");
 
     for (let link of links)
       link.addEventListener("click", this.onClickLink);
 
     let form = doc.getElementById(kFormId);
@@ -155,24 +155,24 @@ var addAccountDialog = {
       this._settings.style.height = this._settings.style.minHeight = "16px";
       return;
     }
     let newHeight = this._settings.contentDocument.body.offsetHeight;
     this._settings.style.height = this._settings.style.minHeight = newHeight + "px";
     window.sizeToContent();
   },
 
-  removeTitleMenuItem: function AAD_removeTitleMenuItem() {
+  removeTitleMenuItem() {
     let menuitem = this._accountType.querySelector('menuitem[value=""]');
     if (menuitem)
       menuitem.remove();
   },
 
   // Return number of additions to the menulist, zero if none happened.
-  addAccountTypes: function AAD_addAccountTypes() {
+  addAccountTypes() {
     let accountTypeTotal = 0;
     for (let [key, provider] of cloudFileAccounts.enumerateProviders()) {
       // If we already have an account for this type, don't add it to the list.
       // This limitation will hopefully be removed in the future.
       if (cloudFileAccounts.getAccountsForType(key).length > 0)
         continue;
 
       if (this._blacklist.has(key))
@@ -206,79 +206,79 @@ var addAccountDialog = {
     // If there's only one option, let's choose it for the user to avoid
     // a few clicks.
     if (this._accountType.itemCount == 1)
       this._accountType.selectedIndex = 0;
 
     return accountTypeTotal;
   },
 
-  onOK: function AAD_onOK() {
+  onOK() {
     let accountType = this._accountType.value;
     let obs = new createAccountObserver();
 
     let extras = this.getExtraArgs();
 
     cloudFileAccounts.createAccount(accountType, obs, extras);
     this._accept.disabled = true;
 
     this._messages.selectedPanel = this._authSpinner;
 
     // Uninitialize the dialog before closing.
     this.onUnInit();
     return false;
   },
 
-  getExtraArgs: function AAD_getExtraArgs() {
+  getExtraArgs() {
     if (!this._settings)
       return {};
 
     let func = this._settings.contentWindow
                    .wrappedJSObject
                    .extraArgs;
     if (!func)
       return {};
 
     return func();
   },
 
-  accountTypeSelected: function AAD_accountTypeSelected() {
+  accountTypeSelected() {
     let providerKey = this._accountType.selectedItem.value;
     if (!providerKey)
       return;
 
     let provider = cloudFileAccounts.getProviderForType(providerKey);
     if (!provider)
       return;
 
     // Reset the message display
     this._messages.selectedIndex = -1;
 
     // Load up the correct XHTML page for this provider.
     this._settings.contentDocument.location.href = provider.settingsURL;
   },
 
-  onClickLink: function AAD_onClickLink(e) {
+  onClickLink(e) {
     e.preventDefault();
     let href = e.target.getAttribute("href");
     gProtocolService.loadURI(Services.io.newURI(href, "UTF-8"));
   },
 
-  onInput: function AAD_onInput() {
+  onInput() {
     // Let's see if we have everything we need to make OK enabled...
     if (this._accountType.selectedIndex == -1) {
       // We have the "Select a service provider" menuitem selected, so we
       // shouldn't be able to click "Set up account"
       this._accept.disabled = true;
     } else {
       this._accept.disabled = !this.checkValidity();
     }
   },
 
-  checkValidity: function AAD_checkValidity() {
+  checkValidity() {
     // If there's a form in the iframe, ensure that
     // it's checkValidity function passes.
     let form = this._settings
                    .contentWindow
                    .wrappedJSObject
                    .document
                    .getElementById(kFormId);
 
--- a/mail/components/cloudfile/nsBox.js
+++ b/mail/components/cloudfile/nsBox.js
@@ -31,25 +31,25 @@ XPCOMUtils.defineLazyServiceGetter(this,
 
 function nsBox() {
   this.log = Log4Moz.getConfiguredLogger("BoxService");
   this._oauth = new OAuth2(kAuthBaseUrl, null, kClientId, kClientSecret);
   this._oauth.authURI = kAuthBaseUrl + kAuthUrl;
 
   let account = this;
   Object.defineProperty(this._oauth, "refreshToken", {
-    get: function getRefreshToken() {
+    get() {
       if (!this.mRefreshToken) {
         let authToken = cloudFileAccounts.getSecretValue(account.accountKey,
                                                          cloudFileAccounts.kTokenRealm);
         this.mRefreshToken = authToken || "";
       }
       return this.mRefreshToken;
     },
-    set: function setRefreshToken(aVal) {
+    set(aVal) {
       if (!aVal)
         aVal = "";
 
       cloudFileAccounts.setSecretValue(account.accountKey,
                                        cloudFileAccounts.kTokenRealm,
                                        aVal);
 
       return (this.mRefreshToken = aVal);
@@ -92,74 +92,73 @@ nsBox.prototype = {
   _uploadInfo: {},
   _uploads: [],
   _oauth: null,
 
   /**
    * Used by our testing framework to override the URLs that this component
    * communicates to.
    */
-  overrideUrls: function nsBox_overrideUrls(aNumUrls, aUrls) {
+  overrideUrls(aNumUrls, aUrls) {
     gServerUrl = aUrls[0];
   },
 
   /**
    * Initializes an instance of this nsIMsgCloudFileProvider for an account
    * with key aAccountKey.
    *
    * @param aAccountKey the account key to initialize this
    *                    nsIMsgCloudFileProvider with.
    */
-  init: function nsBox_init(aAccountKey) {
+  init(aAccountKey) {
     this._accountKey = aAccountKey;
     this._prefBranch = Services.prefs.getBranch("mail.cloud_files.accounts." +
                                                 aAccountKey + ".");
   },
 
   /**
    * Private function for assigning the folder id from a cached version
    * If the folder doesn't exist, check if it exists on the server. If it
    * doesn't, set in motion the creation.
    *
    * @param aCallback called if folder is ready.
    */
-  _initFolder: function nsBox__initFolder(aCallback) {
+  _initFolder(aCallback) {
     this.log.info("_initFolder, cached folder id  = " + this._cachedFolderId);
 
     let saveFolderId = (aFolderId) => {
       this.log.info("saveFolderId : " + aFolderId);
       this._cachedFolderId = this._folderId = aFolderId;
       if (aCallback)
         aCallback();
     };
 
     let createThunderbirdFolder = () => {
       this._createFolder("Thunderbird", saveFolderId);
     };
 
     // If there's no cached folder, try to get one, otherwise create one.
-    if (this._cachedFolderId == "")
+    if (this._cachedFolderId == "") {
       this._getFolder("Thunderbird", saveFolderId, createThunderbirdFolder);
-    else {
+    } else {
       this._folderId = this._cachedFolderId;
       if (aCallback)
         aCallback();
     }
   },
 
   /**
    * Private callback function passed to, and called from
    * nsBoxFileUploader.
    *
    * @param aRequestObserver a request observer for monitoring the start and
    *                         stop states of a request.
    * @param aStatus the status of the request.
    */
-  _uploaderCallback: function nsBox__uploaderCallback(aRequestObserver,
-                                                            aStatus) {
+  _uploaderCallback(aRequestObserver, aStatus) {
     aRequestObserver.onStopRequest(null, null, aStatus);
     this._uploadingFile = null;
     this._uploads.shift();
     if (this._uploads.length > 0) {
       let nextUpload = this._uploads[0];
       this.log.info("chaining upload, file = " + nextUpload.file.leafName);
       this._uploadingFile = nextUpload.file;
       this._uploader = nextUpload;
@@ -175,17 +174,17 @@ nsBox.prototype = {
 
   /**
    * Attempt to upload a file to Box's servers.
    *
    * @param aFile an nsIFile for uploading.
    * @param aCallback an nsIRequestObserver for monitoring the start and
    *                  stop states of the upload procedure.
    */
-  uploadFile: function nsBox_uploadFile(aFile, aCallback) {
+  uploadFile(aFile, aCallback) {
     if (Services.io.offline)
       throw Ci.nsIMsgCloudFileProvider.offlineErr;
 
     this.log.info("uploading " + aFile.leafName);
 
     // Some ugliness here - we stash requestObserver here, because we might
     // use it again in _getUserInfo.
     this.requestObserver = aCallback;
@@ -238,17 +237,17 @@ nsBox.prototype = {
    * A private function called when we're almost ready to kick off the upload
    * for a file. First, ensures that the file size is not too large, and that
    * we won't exceed our storage quota, and then kicks off the upload.
    *
    * @param aFile the nsIFile to upload
    * @param aCallback the nsIRequestObserver for monitoring the start and stop
    *                  states of the upload procedure.
    */
-  _finishUpload: function nsBox__finishUpload(aFile, aCallback) {
+  _finishUpload(aFile, aCallback) {
     let exceedsFileLimit = Ci.nsIMsgCloudFileProvider.uploadExceedsFileLimit;
     let exceedsQuota = Ci.nsIMsgCloudFileProvider.uploadWouldExceedQuota;
     if (aFile.fileSize > this._maxFileSize) {
       aCallback.onStopRequest(null, null, exceedsFileLimit);
       return;
     }
     if (aFile.fileSize > this.remainingFileSpace) {
       aCallback.onStopRequest(null, null, exceedsQuota);
@@ -269,17 +268,17 @@ nsBox.prototype = {
     this._uploader.uploadFile();
   },
 
   /**
    * Cancels an in-progress file upload.
    *
    * @param aFile the nsIFile being uploaded.
    */
-  cancelFileUpload: function nsBox_cancelFileUpload(aFile) {
+  cancelFileUpload(aFile) {
     if (this._uploadingFile.equals(aFile)) {
       this._uploader.cancel();
     } else {
       for (let i = 0; i < this._uploads.length; i++)
         if (this._uploads[i].file.equals(aFile)) {
           this._uploads[i].requestObserver.onStopRequest(
             null, null, Ci.nsIMsgCloudFileProvider.uploadCanceled);
           this._uploads.splice(i, 1);
@@ -291,17 +290,17 @@ nsBox.prototype = {
   /**
    * A private function for retrieving profile information about a user.
    *
    * @param successCallback a callback fired if retrieving profile information
    *                        is successful.
    * @param failureCallback a callback fired if retrieving profile information
    *                        fails.
    */
-  _getUserInfo: function nsBox__getUserInfo(successCallback, failureCallback) {
+  _getUserInfo(successCallback, failureCallback) {
     let requestUrl = gServerUrl + "users/me";
     this.log.info("get_account_info requestUrl = " + requestUrl);
 
     if (!successCallback)
       successCallback = function() {
         this.requestObserver
             .onStopRequest(null, null,
                            this._loggedIn ? Cr.NS_OK : Ci.nsIMsgCloudFileProvider.authErr);
@@ -360,82 +359,76 @@ nsBox.prototype = {
    * retrieves the user's profile information.
    *
    * @param aSuccessCallback the function called on successful information
    *                         retrieval
    * @param aFailureCallback the function called on failed information retrieval
    * @param aWithUI a boolean for whether or not we should display authorization
    *                UI if we don't have a valid token anymore, or just fail out.
    */
-  _logonAndGetUserInfo: function nsBox_logonAndGetUserInfo(aSuccessCallback,
-                                                               aFailureCallback,
-                                                               aWithUI) {
+  _logonAndGetUserInfo(aSuccessCallback, aFailureCallback, aWithUI) {
     if (!aFailureCallback)
       aFailureCallback = function() {
         this.requestObserver
             .onStopRequest(null, null, Ci.nsIMsgCloudFileProvider.authErr);
       }.bind(this);
 
     return this.logon(function() {
       this._getUserInfo(aSuccessCallback, aFailureCallback);
     }.bind(this), aFailureCallback, aWithUI);
   },
 
   /**
    * Returns the sharing URL for some uploaded file.
    *
    * @param aFile the nsIFile to get the URL for.
    */
-  urlForFile: function nsBox_urlForFile(aFile) {
+  urlForFile(aFile) {
     return this._urlsForFiles[aFile.path];
   },
 
   /**
    * Updates the profile information for the account associated with the
    * account key.
    *
    * @param aWithUI a boolean for whether or not we should display authorization
    *                UI if we don't have a valid token anymore, or just fail out.
    * @param aCallback an nsIRequestObserver for observing the starting and
    *                  ending states of the request.
    */
-  refreshUserInfo: function nsBox_refreshUserInfo(aWithUI, aCallback) {
+  refreshUserInfo(aWithUI, aCallback) {
     this.log.info("Getting User Info 1 : " + this._loggedIn);
     if (Services.io.offline)
       throw Ci.nsIMsgCloudFileProvider.offlineErr;
     this.requestObserver = aCallback;
     aCallback.onStartRequest(null, null);
     if (!this._loggedIn)
       return this._logonAndGetUserInfo(null, null, aWithUI);
     if (!this._userInfo)
       return this._getUserInfo();
     return this._userInfo;
   },
 
   /**
    * Our Box implementation does not implement the createNewAccount
    * function defined in nsIMsgCloudFileProvider.idl.
    */
-  createNewAccount: function nsBox_createNewAccount(aEmailAddress,
-                                                          aPassword, aFirstName,
-                                                          aLastName) {
+  createNewAccount(aEmailAddress, aPassword, aFirstName, aLastName) {
     return Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
 
   /**
    * Private function to get the ID of an already existing folder on the Box
    * website.
    *
    * @param aName name of folder
    * @param aSuccessCallback called if the folder exists
    * @param aFailureCallback called if the folder cannot be found
    */
-  _getFolder: function nsBox__getFolder(aName,
-                                        aSuccessCallback,
-                                        aFailureCallback) {
+  _getFolder(aName, aSuccessCallback, aFailureCallback) {
     this.log.info("Getting folder: " + aName);
     if (Services.io.offline)
       throw Ci.nsIMsgCloudFileProvider.offlineErr;
 
     // There's no API to search by name and we don't know the ID. Get the root
     // folder and search for this name inside of it.
     const ROOT_ID = "0";
     let requestUrl = gServerUrl + "folders/" + ROOT_ID;
@@ -490,18 +483,17 @@ nsBox.prototype = {
   },
 
   /**
    * Private function for creating folder on the Box website.
    *
    * @param aName name of folder
    * @param aSuccessCallback called when folder is created
    */
-  _createFolder: function nsBox__createFolder(aName,
-                                              aSuccessCallback) {
+  _createFolder(aName, aSuccessCallback) {
     this.log.info("Creating folder: " + aName);
     if (Services.io.offline)
       throw Ci.nsIMsgCloudFileProvider.offlineErr;
 
     let body = {
       parent: {
         id: "0",
       },
@@ -544,17 +536,17 @@ nsBox.prototype = {
 
   /**
    * If a the user associated with this account key already has an account,
    * allows them to log in.
    *
    * @param aRequestObserver an nsIRequestObserver for monitoring the start and
    *                         stop states of the login procedure.
    */
-  createExistingAccount: function nsBox_createExistingAccount(aRequestObserver) {
+  createExistingAccount(aRequestObserver) {
      // XXX: replace this with a better function
     let successCb = () => {
       aRequestObserver.onStopRequest(null, this, Cr.NS_OK);
     };
 
     let failureCb = (aResponseText) => {
       aRequestObserver.onStopRequest(null, this,
                                      Ci.nsIMsgCloudFileProvider.authErr);
@@ -564,17 +556,17 @@ nsBox.prototype = {
   },
 
   /**
    * Returns an appropriate provider-specific URL for dealing with a particular
    * error type.
    *
    * @param aError an error to get the URL for.
    */
-  providerUrlForError: function nsBox_providerUrlForError(aError) {
+  providerUrlForError(aError) {
     if (aError == Ci.nsIMsgCloudFileProvider.uploadWouldExceedQuota)
       return "https://www.box.com/pricing/";
     return "";
   },
 
   /**
    * If the provider doesn't have an API for creating an account, perhaps
    * there's a url we can load in a content tab that will allow the user
@@ -591,17 +583,17 @@ nsBox.prototype = {
 
   /**
    * Attempts to delete an uploaded file.
    *
    * @param aFile the nsIFile to delete.
    * @param aCallback an nsIRequestObserver for monitoring the start and stop
    *                  states of the delete procedure.
    */
-  deleteFile: function nsBox_deleteFile(aFile, aCallback) {
+  deleteFile(aFile, aCallback) {
     this.log.info("Deleting a file");
 
     if (Services.io.offline) {
       this.log.error("We're offline - we can't delete the file.");
       throw Ci.nsIMsgCloudFileProvider.offlineErr;
     }
 
     let uploadInfo = this._uploadInfo[aFile.path];
@@ -637,17 +629,17 @@ nsBox.prototype = {
   /**
    * Attempt to log on and get the auth token for this Box account.
    *
    * @param successCallback the callback to be fired if logging on is successful
    * @param failureCallback the callback to be fired if loggong on fails
    * @aparam aWithUI a boolean for whether or not we should prompt for a password
    *                 if no auth token is currently stored.
    */
-  logon: function nsBox_logon(successCallback, failureCallback, aWithUI) {
+  logon(successCallback, failureCallback, aWithUI) {
     // The token has expired, reauthenticate.
     if (this._oauth.tokenExpires < (new Date()).getTime()) {
       this._oauth.connect(successCallback, failureCallback, aWithUI);
     } else {
       // The token is still valid, success!
       successCallback();
     }
   },
@@ -678,17 +670,17 @@ nsBoxFileUploader.prototype = {
   box: null,
   file: null,
   callback: null,
   request: null,
 
   /**
    * Do the upload of the file to Box.
    */
-  uploadFile: function nsBox_uploadFile() {
+  uploadFile() {
     this.requestObserver.onStartRequest(null, null);
     let requestUrl = gUploadUrl + "files/content";
     this.box._uploadInfo[this.file.path] = {};
     this.box._uploadInfo[this.file.path].uploadUrl = requestUrl;
 
     let req = new XMLHttpRequest();
 
     this.log.info("upload url = " + requestUrl);
@@ -773,17 +765,17 @@ nsBoxFileUploader.prototype = {
 
       req.send(form);
     });
   },
 
   /**
    * Cancels the upload request for the file associated with this Uploader.
    */
-  cancel: function nsBox_cancel() {
+  cancel() {
     this.log.info("in uploader cancel");
     this.callback(this.requestObserver, Ci.nsIMsgCloudFileProvider.uploadCanceled);
     delete this.callback;
     if (this.request) {
       this.log.info("cancelling upload request");
       let req = this.request;
       if (req.channel) {
         this.log.info("cancelling upload channel");
--- a/mail/components/cloudfile/nsHightail.js
+++ b/mail/components/cloudfile/nsHightail.js
@@ -1154,19 +1154,19 @@ nsHightailFileUploader.prototype = {
       aFailureCallback();
     }.bind(this);
 
     req.onload = function() {
       let response = req.responseText;
       this.log.info("findDownloadUrl response = " + response);
       let fileInfo = JSON.parse(response);
 
-      if (fileInfo.errorStatus)
+      if (fileInfo.errorStatus) {
         aFailureCallback();
-      else {
+      } else {
         // We need a kludge here because Hightail is returning URLs without the scheme...
         let url = this._ensureScheme(fileInfo.clickableDownloadUrl);
         this.hightail._urlsForFiles[this.file.path] = url;
         aSuccessCallback();
       }
     }.bind(this);
 
     req.setRequestHeader("X-Auth-Token", this.hightail._cachedAuthToken + " ");
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1497,25 +1497,24 @@ function uploadListener(aAttachment, aFi
         cloudFileAccounts.getDisplayName(this.cloudProvider),
       ]));
     item.uploading = true;
     item.cloudProvider = this.cloudProvider;
   }
 }
 
 uploadListener.prototype = {
-  onStartRequest: function uploadListener_onStartRequest(aRequest, aContext) {
+  onStartRequest(aRequest, aContext) {
     let bucket = document.getElementById("attachmentBucket");
     let item = bucket.findItemForAttachment(this.attachment);
     if (item)
       item.image = "chrome://global/skin/icons/loading.png";
   },
 
-  onStopRequest: function uploadListener_onStopRequest(aRequest, aContext,
-                                                       aStatusCode) {
+  onStopRequest(aRequest, aContext, aStatusCode) {
     let bucket = document.getElementById("attachmentBucket");
     let attachmentItem = bucket.findItemForAttachment(this.attachment);
 
     if (Components.isSuccessCode(aStatusCode)) {
       let originalUrl = this.attachment.url;
       this.attachment.contentLocation = this.cloudProvider.urlForFile(this.file);
       this.attachment.cloudProviderKey = this.cloudProvider.accountKey;
       if (attachmentItem) {
@@ -1525,19 +1524,19 @@ uploadListener.prototype = {
         attachmentItem.setAttribute("tooltiptext",
           getComposeBundle().getFormattedString("cloudFileUploadedTooltip", [
             cloudFileAccounts.getDisplayName(this.cloudProvider),
           ]));
         attachmentItem.uploading = false;
 
         // Set the icon for the attachment.
         let iconClass = this.cloudProvider.iconClass;
-        if (iconClass)
+        if (iconClass) {
           attachmentItem.image = iconClass;
-        else {
+        } else {
           // Should we use a generic "cloud" icon here? Or an overlay icon?
           // I think the provider should provide an icon, end of story.
           attachmentItem.image = null;
         }
       }
 
       let event = document.createEvent("Events");
       event.initEvent("attachment-uploaded", true, true);
@@ -1626,21 +1625,20 @@ uploadListener.prototype = {
 };
 
 function deletionListener(aAttachment, aCloudProvider) {
   this.attachment = aAttachment;
   this.cloudProvider = aCloudProvider;
 }
 
 deletionListener.prototype = {
-  onStartRequest: function deletionListener_onStartRequest(aRequest, aContext) {
+  onStartRequest(aRequest, aContext) {
   },
 
-  onStopRequest: function deletionListener_onStopRequest(aRequest, aContext,
-                                                         aStatusCode) {
+  onStopRequest(aRequest, aContext, aStatusCode) {
     if (!Components.isSuccessCode(aStatusCode)) {
       let displayName = cloudFileAccounts.getDisplayName(this.cloudProvider);
       Services.prompt.alert(window,
         getComposeBundle().getString("errorCloudFileDeletion.title"),
         getComposeBundle().getFormattedString("errorCloudFileDeletion.message",
                                               [displayName,
                                                this.attachment.name]));
     }
@@ -1967,17 +1965,17 @@ function GetArgs(originalData) {
   var separator = String.fromCharCode(1);
 
   var quoteChar = "";
   var prevChar = "";
   var nextChar = "";
   for (let i = 0; i < originalData.length; i++, prevChar = aChar) {
     var aChar = originalData.charAt(i);
     var aCharCode = originalData.charCodeAt(i);
-    if ( i < originalData.length - 1)
+    if (i < originalData.length - 1)
       nextChar = originalData.charAt(i + 1);
     else
       nextChar = "";
 
     if (aChar == quoteChar && (nextChar == "," || nextChar == "")) {
       quoteChar = "";
       data += aChar;
     } else if ((aCharCode == 39 || aCharCode == 34) && prevChar == "=") { // quote or double quote
@@ -2498,19 +2496,19 @@ function ComposeStartup(aParams) {
     lastButton.parentNode.insertBefore(replaceButton, lastButton.nextSibling);
     lastButton.parentNode.insertBefore(tSeparator, lastButton.nextSibling);
   }
 
   var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object
   var args = null;   // old way, parameters are passed as a string
   gBodyFromArgs = false;
 
-  if (aParams)
+  if (aParams) {
     params = aParams;
-  else if (window.arguments && window.arguments[0]) {
+  } else if (window.arguments && window.arguments[0]) {
     try {
       if (window.arguments[0] instanceof Ci.nsIMsgComposeParams)
         params = window.arguments[0];
       else
         params = handleMailtoArgs(window.arguments[0]);
     } catch (ex) {
       dump("ERROR with parameters: " + ex + "\n");
     }
@@ -6332,25 +6330,25 @@ function AutoSave() {
 /**
  * Periodically check for keywords in the message.
  */
 var gAttachmentNotifier = {
   _obs: null,
 
   enabled: false,
 
-  init: function gAN_init(aDocument) {
+  init(aDocument) {
     if (this._obs)
       this.shutdown();
 
     this.enabled = Services.prefs.getBoolPref("mail.compose.attachment_reminder");
     if (!this.enabled)
       return;
 
-    this._obs = new MutationObserver(function gAN_handleMutations(aMutations) {
+    this._obs = new MutationObserver(function(aMutations) {
       gAttachmentNotifier.timer.cancel();
       gAttachmentNotifier.timer.initWithCallback(gAttachmentNotifier.event, 500,
                                                  Ci.nsITimer.TYPE_ONE_SHOT);
     });
 
     this._obs.observe(aDocument, {
       attributes: true,
       childList: true,
@@ -6365,17 +6363,17 @@ var gAttachmentNotifier = {
 
     // We could have been opened with a draft message already containing
     // some keywords, so run the checker once to pick them up.
     this.event.notify();
   },
 
   // Timer based function triggered by the inputEventListener
   // for the subject field.
-  subjectObserver: function handleEvent() {
+  subjectObserver() {
     gAttachmentNotifier.timer.cancel();
     gAttachmentNotifier.timer.initWithCallback(gAttachmentNotifier.event, 500,
                                                Ci.nsITimer.TYPE_ONE_SHOT);
   },
 
   /**
    * Checks for new keywords synchronously and run the usual handler.
    *
@@ -6480,17 +6478,17 @@ var gAttachmentNotifier = {
 
     if (!async)
       return AttachmentChecker.getAttachmentKeywords(mailData, keywordsInCsv);
 
     attachmentWorker.postMessage([mailData, keywordsInCsv]);
     return null;
   },
 
-  shutdown: function gAN_shutdown() {
+  shutdown() {
     if (this._obs)
       this._obs.disconnect();
     gAttachmentNotifier.timer.cancel();
 
     this._obs = null;
   },
 
   event: {
--- a/mail/components/compose/content/cloudAttachmentLinkManager.js
+++ b/mail/components/compose/content/cloudAttachmentLinkManager.js
@@ -146,21 +146,21 @@ var gCloudAttachmentLinkManager = {
 
     // Are we replying?
     let replyCitation = mailBody.querySelector(".moz-cite-prefix");
     if (replyCitation) {
       if (gCurrentIdentity && gCurrentIdentity.replyOnTop == 0) {
         // Replying below quote - we'll select the point right before
         // the signature.  If there's no signature, we'll just use the
         // last node.
-        if (signature && signature.previousSibling)
+        if (signature && signature.previousSibling) {
           selection.collapse(mailBody,
                              Array.from(childNodes)
                                   .indexOf(signature.previousSibling));
-        else {
+        } else {
           selection.collapse(mailBody, childNodes.length - 1);
           editor.insertLineBreak();
 
           if (!gMsgCompose.composeHTML)
             editor.insertLineBreak();
 
           selection.collapse(mailBody, childNodes.length - 2);
         }
--- a/mail/components/extensions/test/xpcshell/.eslintrc.js
+++ b/mail/components/extensions/test/xpcshell/.eslintrc.js
@@ -3,9 +3,13 @@
 module.exports = {
   "extends": "plugin:mozilla/xpcshell-test",
 
   "env": {
     // The tests in this folder are testing based on WebExtensions, so lets
     // just define the webextensions environment here.
     "webextensions": true,
   },
+
+  "rules": {
+    "func-names": "off",
+  },
 };
--- a/mail/components/im/content/addbuddy.js
+++ b/mail/components/im/content/addbuddy.js
@@ -1,38 +1,38 @@
 /* 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/. */
 
 var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
 var { Services } = ChromeUtils.import("resource:///modules/imServices.jsm", null);
 
 var addBuddy = {
-  onload: function ab_onload() {
+  onload() {
     let accountList = document.getElementById("accountlist");
     for (let acc of fixIterator(Services.accounts.getAccounts())) {
       if (!acc.connected)
         continue;
       let proto = acc.protocol;
       let item = accountList.appendItem(acc.name, acc.id, proto.name);
       item.setAttribute("image", proto.iconBaseURI + "icon.png");
       item.setAttribute("class", "menuitem-iconic");
     }
     if (!accountList.itemCount) {
       document.getElementById("addBuddyDialog").cancelDialog();
       throw "No connected account!";
     }
     accountList.selectedIndex = 0;
   },
 
-  oninput: function ab_oninput() {
+  oninput() {
     document.documentElement.getButton("accept").disabled =
       !addBuddy.getValue("name");
   },
 
-  getValue: function ab_getValue(aId) { return document.getElementById(aId).value; },
+  getValue(aId) { return document.getElementById(aId).value; },
 
-  create: function ab_create() {
+  create() {
     let account = Services.accounts.getAccountById(this.getValue("accountlist"));
     let group = document.getElementById("chatBundle").getString("defaultGroup");
     account.addBuddy(Services.tags.createTag(group), this.getValue("name"));
   },
 };
--- a/mail/components/im/content/am-im.js
+++ b/mail/components/im/content/am-im.js
@@ -9,17 +9,17 @@ ChromeUtils.import("resource://gre/modul
 
 var autoJoinPref = "autoJoin";
 
 function onPreInit(aAccount, aAccountValue) {
   account.init(aAccount.incomingServer.wrappedJSObject.imAccount);
 }
 
 var account = {
-  init: function account_init(aAccount) {
+  init(aAccount) {
     this.account = aAccount;
     this.proto = this.account.protocol;
     document.getElementById("accountName").value = this.account.name;
     document.getElementById("protocolName").value = this.proto.name || this.proto.id;
     document.getElementById("protocolIcon").src =
       this.proto.iconBaseURI + "icon48.png";
 
     let password = document.getElementById("server.password");
@@ -53,23 +53,23 @@ var account = {
     else
       autojoin.removeAttribute("wsm_persist");
 
     this.prefs = Services.prefs.getBranch("messenger.account." +
                                           this.account.id + ".options.");
     this.populateProtoSpecificBox();
   },
 
-  getProtoOptions: function* account_getProtoOptions() {
+  * getProtoOptions() {
     let options = this.proto.getOptions();
     while (options.hasMoreElements())
       yield options.getNext();
   },
 
-  populateProtoSpecificBox: function account_populate() {
+  populateProtoSpecificBox() {
     let attributes = {};
     attributes[Ci.prplIPref.typeBool] = [
       {name: "wsm_persist", value: "true"},
       {name: "preftype", value: "bool"},
       {name: "genericattr", value: "true"},
     ];
     attributes[Ci.prplIPref.typeInt] = [
       {name: "wsm_persist", value: "true"},
--- a/mail/components/im/content/chat-messenger.js
+++ b/mail/components/im/content/chat-messenger.js
@@ -28,29 +28,29 @@ function buddyListContextMenu(aXulMenu) 
     document.getElementById(aId).hidden = hide;
   });
 
   document.getElementById("context-close-conversation").hidden = !this.onConv;
   document.getElementById("context-openconversation").disabled =
     !hide && !this.target.canOpenConversation();
 }
 buddyListContextMenu.prototype = {
-  openConversation: function blcm_openConversation() {
+  openConversation() {
     if (this.onContact || this.onConv)
       this.target.openConversation();
   },
-  closeConversation: function blcm_closeConversation() {
+  closeConversation() {
     if (this.onConv)
       this.target.closeConversation();
   },
-  alias: function blcm_alias() {
+  alias() {
     if (this.onContact)
       this.target.startAliasing();
   },
-  delete: function blcm_delete() {
+  delete() {
     if (!this.onContact)
       return;
 
     let buddy = this.target.contact.preferredBuddy;
     let bundle = document.getElementById("chatBundle");
     let displayName = this.target.displayName;
     let promptTitle = bundle.getFormattedString("buddy.deletePrompt.title",
                                                 [displayName]);
@@ -185,46 +185,46 @@ var chatTabType = {
   },
   persistTab(aTab) {
     return {};
   },
   restoreTab(aTabmail, aPersistedState) {
     aTabmail.openTab("chat", {});
   },
 
-  supportsCommand: function ct_supportsCommand(aCommand, aTab) {
+  supportsCommand(aCommand, aTab) {
     switch (aCommand) {
       case "cmd_fullZoomReduce":
       case "cmd_fullZoomEnlarge":
       case "cmd_fullZoomReset":
       case "cmd_fullZoomToggle":
       case "cmd_find":
       case "cmd_findAgain":
       case "cmd_findPrevious":
         return true;
       default:
         return false;
     }
   },
-  isCommandEnabled: function ct_isCommandEnabled(aCommand, aTab) {
+  isCommandEnabled(aCommand, aTab) {
     switch (aCommand) {
       case "cmd_fullZoomReduce":
       case "cmd_fullZoomEnlarge":
       case "cmd_fullZoomReset":
       case "cmd_fullZoomToggle":
         return !!this.getBrowser();
       case "cmd_find":
       case "cmd_findAgain":
       case "cmd_findPrevious":
         return !!this.getFindbar();
       default:
         return false;
     }
   },
-  doCommand: function ct_doCommand(aCommand, aTab) {
+  doCommand(aCommand, aTab) {
     switch (aCommand) {
       case "cmd_fullZoomReduce":
         ZoomManager.reduce();
         break;
       case "cmd_fullZoomEnlarge":
         ZoomManager.enlarge();
         break;
       case "cmd_fullZoomReset":
@@ -240,28 +240,28 @@ var chatTabType = {
         this.getFindbar().onFindAgainCommand(false);
         break;
       case "cmd_findPrevious":
         this.getFindbar().onFindAgainCommand(true);
         break;
     }
   },
   onEvent(aEvent, aTab) {},
-  getBrowser: function ct_getBrowser(aTab) {
+  getBrowser(aTab) {
     let panel = document.getElementById("conversationsDeck").selectedPanel;
     if (panel == document.getElementById("logDisplay")) {
       if (document.getElementById("logDisplayDeck").selectedPanel ==
           document.getElementById("logDisplayBrowserBox"))
         return document.getElementById("conv-log-browser");
     } else if (panel && panel.localName == "imconversation") {
       return panel.browser;
     }
     return null;
   },
-  getFindbar: function ct_getFindbar(aTab) {
+  getFindbar(aTab) {
     let panel = document.getElementById("conversationsDeck").selectedPanel;
     if (panel == document.getElementById("logDisplay")) {
       if (document.getElementById("logDisplayDeck").selectedPanel ==
           document.getElementById("logDisplayBrowserBox"))
         return document.getElementById("log-findbar");
     } else if (panel && panel.localName == "imconversation") {
       return panel.findbar;
     }
@@ -1180,19 +1180,19 @@ var chatHandler = {
       else
         listbox.focus();
     });
     window.addEventListener("resize", this.onConvResize.bind(this));
     document.getElementById("conversationsGroup").sortComparator =
       (a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase());
 
     ChromeUtils.import("resource:///modules/chatHandler.jsm", this);
-    if (this.ChatCore.initialized)
+    if (this.ChatCore.initialized) {
       this.initAfterChatCore();
-    else {
+    } else {
       this.ChatCore.init();
       this._addObserver("chat-core-initialized");
     }
   },
 };
 
 function chatLogTreeGroupItem(aTitle, aLogItems) {
   this._title = aTitle;
@@ -1229,17 +1229,17 @@ function chatLogTreeView(aTree, aLogs) {
   this._tree = aTree;
   this._logs = aLogs;
   this._tree.view = this;
   this._rebuild();
 }
 chatLogTreeView.prototype = {
   __proto__: new PROTO_TREE_VIEW(),
 
-  _rebuild: function cLTV__rebuild() {
+  _rebuild() {
     // Some date helpers...
     const kDayInMsecs = 24 * 60 * 60 * 1000;
     const kWeekInMsecs = 7 * kDayInMsecs;
     const kTwoWeeksInMsecs = 2 * kWeekInMsecs;
 
     // Drop the old rowMap.
     if (this._tree)
       this._tree.rowCountChanged(0, -this._rowMap.length);
--- a/mail/components/im/content/imAccountWizard.js
+++ b/mail/components/im/content/imAccountWizard.js
@@ -6,17 +6,17 @@
 /* globals accountOptionsHelper */
 
 var { Services } = ChromeUtils.import("resource:///modules/imServices.jsm", null);
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
 var PREF_EXTENSIONS_GETMOREPROTOCOLSURL = "extensions.getMoreProtocolsURL";
 
 var accountWizard = {
-  onload: function aw_onload() {
+  onload() {
     // Ensure the im core is initialized before we get a list of protocols.
     Services.core.init();
 
     accountWizard.setGetMoreProtocols();
 
     var protoList = document.getElementById("protolist");
     var protos = [];
     for (let proto of this.getProtocols())
@@ -43,62 +43,61 @@ var accountWizard = {
     // there is a strange selection bug without this timeout
     setTimeout(function() {
       protoList.selectedIndex = 0;
     }, 0);
 
     Services.obs.addObserver(this, "prpl-quit");
     window.addEventListener("unload", this.unload);
   },
-  unload: function aw_unload() {
+  unload() {
     Services.obs.removeObserver(accountWizard, "prpl-quit");
   },
-  observe: function am_observe(aObject, aTopic, aData) {
+  observe(aObject, aTopic, aData) {
     if (aTopic == "prpl-quit") {
       // libpurple is being uninitialized. We can't create any new
       // account so keeping this wizard open would be pointless, close it.
       window.close();
     }
   },
 
-  getUsername: function aw_getUsername() {
+  getUsername() {
     // If the first username textbox is empty, make sure we return an empty
     // string so that it blocks the 'next' button of the wizard.
     if (!this.userNameBoxes[0].value)
       return "";
 
     return this.userNameBoxes.reduce((prev, elt) => prev + elt.value, "");
   },
 
-  checkUsername: function aw_checkUsername() {
+  checkUsername() {
     var wizard = document.getElementById("accountWizard");
     var name = accountWizard.getUsername();
     var duplicateWarning = document.getElementById("duplicateAccount");
     if (!name) {
       wizard.canAdvance = false;
       duplicateWarning.hidden = true;
       return;
     }
 
     var exists = accountWizard.proto.accountExists(name);
     wizard.canAdvance = !exists;
     duplicateWarning.hidden = !exists;
   },
 
-  selectProtocol: function aw_selectProtocol() {
+  selectProtocol() {
     var protoList = document.getElementById("protolist");
     var id = protoList.selectedItem.value;
     this.proto = Services.core.getProtocolById(id);
 
     return true;
   },
 
 
-  insertUsernameField: function aw_insertUsernameField(aName, aLabel, aParent,
-                                                       aDefaultValue) {
+  insertUsernameField(aName, aLabel, aParent, aDefaultValue) {
     var hbox = document.createElement("hbox");
     hbox.setAttribute("id", aName + "-hbox");
     hbox.setAttribute("align", "baseline");
     hbox.setAttribute("equalsize", "always");
 
     var label = document.createElement("label");
     label.setAttribute("value", aLabel);
     label.setAttribute("control", aName);
@@ -112,17 +111,17 @@ var accountWizard = {
       textbox.setAttribute("value", aDefaultValue);
     textbox.addEventListener("input", accountWizard.checkUsername);
     hbox.appendChild(textbox);
 
     aParent.appendChild(hbox);
     return textbox;
   },
 
-  showUsernamePage: function aw_showUsernamePage() {
+  showUsernamePage() {
     var proto = this.proto.id;
     if ("userNameBoxes" in this && this.userNameProto == proto) {
       this.checkUsername();
       return;
     }
 
     var bundle = document.getElementById("accountsBundle");
     var usernameInfo;
@@ -158,48 +157,48 @@ var accountWizard = {
                                                        label, vbox,
                                                        defaultVal));
     }
     this.userNameBoxes[0].focus();
     this.userNameProto = proto;
     this.checkUsername();
   },
 
-  hideUsernamePage: function aw_hideUsernamePage() {
+  hideUsernamePage() {
     document.getElementById("accountWizard").canAdvance = true;
     var next = "account" +
       (this.proto.noPassword ? "advanced" : "password");
     document.getElementById("accountusername").next = next;
   },
 
-  showAdvanced: function aw_showAdvanced() {
+  showAdvanced() {
     // ensure we don't destroy user data if it's not necessary
     var id = this.proto.id;
     if ("protoSpecOptId" in this && this.protoSpecOptId == id)
       return;
     this.protoSpecOptId = id;
 
     this.populateProtoSpecificBox();
 
     let alias = document.getElementById("alias");
     alias.focus();
   },
 
-  populateProtoSpecificBox: function aw_populate() {
+  populateProtoSpecificBox() {
     let haveOptions =
       accountOptionsHelper.addOptions(this.proto.id + "-", this.getProtoOptions());
     document.getElementById("protoSpecificGroupbox").hidden = !haveOptions;
     if (haveOptions) {
       var bundle = document.getElementById("accountsBundle");
       document.getElementById("protoSpecificCaption").label =
         bundle.getFormattedString("protoOptions", [this.proto.name]);
     }
   },
 
-  createSummaryRow: function aw_createSummaryRow(aLabel, aValue) {
+  createSummaryRow(aLabel, aValue) {
     var row = document.createElement("row");
     row.setAttribute("align", "baseline");
 
     var label = document.createElement("label");
     label.setAttribute("class", "header");
     if (aLabel.length > 20) {
       aLabel = aLabel.substring(0, 20);
       aLabel += "…";
@@ -211,17 +210,17 @@ var accountWizard = {
     textbox.setAttribute("value", aValue);
     textbox.setAttribute("class", "plain");
     textbox.setAttribute("readonly", true);
     row.appendChild(textbox);
 
     return row;
   },
 
-  showSummary: function aw_showSummary() {
+  showSummary() {
     var rows = document.getElementById("summaryRows");
     var bundle = document.getElementById("accountsBundle");
     while (rows.hasChildNodes())
       rows.lastChild.remove();
 
     var label = document.getElementById("protoLabel").value;
     rows.appendChild(this.createSummaryRow(label, this.proto.name));
     this.username = this.getUsername();
@@ -282,17 +281,17 @@ var accountWizard = {
 
     for (let i = 0; i < this.prefs.length; ++i) {
       let opt = this.prefs[i];
       let label = bundle.getFormattedString("accountColon", [opt.opt.label]);
       rows.appendChild(this.createSummaryRow(label, opt.value));
     }
   },
 
-  createAccount: function aw_createAccount() {
+  createAccount() {
     var acc = Services.accounts.createAccount(this.username, this.proto.id);
     if (!this.proto.noPassword && this.password)
       acc.password = this.password;
     if (this.alias)
       acc.alias = this.alias;
 
     for (let i = 0; i < this.prefs.length; ++i) {
       let option = this.prefs[i];
@@ -342,17 +341,17 @@ var accountWizard = {
     inServer.valid = false;
     account.incomingServer = inServer;
     inServer.valid = true;
     MailServices.accounts.notifyServerLoaded(inServer);
 
     return true;
   },
 
-  getValue: function aw_getValue(aId) {
+  getValue(aId) {
     var elt = document.getElementById(aId);
     if ("selectedItem" in elt)
       return elt.selectedItem.value;
     if ("checked" in elt)
       return elt.checked;
     if ("value" in elt)
       return elt.value;
     // If the groupbox has never been opened, the binding isn't attached
@@ -360,36 +359,36 @@ var accountWizard = {
     // has a special handling of the undefined value for this case.
     return undefined;
   },
 
   * getIter(aEnumerator) {
     while (aEnumerator.hasMoreElements())
       yield aEnumerator.getNext();
   },
-  getProtocols: function aw_getProtocols() {
+  getProtocols() {
     return this.getIter(Services.core.getProtocols());
   },
-  getProtoOptions: function aw_getProtoOptions() {
+  getProtoOptions() {
     return this.getIter(this.proto.getOptions());
   },
-  getProtoUserSplits: function aw_getProtoUserSplits() {
+  getProtoUserSplits() {
     return this.getIter(this.proto.getUsernameSplit());
   },
 
-  onGroupboxKeypress: function aw_onGroupboxKeypress(aEvent) {
+  onGroupboxKeypress(aEvent) {
     var target = aEvent.target;
     var code = aEvent.charCode || aEvent.keyCode;
     if (code == KeyEvent.DOM_VK_SPACE ||
         (code == KeyEvent.DOM_VK_LEFT && !target.hasAttribute("closed")) ||
         (code == KeyEvent.DOM_VK_RIGHT && target.hasAttribute("closed")))
         this.toggleGroupbox(target.id);
   },
 
-  toggleGroupbox: function aw_toggleGroupbox(id) {
+  toggleGroupbox(id) {
     var elt = document.getElementById(id);
     if (elt.hasAttribute("closed")) {
       elt.removeAttribute("closed");
       if (elt.flexWhenOpened)
         elt.flex = elt.flexWhenOpened;
     } else {
       elt.setAttribute("closed", "true");
       if (elt.flex) {
--- a/mail/components/im/content/imAccounts.js
+++ b/mail/components/im/content/imAccounts.js
@@ -31,36 +31,36 @@ var events = [
 ];
 
 var gAccountManager = {
   // Sets the delay after connect() or disconnect() during which
   // it is impossible to perform disconnect() and connect()
   _disabledDelay: 500,
   disableTimerID: 0,
   _connectedLabelInterval: 0,
-  load: function am_load() {
+  load() {
     // Wait until the password service is ready before offering anything.
     Services.logins.initializationPromise.then(() => {
       this.accountList = document.getElementById("accountlist");
       let defaultID;
       Services.core.init(); // ensure the imCore is initialized.
       for (let acc of this.getAccounts()) {
         var elt = document.createElement("richlistitem");
         this.accountList.appendChild(elt);
         elt.build(acc);
         if (!defaultID && acc.firstConnectionState == acc.FIRST_CONNECTION_CRASHED)
           defaultID = acc.id;
       }
       for (let event of events)
         Services.obs.addObserver(this, event);
-      if (!this.accountList.getRowCount())
+      if (!this.accountList.getRowCount()) {
         // This is horrible, but it works. Otherwise (at least on mac)
         // the wizard is not centered relatively to the account manager
         setTimeout(function() { gAccountManager.new(); }, 0);
-      else {
+      } else {
         // we have accounts, show the list
         document.getElementById("accountsDesk").selectedIndex = 1;
 
         // ensure an account is selected
         if (defaultID)
           this.selectAccount(defaultID);
         else
           this.accountList.selectedIndex = 0;
@@ -71,22 +71,22 @@ var gAccountManager = {
       this.accountList.addEventListener("keypress", this.onKeyPress, true);
       window.addEventListener("unload", this.unload.bind(this));
       this._connectedLabelInterval = setInterval(this.updateConnectedLabels, 60000);
       statusSelector.init();
     }, () => {
       this.close();
     });
   },
-  unload: function am_unload() {
+  unload() {
     clearInterval(this._connectedLabelInterval);
     for (let event of events)
       Services.obs.removeObserver(this, event);
   },
-  _updateAccountList: function am__updateAccountList() {
+  _updateAccountList() {
     let accountList = this.accountList;
     let i = 0;
     for (let acc of this.getAccounts()) {
       let oldItem = accountList.getItemAtIndex(i);
       if (oldItem.id != acc.id) {
         let accElt = document.getElementById(acc.id);
         accountList.insertBefore(accElt, oldItem);
         accElt.restoreItems();
@@ -104,17 +104,17 @@ var gAccountManager = {
 
     // The selected item is still selected
     accountList.selectedItem.buttons.setFocus();
     accountList.ensureSelectedElementIsVisible();
 
     // We need to refresh the disabled menu items
     this.disableCommandItems();
   },
-  observe: function am_observe(aObject, aTopic, aData) {
+  observe(aObject, aTopic, aData) {
     if (aTopic == "prpl-quit") {
       // libpurple is being uninitialized. We don't need the account
       // manager window anymore, close it.
       this.close();
       return;
     } else if (aTopic == "autologin-processed") {
       var notification = document.getElementById("accountsNotificationBox")
                                  .getNotificationWithValue("autoLoginStatus");
@@ -189,34 +189,34 @@ var gAccountManager = {
         } else if (aTopic == "account-connected") {
           elt.refreshConnectedLabel();
         }
 
         elt.setAttribute("state", stateEvents[aTopic]);
       }
     }
   },
-  cancelReconnection: function am_cancelReconnection() {
+  cancelReconnection() {
     this.accountList.selectedItem.cancelReconnection();
   },
-  connect: function am_connect() {
+  connect() {
     let account = this.accountList.selectedItem.account;
     if (account.disconnected) {
       this.temporarilyDisableButtons();
       account.connect();
     }
   },
-  disconnect: function am_disconnect() {
+  disconnect() {
     let account = this.accountList.selectedItem.account;
     if (account.connected || account.connecting) {
       this.temporarilyDisableButtons();
       account.disconnect();
     }
   },
-  addException: function am_addException() {
+  addException() {
     let account = this.accountList.selectedItem.account;
     let prplAccount = account.prplAccount;
     if (!account.disconnected || !prplAccount.connectionTarget)
       return;
 
     // Open the Gecko SSL exception dialog.
     let params = {
       exceptionAdded: false,
@@ -225,17 +225,17 @@ var gAccountManager = {
       location: prplAccount.connectionTarget,
     };
     window.openDialog("chrome://pippki/content/exceptionDialog.xul", "",
                       "chrome,centerscreen,modal", params);
     // Reconnect the account if an exception was added.
     if (params.exceptionAdded)
       account.connect();
   },
-  copyDebugLog: function am_copyDebugLog() {
+  copyDebugLog() {
     let account = this.accountList.selectedItem.account;
     let text = account.getDebugMessages().map(function(dbgMsg) {
       let m = dbgMsg.message;
       let time = new Date(m.timeStamp);
       const dateTimeFormatter = new Services.intl.DateTimeFormat(undefined, {
         dateStyle: "short", timeStyle: "long",
       });
       time = dateTimeFormatter.format(time);
@@ -252,43 +252,43 @@ var gAccountManager = {
         level = "DEBUG";
       return "[" + time + "] " + level + " (@ " + m.sourceLine +
              " " + m.sourceName + ":" + m.lineNumber + ")\n" +
              m.errorMessage;
     }).join("\n");
     Cc["@mozilla.org/widget/clipboardhelper;1"]
       .getService(Ci.nsIClipboardHelper).copyString(text);
   },
-  updateConnectedLabels: function am_updateConnectedLabels() {
+  updateConnectedLabels() {
     for (let i = 0; i < gAccountManager.accountList.itemCount; ++i) {
       let item = gAccountManager.accountList.getItemAtIndex(i);
       if (item.account.connected)
         item.refreshConnectedLabel();
     }
   },
   /* This function disables the connect/disconnect buttons for
    * `this._disabledDelay` ms before calling disableCommandItems to restore
    * the state of the buttons.
    */
-  temporarilyDisableButtons: function am_temporarilyDisableButtons() {
+  temporarilyDisableButtons() {
     document.getElementById("cmd_disconnect").setAttribute("disabled", "true");
     document.getElementById("cmd_connect").setAttribute("disabled", "true");
     clearTimeout(this.disableTimerID);
     this.accountList.focus();
     this.disableTimerID = setTimeout(function(aItem) {
       gAccountManager.disableTimerID = 0;
       gAccountManager.disableCommandItems();
       aItem.buttons.setFocus();
     }, this._disabledDelay, this.accountList.selectedItem);
   },
 
-  new: function am_new() {
+  new() {
     this.openDialog("chrome://messenger/content/chat/imAccountWizard.xul");
   },
-  edit: function am_edit() {
+  edit() {
     // Find the nsIIncomingServer for the current imIAccount.
     let server = null;
     let imAccountId = this.accountList.selectedItem.account.numericId;
     let mgr = MailServices.accounts;
     for (let account of fixIterator(mgr.accounts, Ci.nsIMsgAccount)) {
       let incomingServer = account.incomingServer;
       if (!incomingServer || incomingServer.type != "im")
         continue;
@@ -304,31 +304,31 @@ var gAccountManager = {
       win.selectServer(server);
     } else {
       window.openDialog("chrome://messenger/content/AccountManager.xul",
                         "AccountManager",
                         "chrome,centerscreen,modal,titlebar,resizable",
                         { server, selectPage: null });
     }
   },
-  autologin: function am_autologin() {
+  autologin() {
     var elt = this.accountList.selectedItem;
     elt.autoLogin = !elt.autoLogin;
   },
-  close: function am_close() {
+  close() {
     // If a modal dialog is opened, we can't close this window now
     if (this.modalDialog)
       setTimeout(function() { window.close(); }, 0);
     else
       window.close();
   },
 
   /* This function disables or enables the currently selected button and
      the corresponding context menu item */
-  disableCommandItems: function am_disableCommandItems() {
+  disableCommandItems() {
     let accountList = this.accountList;
     let selectedItem = accountList.selectedItem;
     // When opening the account manager, if accounts have errors, we
     // can be called during build(), before any item is selected.
     // In this case, just return early.
     if (!selectedItem)
       return;
 
@@ -352,17 +352,17 @@ var gAccountManager = {
     for (let [name, state] of disabledItems) {
       let elt = document.getElementById("cmd_" + name);
       if (state)
         elt.setAttribute("disabled", "true");
       else
         elt.removeAttribute("disabled");
     }
   },
-  onContextMenuShowing: function am_onContextMenuShowing() {
+  onContextMenuShowing() {
     let targetElt = document.popupNode;
     let isAccount = targetElt instanceof Ci.nsIDOMXULSelectControlItemElement;
     document.querySelector(".im-context-account-item").forEach(e => {
       e.hidden = !isAccount;
     });
     if (isAccount) {
       let account = targetElt.account;
       let hiddenItems = {
@@ -371,36 +371,36 @@ var gAccountManager = {
         cancelReconnection: !targetElt.hasAttribute("reconnectPending"),
         accountsItemsSeparator: account.disconnecting,
       };
       for (let name in hiddenItems)
         document.getElementById("context_" + name).hidden = hiddenItems[name];
     }
   },
 
-  selectAccount: function am_selectAccount(aAccountId) {
+  selectAccount(aAccountId) {
     this.accountList.selectedItem = document.getElementById(aAccountId);
     this.accountList.ensureSelectedElementIsVisible();
   },
-  onAccountSelect: function am_onAccountSelect() {
+  onAccountSelect() {
     clearTimeout(this.disableTimerID);
     this.disableTimerID = 0;
     this.disableCommandItems();
     // Horrible hack here too, see Bug 177
     setTimeout(function(aThis) {
       try {
         aThis.accountList.selectedItem.buttons.setFocus();
       } catch (e) {
         /* Sometimes if the user goes too fast with VK_UP or VK_DOWN, the
            selectedItem doesn't have the expected binding attached */
       }
     }, 0, this);
   },
 
-  onKeyPress: function am_onKeyPress(event) {
+  onKeyPress(event) {
     if (!this.selectedItem)
       return;
 
     if (event.shiftKey &&
         (event.keyCode == event.DOM_VK_DOWN || event.keyCode == event.DOM_VK_UP)) {
       let offset = event.keyCode == event.DOM_VK_DOWN ? 1 : -1;
       gAccountManager.moveCurrentItem(offset);
       event.stopPropagation();
@@ -428,17 +428,17 @@ var gAccountManager = {
       let target = event.originalTarget;
       if (target.localName != "checkbox" &&
           (target.localName != "button" ||
            /^(dis)?connect$/.test(target.getAttribute("anonid"))))
         this.selectedItem.buttons.proceedDefaultAction();
     }
   },
 
-  moveCurrentItem: function am_moveCurrentItem(aOffset) {
+  moveCurrentItem(aOffset) {
     let accountList = this.accountList;
     if (!aOffset || !accountList.selectedItem)
       return;
 
     // Create the new preference value from the richlistbox list
     let items = accountList.itemChildren;
     let selectedID = accountList.selectedItem.id;
     let array = [];
@@ -451,28 +451,28 @@ var gAccountManager = {
       newIndex = 0;
     else if (newIndex >= accountList.itemCount)
       newIndex = accountList.itemCount - 1;
     array.splice(newIndex, 0, selectedID);
 
     Services.prefs.setCharPref("messenger.accounts", array.join(","));
   },
 
-  getAccounts: function* am_getAccounts() {
+  * getAccounts() {
     let accounts = Services.accounts.getAccounts();
     while (accounts.hasMoreElements())
       yield accounts.getNext();
   },
 
-  openDialog: function am_openDialog(aUrl, aArgs) {
+  openDialog(aUrl, aArgs) {
     this.modalDialog = true;
     window.openDialog(aUrl, "", "chrome,modal,titlebar,centerscreen", aArgs);
     this.modalDialog = false;
   },
-  setAutoLoginNotification: function am_setAutoLoginNotification() {
+  setAutoLoginNotification() {
     var as = Services.accounts;
     var autoLoginStatus = as.autoLoginStatus;
     let isOffline = false;
     let crashCount = 0;
     for (let acc of this.getAccounts())
       if (acc.autoLogin && acc.firstConnectionState == acc.FIRST_CONNECTION_CRASHED)
         ++crashCount;
 
@@ -525,41 +525,41 @@ var gAccountManager = {
       default:
         label = bundle.getString("accountsManager.notification.other.label");
     }
     let status = Services.core.globalUserStatus.statusType;
     this.setOffline(isOffline || status == Ci.imIStatusInfo.STATUS_OFFLINE);
 
     box.appendNotification(label, "autologinStatus", null, priority, [connectNowButton]);
   },
-  processAutoLogin: function am_processAutoLogin() {
+  processAutoLogin() {
     var ioService = Services.io;
     if (ioService.offline) {
       ioService.manageOfflineStatus = false;
       ioService.offline = false;
     }
 
     Services.accounts.processAutoLogin();
 
     gAccountManager.accountList.selectedItem.buttons.setFocus();
   },
-  processCrashedAccountsLogin: function am_processCrashedAccountsLogin() {
+  processCrashedAccountsLogin() {
     for (let acc in gAccountManager.getAccounts())
       if (acc.disconnected && acc.autoLogin &&
           acc.firstConnectionState == acc.FIRST_CONNECTION_CRASHED)
         acc.connect();
 
     let notification = document.getElementById("accountsNotificationBox")
                                .getNotificationWithValue("autoLoginStatus");
     if (notification)
       notification.close();
 
     gAccountManager.accountList.selectedItem.buttons.setFocus();
   },
-  setOffline: function am_setOffline(aState) {
+  setOffline(aState) {
     this.isOffline = aState;
     if (aState)
       this.accountList.setAttribute("offline", "true");
     else
       this.accountList.removeAttribute("offline");
     this.disableCommandItems();
   },
 };
@@ -572,30 +572,30 @@ var gAMDragAndDrop = {
 
   // A preference already exists to define scroll speed, let's use it.
   get SCROLL_SPEED() {
     delete this.SCROLL_SPEED;
     this.SCROLL_SPEED = Services.prefs.getIntPref("toolkit.scrollbox.scrollIncrement", 20);
     return this.SCROLL_SPEED;
   },
 
-  onDragStart: function amdnd_onDragStart(aEvent, aTransferData, aAction) {
+  onDragStart(aEvent, aTransferData, aAction) {
     let accountElement = aEvent.explicitOriginalTarget;
     // This stops the dragging session.
     if (!(accountElement instanceof Ci.nsIDOMXULSelectControlItemElement))
       throw "Element is not draggable!";
     if (gAccountManager.accountList.itemCount == 1)
       throw "Can't drag while there is only one account!";
 
     // Transferdata is never used, but we need to transfer something.
     aTransferData.data = new TransferData();
     aTransferData.data.addDataForFlavour(this.ACCOUNT_MIME_TYPE, accountElement);
   },
 
-  onDragOver: function amdnd_onDragOver(aEvent, aFlavour, aSession) {
+  onDragOver(aEvent, aFlavour, aSession) {
     let accountElement = aEvent.explicitOriginalTarget;
     // We are dragging over the account manager, consider it is the same as
     // the last element.
     if (accountElement == gAccountManager.accountList)
       accountElement = gAccountManager.accountList.lastChild;
 
     // Auto scroll the account list if we are dragging at the top/bottom
     this.checkForMagicScroll(aEvent.clientY);
@@ -623,54 +623,54 @@ var gAMDragAndDrop = {
           accountElement.getAttribute("dragover") == "up")
         this.cleanBorders();
       accountElement.setAttribute("dragover", "down");
     }
 
     this._accountElement = accountElement;
   },
 
-  cleanBorders: function amdnd_cleanBorders(aIsEnd) {
+  cleanBorders(aIsEnd) {
     if (!this._accountElement)
       return;
 
     this._accountElement.removeAttribute("dragover");
     // reset the border of the previous element
     let previousItem = this._accountElement.previousSibling;
     if (previousItem) {
       if (aIsEnd && !previousItem.style.borderBottom && previousItem.previousSibling)
         previousItem = previousItem.previousSibling;
       previousItem.style.borderBottom = "";
     }
 
     if (aIsEnd)
       delete this._accountElement;
   },
 
-  canDrop: function amdnd_canDrop(aEvent, aSession) {
+  canDrop(aEvent, aSession) {
     let accountElement = aEvent.explicitOriginalTarget;
     if (accountElement == gAccountManager.accountList)
       accountElement = gAccountManager.accountList.lastChild;
     return (accountElement != gAccountManager.accountList.selectedItem);
   },
 
-  checkForMagicScroll: function amdnd_checkForMagicScroll(aClientY) {
+  checkForMagicScroll(aClientY) {
     let accountList = gAccountManager.accountList;
     let listSize = accountList.getBoundingClientRect();
     let direction = 1;
     if (aClientY < listSize.top + this.MAGIC_SCROLL_HEIGHT)
       direction = -1;
     else if (aClientY < listSize.bottom - this.MAGIC_SCROLL_HEIGHT)
       // We are not on a scroll zone
       return;
 
     accountList._scrollbox.scrollTop += direction * this.SCROLL_SPEED;
   },
 
-  onDrop: function amdnd_onDrop(aEvent, aTransferData, aSession) {
+  onDrop(aEvent, aTransferData, aSession) {
     let accountElement = aEvent.explicitOriginalTarget;
     if (accountElement == gAccountManager.accountList)
       accountElement = gAccountManager.accountList.lastChild;
 
      if (!aSession.canDrop)
       return;
 
     // compute the destination
@@ -682,17 +682,17 @@ var gAMDragAndDrop = {
                        accountElement.clientHeight / 2;
     if (offset > 0)
       offset -= isDroppingAbove;
     else
       offset += !isDroppingAbove;
     gAccountManager.moveCurrentItem(offset);
   },
 
-  getSupportedFlavours: function amdnd_getSupportedFlavours() {
+  getSupportedFlavours() {
     var flavours = new FlavourSet();
     flavours.appendFlavour(this.ACCOUNT_MIME_TYPE,
                            "nsIDOMXULSelectControlItemElement");
     return flavours;
   },
 };
 
 window.addEventListener("DOMContentLoaded", () => { gAccountManager.load(); });
--- a/mail/components/im/content/imContextMenu.js
+++ b/mail/components/im/content/imContextMenu.js
@@ -40,17 +40,17 @@ imContextMenu.prototype = {
     while (elt && elt.localName != "menuseparator") {
       let tmp = elt.nextSibling;
       elt.remove();
       elt = tmp;
     }
   },
 
   // Initialize context menu.
-  initMenu: function CM_initMenu(aPopup) {
+  initMenu(aPopup) {
     this.menu = aPopup;
 
     // Get contextual info.
     let node = document.popupNode;
     this.setTarget(node);
 
     let actions = [];
     while (node) {
--- a/mail/components/im/content/imStatusSelector.js
+++ b/mail/components/im/content/imStatusSelector.js
@@ -4,91 +4,91 @@
 
 // chat/modules/imTextboxUtils.jsm
 /* globals TextboxSpellChecker */
 
 var { Status } = ChromeUtils.import("resource:///modules/imStatusUtils.jsm", null);
 var { Services } = ChromeUtils.import("resource:///modules/imServices.jsm", null);
 
 var statusSelector = {
-  observe: function ss_observe(aSubject, aTopic, aMsg) {
+  observe(aSubject, aTopic, aMsg) {
     if (aTopic == "status-changed")
       this.displayCurrentStatus();
     else if (aTopic == "user-icon-changed")
       this.displayUserIcon();
     else if (aTopic == "user-display-name-changed")
       this.displayUserDisplayName();
   },
 
-  displayUserIcon: function ss_displayUserIcon() {
+  displayUserIcon() {
     let icon = Services.core.globalUserStatus.getUserIcon();
     document.getElementById("userIcon").src = icon ? icon.spec : "";
   },
 
-  displayUserDisplayName: function ss_displayUserDisplayName() {
+  displayUserDisplayName() {
     let displayName = Services.core.globalUserStatus.displayName;
     let elt = document.getElementById("displayName");
-    if (displayName)
+    if (displayName) {
       elt.removeAttribute("usingDefault");
-    else {
+    } else {
       let bundle = document.getElementById("chatBundle");
       displayName = bundle.getString("displayNameEmptyText");
       elt.setAttribute("usingDefault", displayName);
     }
     elt.setAttribute("value", displayName);
   },
 
-  displayStatusType: function ss_displayStatusType(aStatusType) {
+  displayStatusType(aStatusType) {
     document.getElementById("statusMessage")
             .setAttribute("statusType", aStatusType);
     let statusString = Status.toLabel(aStatusType);
     let statusTypeIcon = document.getElementById("statusTypeIcon");
     statusTypeIcon.setAttribute("status", aStatusType);
     statusTypeIcon.setAttribute("tooltiptext", statusString);
     return statusString;
   },
 
-  displayCurrentStatus: function ss_displayCurrentStatus() {
+  displayCurrentStatus() {
     let us = Services.core.globalUserStatus;
     let status = Status.toAttribute(us.statusType);
     let message = status == "offline" ? "" : us.statusText;
     let statusMessage = document.getElementById("statusMessage");
     if (!statusMessage) // Chat toolbar not in the DOM yet
       return;
-    if (message)
+    if (message) {
       statusMessage.removeAttribute("usingDefault");
-    else {
+    } else {
       let statusString = this.displayStatusType(status);
       statusMessage.setAttribute("usingDefault", statusString);
       message = statusString;
     }
     statusMessage.setAttribute("value", message);
     statusMessage.setAttribute("tooltiptext", message);
   },
 
-  editStatus: function ss_editStatus(aEvent) {
+  editStatus(aEvent) {
     let status = aEvent.originalTarget.getAttribute("status");
     if (status == "offline")
       Services.core.globalUserStatus.setStatus(Ci.imIStatusInfo.STATUS_OFFLINE, "");
     else if (status)
       this.startEditStatus(status);
   },
 
-  startEditStatus: function ss_startEditStatus(aStatusType) {
+  startEditStatus(aStatusType) {
     let currentStatusType =
       document.getElementById("statusTypeIcon").getAttribute("status");
     if (aStatusType != currentStatusType) {
       this._statusTypeBeforeEditing = currentStatusType;
       this._statusTypeEditing = aStatusType;
       this.displayStatusType(aStatusType);
     }
     this.statusMessageClick();
   },
 
-  statusMessageClick: function ss_statusMessageClick() {
+  statusMessageClick() {
     let elt = document.getElementById("statusMessage");
     let statusType =
       document.getElementById("statusTypeIcon").getAttribute("status");
     if (statusType == "offline" || elt.disabled)
       return;
 
     if (!elt.hasAttribute("editing")) {
       elt.setAttribute("editing", "true");
@@ -106,30 +106,30 @@ var statusSelector = {
       // force binding attachment by forcing layout
       elt.getBoundingClientRect();
       elt.select();
     }
 
     this.statusMessageRefreshTimer();
   },
 
-  statusMessageRefreshTimer: function ss_statusMessageRefreshTimer() {
+  statusMessageRefreshTimer() {
     const timeBeforeAutoValidate = 20 * 1000;
     if ("_stopEditStatusTimeout" in this)
       clearTimeout(this._stopEditStatusTimeout);
     this._stopEditStatusTimeout = setTimeout(this.finishEditStatusMessage,
                                              timeBeforeAutoValidate, true);
   },
 
-  statusMessageBlur: function ss_statusMessageBlur(aEvent) {
+  statusMessageBlur(aEvent) {
     if (aEvent.originalTarget == document.getElementById("statusMessage").inputField)
       statusSelector.finishEditStatusMessage(true);
   },
 
-  statusMessageKeyPress: function ss_statusMessageKeyPress(aEvent) {
+  statusMessageKeyPress(aEvent) {
     if (!this.hasAttribute("editing")) {
       if (aEvent.keyCode == aEvent.DOM_VK_DOWN) {
         let button = document.getElementById("statusTypeIcon");
         document.getElementById("setStatusTypeMenupopup").openPopup(button);
       }
       return;
     }
 
@@ -142,17 +142,17 @@ var statusSelector = {
         statusSelector.finishEditStatusMessage(false);
         break;
 
       default:
         statusSelector.statusMessageRefreshTimer();
     }
   },
 
-  finishEditStatusMessage: function ss_finishEditStatusMessage(aSave) {
+  finishEditStatusMessage(aSave) {
     clearTimeout(this._stopEditStatusTimeout);
     delete this._stopEditStatusTimeout;
     let elt = document.getElementById("statusMessage");
     if (aSave) {
       let newStatus = Ci.imIStatusInfo.STATUS_UNKNOWN;
       if ("_statusTypeEditing" in this) {
         let statusType = this._statusTypeEditing;
         if (statusType == "available")
@@ -183,91 +183,91 @@ var statusSelector = {
     // We need to put the focus back on the label after the textbox
     // binding has been detached, otherwise the focus gets lost (it's
     // on none of the elements in the document), but before that we
     // need to flush the layout.
     elt.getBoundingClientRect();
     elt.focus();
   },
 
-  userIconClick: function ss_userIconClick() {
+  userIconClick() {
     const nsIFilePicker = Ci.nsIFilePicker;
     let fp = Cc["@mozilla.org/filepicker;1"]
                .createInstance(nsIFilePicker);
     let bundle = document.getElementById("chatBundle");
     fp.init(window, bundle.getString("userIconFilePickerTitle"),
             nsIFilePicker.modeOpen);
     fp.appendFilters(nsIFilePicker.filterImages);
     fp.open(rv => {
       if (rv != nsIFilePicker.returnOK || !fp.file) {
         return;
       }
       Services.core.globalUserStatus.setUserIcon(fp.file);
     });
   },
 
-  displayNameClick: function ss_displayNameClick() {
+  displayNameClick() {
     let elt = document.getElementById("displayName");
     if (!elt.hasAttribute("editing")) {
       elt.setAttribute("editing", "true");
       if (elt.hasAttribute("usingDefault"))
         elt.removeAttribute("value");
       elt.addEventListener("keypress", this.displayNameKeyPress);
       elt.addEventListener("blur", this.displayNameBlur);
       // force binding attachmant by forcing layout
       elt.getBoundingClientRect();
       elt.select();
     }
 
     this.displayNameRefreshTimer();
   },
 
   _stopEditDisplayNameTimeout: 0,
-  displayNameRefreshTimer: function ss_displayNameRefreshTimer() {
+  displayNameRefreshTimer() {
     const timeBeforeAutoValidate = 20 * 1000;
     clearTimeout(this._stopEditDisplayNameTimeout);
     this._stopEditDisplayNameTimeout =
       setTimeout(this.finishEditDisplayName, timeBeforeAutoValidate, true);
   },
 
-  displayNameBlur: function ss_displayNameBlur(aEvent) {
+  displayNameBlur(aEvent) {
     if (aEvent.originalTarget == document.getElementById("displayName").inputField)
       statusSelector.finishEditDisplayName(true);
   },
 
-  displayNameKeyPress: function ss_displayNameKeyPress(aEvent) {
+  displayNameKeyPress(aEvent) {
     switch (aEvent.keyCode) {
       case aEvent.DOM_VK_RETURN:
         statusSelector.finishEditDisplayName(true);
         break;
 
       case aEvent.DOM_VK_ESCAPE:
         statusSelector.finishEditDisplayName(false);
         break;
 
       default:
         statusSelector.displayNameRefreshTimer();
     }
   },
 
-  finishEditDisplayName: function ss_finishEditDisplayName(aSave) {
+  finishEditDisplayName(aSave) {
     clearTimeout(this._stopEditDisplayNameTimeout);
     let elt = document.getElementById("displayName");
     // Apply the new display name only if it is different from the current one.
     if (aSave && elt.value != elt.getAttribute("value"))
       Services.core.globalUserStatus.displayName = elt.value;
     else if (elt.hasAttribute("usingDefault"))
       elt.setAttribute("value", elt.getAttribute("usingDefault"));
 
     elt.removeAttribute("editing");
     elt.removeEventListener("keypress", this.displayNameKeyPress);
     elt.removeEventListener("blur", this.displayNameBlur);
   },
 
-  init: function ss_load() {
+  init() {
     let events = ["status-changed"];
     statusSelector.displayCurrentStatus();
 
     if (document.getElementById("displayName")) {
       events.push("user-display-name-changed");
       statusSelector.displayUserDisplayName();
     }
 
@@ -282,13 +282,13 @@ var statusSelector = {
 
     for (let event of events)
       Services.obs.addObserver(statusSelector, event);
     statusSelector._events = events;
 
     window.addEventListener("unload", statusSelector.unload);
   },
 
-  unload: function ss_unload() {
+  unload() {
     for (let event of statusSelector._events)
       Services.obs.removeObserver(statusSelector, event);
    },
 };
--- a/mail/components/im/content/imconversation.xml
+++ b/mail/components/im/content/imconversation.xml
@@ -626,19 +626,19 @@
           // there is no need to complete - just jump to the end of the nick.
           let wholeWord = text.substring(inputBox.selectionStart - word.length);
           for (let completion of matchingCompletions) {
             if (wholeWord.lastIndexOf(completion, 0) == 0) {
               let moveCursor = completion.length - word.length;
               inputBox.selectionStart += moveCursor;
               let separator = text.substring(inputBox.selectionStart,
                                              inputBox.selectionStart + 2);
-              if (separator == ": " || separator == ", ")
+              if (separator == ": " || separator == ", ") {
                 inputBox.selectionStart += 2;
-              else if (!moveCursor) {
+              } else if (!moveCursor) {
                 // If we're already at the end of a nick, carry on to display
                 // a list of possible alternatives and/or apply punctuation.
                 break;
               }
               return;
             }
           }
 
--- a/mail/components/im/content/joinchat.js
+++ b/mail/components/im/content/joinchat.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm", null);
 var { Services } = ChromeUtils.import("resource:///modules/imServices.jsm", null);
 
 var autoJoinPref = "autoJoin";
 
 var joinChat = {
-  onload: function jc_onload() {
+  onload() {
     var accountList = document.getElementById("accountlist");
     for (let acc of fixIterator(Services.accounts.getAccounts())) {
       if (!acc.connected || !acc.canJoinChat)
         continue;
       var proto = acc.protocol;
       var item = accountList.appendItem(acc.name, acc.id, proto.name);
       item.setAttribute("image", proto.iconBaseURI + "icon.png");
       item.setAttribute("class", "menuitem-iconic");
@@ -21,17 +21,17 @@ var joinChat = {
     }
     if (!accountList.itemCount) {
       document.getElementById("joinChatDialog").cancelDialog();
       throw "No connected MUC enabled account!";
     }
     accountList.selectedIndex = 0;
   },
 
-  onAccountSelect: function jc_onAccountSelect() {
+  onAccountSelect() {
     let ab = document.getElementById("separatorRow1");
     while (ab.nextSibling && ab.nextSibling.id != "separatorRow2")
       ab.nextSibling.remove();
 
     let acc = document.getElementById("accountlist").selectedItem.account;
     let sep = document.getElementById("separatorRow2");
     let defaultValues = acc.getChatRoomDefaultFieldValues();
     joinChat._values = defaultValues;
@@ -57,19 +57,19 @@ var joinChat = {
       label.setAttribute("control", "field-" + field.identifier);
       row.appendChild(label);
 
       let textbox = document.createElement("textbox");
       textbox.setAttribute("id", "field-" + field.identifier);
       let val = defaultValues.getValue(field.identifier);
       if (val)
         textbox.setAttribute("value", val);
-      if (field.type == Ci.prplIChatRoomField.TYPE_PASSWORD)
+      if (field.type == Ci.prplIChatRoomField.TYPE_PASSWORD) {
         textbox.setAttribute("type", "password");
-      else if (field.type == Ci.prplIChatRoomField.TYPE_INT) {
+      } else if (field.type == Ci.prplIChatRoomField.TYPE_INT) {
         textbox.setAttribute("type", "number");
         textbox.setAttribute("min", field.min);
         textbox.setAttribute("max", field.max);
       }
       row.appendChild(textbox);
 
       if (!field.required) {
         label = document.createElement("label");
@@ -82,17 +82,17 @@ var joinChat = {
       row.setAttribute("align", "baseline");
       sep.parentNode.insertBefore(row, sep);
       joinChat._fields.push({field, textbox});
     }
 
     window.sizeToContent();
   },
 
-  join: function jc_join() {
+  join() {
     let values = joinChat._values;
     for (let field of joinChat._fields) {
       let val = field.textbox.value.trim();
       if (!val && field.field.required) {
         field.textbox.focus();
         // FIXME: why isn't the return false enough?
         throw "Some required fields are empty!";
         // return false;
--- a/mail/components/im/messages/papersheets/Footer.html
+++ b/mail/components/im/messages/papersheets/Footer.html
@@ -40,19 +40,19 @@ function setColors(target) {
       body.className = "event-color";
       body.removeAttribute("style");
     }
   }
 }
 
 
 function checkNewText(target) {
-  if (target.tagName == "DIV")
+  if (target.tagName == "DIV") {
     setColors(target);
-  else if (target.tagName == "P" && target.className == "event") {
+  } else if (target.tagName == "P" && target.className == "event") {
     let parent = target.parentNode;
     // We need to start a group with this element if there are at least 3
     // system messages and they aren't already grouped.
     if (!parent.grouped && parent.querySelector("p.event:nth-of-type(3)")) {
       var div = document.createElement("div");
       div.className = "eventToggle";
       div.addEventListener("click", event =>
         event.target.parentNode.classList.toggle("hide-children"));
--- a/mail/components/im/modules/index_im.jsm
+++ b/mail/components/im/modules/index_im.jsm
@@ -453,17 +453,17 @@ var GlodaIMIndexer = {
       }
       conv.logFileCount = logFiles.length;
     })().catch(Cu.reportError);
 
     // Now clear the job, so we can index in the future.
     this._knownConversations[convId].scheduledIndex = null;
   },
 
-  observe: function logger_observe(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     if (aTopic == "new-ui-conversation") {
       // Add ourselves to the ui-conversation's list of observers for the
       // unread-message-count-changed notification.
       // For this notification, aSubject is the ui-conversation that is opened.
       aSubject.addObserver(this);
       return;
     }
 
--- a/mail/components/im/modules/search_im.jsm
+++ b/mail/components/im/modules/search_im.jsm
@@ -200,17 +200,17 @@ GlodaIMSearcher.prototype = {
     return Services.prefs.getIntPref(
       "mailnews.database.global.search.im.limit"
     );
   },
 
   /**
    * Parse the string into terms/phrases by finding matching double-quotes.
    */
-  parseSearchString: function GlodaIMSearcher_parseSearchString(aSearchString) {
+  parseSearchString(aSearchString) {
     aSearchString = aSearchString.trim();
     let terms = [];
 
     /*
      * Add the term as long as the trim on the way in didn't obliterate it.
      *
      * In the future this might have other helper logic; it did once before.
      */
@@ -241,17 +241,17 @@ GlodaIMSearcher.prototype = {
 
       addTerm(aSearchString.substring(0, spaceIndex));
       aSearchString = aSearchString.substring(spaceIndex + 1);
     }
 
     return terms;
   },
 
-  buildFulltextQuery: function GlodaIMSearcher_buildFulltextQuery() {
+  buildFulltextQuery() {
     let query = Gloda.newQuery(Gloda.lookupNoun("im-conversation"), {
       noMagic: true,
       explicitSQL: NUEVO_FULLTEXT_SQL,
       limitClauseAlreadyIncluded: true,
       // osets is 0-based column number 4 (volatile to column changes)
       // save the offset column for extra analysis
       stashColumns: [6],
     });
@@ -283,54 +283,51 @@ GlodaIMSearcher.prototype = {
     }
 
     query.fulltextMatches(fulltextQueryString);
     query.limit(this.retrievalLimit);
 
     return query;
   },
 
-  getCollection: function GlodaIMSearcher_getCollection(
-      aListenerOverride, aData) {
+  getCollection(aListenerOverride, aData) {
     if (aListenerOverride)
       this.listener = aListenerOverride;
 
     this.query = this.buildFulltextQuery();
     this.collection = this.query.getCollection(this, aData);
     this.completed = false;
 
     return this.collection;
   },
 
   sortBy: "-dascore",
 
-  onItemsAdded: function GlodaIMSearcher_onItemsAdded(aItems, aCollection) {
+  onItemsAdded(aItems, aCollection) {
     let newScores = Gloda.scoreNounItems(
       aItems,
       {
         terms: this.fulltextTerms,
         stashedColumns: aCollection.stashedColumns,
       },
       [scoreOffsets]);
     if (this.scores)
       this.scores = this.scores.concat(newScores);
     else
       this.scores = newScores;
 
     if (this.listener)
       this.listener.onItemsAdded(aItems, aCollection);
   },
-  onItemsModified: function GlodaIMSearcher_onItemsModified(aItems,
-                                                            aCollection) {
+  onItemsModified(aItems, aCollection) {
     if (this.listener)
       this.listener.onItemsModified(aItems, aCollection);
   },
-  onItemsRemoved: function GlodaIMSearcher_onItemsRemoved(aItems,
-                                                          aCollection) {
+  onItemsRemoved(aItems, aCollection) {
     if (this.listener)
       this.listener.onItemsRemoved(aItems, aCollection);
   },
-  onQueryCompleted: function GlodaIMSearcher_onQueryCompleted(aCollection) {
+  onQueryCompleted(aCollection) {
     this.completed = true;
     if (this.listener)
       this.listener.onQueryCompleted(aCollection);
   },
 };
--- a/mail/components/mailContentHandler.js
+++ b/mail/components/mailContentHandler.js
@@ -8,35 +8,34 @@ ChromeUtils.import("resource://gre/modul
 var NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001;
 
 function mailContentHandler() {
 }
 mailContentHandler.prototype = {
   classID: Components.ID("{1c73f03a-b817-4640-b984-18c3478a9ae3}"),
 
   _xpcom_factory: {
-    createInstance: function mch_factory_ci(outer, iid) {
+    createInstance(outer, iid) {
       if (outer)
         throw Cr.NS_ERROR_NO_AGGREGATION;
       return gMailContentHandler.QueryInterface(iid);
     },
   },
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIContentHandler]),
 
-  openInExternal: function mch_OpenInExternal(uri) {
+  openInExternal(uri) {
     Cc["@mozilla.org/uriloader/external-protocol-service;1"]
       .getService(Ci.nsIExternalProtocolService)
       .loadURI(uri);
   },
 
   // nsIContentHandler
 
-  handleContent: function mch_HandleContent(aContentType, aWindowContext,
-                                            aRequest) {
+  handleContent(aContentType, aWindowContext, aRequest) {
     try {
       if (!Cc["@mozilla.org/webnavigation-info;1"]
              .getService(Ci.nsIWebNavigationInfo)
              .isTypeSupported(aContentType, null))
         throw NS_ERROR_WONT_HANDLE_CONTENT;
     } catch (e) {
       throw NS_ERROR_WONT_HANDLE_CONTENT;
     }
@@ -50,22 +49,22 @@ mailContentHandler.prototype = {
     if (!aRequest.URI.schemeIs("http") && !aRequest.URI.schemeIs("https"))
       throw NS_ERROR_WONT_HANDLE_CONTENT;
 
     this.openInExternal(aRequest.URI);
     aRequest.cancel(Cr.NS_BINDING_ABORTED);
   },
 
   // nsIFactory
-  createInstance: function mch_CI(outer, iid) {
+  createInstance(outer, iid) {
     if (outer != null)
       throw Cr.NS_ERROR_NO_AGGREGATION;
 
     return this.QueryInterface(iid);
   },
 
-  lockFactory: function mch_lock(lock) {
+  lockFactory(lock) {
     // No-op.
   },
 };
 var gMailContentHandler = new mailContentHandler();
 
 var NSGetFactory = XPCOMUtils.generateNSGetFactory([mailContentHandler]);
--- a/mail/components/mailGlue.js
+++ b/mail/components/mailGlue.js
@@ -50,17 +50,17 @@ function MailGlue() {
       return sanitizerScope.Sanitizer;
     });
 
   this._init();
 }
 
 MailGlue.prototype = {
   // init (called at app startup)
-  _init: function MailGlue__init() {
+  _init() {
     Services.obs.addObserver(this, "xpcom-shutdown");
     Services.obs.addObserver(this, "final-ui-startup");
     Services.obs.addObserver(this, "mail-startup-done");
     Services.obs.addObserver(this, "handle-xul-text-link");
     Services.obs.addObserver(this, "chrome-document-global-created");
 
     // Inject scripts into some devtools windows.
     function _setupBrowserConsole(domWindow) {
@@ -87,29 +87,29 @@ MailGlue.prototype = {
         onLoadWindow: _setupToolbox,
       });
 
     ActorManagerParent.addActors(ACTORS);
     ActorManagerParent.flush();
   },
 
   // cleanup (called at shutdown)
-  _dispose: function MailGlue__dispose() {
+  _dispose() {
     Services.obs.removeObserver(this, "xpcom-shutdown");
     Services.obs.removeObserver(this, "final-ui-startup");
     Services.obs.removeObserver(this, "mail-startup-done");
     Services.obs.removeObserver(this, "handle-xul-text-link");
     Services.obs.removeObserver(this, "chrome-document-global-created");
 
     ExtensionSupport.unregisterWindowListener("Thunderbird-internal-Toolbox");
     ExtensionSupport.unregisterWindowListener("Thunderbird-internal-BrowserConsole");
   },
 
   // nsIObserver implementation
-  observe: function MailGlue_observe(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     case "xpcom-shutdown":
       this._dispose();
       break;
     case "final-ui-startup":
       this._onProfileStartup();
       break;
     case "mail-startup-done":
@@ -138,21 +138,21 @@ MailGlue.prototype = {
             "chrome://messenger/content/customElements.js", doc.ownerGlobal);
         }
       }, {once: true});
       break;
     }
   },
 
   // nsIMailGlue implementation
-  sanitize: function MG_sanitize(aParentWindow) {
+  sanitize(aParentWindow) {
     this._sanitizer.sanitize(aParentWindow);
   },
 
-  _onProfileStartup: function MailGlue__onProfileStartup() {
+  _onProfileStartup() {
     TBDistCustomizer.applyPrefDefaults();
 
     let locales = Services.locale.packagedLocales;
     const appSource = new FileSource("app", locales, "resource:///localization/{locale}/");
     L10nRegistry.registerSource(appSource);
 
     // handle any migration work that has to happen at profile startup
     MailMigrator.migrateAtProfileStartup();
@@ -205,30 +205,30 @@ MailGlue.prototype = {
       sidebar_text: "rgb(249, 249, 250)",
       sidebar_border: "rgba(255, 255, 255, 0.2)",
       author: vendorShortName,
     }, {
       useInDarkMode: true,
     });
   },
 
-  _onMailStartupDone: function MailGlue__onMailStartupDone() {
+  _onMailStartupDone() {
     // On Windows 7 and above, initialize the jump list module.
     const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
     if (WINTASKBAR_CONTRACTID in Cc &&
         Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
       const { WinTaskbarJumpList } = ChromeUtils.import("resource:///modules/windowsJumpLists.js", null);
       WinTaskbarJumpList.startup();
     }
 
     ChromeUtils.import("resource:///modules/ExtensionsUI.jsm");
     ExtensionsUI.checkForSideloadedExtensions();
   },
 
-  _handleLink: function MailGlue__handleLink(aSubject, aData) {
+  _handleLink(aSubject, aData) {
     let linkHandled = aSubject.QueryInterface(Ci.nsISupportsPRBool);
     if (!linkHandled.data) {
       let win = Services.wm.getMostRecentWindow("mail:3pane");
       aData = JSON.parse(aData);
       let tabParams = { contentPage: aData.href, clickHandler: null };
       if (win) {
         let tabmail = win.document.getElementById("tabmail");
         if (tabmail) {
--- a/mail/components/migration/content/migration.js
+++ b/mail/components/migration/content/migration.js
@@ -115,19 +115,19 @@ var MigrationWizard = {
 
       this._itemsFlags = kIMig.ALL;
       this._selectedProfile = null;
     }
 
       this._source = newSource;
 
     // check for more than one source profile
-    if (this._migrator.sourceHasMultipleProfiles)
+    if (this._migrator.sourceHasMultipleProfiles) {
       this._wiz.currentPage.next = "selectProfile";
-    else {
+    } else {
       this._wiz.currentPage.next = "migrating";
       var sourceProfiles = this._migrator.sourceProfiles;
       if (sourceProfiles && sourceProfiles.length == 1)
         this._selectedProfile =
           sourceProfiles.queryElementAt(0, nsISupportsString).data;
       else
         this._selectedProfile = "";
     }
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -118,46 +118,46 @@ var EmailAccountProvisioner = {
    */
   get userLanguage() {
     return Services.locale.requestedLocale;
   },
 
   /**
    * A helper function to enable or disable the Search button.
    */
-  searchButtonEnabled: function EAP_searchButtonEnabled(aVal) {
+  searchButtonEnabled(aVal) {
     document.getElementById("searchSubmit").disabled = !aVal;
   },
 
   /**
    * A setter for enabling / disabling the search fields.
    */
-  searchEnabled: function EAP_searchEnabled(aVal) {
+  searchEnabled(aVal) {
     document.getElementById("name").disabled = !aVal;
     for (let node of document.querySelectorAll(".providerCheckbox")) {
       node.disabled = !aVal;
     }
     this.searchButtonEnabled(aVal);
   },
 
   /**
    * If aVal is true, show the spinner, else hide.
    */
-  spinning: function EAP_spinning(aVal) {
+  spinning(aVal) {
     let display = aVal ? "block" : "none";
     for (let node of document.querySelectorAll("#notifications .spinner")) {
       node.style.display = display;
     }
   },
 
   /**
    * Sets the current window state to display the "success" page, with options
    * for composing messages, setting a signature, finding add-ons, etc.
    */
-  showSuccessPage: function EAP_showSuccessPage() {
+  showSuccessPage() {
     gLog.info("Showing the success page");
     let engine = Services.search.getEngineByName(window.arguments[0].search_engine);
     let account = window.arguments[0].account;
 
     if (engine && Services.search.defaultEngine != engine) {
       // Expose the search engine checkbox
       let searchEngineWrap = document.getElementById("search_engine_wrap");
       let searchEngineCheck = document.getElementById("search_engine_check");
@@ -210,34 +210,34 @@ var EmailAccountProvisioner = {
     document.getElementById("window").style.display = "none";
     document.getElementById("successful_account").style.display = "block";
   },
 
   /**
    * Save the name inputted in the search field to localstorage, so we can
    * reconstitute it on respawn later.
    */
-  saveName: function EAP_saveName() {
+  saveName() {
     let name = document.getElementById("name").value.trim();
     this.storage.setItem("name", name);
   },
 
-  onSearchInputOrProvidersChanged: function EAP_onSearchInputOrProvidersChanged(event) {
+  onSearchInputOrProvidersChanged(event) {
     let emptyName = document.getElementById("name").value == "";
     EmailAccountProvisioner.searchButtonEnabled(!emptyName &&
       EmailAccountProvisioner.someProvidersChecked);
   },
 
   /**
    * Hook up our events, populate the DOM, set our hooks, do all of our
    * prep work.  Since this is called via jQuery on document ready,
    * the value for "this" is the actual window document, hence the need
    * to explicitly refer to EmailAccountProvisioner.
    */
-  init: function EAP_init() {
+  init() {
     // We can only init once, so bail out if we've been called again.
     if (EmailAccountProvisioner._inited)
       return;
 
     gLog.info("Initializing Email Account Provisioner");
 
     // For any anchor element that gets the "external" class, make it so that
     // when we click on that element, instead of loading up the href in the
@@ -439,17 +439,17 @@ var EmailAccountProvisioner = {
 
     EmailAccountProvisioner._inited = true;
   },
 
   /**
    * Event handler for when the user submits the search request for their
    * name to the suggestFromName service.
    */
-  onSearchSubmit: function EAP_onSearchSubmit() {
+  onSearchSubmit() {
     for (let node of document.getElementById("notifications").children) {
       node.style.display = "none";
     }
     document.getElementById("instructions").classList.add("hide");
     EmailAccountProvisioner.saveName();
 
     // Here's where we do some kind of hack-y client-side sanitization.
     // Believe it or not, this is how you sanitize stuff to HTML elements
@@ -507,17 +507,17 @@ var EmailAccountProvisioner = {
   },
 
   /**
    * Event handler for when the user selects an address by clicking on
    * the price button for that address.  This function spawns the content
    * tab for the address order form, and then closes the Account Provisioner
    * window.
    */
-  onAddressSelected: function EAP_onAddressSelected(aTarget) {
+  onAddressSelected(aTarget) {
     gLog.info("An address was selected by the user.");
     let provider = EmailAccountProvisioner.providers[aTarget.dataset.provider];
 
     // Replace the variables in the url.
     let url = provider.api;
     let [firstName, lastName] = splitName(document.getElementById("name").value.trim());
     let email = aTarget.getAttribute("address");
     url = url.replace("{firstname}", firstName);
@@ -553,17 +553,17 @@ var EmailAccountProvisioner = {
       node.style.display = "none";
     }
   },
 
   /**
    * Attempt to fetch the provider list from the server.  If it fails,
    * display an error message, and queue for retry.
    */
-  tryToPopulateProviderList: function EAP_tryToPopulateProviderList() {
+  tryToPopulateProviderList() {
     // If we're already in the middle of getting the provider list, or
     // we already got it before, bail out.
     if (this._loadingProviders || this._loadedProviders)
       return;
 
     gLog.info("Trying to populate provider list...");
 
     // If there's a timeout ID for waking the account provisioner, clear it.
@@ -609,17 +609,17 @@ var EmailAccountProvisioner = {
       request.onError();
     };
     request.send(null);
 
     EmailAccountProvisioner._loadingProviders = true;
     gLog.info("We've kicked off a request for the provider list JSON file...");
   },
 
-  providerHasCorrectFields: function EAP_providerHasCorrectFields(provider) {
+  providerHasCorrectFields(provider) {
     let result = true;
 
     let required = ["id", "label", "paid", "languages", "api", "tos_url",
                     "privacy_url"];
 
     for (let aField of required) {
       let fieldExists = (aField in provider);
       result &= fieldExists;
@@ -631,17 +631,17 @@ var EmailAccountProvisioner = {
 
     return result;
   },
 
   /**
    * Take the fetched providers, create checkboxes, icons and labels,
    * and insert them below the search input.
    */
-  populateProviderList: function EAP_populateProviderList(data) {
+  populateProviderList(data) {
     gLog.info("Populating the provider list");
 
     if (!data || !data.length) {
       gLog.error("The provider list we got back from the server was empty!");
       EmailAccountProvisioner.beOffline();
       return;
     }
 
@@ -730,17 +730,17 @@ var EmailAccountProvisioner = {
     EmailAccountProvisioner._loadedProviders = true;
     EmailAccountProvisioner.onSearchInputOrProvidersChanged();
   },
 
   /**
    * Go through each of the checked providers, and add the appropriate
    * ToS and privacy links to the disclaimer.
    */
-  populateTermsAndPrivacyLinks: function EAP_populateTOSandPrivacyLinks() {
+  populateTermsAndPrivacyLinks() {
     gLog.info("Refreshing terms and privacy links");
     // Empty the Terms of Service and Privacy links placeholder.
     let placeholder = document.querySelector(".commentary .placeholder");
 
     let selectedProviders =
       [...document.querySelectorAll(".provider input:checked")];
     let len = selectedProviders.length;
 
@@ -977,33 +977,33 @@ var EmailAccountProvisioner = {
       storedData[provider.provider] = provider;
     }
   },
 
   /**
    * If we cannot retrieve the provider list from the server, display a
    * message about connection problems, and disable the search fields.
    */
-  beOffline: function EAP_beOffline() {
+  beOffline() {
     let offlineMsg = stringBundle.get("cannotConnect");
     let element = document.getElementById("cannotConnectMessage");
     if (!element.hasChildNodes()) {
       element.appendChild(document.createTextNode(offlineMsg));
     }
     element.style.display = "block";
     element.style.opacity = 1;
     this.searchEnabled(false);
     gLog.info("Email Account Provisioner is in offline mode.");
   },
 
   /**
    * If we're suddenly able to get the provider list, hide the connection
    * error message and re-enable the search fields.
    */
-  beOnline: function EAP_beOnline() {
+  beOnline() {
     let element = document.getElementById("cannotConnectMessage");
     element.style.display = "none";
     element.textContent = "";
     this.searchEnabled(true);
     gLog.info("Email Account Provisioner is in online mode.");
   },
 };
 
--- a/mail/components/newmailaccount/content/accountProvisionerTab.js
+++ b/mail/components/newmailaccount/content/accountProvisionerTab.js
@@ -77,21 +77,23 @@ accountProvisionerTabType.persistTab = f
 };
 
 /**
  * Re-open the accountProvisionerTab with all of the stuff we stashed in
  * persistTab. This will automatically hook up our monitoring again.
  */
 accountProvisionerTabType.restoreTab = function(aTabmail, aPersistedState) {
   aTabmail.openTab("accountProvisionerTab",
-                   { contentPage: aPersistedState.tabURI,
+                   {
+                     contentPage: aPersistedState.tabURI,
                      realName: aPersistedState.realName,
                      email: aPersistedState.email,
                      searchEngine: aPersistedState.searchEngine,
-                     background: true } );
+                     background: true,
+                   });
 };
 
 /**
  * This function registers an observer to watch for HTTP requests where the
  * contentType contains text/xml.
  */
 accountProvisionerTabType._setMonitoring = function(aBrowser, aRealName,
                                                     aEmail, aSearchEngine) {
--- a/mail/components/preferences/applicationManager.js
+++ b/mail/components/preferences/applicationManager.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // applications.js
 /* globals gApplicationsPane */
 
 var gAppManagerDialog = {
   _removed: [],
 
-  init: function appManager_init() {
+  init() {
     this.handlerInfo = window.arguments[0];
     var bundle = document.getElementById("appManagerBundle");
     gApplicationsPane._prefsBundle = document.getElementById("bundlePreferences");
     var description = this.handlerInfo.typeDescription;
     var key = (this.handlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) ?
                 "handleFile" : "handleProtocol";
     var contentText = bundle.getFormattedString(key, [description]);
     contentText = bundle.getFormattedString("descriptionApplications", [contentText]);
@@ -41,50 +41,50 @@ var gAppManagerDialog = {
       let label = document.createElement("label");
       label.setAttribute("value", app.name);
       item.appendChild(label);
     }
 
     list.selectedIndex = 0;
   },
 
-  onOK: function appManager_onOK() {
+  onOK() {
     if (!this._removed.length) {
       // return early to avoid calling the |store| method.
       return;
     }
 
     for (var i = 0; i < this._removed.length; ++i)
       this.handlerInfo.removePossibleApplicationHandler(this._removed[i]);
 
     this.handlerInfo.store();
   },
 
-  onCancel: function appManager_onCancel() {
+  onCancel() {
     // do nothing
   },
 
-  remove: function appManager_remove() {
+  remove() {
     var list = document.getElementById("appList");
     this._removed.push(list.selectedItem.app);
     var index = list.selectedIndex;
     list.selectedItem.remove();
     if (list.getRowCount() == 0) {
       // The list is now empty, make the bottom part disappear
       document.getElementById("appDetails").hidden = true;
     } else {
       // Select the item at the same index, if we removed the last
       // item of the list, select the previous item
       if (index == list.getRowCount())
         --index;
       list.selectedIndex = index;
     }
   },
 
-  onSelect: function appManager_onSelect() {
+  onSelect() {
     var list = document.getElementById("appList");
     if (!list.selectedItem) {
       document.getElementById("remove").disabled = true;
       return;
     }
     document.getElementById("remove").disabled = false;
     var app = list.selectedItem.app;
     var address = "";
--- a/mail/components/preferences/applications.js
+++ b/mail/components/preferences/applications.js
@@ -1115,30 +1115,32 @@ var gApplicationsPane = {
     menuItem.setAttribute("oncommand", "gApplicationsPane.confirmDelete(event)");
     menuItem.setAttribute("label", this._prefsBundle.getString("delete"));
     menuPopup.appendChild(menuItem);
 
     // Select the item corresponding to the preferred action.  If the always
     // ask flag is set, it overrides the preferred action.  Otherwise we pick
     // the item identified by the preferred action (when the preferred action
     // is to use a helper app, we have to pick the specific helper app item).
-    if (handlerInfo.alwaysAskBeforeHandling)
+    if (handlerInfo.alwaysAskBeforeHandling) {
       menu.selectedItem = askMenuItem;
-    else switch (handlerInfo.preferredAction) {
-      case Ci.nsIHandlerInfo.useSystemDefault:
-        menu.selectedItem = defaultMenuItem;
-        break;
-      case Ci.nsIHandlerInfo.useHelperApp:
-        if (preferredApp)
-          menu.selectedItem =
-            possibleAppMenuItems.filter(v => v.handlerApp.equals(preferredApp))[0];
-        break;
-      case Ci.nsIHandlerInfo.saveToDisk:
-        menu.selectedItem = saveMenuItem;
-        break;
+    } else {
+      switch (handlerInfo.preferredAction) {
+        case Ci.nsIHandlerInfo.useSystemDefault:
+          menu.selectedItem = defaultMenuItem;
+          break;
+        case Ci.nsIHandlerInfo.useHelperApp:
+          if (preferredApp)
+            menu.selectedItem =
+              possibleAppMenuItems.filter(v => v.handlerApp.equals(preferredApp))[0];
+          break;
+        case Ci.nsIHandlerInfo.saveToDisk:
+          menu.selectedItem = saveMenuItem;
+          break;
+      }
     }
     // menu.selectedItem may be null if the preferredAction is
     // useSystemDefault, but handlerInfo.hasDefaultHandler returns false.
     // For now, we'll just use the askMenuItem to avoid ugly exceptions.
     menu.previousSelectedItem = menu.selectedItem || askMenuItem;
   },
 
   // -------------------
--- a/mail/components/preferences/cookies.js
+++ b/mail/components/preferences/cookies.js
@@ -672,19 +672,19 @@ var gCookiesWindow = {
     if (Services.prefs.prefHasUserValue("network.cookie.blockFutureCookies"))
       blockFutureCookies = Services.prefs
         .getBoolPref("network.cookie.blockFutureCookies");
     for (let item of deleteItems) {
       Services.cookies.remove(item.host, item.name, item.path,
                               blockFutureCookies, item.originAttributes);
     }
 
-    if (nextSelected < 0)
+    if (nextSelected < 0) {
       seln.clearSelection();
-    else {
+    } else {
       seln.select(nextSelected);
       this._tree.focus();
     }
   },
 
   deleteAllCookies() {
     Services.cookies.removeAll();
     this._tree.focus();
--- a/mail/components/preferences/display.js
+++ b/mail/components/preferences/display.js
@@ -140,17 +140,17 @@ var gDisplayPane = {
 
   /**
    * Determine the appropriate value to select for defaultFont, for the
    * following cases:
    * - there is no setting
    * - the font selected by the user is no longer present (e.g. deleted from
    *   fonts folder)
    */
-  readFontSelection: function gDisplayPane_readFontSelection() {
+  readFontSelection() {
     let element = document.getElementById("defaultFont");
     let preference = document.getElementById(element.getAttribute("preference"));
     if (preference.value) {
       let fontItem = element.querySelector('[value="' + preference.value + '"]');
 
       // There is a setting that actually is in the list. Respect it.
       if (fontItem)
         return undefined;
--- a/mail/components/preferences/messagestyle.js
+++ b/mail/components/preferences/messagestyle.js
@@ -132,19 +132,19 @@ var previewObserver = {
       if (displayName != defaultVariant) {
         let menuitem = document.createElement("menuitem");
         menuitem.setAttribute("label", displayName);
         menuitem.setAttribute("value", aVariantName);
         popup.appendChild(menuitem);
       }
     });
     this._ignoreVariantChange = true;
-    if (!this._loaded)
+    if (!this._loaded) {
       menulist.value = this.theme.variant = menulist.value;
-    else {
+    } else {
       menulist.value = this.theme.variant; // (reset to "default")
       document.getElementById("paneChat").userChangedValue(menulist);
     }
     this._ignoreVariantChange = false;
 
     // disable the variant menulist if there's no variant, or only one
     // which is the default
     menulist.disabled = variants.length == 0 ||
--- a/mail/components/preferences/preferences.js
+++ b/mail/components/preferences/preferences.js
@@ -37,17 +37,17 @@ function selectPaneAndTab(prefWindow, aP
   if (aPaneID) {
     let prefPane = document.getElementById(aPaneID);
     let tabOnEvent = false;
     // The prefwindow element selects the pane specified in window.arguments[0]
     // automatically. But let's check it and if the prefs window was already
     // open, the current prefpane may not be the wanted one.
     if (prefWindow.currentPane.id != prefPane.id) {
       if (aTabID && !prefPane.loaded) {
-        prefPane.addEventListener("paneload", function showTabOnLoad() {
+        prefPane.addEventListener("paneload", function() {
           showTab(prefPane, aTabID);
         }, {once: true});
         tabOnEvent = true;
       }
       prefWindow.showPane(prefPane);
     }
     if (aTabID && !tabOnEvent)
       showTab(prefPane, aTabID, aSubdialogID);
--- a/mail/components/preferences/preferencesTab.js
+++ b/mail/components/preferences/preferencesTab.js
@@ -36,30 +36,30 @@ var preferencesTabType = {
     },
   },
 
   initialize() {
     let tabmail = document.getElementById("tabmail");
     tabmail.registerTabType(this);
   },
 
-  shouldSwitchTo: function shouldSwitchTo(aArgs) {
+  shouldSwitchTo(aArgs) {
     if (!gPrefTab) {
       return -1;
     }
     let prefWindow = gPrefTab.browser.contentDocument.getElementById("MailPreferences");
     gPrefTab.browser.contentWindow.selectPaneAndTab(prefWindow, aArgs.paneID, aArgs.tabID, aArgs.otherArgs);
     return document.getElementById("tabmail").tabInfo.indexOf(gPrefTab);
   },
 
   closeTab(aTab) {
     gPrefTab = null;
   },
 
-  openTab: function onTabOpened(aTab, aArgs) {
+  openTab(aTab, aArgs) {
     if (!("contentPage" in aArgs)) {
       throw ("contentPage must be specified");
     }
 
     // First clone the page and set up the basics.
     let clone = document.getElementById("preferencesTab").firstChild
                         .cloneNode(true);
 
@@ -86,17 +86,17 @@ var preferencesTabType = {
 
     // Now set up the listeners.
     this._setUpTitleListener(aTab);
     this._setUpCloseWindowListener(aTab);
 
     // Wait for full loading of the tab and the automatic selecting of last tab.
     // Then run the given onload code.
     aTab.browser.addEventListener("paneSelected",
-      function _contentTab_onLoad(event) {
+      function(event) {
         aTab.pageLoading = false;
         aTab.pageLoaded = true;
 
         if ("onLoad" in aArgs) {
           // Let selection of the initial pane complete before selecting another.
           // Otherwise we can end up with two panes selected at once.
           setTimeout(() => {
             aArgs.onLoad(event, aTab.browser);
@@ -118,29 +118,29 @@ var preferencesTabType = {
       postData: aArgs.postData || null,
     };
     aTab.browser.loadURI(aArgs.contentPage, params);
 
     gPrefTab = aTab;
     this.lastBrowserId++;
   },
 
-  persistTab: function onPersistTab(aTab) {
+  persistTab(aTab) {
     if (aTab.browser.currentURI.spec == "about:blank")
       return null;
 
     return {
       tabURI: aTab.url,
       paneID: aTab.paneID,
       tabID: aTab.tabID,
       otherArgs: aTab.otherArgs,
     };
   },
 
-  restoreTab: function onRestoreTab(aTabmail, aPersistedState) {
+  restoreTab(aTabmail, aPersistedState) {
     aTabmail.openTab("preferencesTab", {
       contentPage: aPersistedState.tabURI,
       paneID: aPersistedState.paneID,
       tabID: aPersistedState.tabID,
       otherArgs: aPersistedState.otherArgs,
     });
   },
 };
--- a/mail/components/search/SearchIntegration.jsm
+++ b/mail/components/search/SearchIntegration.jsm
@@ -267,17 +267,17 @@ var SearchSupport = {
    *
    * Next, it looks for the next folder after the lastFolderIndexedUri. If it is
    * in such a folder, it'll yield return that folder, then set the
    * lastFolderIndexedUrl to the URI of that folder.
    *
    * It resets lastFolderIndexedUri to an empty string, then yield returns null
    * once iteration across all folders is complete.
    */
-  _foldersToIndexGenerator: function* search_find_next_folder() {
+  * _foldersToIndexGenerator() {
     let servers = MailServices.accounts.allServers;
 
     // Stores whether we're after the last folder indexed or before that --
     // if the last folder indexed is empty, this needs to be true initially
     let afterLastFolderIndexed = (this._lastFolderIndexedUri.length == 0);
 
     for (var server of fixIterator(servers, Ci.nsIMsgIncomingServer)) {
       let allFolders = server.rootFolder.descendants;
--- a/mail/components/wintaskbar/windowsJumpLists.js
+++ b/mail/components/wintaskbar/windowsJumpLists.js
@@ -54,53 +54,53 @@ var gTasks = [
 
 
 var WinTaskbarJumpList = {
 
   /**
    * Startup, shutdown, and update
    */
 
-  startup: function WTBJL_startup() {
+  startup() {
     // exit if this isn't win7 or higher.
     if (!this._initTaskbar())
       return;
 
     // Store our task list config data
     this._tasks = gTasks;
 
     // retrieve taskbar related prefs.
     this._refreshPrefs();
 
     // observer for our prefs branch
     this._initObs();
 
     this.update();
   },
 
-  update: function WTBJL_update() {
+  update() {
     // are we disabled via prefs? don't do anything!
     if (!this._enabled)
       return;
 
     // do what we came here to do, update the taskbar jumplist
     this._buildList();
   },
 
-  _shutdown: function WTBJL__shutdown() {
+  _shutdown() {
     this._shuttingDown = true;
 
     this._free();
   },
 
   /**
    * List building
    */
 
-  _buildList: function WTBJL__buildList() {
+  _buildList() {
     // anything to build?
     if (!this._showTasks) {
       // don't leave the last list hanging on the taskbar.
       this._deleteActiveJumpList();
       return;
     }
 
     if (!this._startBuild())
@@ -111,53 +111,53 @@ var WinTaskbarJumpList = {
 
     this._commitBuild();
   },
 
   /**
    * Taskbar api wrappers
    */
 
-  _startBuild: function WTBJL__startBuild() {
+  _startBuild() {
     // This is useful if there are any async tasks pending. Since we don't right
     // now, it's just harmless.
     this._builder.abortListBuild();
     // Since our list is static right now, we won't actually get back any
     // removed items.
     let removedItems = Cc["@mozilla.org/array;1"]
                          .createInstance(Ci.nsIMutableArray);
     return this._builder.initListBuild(removedItems);
   },
 
-  _commitBuild: function WTBJL__commitBuild() {
+  _commitBuild() {
     this._builder.commitListBuild(succeed => {
       if (!succeed) {
         this._builder.abortListBuild();
       }
     });
   },
 
-  _buildTasks: function WTBJL__buildTasks() {
+  _buildTasks() {
     if (this._tasks.length > 0) {
       let items = toXPCOMArray(this._tasks.map(task =>
                                  this._createHandlerAppItem(task)),
                                Ci.nsIMutableArray);
       this._builder.addListToBuild(this._builder.JUMPLIST_CATEGORY_TASKS, items);
     }
   },
 
-  _deleteActiveJumpList: function WTBJL__deleteAJL() {
+  _deleteActiveJumpList() {
     this._builder.deleteActiveList();
   },
 
   /**
    * Jump list item creation helpers
    */
 
-  _createHandlerAppItem: function WTBJL__createHandlerAppItem(aTask) {
+  _createHandlerAppItem(aTask) {
     let file = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
 
     // XXX where can we grab this from in the build? Do we need to?
     file.append("thunderbird.exe");
 
     let handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
                        .createInstance(Ci.nsILocalHandlerApp);
     handlerApp.executable = file;
@@ -170,64 +170,64 @@ var WinTaskbarJumpList = {
 
     let item = Cc["@mozilla.org/windows-jumplistshortcut;1"]
                  .createInstance(Ci.nsIJumpListShortcut);
     item.app = handlerApp;
     item.iconIndex = aTask.iconIndex;
     return item;
   },
 
-  _createSeparatorItem: function WTBJL__createSeparatorItem() {
+  _createSeparatorItem() {
     return Cc["@mozilla.org/windows-jumplistseparator;1"]
              .createInstance(Ci.nsIJumpListSeparator);
   },
 
   /**
    * Prefs utilities
    */
 
-  _refreshPrefs: function WTBJL__refreshPrefs() {
+  _refreshPrefs() {
     this._enabled = _prefs.getBoolPref(PREF_TASKBAR_ENABLED);
     this._showTasks = _prefs.getBoolPref(PREF_TASKBAR_TASKS);
   },
 
   /**
    * Init and shutdown utilities
    */
 
-  _initTaskbar: function WTBJL__initTaskbar() {
+  _initTaskbar() {
     this._builder = _taskbarService.createJumpListBuilder();
     if (!this._builder || !this._builder.available)
       return false;
 
     return true;
   },
 
-  _initObs: function WTBJL__initObs() {
+  _initObs() {
     Services.obs.addObserver(this, "profile-before-change");
     _prefs.addObserver("", this);
   },
 
-  _freeObs: function WTBJL__freeObs() {
+  _freeObs() {
     Services.obs.removeObserver(this, "profile-before-change");
     _prefs.removeObserver("", this);
   },
 
-  observe: function WTBJL_observe(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "nsPref:changed":
         if (this._enabled && !_prefs.getBoolPref(PREF_TASKBAR_ENABLED))
           this._deleteActiveJumpList();
         this._refreshPrefs();
         this.update();
       break;
 
       case "profile-before-change":
         this._shutdown();
       break;
     }
   },
 
-  _free: function WTBJL__free() {
+  _free() {
     this._freeObs();
     delete this._builder;
   },
 };