Bug 1245649: Merge browser and toolkit eslint rule settings. draft
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 03 Feb 2016 13:12:18 -0800
changeset 328695 c384710c018a70d7db709dd0deffa9249c8c5500
parent 328571 6826dfd0e85b29050e45273d9bfdb27dc2bc1128
child 513847 9d5e473fe5b39d91eb037df1b14cc87e4291e324
push id10391
push userdtownsend@mozilla.com
push dateWed, 03 Feb 2016 22:10:06 +0000
bugs1245649
milestone47.0a1
Bug 1245649: Merge browser and toolkit eslint rule settings.
browser/.eslintrc
toolkit/.eslintrc
toolkit/components/aboutcache/content/aboutCache.js
toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js
toolkit/components/apppicker/content/appPicker.js
toolkit/components/contentprefs/nsContentPrefService.js
toolkit/components/contentprefs/tests/unit/test_contentPrefs.js
toolkit/components/crashes/CrashManager.jsm
toolkit/components/feeds/FeedProcessor.js
toolkit/components/filepicker/content/filepicker.js
toolkit/components/microformats/Microformats.js
toolkit/components/microformats/microformat-shiv.js
toolkit/components/microformats/test/lib/domutils.js
toolkit/components/microformats/test/static/javascript/chai.js
toolkit/components/microformats/test/static/javascript/mocha.js
toolkit/components/microformats/test/static/javascript/prettify.js
toolkit/components/microformats/tests/test_Microformats_add.html
toolkit/components/places/Bookmarks.jsm
toolkit/components/places/PlacesBackups.jsm
toolkit/components/places/PlacesUtils.jsm
toolkit/components/places/nsPlacesExpiration.js
toolkit/components/places/tests/bookmarks/test_395101.js
toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js
toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js
toolkit/components/places/tests/bookmarks/test_savedsearches.js
toolkit/components/places/tests/queries/test_containersQueries_sorting.js
toolkit/components/places/tests/queries/test_results-as-visit.js
toolkit/components/places/tests/test_bug_461710_perwindowpb.html
toolkit/components/places/tests/unit/test_000_frecency.js
toolkit/components/places/tests/unit/test_331487.js
toolkit/components/places/tests/unit/test_415757.js
toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js
toolkit/components/places/tests/unit/test_annotations.js
toolkit/components/places/tests/unit/test_history.js
toolkit/components/places/tests/unit/test_history_sidebar.js
toolkit/components/places/tests/unit/test_placeURIs.js
toolkit/components/printing/content/printProgress.js
toolkit/components/printing/content/printUtils.js
toolkit/components/reader/JSDOMParser.js
toolkit/components/reader/Readability.js
toolkit/components/satchel/FormHistory.jsm
toolkit/components/satchel/test/test_form_autocomplete_with_list.html
toolkit/components/satchel/test/test_form_submission.html
toolkit/components/satchel/test/unit/test_notify.js
toolkit/components/telemetry/tests/unit/test_nsITelemetry.js
toolkit/components/thumbnails/test/browser_thumbnails_storage.js
toolkit/components/viewsource/content/viewSource.js
toolkit/content/browser-content.js
toolkit/content/customizeToolbar.js
toolkit/content/tests/widgets/tree_shared.js
toolkit/content/treeUtils.js
toolkit/content/widgets/browser.xml
toolkit/content/widgets/datetimepicker.xml
toolkit/content/widgets/findbar.xml
toolkit/content/widgets/menulist.xml
toolkit/content/widgets/notification.xml
toolkit/content/widgets/preferences.xml
toolkit/content/widgets/richlistbox.xml
toolkit/content/widgets/tabbox.xml
toolkit/content/widgets/tree.xml
toolkit/crashreporter/google-breakpad/src/third_party/glog/doc/glog.html
toolkit/modules/BrowserUtils.jsm
toolkit/modules/Sqlite.jsm
toolkit/modules/tests/browser/browser_WebRequest_cookies.js
toolkit/mozapps/downloads/content/helperApps.js
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/test/browser/browser_bug581076.js
toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js
toolkit/mozapps/extensions/test/browser/browser_purchase.js
toolkit/mozapps/extensions/test/browser/browser_searching.js
toolkit/mozapps/extensions/test/browser/browser_select_confirm.js
toolkit/mozapps/extensions/test/browser/browser_uninstalling.js
toolkit/mozapps/extensions/test/browser/head.js
toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
toolkit/mozapps/extensions/test/xpcshell/test_error.js
toolkit/mozapps/extensions/test/xpcshell/test_fuel.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile2.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile3.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile4.js
toolkit/mozapps/installer/precompile_cache.js
--- a/browser/.eslintrc
+++ b/browser/.eslintrc
@@ -1,13 +1,5 @@
 {
   "extends": [
     "../toolkit/.eslintrc"
   ],
-
-  "rules": {
-    // No redeclaring variables
-    "no-redeclare": 2,
-
-    // Functions must always return something or nothing
-    "consistent-return": 2,
-  }
 }
--- a/toolkit/.eslintrc
+++ b/toolkit/.eslintrc
@@ -19,17 +19,17 @@
 
     // Commas at the end of the line not the start
     // "comma-style": 2,
 
     // Don't require spaces around computed properties
     // "computed-property-spacing": [2, "never"],
 
     // Functions must always return something or nothing
-    // "consistent-return": 2,
+    "consistent-return": 2,
 
     // Require braces around blocks that start a new line
     // Note that this rule is likely to be overridden on a per-directory basis
     // very frequently.
     // "curly": [2, "multi-line"],
 
     // Always require a trailing EOL
     "eol-last": 2,
@@ -117,17 +117,17 @@
 
     // No Math() or JSON()
     "no-obj-calls": 2,
 
     // No octal literals
     // "no-octal": 2,
 
     // No redeclaring variables
-    // "no-redeclare": 2,
+    "no-redeclare": 2,
 
     // No unnecessary comparisons
     // "no-self-compare": 2,
 
     // No declaring variables from an outer scope
     // "no-shadow": 2,
 
     // No declaring variables that hide things like arguments
--- a/toolkit/components/aboutcache/content/aboutCache.js
+++ b/toolkit/components/aboutcache/content/aboutCache.js
@@ -2,21 +2,21 @@
  * 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/. */
 
 // First, parse and save the incoming arguments ("?storage=name&context=key")
 // Note: window.location.search doesn't work with nsSimpleURIs used for about:* addresses.
 var search = window.location.href.match(/^.*\?(.*)$/);
 var searchParams = new URLSearchParams(search ? search[1] : '');
 var storage = searchParams.get('storage');
-var context = searchParams.get('context');
+var cacheContext = searchParams.get('context');
 
 // The context is in a format as used by the HTTP cache v2 back end
-if (context)
-  var [context, isAnon, isInBrowser, appId, isPrivate] = context.match(/(a,)?(b,)?(i\d+,)?(p,)?/);
+if (cacheContext)
+  var [context, isAnon, isInBrowser, appId, isPrivate] = cacheContext.match(/(a,)?(b,)?(i\d+,)?(p,)?/);
 if (appId)
   appId = appId.match(/i(\d+),/)[1];
 
 
 function $(id) { return document.getElementById(id) || {}; }
 
 // Initialize the context UI controls at the start according what we got in the "context=" argument
 addEventListener('DOMContentLoaded', function() {
--- a/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js
+++ b/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js
@@ -73,17 +73,17 @@ function frameScript() {
 
       let getContentOfSelector = function(eltContainer, selector, re) {
         let elt = eltContainer.querySelector(selector);
         if (!elt) {
           throw new Error(`No item ${selector}`);
         }
 
         if (!re) {
-          return;
+          return undefined;
         }
 
         let match = elt.textContent.match(re);
         if (!match) {
           throw new Error(`Item ${selector} doesn't match regexp ${re}: ${elt.textContent}`);
         }
         return match;
       }
--- a/toolkit/components/apppicker/content/appPicker.js
+++ b/toolkit/components/apppicker/content/appPicker.js
@@ -1,18 +1,16 @@
 /* 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/. */
 
 Components.utils.import("resource://gre/modules/AppConstants.jsm");
 
 function AppPicker() {};
 
-var g_dialog = null;
-
 AppPicker.prototype = 
 {
     // Class members
     _incomingParams:null,
 
     /** 
     * Init the dialog and populate the application list
     */ 
--- a/toolkit/components/contentprefs/nsContentPrefService.js
+++ b/toolkit/components/contentprefs/nsContentPrefService.js
@@ -224,17 +224,17 @@ ContentPrefService.prototype = {
 
     var group = this._parseGroupParam(aGroup);
 
     if (aContext && aContext.usePrivateBrowsing) {
       if (this._privModeStorage.has(group, aName)) {
         let value = this._privModeStorage.get(group, aName);
         if (aCallback) {
           this._scheduleCallback(function(){aCallback.onResult(value);});
-          return;
+          return undefined;
         }
         return value;
       }
       // if we don't have a pref specific to this private mode browsing
       // session, to try to get one from normal mode
     }
 
     if (group == null)
@@ -593,17 +593,17 @@ ContentPrefService.prototype = {
   },
 
   _selectPref: function ContentPrefService__selectPref(aGroup, aSetting, aCallback) {
     let value = undefined;
     if (this._cache.has(aGroup, aSetting)) {
       value = this._cache.get(aGroup, aSetting);
       if (aCallback) {
         this._scheduleCallback(function(){aCallback.onResult(value);});
-        return;
+        return undefined;
       }
       return value;
     }
 
     try {
       this._stmtSelectPref.params.group = aGroup;
       this._stmtSelectPref.params.setting = aSetting;
 
@@ -643,17 +643,17 @@ ContentPrefService.prototype = {
   },
 
   _selectGlobalPref: function ContentPrefService__selectGlobalPref(aName, aCallback) {
     let value = undefined;
     if (this._cache.has(null, aName)) {
       value = this._cache.get(null, aName);
       if (aCallback) {
         this._scheduleCallback(function(){aCallback.onResult(value);});
-        return;
+        return undefined;
       }
       return value;
     }
 
     try {
       this._stmtSelectGlobalPref.params.name = aName;
 
       if (aCallback) {
--- a/toolkit/components/contentprefs/tests/unit/test_contentPrefs.js
+++ b/toolkit/components/contentprefs/tests/unit/test_contentPrefs.js
@@ -352,20 +352,20 @@ function run_test() {
 
         // remove the domain from the list of expected domains
         var index = this.expectedDomains.indexOf(group);
         do_check_true(index >= 0);
         this.expectedDomains.splice(index, 1);
       }
     };
 
-    var uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
-    var uri2 = ContentPrefTest.getURI("http://foo.domain1.com/");
-    var uri3 = ContentPrefTest.getURI("http://domain1.com/");
-    var uri4 = ContentPrefTest.getURI("http://www.domain2.com/");
+    let uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
+    let uri2 = ContentPrefTest.getURI("http://foo.domain1.com/");
+    let uri3 = ContentPrefTest.getURI("http://domain1.com/");
+    let uri4 = ContentPrefTest.getURI("http://www.domain2.com/");
 
     cps.setPref(uri1, "test.byname.1", 1);
     cps.setPref(uri1, "test.byname.2", 2);
     cps.setPref(uri2, "test.byname.1", 4);
     cps.setPref(uri3, "test.byname.3", 8);
     cps.setPref(uri4, "test.byname.1", 16);
     cps.setPref(null, "test.byname.1", 32);
     cps.setPref(null, "test.byname.2", false);
--- a/toolkit/components/crashes/CrashManager.jsm
+++ b/toolkit/components/crashes/CrashManager.jsm
@@ -601,22 +601,22 @@ this.CrashManager.prototype = Object.fre
       }
 
       let it = new OS.File.DirectoryIterator(path);
       let entries = [];
 
       try {
         yield it.forEach((entry, index, it) => {
           if (entry.isDir) {
-            return;
+            return undefined;
           }
 
           let match = re.exec(entry.name);
           if (!match) {
-            return;
+            return undefined;
           }
 
           return OS.File.stat(entry.path).then((info) => {
             entries.push({
               path: entry.path,
               id: match[1],
               date: info.lastModificationDate,
             });
--- a/toolkit/components/feeds/FeedProcessor.js
+++ b/toolkit/components/feeds/FeedProcessor.js
@@ -45,17 +45,17 @@ const PARSERUTILS_CONTRACTID = "@mozilla
 
 var gIoService = null;
 
 const XMLNS = "http://www.w3.org/XML/1998/namespace";
 const RSS090NS = "http://my.netscape.com/rdf/simple/0.9/";
 
 /***** Some general utils *****/
 function strToURI(link, base) {
-  var base = base || null;
+  base = base || null;
   if (!gIoService)
     gIoService = Cc[IO_CONTRACTID].getService(Ci.nsIIOService);
   try {
     return gIoService.newURI(link, null, base);
   }
   catch(e) {
     return null;
   }
@@ -865,28 +865,28 @@ XHTMLHandler.prototype = {
     }
     return false;
   },
 
   startDocument: function XH_startDocument() {
   },
   endDocument: function XH_endDocument() {
   },
-  startElement: function XH_startElement(uri, localName, qName, attributes) {
+  startElement: function XH_startElement(namespace, localName, qName, attributes) {
     ++this._depth;
     this._inScopeNS.push([]);
 
     // RFC4287 requires XHTML to be wrapped in a div that is *not* part of 
     // the content. This prevents people from screwing up namespaces, but
     // we need to skip it here.
     if (this._isAtom && this._depth == 1 && localName == "div")
       return;
 
     // If it's an XHTML element, record it. Otherwise, it's ignored.
-    if (uri == XHTML_NS) {
+    if (namespace == XHTML_NS) {
       this._buf += "<" + localName;
       var uri;
       for (var i=0; i < attributes.length; ++i) {
         uri = attributes.getURI(i);
         // XHTML attributes aren't in a namespace
         if (uri == "") { 
           this._buf += (" " + attributes.getLocalName(i) + "='" +
                         xmlEscape(attributes.getValue(i)) + "'");
@@ -1664,17 +1664,17 @@ FeedProcessor.prototype = {
         var el = container.queryElementAt(container.length - 1, 
                                           Ci.nsIFeedElementBase);
         // XXX there must be a way to flatten these interfaces
         if (contract == Cc[PERSON_CONTRACTID]) 
           el.QueryInterface(Ci.nsIFeedPerson);
         else
           return; // don't know about this interface
 
-        var propName = localName;
+        let propName = localName;
         var prefix = gNamespaces[uri];
 
         // synonyms
         if ((uri == "" || 
              prefix &&
              ((prefix.indexOf("atom") > -1) ||
               (prefix.indexOf("rss") > -1))) && 
             (propName == "url" || propName == "href"))
--- a/toolkit/components/filepicker/content/filepicker.js
+++ b/toolkit/components/filepicker/content/filepicker.js
@@ -201,17 +201,17 @@ function selectOnOK()
 
   retvals.filterIndex = document.getElementById("filterMenuList").selectedIndex;
   retvals.fileURL = null;
 
   if (allowURLs) {
     try {
       var ios = Components.classes[NS_IOSERVICE_CONTRACTID].getService(Components.interfaces.nsIIOService);
       retvals.fileURL = ios.newURI(textInput.value, null, null);
-      var fileList = [];
+      let fileList = [];
       if (retvals.fileURL instanceof Components.interfaces.nsIFileURL)
         fileList.push(retvals.fileURL.file);
       gFilesEnumerator.mFiles = fileList;
       retvals.files = gFilesEnumerator;
       retvals.buttonStatus = ret;
 
       return true;
     } catch (e) {
--- a/toolkit/components/microformats/Microformats.js
+++ b/toolkit/components/microformats/Microformats.js
@@ -39,17 +39,17 @@ this.Microformats = {
         /* isn't a real DOM node */
         if (parent == needle.parentNode) {
           return true;
         }
       }
       return false;
     }
     if (!Microformats[name] || !rootElement) {
-      return;
+      return undefined;
     }
     targetArray = targetArray || [];
 
     /* Root element might not be the document - we need the document's default view */
     /* to get frames and to check their ancestry */
     var defaultView = rootElement.defaultView || rootElement.ownerDocument.defaultView;
     var rootDocument = rootElement.ownerDocument || rootElement;
 
@@ -85,17 +85,17 @@ this.Microformats = {
       
     }
     
 
     function isVisible(node, checkChildren) {
       if (node.getBoundingClientRect) {
         var box = node.getBoundingClientRect();
       } else {
-        var box = node.ownerDocument.getBoxObjectFor(node);
+        box = node.ownerDocument.getBoxObjectFor(node);
       }
       /* If the parent has is an empty box, double check the children */
       if ((box.height == 0) || (box.width == 0)) {
         if (checkChildren && node.childNodes.length > 0) {
           for(let i=0; i < node.childNodes.length; i++) {
             if (node.childNodes[i].nodeType == Components.interfaces.nsIDOMNode.ELEMENT_NODE) {
               /* For performance reasons, we only go down one level */
               /* of children */
@@ -634,17 +634,17 @@ this.Microformats = {
         for (let value in prop.values) {
           if (result.toLowerCase() == prop.values[value]) {
             result = result.toLowerCase();
             validType = true;
             break;
           }
         }
         if (!validType) {
-          return;
+          return undefined;
         }
       }
       return result;
     },
     newMicroformat: function(object, in_node, microformat, validate) {
       /* check to see if we are even valid */
       if (!Microformats[microformat]) {
         throw("Invalid microformat - " + microformat);
@@ -755,17 +755,17 @@ this.Microformats = {
       }
       /* propobj is the corresponding property object in the microformat */
       var propobj;
       /* If there is a corresponding property in the microformat, use it */
       if (Microformats[mfname].properties[propname]) {
         propobj = Microformats[mfname].properties[propname];
       } else {
         /* If we didn't get a property, bail */
-        return;
+        return undefined;
       }
       /* Query the correct set of nodes (rel or class) based on the setting */
       /* in the property */
       var propnodes;
       if (propobj.rel == true) {
         propnodes = Microformats.getElementsByAttribute(mfnode, "rel", propname);
       } else {
         propnodes = Microformats.getElementsByClassName(mfnode, propname);
@@ -834,17 +834,17 @@ this.Microformats = {
       } else {
         /* If we didn't find any class nodes, check to see if this property */
         /* is virtual and if so, call getPropertyInternal again */
         if (propobj.virtual) {
           return Microformats.parser.getPropertyInternal(mfnode, null,
                                                          propobj, propname);
         }
       }
-      return;
+      return undefined;
     },
     /**
      * Internal parser API used to resolve includes and headers. Includes are
      * resolved by simply cloning the node and replacing it in a clone of the
      * original DOM node. Headers are resolved by creating a span and then copying
      * the innerHTML and the class name.
      *
      * @param  in_mfnode The node to preProcess.
@@ -914,17 +914,17 @@ this.Microformats = {
     /* ensuring that hours and seconds have values */
     normalizeISO8601: function normalizeISO8601(string)
     {
       var dateArray = string.match(/(\d\d\d\d)(?:-?(\d\d)(?:-?(\d\d)(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(?:([-+Z])(?:(\d\d)(?::?(\d\d))?)?)?)?)?)?/);
   
       var dateString;
       var tzOffset = 0;
       if (!dateArray) {
-        return;
+        return undefined;
       }
       if (dateArray[1]) {
         dateString = dateArray[1];
         if (dateArray[2]) {
           dateString += "-" + dateArray[2];
           if (dateArray[3]) {
             dateString += "-" + dateArray[3];
             if (dateArray[4]) {
@@ -1394,17 +1394,17 @@ var hCard_definition = {
         var given_name;
         var family_name;
         if (fn && (!orgs || (orgs.length) > 1 || (fn != orgs[0]["organization-name"]))) {
           var fns = fn.split(" ");
           if (fns.length === 1) {
             return [fns[0]];
           }
         }
-        return;
+        return undefined;
       }
     },
     "note" : {
       plural: true,
       datatype: "HTML"
     },
     "org" : {
       subproperties: {
@@ -1481,17 +1481,17 @@ hCalendar.prototype.toString = function(
           return this.summary + " (" + Microformats.dateFromISO8601(this.dtstart).toLocaleString() + ")";
         }
       }
     }
   }
   if (this.dtstart) {
     return this.summary;
   }
-  return;
+  return undefined;
 }
 
 var hCalendar_definition = {
   mfObject: hCalendar,
   className: "vevent",
   required: ["summary", "dtstart"],
   properties: {
     "category" : {
@@ -1647,22 +1647,22 @@ Microformats.add("hCalendar", hCalendar_
 this.geo = function geo(node, validate) {
   if (node) {
     Microformats.parser.newMicroformat(this, node, "geo", validate);
   }
 }
 geo.prototype.toString = function() {
   if (this.latitude != undefined) {
     if (!isFinite(this.latitude) || (this.latitude > 360) || (this.latitude < -360)) {
-      return;
+      return undefined;
     }
   }
   if (this.longitude != undefined) {
     if (!isFinite(this.longitude) || (this.longitude > 360) || (this.longitude < -360)) {
-      return;
+      return undefined;
     }
   }
 
   if ((this.latitude != undefined) && (this.longitude != undefined)) {
     var s;
     if ((this.node.localName.toLowerCase() == "abbr") || (this.node.localName.toLowerCase() == "html:abbr")) {
       s = this.node.textContent;
     }
--- a/toolkit/components/microformats/microformat-shiv.js
+++ b/toolkit/components/microformats/microformat-shiv.js
@@ -2410,17 +2410,17 @@ var Microformats; // jshint ignore:line
          * @return {Object || undefined}
 		 */
         getDOMParser: function () {
             if (typeof DOMParser === "undefined") {
                 try {
                     return Components.classes["@mozilla.org/xmlextras/domparser;1"]
                         .createInstance(Components.interfaces.nsIDOMParser);
                 } catch (e) {
-                    return;
+                    return undefined;
                 }
             } else {
                 return new DOMParser();
             }
         },
 
 
 	     /**
--- a/toolkit/components/microformats/test/lib/domutils.js
+++ b/toolkit/components/microformats/test/lib/domutils.js
@@ -26,17 +26,17 @@ var Modules = (function (modules) {
          * @return {Object || undefined}
 		 */
         getDOMParser: function () {
             if (typeof DOMParser === undefined) {
                 try {
                     return Components.classes["@mozilla.org/xmlextras/domparser;1"]
                         .createInstance(Components.interfaces.nsIDOMParser);
                 } catch (e) {
-                    return;
+                    return undefined;
                 }
             } else {
                 return new DOMParser();
             }
         },
 
 
 	     /**
--- a/toolkit/components/microformats/test/static/javascript/chai.js
+++ b/toolkit/components/microformats/test/static/javascript/chai.js
@@ -1,17 +1,17 @@
 (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.chai = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
 /*!
  * chai
  * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
  * MIT Licensed
  */
 
-var used = []
-  , exports = module.exports = {};
+var used = [];
+exports = module.exports = {};
 
 /*!
  * Chai version
  */
 
 exports.version = '3.0.0';
 
 /*!
@@ -193,18 +193,18 @@ module.exports = function (_chai, util) 
    */
 
   Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) {
     var ok = util.test(this, arguments);
     if (true !== showDiff) showDiff = false;
     if (true !== config.showDiff) showDiff = false;
 
     if (!ok) {
-      var msg = util.getMessage(this, arguments)
-        , actual = util.getActual(this, arguments);
+      msg = util.getMessage(this, arguments)
+      var actual = util.getActual(this, arguments);
       throw new AssertionError(msg, {
           actual: actual
         , expected: expected
         , showDiff: showDiff
       }, (config.includeStack) ? this.assert : flag(this, 'ssfi'));
     }
   };
 
@@ -492,17 +492,17 @@ module.exports = function (chai, _) {
         }
       }
     } else if (_.type(val) === 'object') {
       if (!flag(this, 'negate')) {
         for (var k in val) new Assertion(obj).property(k, val[k]);
         return;
       }
       var subset = {};
-      for (var k in val) subset[k] = obj[k];
+      for (k in val) subset[k] = obj[k];
       expected = _.eql(subset, val);
     } else {
       expected = obj && ~obj.indexOf(val);
     }
     this.assert(
         expected
       , 'expected #{this} to include ' + _.inspect(val)
       , 'expected #{this} to not include ' + _.inspect(val));
@@ -3938,17 +3938,17 @@ module.exports = function hasProperty(na
  * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
  * MIT Licensed
  */
 
 /*!
  * Main exports
  */
 
-var exports = module.exports = {};
+exports = module.exports = {};
 
 /*!
  * test utility
  */
 
 exports.test = require('./test');
 
 /*!
@@ -4188,18 +4188,18 @@ function formatValue(ctx, value, recurse
   // Make Array say that they are Array
   if (isArray(value)) {
     array = true;
     braces = ['[', ']'];
   }
 
   // Make functions say that they are functions
   if (typeof value === 'function') {
-    var name = getName(value);
-    var nameSuffix = name ? ': ' + name : '';
+    name = getName(value);
+    nameSuffix = name ? ': ' + name : '';
     base = ' [Function' + nameSuffix + ']';
   }
 
   // Make RegExps say that they are RegExps
   if (isRegExp(value)) {
     base = ' ' + RegExp.prototype.toString.call(value);
   }
 
@@ -5069,17 +5069,17 @@ module.exports = require('./lib/type');
  * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
  * MIT Licensed
  */
 
 /*!
  * Primary Exports
  */
 
-var exports = module.exports = getType;
+exports = module.exports = getType;
 
 /*!
  * Detectable javascript natives
  */
 
 var natives = {
     '[object Array]': 'array'
   , '[object RegExp]': 'regexp'
@@ -5215,17 +5215,17 @@ arguments[4][31][0].apply(exports,argume
  * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
  * MIT Licensed
  */
 
 /*!
  * Primary Exports
  */
 
-var exports = module.exports = getType;
+exports = module.exports = getType;
 
 /**
  * ### typeOf (obj)
  *
  * Use several different techniques to determine
  * the type of object being tested.
  *
  *
--- a/toolkit/components/microformats/test/static/javascript/mocha.js
+++ b/toolkit/components/microformats/test/static/javascript/mocha.js
@@ -150,17 +150,17 @@ var JsDiff = (function() {
               basePath = clonePath(removePath);
               this.pushComponent(basePath.components, oldString[oldPos], undefined, true);
             } else {
               basePath = clonePath(addPath);
               basePath.newPos++;
               this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined);
             }
 
-            var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath);
+            oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath);
 
             if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {
               return basePath.components;
             } else {
               bestPath[diagonalPath] = basePath;
             }
           }
         }
@@ -364,17 +364,17 @@ var JsDiff = (function() {
             remEOFNL = true;
           } else if(diffstr[i-1][0] === '-') {
             addEOFNL = true;
           }
         }
       }
 
       var str = oldStr.split('\n');
-      for (var i = diff.length - 1; i >= 0; i--) {
+      for (i = diff.length - 1; i >= 0; i--) {
         var d = diff[i];
         for (var j = 0; j < d.oldlength; j++) {
           if(str[d.start-1+j] !== d.oldlines[j]) {
             return false;
           }
         }
         Array.prototype.splice.apply(str,[d.start-1,+d.oldlength].concat(d.newlines));
       }
@@ -867,18 +867,18 @@ Context.prototype.skip = function(){
  * Inspect the context void of `._runnable`.
  *
  * @return {String}
  * @api private
  */
 
 Context.prototype.inspect = function(){
   return JSON.stringify(this, function(key, val){
-    if ('_runnable' == key) return;
-    if ('test' == key) return;
+    if ('_runnable' == key) return undefined;
+    if ('test' == key) return undefined;
     return val;
   }, 2);
 };
 
 }); // module: context.js
 
 require.register("hook.js", function(module, exports, require){
 /**
@@ -921,17 +921,17 @@ Hook.prototype.constructor = Hook;
  *
  * @param {Error} err
  * @return {Error}
  * @api public
  */
 
 Hook.prototype.error = function(err){
   if (0 == arguments.length) {
-    var err = this._error;
+    err = this._error;
     this._error = null;
     return err;
   }
 
   this._error = err;
 };
 
 }); // module: hook.js
@@ -1886,17 +1886,17 @@ module.exports = function(val, options){
  *
  * @param {String} str
  * @return {Number}
  * @api private
  */
 
 function parse(str) {
   var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
-  if (!match) return;
+  if (!match) return undefined;
   var n = parseFloat(match[1]);
   var type = (match[2] || 'ms').toLowerCase();
   switch (type) {
     case 'years':
     case 'year':
     case 'y':
       return n * y;
     case 'days':
@@ -1952,17 +1952,17 @@ function longFormat(ms) {
     || ms + ' ms';
 }
 
 /**
  * Pluralization helper.
  */
 
 function plural(ms, n, name) {
-  if (ms < n) return;
+  if (ms < n) return undefined;
   if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
   return Math.ceil(ms / n) + ' ' + name + 's';
 }
 
 }); // module: ms.js
 
 require.register("pending.js", function(module, exports, require){
 
@@ -2775,19 +2775,19 @@ function HTML(runner) {
     text(failures, stats.failures);
     text(duration, (ms / 1000).toFixed(2));
 
     // test
     if ('passed' == test.state) {
       var url = self.testURL(test);
       var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="%s" class="replay">‣</a></h2></li>', test.speed, test.title, test.duration, url);
     } else if (test.pending) {
-      var el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
+      el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
     } else {
-      var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">‣</a></h2></li>', test.title, self.testURL(test));
+      el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">‣</a></h2></li>', test.title, self.testURL(test));
       var str = test.err.stack || test.err.toString();
 
       // FF / Opera do not add the message
       if (!~str.indexOf(test.err.message)) {
         str = test.err.message + '\n' + str;
       }
 
       // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we
@@ -2973,18 +2973,18 @@ exports = module.exports = JSONCov;
  * Initialize a new `JsCoverage` reporter.
  *
  * @param {Runner} runner
  * @param {Boolean} output
  * @api public
  */
 
 function JSONCov(runner, output) {
-  var self = this
-    , output = 1 == arguments.length ? true : output;
+  var self = this;
+  output = 1 == arguments.length ? true : output;
 
   Base.call(this, runner);
 
   var tests = []
     , failures = []
     , passes = [];
 
   runner.on('test end', function(test){
@@ -3893,18 +3893,18 @@ Base.colors.progress = 90;
  * @param {Runner} runner
  * @param {Object} options
  * @api public
  */
 
 function Progress(runner, options) {
   Base.call(this, runner);
 
+  options = options || {}
   var self = this
-    , options = options || {}
     , stats = this.stats
     , width = Base.window.width * .50 | 0
     , total = runner.total
     , complete = 0
     , max = Math.max
     , lastN = -1;
 
   // default chars
@@ -4022,17 +4022,17 @@ function Spec(runner) {
   runner.on('pass', function(test){
     if ('fast' == test.speed) {
       var fmt = indent()
         + color('checkmark', '  ' + Base.symbols.ok)
         + color('pass', ' %s');
       cursor.CR();
       console.log(fmt, test.title);
     } else {
-      var fmt = indent()
+      fmt = indent()
         + color('checkmark', '  ' + Base.symbols.ok)
         + color('pass', ' %s')
         + color(test.speed, ' (%dms)');
       cursor.CR();
       console.log(fmt, test.title, test.duration);
     }
   });
 
@@ -4437,17 +4437,17 @@ Runnable.prototype.clearTimeout = functi
  * Inspect the runnable void of private properties.
  *
  * @return {String}
  * @api private
  */
 
 Runnable.prototype.inspect = function(){
   return JSON.stringify(this, function(key, val){
-    if ('_' == key[0]) return;
+    if ('_' == key[0]) return undefined;
     if ('parent' == key) return '#<Suite>';
     if ('ctx' == key) return '#<Context>';
     return val;
   }, 2);
 };
 
 /**
  * Reset the timeout.
@@ -4500,21 +4500,21 @@ Runnable.prototype.run = function(fn){
     if (emitted) return;
     emitted = true;
     self.emit('error', err || new Error('done() called multiple times; stacktrace may be inaccurate'));
   }
 
   // finished
   function done(err) {
     var ms = self.timeout();
-    if (self.timedOut) return;
+    if (self.timedOut) return undefined;
     if (finished) return multiple(err || self._trace);
 
     // Discard the resolution if this test has already failed asynchronously
-    if (self.state) return;
+    if (self.state) return undefined;
 
     self.clearTimeout();
     self.duration = new Date - start;
     finished = true;
     if (!err && self.duration > ms && self._enableTimeouts) err = new Error('timeout of ' + ms + 'ms exceeded. Ensure the done() callback is being called in this test.');
     fn(err);
   }
 
@@ -4535,17 +4535,17 @@ Runnable.prototype.run = function(fn){
             return done(new Error('done() invoked with non-Error: ' + err));
           }
         }
         done();
       });
     } catch (err) {
       done(utils.getError(err));
     }
-    return;
+    return undefined;
   }
 
   if (this.asyncOnly) {
     return done(new Error('--async-only option in use without declaring `done()`'));
   }
 
   // sync or promise-returning
   try {
@@ -6285,17 +6285,17 @@ exports.lookupFiles = function lookupFil
     }
   }
 
   try {
     var stat = fs.statSync(path);
     if (stat.isFile()) return path;
   }
   catch (ignored) {
-    return;
+    return undefined;
   }
 
   fs.readdirSync(path).forEach(function(file) {
     file = join(path, file);
     try {
       var stat = fs.statSync(file);
       if (stat.isDirectory()) {
         if (recursive) {
--- a/toolkit/components/microformats/test/static/javascript/prettify.js
+++ b/toolkit/components/microformats/test/static/javascript/prettify.js
@@ -316,30 +316,30 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?
         }
       }
   
       // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
       // -> [[1, 12], [14, 14], [16, 17]]
       ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
       var consolidatedRanges = [];
       var lastRange = [NaN, NaN];
-      for (var i = 0; i < ranges.length; ++i) {
+      for (i = 0; i < ranges.length; ++i) {
         var range = ranges[i];
         if (range[0] <= lastRange[1] + 1) {
           lastRange[1] = Math.max(lastRange[1], range[1]);
         } else {
           consolidatedRanges.push(lastRange = range);
         }
       }
   
       var out = ['['];
       if (inverse) { out.push('^'); }
       out.push.apply(out, groups);
-      for (var i = 0; i < consolidatedRanges.length; ++i) {
-        var range = consolidatedRanges[i];
+      for (i = 0; i < consolidatedRanges.length; ++i) {
+        range = consolidatedRanges[i];
         out.push(encodeEscape(range[0]));
         if (range[1] > range[0]) {
           if (range[1] + 1 > range[0]) { out.push('-'); }
           out.push(encodeEscape(range[1]));
         }
       }
       out.push(']');
       return out.join('');
@@ -381,47 +381,47 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?
           if (decimalValue && decimalValue <= groupIndex) {
             capturedGroups[decimalValue] = -1;
           }
         }
       }
   
       // Renumber groups and reduce capturing groups to non-capturing groups
       // where possible.
-      for (var i = 1; i < capturedGroups.length; ++i) {
+      for (i = 1; i < capturedGroups.length; ++i) {
         if (-1 === capturedGroups[i]) {
           capturedGroups[i] = ++capturedGroupIndex;
         }
       }
-      for (var i = 0, groupIndex = 0; i < n; ++i) {
-        var p = parts[i];
+      for (i = 0, groupIndex = 0; i < n; ++i) {
+        p = parts[i];
         if (p === '(') {
           ++groupIndex;
           if (capturedGroups[groupIndex] === undefined) {
             parts[i] = '(?:';
           }
         } else if ('\\' === p.charAt(0)) {
-          var decimalValue = +p.substring(1);
+          decimalValue = +p.substring(1);
           if (decimalValue && decimalValue <= groupIndex) {
             parts[i] = '\\' + capturedGroups[groupIndex];
           }
         }
       }
   
       // Remove any prefix anchors so that the output will match anywhere.
       // ^^ really does mean an anchored match though.
-      for (var i = 0, groupIndex = 0; i < n; ++i) {
+      for (i = 0, groupIndex = 0; i < n; ++i) {
         if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
       }
   
       // Expand letters to groups to handle mixing of case-sensitive and
       // case-insensitive patterns if necessary.
       if (regex.ignoreCase && needToFoldCase) {
-        for (var i = 0; i < n; ++i) {
-          var p = parts[i];
+        for (i = 0; i < n; ++i) {
+          p = parts[i];
           var ch0 = p.charAt(0);
           if (p.length >= 2 && ch0 === '[') {
             parts[i] = caseFoldCharset(p);
           } else if (ch0 !== '\\') {
             // TODO: handle letters in numeric escapes.
             parts[i] = p.replace(
                 /[a-zA-Z]/g,
                 function (ch) {
@@ -431,18 +431,18 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?
           }
         }
       }
   
       return parts.join('');
     }
   
     var rewritten = [];
-    for (var i = 0, n = regexs.length; i < n; ++i) {
-      var regex = regexs[i];
+    for (i = 0, n = regexs.length; i < n; ++i) {
+      regex = regexs[i];
       if (regex.global || regex.multiline) { throw new Error('' + regex); }
       rewritten.push(
           '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
     }
   
     return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
   }
 
@@ -1026,17 +1026,17 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?
     // Make sure numeric indices show correctly.
     if (opt_startLineNum === (opt_startLineNum|0)) {
       listItems[0].setAttribute('value', opt_startLineNum);
     }
   
     var ol = document.createElement('OL');
     ol.className = 'linenums';
     var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
-    for (var i = 0, n = listItems.length; i < n; ++i) {
+    for (i = 0, n = listItems.length; i < n; ++i) {
       li = listItems[i];
       // Stick a class on the LIs so that stylesheets can
       // color odd/even rows, or any other row pattern that
       // is co-prime with 10.
       li.className = 'L' + ((i + offset) % 10);
       if (!li.firstChild) {
         li.appendChild(document.createTextNode('\xA0'));
       }
@@ -1111,17 +1111,17 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?
     var decoration = null;
     while (spanIndex < nSpans) {
       var spanStart = spans[spanIndex];
       var spanEnd = spans[spanIndex + 2] || sourceLength;
   
       var decStart = decorations[decorationIndex];
       var decEnd = decorations[decorationIndex + 2] || sourceLength;
   
-      var end = Math.min(spanEnd, decEnd);
+      end = Math.min(spanEnd, decEnd);
   
       var textNode = spans[spanIndex + 1];
       var styledText;
       if (textNode.nodeType !== 1  // Don't muck with <BR>s or <LI>s
           // Don't introduce spans around empty text nodes.
           && (styledText = source.substring(sourceIndex, end))) {
         // This may seem bizarre, and it is.  Emitting LF on IE causes the
         // code to display with spaces instead of line breaks.
--- a/toolkit/components/microformats/tests/test_Microformats_add.html
+++ b/toolkit/components/microformats/tests/test_Microformats_add.html
@@ -220,17 +220,17 @@
 
     // The old version's microformat is still valid
     mf = Microformats.get("hTest", document.getElementById("test1"),
                           {recurseExternalFrames: true});
 
     ok(mf.length, 1, "Check that test1 is a valid microformat");
 
     // Verify that the version 2 microformat is now also considered valid
-    var mf2 = Microformats.get("hTest", document.getElementById("test2"), {});
+    mf2 = Microformats.get("hTest", document.getElementById("test2"), {});
 
     ok(mf2.length, 1, "Check that the mfTest microformat version 2 is now valid");
     doTest3_4_and5(true);
 
     Microformats.remove("hTest");
   }
 
   </script>
--- a/toolkit/components/places/Bookmarks.jsm
+++ b/toolkit/components/places/Bookmarks.jsm
@@ -964,17 +964,17 @@ function removeBookmark(item) {
 // Reorder implementation.
 
 function reorderChildren(parent, orderedChildrenGuids) {
   return PlacesUtils.withConnectionWrapper("Bookmarks.jsm: updateBookmark",
     db => db.executeTransaction(function* () {
       // Select all of the direct children for the given parent.
       let children = yield fetchBookmarksByParent({ parentGuid: parent.guid });
       if (!children.length)
-        return;
+        return undefined;
 
       // Reorder the children array according to the specified order, provided
       // GUIDs come first, others are appended in somehow random order.
       children.sort((a, b) => {
         let i = orderedChildrenGuids.indexOf(a.guid);
         let j = orderedChildrenGuids.indexOf(b.guid);
         // This works provided fetchBookmarksByParent returns sorted children.
         return (i == -1 && j == -1) ? 0 :
--- a/toolkit/components/places/PlacesBackups.jsm
+++ b/toolkit/components/places/PlacesBackups.jsm
@@ -192,17 +192,17 @@ this.PlacesBackups = {
 
       let backupFolderPath = yield this.getBackupFolder();
       let iterator = new OS.File.DirectoryIterator(backupFolderPath);
       yield iterator.forEach(function(aEntry) {
         // Since this is a lazy getter and OS.File I/O is serialized, we can
         // safely remove .tmp files without risking to remove ongoing backups.
         if (aEntry.name.endsWith(".tmp")) {
           OS.File.remove(aEntry.path);
-          return;
+          return undefined;
         }
 
         if (filenamesRegex.test(aEntry.name)) {
           // Remove bogus backups in future dates.
           let filePath = aEntry.path;
           if (this.getDateForFile(filePath) > new Date()) {
             return OS.File.remove(filePath);
           } else {
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -693,26 +693,26 @@ this.PlacesUtils = {
     // We split on "\n"  because the transferable system converts "\r\n" to "\n"
     var nodes = [];
     switch(type) {
       case this.TYPE_X_MOZ_PLACE:
       case this.TYPE_X_MOZ_PLACE_SEPARATOR:
       case this.TYPE_X_MOZ_PLACE_CONTAINER:
         nodes = JSON.parse("[" + blob + "]");
         break;
-      case this.TYPE_X_MOZ_URL:
-        var parts = blob.split("\n");
+      case this.TYPE_X_MOZ_URL: {
+        let parts = blob.split("\n");
         // data in this type has 2 parts per entry, so if there are fewer
         // than 2 parts left, the blob is malformed and we should stop
         // but drag and drop of files from the shell has parts.length = 1
         if (parts.length != 1 && parts.length % 2)
           break;
-        for (var i = 0; i < parts.length; i=i+2) {
-          var uriString = parts[i];
-          var titleString = "";
+        for (let i = 0; i < parts.length; i=i+2) {
+          let uriString = parts[i];
+          let titleString = "";
           if (parts.length > i+1)
             titleString = parts[i+1];
           else {
             // for drag and drop of files, try to use the leafName as title
             try {
               titleString = this._uri(uriString).QueryInterface(Ci.nsIURL)
                                 .fileName;
             }
@@ -721,31 +721,33 @@ this.PlacesUtils = {
           // note:  this._uri() will throw if uriString is not a valid URI
           if (this._uri(uriString)) {
             nodes.push({ uri: uriString,
                          title: titleString ? titleString : uriString ,
                          type: this.TYPE_X_MOZ_URL });
           }
         }
         break;
-      case this.TYPE_UNICODE:
-        var parts = blob.split("\n");
-        for (var i = 0; i < parts.length; i++) {
-          var uriString = parts[i];
+      }
+      case this.TYPE_UNICODE: {
+        let parts = blob.split("\n");
+        for (let i = 0; i < parts.length; i++) {
+          let uriString = parts[i];
           // text/uri-list is converted to TYPE_UNICODE but it could contain
           // comments line prepended by #, we should skip them
           if (uriString.substr(0, 1) == '\x23')
             continue;
           // note: this._uri() will throw if uriString is not a valid URI
           if (uriString != "" && this._uri(uriString))
             nodes.push({ uri: uriString,
                          title: uriString,
                          type: this.TYPE_X_MOZ_URL });
         }
         break;
+      }
       default:
         throw Cr.NS_ERROR_INVALID_ARG;
     }
     return nodes;
   },
 
   /**
    * Generates a nsINavHistoryResult for the contents of a folder.
--- a/toolkit/components/places/nsPlacesExpiration.js
+++ b/toolkit/components/places/nsPlacesExpiration.js
@@ -1000,17 +1000,17 @@ nsPlacesExpiration.prototype = {
    *
    * @return a REPEATING_SLACK nsITimer that runs every this._interval.
    */
   _newTimer: function PEX__newTimer()
   {
     if (this._timer)
       this._timer.cancel();
     if (this._shuttingDown)
-      return;
+      return undefined;
     let interval = this.status != STATUS.DIRTY ?
       this._interval * EXPIRE_AGGRESSIVITY_MULTIPLIER : this._interval;
 
     let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     timer.initWithCallback(this, interval * 1000,
                            Ci.nsITimer.TYPE_REPEATING_SLACK);
     return this._timer = timer;
   },
--- a/toolkit/components/places/tests/bookmarks/test_395101.js
+++ b/toolkit/components/places/tests/bookmarks/test_395101.js
@@ -56,32 +56,32 @@ function run_test() {
   rootNode.containerOpen = true;
 
   do_check_eq(rootNode.childCount, 1);
   do_check_eq(rootNode.getChild(0).itemId, b1);
   rootNode.containerOpen = false;
 
   // partial matches are okay
   query.searchTerms = "wal";
-  var result = histsvc.executeQuery(query, options);
-  var rootNode = result.root;
+  result = histsvc.executeQuery(query, options);
+  rootNode = result.root;
   rootNode.containerOpen = true;
   do_check_eq(rootNode.childCount, 1);
   rootNode.containerOpen = false;
 
   // case insensitive search term
   query.searchTerms = "WALRUS";
-  var result = histsvc.executeQuery(query, options);
-  var rootNode = result.root;
+  result = histsvc.executeQuery(query, options);
+  rootNode = result.root;
   rootNode.containerOpen = true;
   do_check_eq(rootNode.childCount, 1);
   do_check_eq(rootNode.getChild(0).itemId, b1);
   rootNode.containerOpen = false;
 
   // case insensitive tag
   query.searchTerms = "baboon";
-  var result = histsvc.executeQuery(query, options);
-  var rootNode = result.root;
+  result = histsvc.executeQuery(query, options);
+  rootNode = result.root;
   rootNode.containerOpen = true;
   do_check_eq(rootNode.childCount, 1);
   do_check_eq(rootNode.getChild(0).itemId, b1);
   rootNode.containerOpen = false;
 }
--- a/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js
+++ b/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js
@@ -91,17 +91,17 @@ var test = {
                                          DEFAULT_INDEX, this._queryTitle3);
   },
 
   clean: function () {},
 
   validate: function validate() {
     // Throw a wrench in the works by inserting some new bookmarks,
     // ensuring folder ids won't be the same, when restoring.
-    for (var i = 0; i < 10; i++) {
+    for (let i = 0; i < 10; i++) {
       PlacesUtils.bookmarks.
                   insertBookmark(PlacesUtils.bookmarksMenuFolderId, uri("http://aaaa"+i), DEFAULT_INDEX, "");
     }
 
     var toolbar =
       PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId,
                                     false, true).root;
     do_check_true(toolbar.childCount, 1);
@@ -110,17 +110,17 @@ var test = {
     do_check_eq(folderNode.type, folderNode.RESULT_TYPE_FOLDER);
     do_check_eq(folderNode.title, this._testRootTitle);
     folderNode.QueryInterface(Ci.nsINavHistoryQueryResultNode);
     folderNode.containerOpen = true;
 
     // |_count| folders + the query node
     do_check_eq(folderNode.childCount, this._count+3);
 
-    for (var i = 0; i < this._count; i++) {
+    for (let i = 0; i < this._count; i++) {
       var subFolder = folderNode.getChild(i);
       do_check_eq(subFolder.title, "folder"+i);
       subFolder.QueryInterface(Ci.nsINavHistoryContainerResultNode);
       subFolder.containerOpen = true;
       do_check_eq(subFolder.childCount, 1);
       var child = subFolder.getChild(0);
       do_check_eq(child.title, "bookmark"+i);
       do_check_true(uri(child.uri).equals(uri("http://" + i)))
--- a/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js
+++ b/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js
@@ -85,17 +85,17 @@ var test = {
       do_check_eq(excludeRootNode.childCount, 1);
       var excludeRootChildNode = excludeRootNode.getChild(0);
       do_check_eq(excludeRootChildNode.uri, this._restoreRootExcludeURI.spec);
       excludeRootNode.containerOpen = false;
     }
     else {
       // exclude root should not exist anymore
       do_check_eq(rootNode.childCount, PLACES_ROOTS_COUNT + 1);
-      var restoreRootIndex = PLACES_ROOTS_COUNT;
+      restoreRootIndex = PLACES_ROOTS_COUNT;
     }
 
     var restoreRootNode = rootNode.getChild(restoreRootIndex);
     do_check_eq(this._restoreRootTitle, restoreRootNode.title);
     restoreRootNode.QueryInterface(Ci.nsINavHistoryQueryResultNode);
     restoreRootNode.containerOpen = true;
     do_check_eq(restoreRootNode.childCount, 1);
     var restoreRootChildNode = restoreRootNode.getChild(0);
--- a/toolkit/components/places/tests/bookmarks/test_savedsearches.js
+++ b/toolkit/components/places/tests/bookmarks/test_savedsearches.js
@@ -32,54 +32,54 @@ add_test(function test_savedsearches_boo
   // create a saved-search that matches a default bookmark
   var searchId = PlacesUtils.bookmarks.insertBookmark(
     testRoot, uri("place:terms=" + searchTerm + "&excludeQueries=1&expandQueries=1&queryType=1"),
     PlacesUtils.bookmarks.DEFAULT_INDEX, searchTerm);
 
   // query for the test root, expandQueries=0
   // the query should show up as a regular bookmark
   try {
-    var options = PlacesUtils.history.getNewQueryOptions();
+    let options = PlacesUtils.history.getNewQueryOptions();
     options.expandQueries = 0;
-    var query = PlacesUtils.history.getNewQuery();
+    let query = PlacesUtils.history.getNewQuery();
     query.setFolders([testRoot], 1);
-    var result = PlacesUtils.history.executeQuery(query, options);
-    var rootNode = result.root;
+    let result = PlacesUtils.history.executeQuery(query, options);
+    let rootNode = result.root;
     rootNode.containerOpen = true;
-    var cc = rootNode.childCount;
+    let cc = rootNode.childCount;
     do_check_eq(cc, 1);
-    for (var i = 0; i < cc; i++) {
-      var node = rootNode.getChild(i);
+    for (let i = 0; i < cc; i++) {
+      let node = rootNode.getChild(i);
       // test that queries have valid itemId
       do_check_true(node.itemId > 0);
       // test that the container is closed
       node.QueryInterface(Ci.nsINavHistoryContainerResultNode);
       do_check_eq(node.containerOpen, false);
     }
     rootNode.containerOpen = false;
   }
   catch(ex) {
     do_throw("expandQueries=0 query error: " + ex);
   }
 
   // bookmark saved search
   // query for the test root, expandQueries=1
   // the query should show up as a query container, with 1 child
   try {
-    var options = PlacesUtils.history.getNewQueryOptions();
+    let options = PlacesUtils.history.getNewQueryOptions();
     options.expandQueries = 1;
-    var query = PlacesUtils.history.getNewQuery();
+    let query = PlacesUtils.history.getNewQuery();
     query.setFolders([testRoot], 1);
-    var result = PlacesUtils.history.executeQuery(query, options);
-    var rootNode = result.root;
+    let result = PlacesUtils.history.executeQuery(query, options);
+    let rootNode = result.root;
     rootNode.containerOpen = true;
-    var cc = rootNode.childCount;
+    let cc = rootNode.childCount;
     do_check_eq(cc, 1);
-    for (var i = 0; i < cc; i++) {
-      var node = rootNode.getChild(i);
+    for (let i = 0; i < cc; i++) {
+      let node = rootNode.getChild(i);
       // test that query node type is container when expandQueries=1
       do_check_eq(node.type, node.RESULT_TYPE_QUERY);
       // test that queries (as containers) have valid itemId
       do_check_true(node.itemId > 0);
       node.QueryInterface(Ci.nsINavHistoryContainerResultNode);
       node.containerOpen = true;
 
       // test that queries have children when excludeItems=1
@@ -191,17 +191,17 @@ add_task(function* test_savedsearches_hi
 
     // test live-update of renamed queries
     PlacesUtils.bookmarks.setItemTitle(searchId, "foo");
     do_check_eq(tmpFolderNode.title, "foo");
 
     // test live-update of deleted queries
     PlacesUtils.bookmarks.removeItem(searchId);
     try {
-      var tmpFolderNode = root.getChild(1);
+      tmpFolderNode = root.getChild(1);
       do_throw("query was not removed");
     } catch(ex) {}
 
     tmpFolderNode.containerOpen = false;
     rootNode.containerOpen = false;
   }
   catch(ex) {
     do_throw("expandQueries=1 bookmarks query: " + ex);
--- a/toolkit/components/places/tests/queries/test_containersQueries_sorting.js
+++ b/toolkit/components/places/tests/queries/test_containersQueries_sorting.js
@@ -307,17 +307,17 @@ function test_result_sortingMode_change(
  * @param aRootNode
  *        already opened root node from our query's result.
  * @param aExpectedSortingMode
  *        The sortingMode we expect results to be.
  */
 function check_children_sorting(aRootNode, aExpectedSortingMode) {
   var results = [];
   print("Found children:");
-  for (var i = 0; i < aRootNode.childCount; i++) {
+  for (let i = 0; i < aRootNode.childCount; i++) {
     results[i] = aRootNode.getChild(i);
     print(i + " " + results[i].title);
   }
 
   // Helper for case insensitive string comparison.
   function caseInsensitiveStringComparator(a, b) {
     var aLC = a.toLowerCase();
     var bLC = b.toLowerCase();
@@ -368,17 +368,17 @@ function check_children_sorting(aRootNod
     default:
       do_throw("Unknown sorting type: " + aExpectedSortingMode);
   }
 
   // Make an independent copy of the results array and sort it.
   var sortedResults = results.slice();
   sortedResults.sort(comparator);
   // Actually compare returned children with our sorted array.
-  for (var i = 0; i < sortedResults.length; i++) {
+  for (let i = 0; i < sortedResults.length; i++) {
     if (sortedResults[i].title != results[i].title)
       print(i + " index wrong, expected " + sortedResults[i].title +
             " found " + results[i].title);
     do_check_eq(sortedResults[i].title, results[i].title);
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/toolkit/components/places/tests/queries/test_results-as-visit.js
+++ b/toolkit/components/places/tests/queries/test_results-as-visit.js
@@ -61,23 +61,23 @@ add_task(function* test_results_as_visit
 
    // Check our inital result set
    compareArrayToResult(testData, root);
 
    // If that passes, check liveupdate
    // Add to the query set
    do_print("Adding item to query")
    var tmp = [];
-   for (var i=0; i < 2; i++) {
+   for (let i=0; i < 2; i++) {
      tmp.push({ isVisit: true,
                 uri: "http://foo.com/added.html",
                 title: "ab moz" });
    }
    yield task_populateDB(tmp);
-   for (var i=0; i < 2; i++)
+   for (let i=0; i < 2; i++)
      do_check_eq(root.getChild(i).title, "ab moz");
 
    // Update an existing URI
    do_print("Updating Item");
    var change2 = [{ isVisit: true,
                     title: "moz",
                     uri: "http://foo.mail.com/changeme2.html" }];
    yield task_populateDB(change2);
--- a/toolkit/components/places/tests/test_bug_461710_perwindowpb.html
+++ b/toolkit/components/places/tests/test_bug_461710_perwindowpb.html
@@ -122,25 +122,25 @@ function checkTest() {
       // run outside of private mode, link should appear as visited
       var doc = gIframe.contentDocument;
       var win = doc.defaultView;
       is(getColor(doc, win, "link"), kRed, "Visited link coloring should work outside of private mode");
       break;
 
     case 3:
       // run inside of private mode, link should appear as not visited
-      var doc = gIframe.contentDocument;
-      var win = doc.defaultView;
+      doc = gIframe.contentDocument;
+      win = doc.defaultView;
       is(getColor(doc, win, "link"), kBlue, "Visited link coloring should not work inside of private mode");
       break;
 
     case 4:
       // run outside of private mode, link should appear as visited
-      var doc = gIframe.contentDocument;
-      var win = doc.defaultView;
+      doc = gIframe.contentDocument;
+      win = doc.defaultView;
       is(getColor(doc, win, "link"), kRed, "Visited link coloring should work outside of private mode");
       break;
 
     default:
       ok(false, "Unexpected call to checkTest for test #" + testNum);
   }
 }
 
--- a/toolkit/components/places/tests/unit/test_000_frecency.js
+++ b/toolkit/components/places/tests/unit/test_000_frecency.js
@@ -72,17 +72,17 @@ function* task_initializeBucket(bucket) 
   for (let [bonusName, visitType] in Iterator(bonusPrefs)) {
     var frecency = -1;
     var calculatedURI = null;
     var matchTitle = "";
     var bonusValue = prefs.getIntPref(prefPrefix + bonusName);
     // unvisited (only for first cutoff date bucket)
     if (bonusName == "unvisitedBookmarkBonus" || bonusName == "unvisitedTypedBonus") {
       if (cutoffName == "firstBucketCutoff") {
-        var points = Math.ceil(bonusValue / parseFloat(100.0) * weight);
+        let points = Math.ceil(bonusValue / parseFloat(100.0) * weight);
         var visitCount = 1; //bonusName == "unvisitedBookmarkBonus" ? 1 : 0;
         frecency = Math.ceil(visitCount * points);
         calculatedURI = uri("http://" + searchTerm + ".com/" +
           bonusName + ":" + bonusValue + "/cutoff:" + cutoff +
           "/weight:" + weight + "/frecency:" + frecency);
         if (bonusName == "unvisitedBookmarkBonus") {
           matchTitle = searchTerm + "UnvisitedBookmark";
           bmsvc.insertBookmark(bmsvc.unfiledBookmarksFolder, calculatedURI, bmsvc.DEFAULT_INDEX, matchTitle);
@@ -100,17 +100,17 @@ function* task_initializeBucket(bucket) 
       }
     }
     else {
       // visited
       // visited bookmarks get the visited bookmark bonus twice
       if (visitType == Ci.nsINavHistoryService.TRANSITION_BOOKMARK)
         bonusValue = bonusValue * 2;
 
-      var points = Math.ceil(1 * ((bonusValue / parseFloat(100.000000)).toFixed(6) * weight) / 1);
+      let points = Math.ceil(1 * ((bonusValue / parseFloat(100.000000)).toFixed(6) * weight) / 1);
       if (!points) {
         if (visitType == Ci.nsINavHistoryService.TRANSITION_EMBED ||
             visitType == Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK ||
             visitType == Ci.nsINavHistoryService.TRANSITION_DOWNLOAD ||
             bonusName == "defaultVisitBonus")
           frecency = 0;
         else
           frecency = -1;
--- a/toolkit/components/places/tests/unit/test_331487.js
+++ b/toolkit/components/places/tests/unit/test_331487.js
@@ -68,23 +68,23 @@ function run_test() {
   do_check_eq(sf2Node.getChild(0).itemId, b3);
 
   sf2Node.containerOpen = false;
   sf1Node.containerOpen = false;
   root.containerOpen = false;
 
   // bookmark query that should result in a flat list
   // because we specified max results
-  var options = histsvc.getNewQueryOptions();
+  options = histsvc.getNewQueryOptions();
   options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
   options.maxResults = 10;
-  var query = histsvc.getNewQuery();
+  query = histsvc.getNewQuery();
   query.setFolders([folder], 1);
-  var result = histsvc.executeQuery(query, options);
-  var root = result.root;
+  result = histsvc.executeQuery(query, options);
+  root = result.root;
   root.containerOpen = true;
   do_check_eq(root.childCount, 3);
   do_check_eq(root.getChild(0).itemId, b1);
   do_check_eq(root.getChild(1).itemId, b2);
   do_check_eq(root.getChild(2).itemId, b3);
   root.containerOpen = false;
 
   // XXX TODO
--- a/toolkit/components/places/tests/unit/test_415757.js
+++ b/toolkit/components/places/tests/unit/test_415757.js
@@ -31,23 +31,23 @@ const TOTAL_SITES = 20;
 function run_test()
 {
   run_next_test();
 }
 
 add_task(function* test_execute()
 {
   // add pages to global history
-  for (var i = 0; i < TOTAL_SITES; i++) {
+  for (let i = 0; i < TOTAL_SITES; i++) {
     let site = "http://www.test-" + i + ".com/";
     let testURI = uri(site);
     let when = Date.now() * 1000 + (i * TOTAL_SITES);
     yield PlacesTestUtils.addVisits({ uri: testURI, visitDate: when });
   }
-  for (var i = 0; i < TOTAL_SITES; i++) {
+  for (let i = 0; i < TOTAL_SITES; i++) {
     let site = "http://www.test.com/" + i + "/";
     let testURI = uri(site);
     let when = Date.now() * 1000 + (i * TOTAL_SITES);
     yield PlacesTestUtils.addVisits({ uri: testURI, visitDate: when });
   }
 
   // set a page annotation on one of the urls that will be removed
   var testAnnoDeletedURI = uri("http://www.test.com/1/");
@@ -73,17 +73,17 @@ add_task(function* test_execute()
   // check that all pages in www.test.com have been removed
   for (var i = 0; i < TOTAL_SITES; i++) {
     let site = "http://www.test.com/" + i + "/";
     let testURI = uri(site);
     do_check_false(uri_in_db(testURI));
   }
 
   // check that all pages in www.test-X.com have NOT been removed
-  for (var i = 0; i < TOTAL_SITES; i++) {
+  for (let i = 0; i < TOTAL_SITES; i++) {
     let site = "http://www.test-" + i + ".com/";
     let testURI = uri(site);
     do_check_true(uri_in_db(testURI));
   }
 
   // check that annotation on the removed item does not exists
   try {
     PlacesUtils.annotations.getPageAnnotation(testAnnoDeletedURI, testAnnoName);
--- a/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js
+++ b/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js
@@ -37,20 +37,20 @@ add_task(function* test_execute()
   do_check_eq(root.hasChildren, true);
 
   // now check via the saved search path
   var queryURI = histsvc.queriesToQueryString([query], 1, options);
   bmsvc.insertBookmark(bmsvc.toolbarFolder, uri(queryURI),
                        0 /* first item */, "test query");
 
   // query for that query
-  var options = histsvc.getNewQueryOptions();
-  var query = histsvc.getNewQuery();
+  options = histsvc.getNewQueryOptions();
+  query = histsvc.getNewQuery();
   query.setFolders([bmsvc.toolbarFolder], 1);
-  var result = histsvc.executeQuery(query, options);
-  var root = result.root;
+  result = histsvc.executeQuery(query, options);
+  root = result.root;
   root.containerOpen = true;
   var queryNode = root.getChild(0);
   do_check_eq(queryNode.title, "test query");
   queryNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
   do_check_eq(queryNode.hasChildren, true);
   root.containerOpen = false;
 });
--- a/toolkit/components/places/tests/unit/test_annotations.js
+++ b/toolkit/components/places/tests/unit/test_annotations.js
@@ -144,26 +144,26 @@ add_task(function* test_execute()
   do_check_eq(storageType.value, Ci.nsIAnnotationService.TYPE_STRING);
 
   // get annotation names for a uri
   var annoNames = annosvc.getPageAnnotationNames(testURI);
   do_check_eq(annoNames.length, 1);
   do_check_eq(annoNames[0], "moz-test-places/annotations");
 
   // get annotation names for an item
-  var annoNames = annosvc.getItemAnnotationNames(testItemId);
+  annoNames = annosvc.getItemAnnotationNames(testItemId);
   do_check_eq(annoNames.length, 1);
   do_check_eq(annoNames[0], "moz-test-places/annotations");
 
   // copy annotations to another uri
   var newURI = uri("http://mozilla.org");
   yield PlacesTestUtils.addVisits(newURI);
   annosvc.setPageAnnotation(testURI, "oldAnno", "new", 0, 0);
   annosvc.setPageAnnotation(newURI, "oldAnno", "old", 0, 0);
-  var annoNames = annosvc.getPageAnnotationNames(newURI);
+  annoNames = annosvc.getPageAnnotationNames(newURI);
   do_check_eq(annoNames.length, 1);
   do_check_eq(annoNames[0], "oldAnno");
   var oldAnnoNames = annosvc.getPageAnnotationNames(testURI);
   do_check_eq(oldAnnoNames.length, 2);
   var copiedAnno = oldAnnoNames[0];
   annosvc.copyPageAnnotations(testURI, newURI, false);
   var newAnnoNames = annosvc.getPageAnnotationNames(newURI);
   do_check_eq(newAnnoNames.length, 2);
@@ -175,30 +175,30 @@ add_task(function* test_execute()
   newAnnoNames = annosvc.getPageAnnotationNames(newURI);
   do_check_eq(newAnnoNames.length, 2);
   do_check_true(annosvc.pageHasAnnotation(newURI, "oldAnno"));
   do_check_true(annosvc.pageHasAnnotation(newURI, copiedAnno));
   do_check_eq(annosvc.getPageAnnotation(newURI, "oldAnno"), "new");
 
 
   // copy annotations to another item
-  var newURI = uri("http://mozilla.org");
+  newURI = uri("http://mozilla.org");
   var newItemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, newURI, -1, "");
   var itemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, -1, "");
   annosvc.setItemAnnotation(itemId, "oldAnno", "new", 0, 0);
   annosvc.setItemAnnotation(itemId, "testAnno", "test", 0, 0);
   annosvc.setItemAnnotation(newItemId, "oldAnno", "old", 0, 0);
-  var annoNames = annosvc.getItemAnnotationNames(newItemId);
+  annoNames = annosvc.getItemAnnotationNames(newItemId);
   do_check_eq(annoNames.length, 1);
   do_check_eq(annoNames[0], "oldAnno");
-  var oldAnnoNames = annosvc.getItemAnnotationNames(itemId);
+  oldAnnoNames = annosvc.getItemAnnotationNames(itemId);
   do_check_eq(oldAnnoNames.length, 2);
-  var copiedAnno = oldAnnoNames[0];
+  copiedAnno = oldAnnoNames[0];
   annosvc.copyItemAnnotations(itemId, newItemId, false);
-  var newAnnoNames = annosvc.getItemAnnotationNames(newItemId);
+  newAnnoNames = annosvc.getItemAnnotationNames(newItemId);
   do_check_eq(newAnnoNames.length, 2);
   do_check_true(annosvc.itemHasAnnotation(newItemId, "oldAnno"));
   do_check_true(annosvc.itemHasAnnotation(newItemId, copiedAnno));
   do_check_eq(annosvc.getItemAnnotation(newItemId, "oldAnno"), "old");
   annosvc.setItemAnnotation(newItemId, "oldAnno", "new", 0, 0);
   annosvc.copyItemAnnotations(itemId, newItemId, true);
   newAnnoNames = annosvc.getItemAnnotationNames(newItemId);
   do_check_eq(newAnnoNames.length, 2);
@@ -206,17 +206,17 @@ add_task(function* test_execute()
   do_check_true(annosvc.itemHasAnnotation(newItemId, copiedAnno));
   do_check_eq(annosvc.getItemAnnotation(newItemId, "oldAnno"), "new");
 
   // test int32 anno type
   var int32Key = testAnnoName + "/types/Int32";
   var int32Val = 23;
   annosvc.setPageAnnotation(testURI, int32Key, int32Val, 0, 0);
   do_check_true(annosvc.pageHasAnnotation(testURI, int32Key));
-  var flags = {}, exp = {}, storageType = {};
+  flags = {}, exp = {}, storageType = {};
   annosvc.getPageAnnotationInfo(testURI, int32Key, flags, exp, storageType);
   do_check_eq(flags.value, 0);
   do_check_eq(exp.value, 0);
   do_check_eq(storageType.value, Ci.nsIAnnotationService.TYPE_INT32);
   var storedVal = annosvc.getPageAnnotation(testURI, int32Key);
   do_check_true(int32Val === storedVal);
   annosvc.setItemAnnotation(testItemId, int32Key, int32Val, 0, 0);
   do_check_true(annosvc.itemHasAnnotation(testItemId, int32Key));
@@ -292,17 +292,17 @@ add_task(function* test_execute()
     try {
       annosvc.setItemAnnotation(id, "foo", "bar", 0, 0);
       do_throw("setItemAnnotation* should throw for invalid item id: " + id)
     }
     catch(ex) { }
   }
 
   // setting an annotation with EXPIRE_HISTORY for an item should throw
-  var itemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, -1, "");
+  itemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, -1, "");
   try {
     annosvc.setItemAnnotation(itemId, "foo", "bar", 0, annosvc.EXPIRE_WITH_HISTORY);
     do_throw("setting an item annotation with EXPIRE_HISTORY should throw");
   }
   catch(ex) {
   }
 
   annosvc.removeObserver(annoObserver);
--- a/toolkit/components/places/tests/unit/test_history.js
+++ b/toolkit/components/places/tests/unit/test_history.js
@@ -167,18 +167,18 @@ add_task(function* test_execute()
     do_throw("bookmarks table does not have id field, schema is too old!");
   }
   finally {
     statement.finalize();
   }
 
   // bug 394741 - regressed history text searches
   yield PlacesTestUtils.addVisits(uri("http://mozilla.com"));
-  var options = histsvc.getNewQueryOptions();
+  options = histsvc.getNewQueryOptions();
   //options.resultType = options.RESULTS_AS_VISIT;
-  var query = histsvc.getNewQuery();
+  query = histsvc.getNewQuery();
   query.searchTerms = "moz";
-  var result = histsvc.executeQuery(query, options);
-  var root = result.root;
+  result = histsvc.executeQuery(query, options);
+  root = result.root;
   root.containerOpen = true;
   do_check_true(root.childCount > 0);
   root.containerOpen = false;
 });
--- a/toolkit/components/places/tests/unit/test_history_sidebar.js
+++ b/toolkit/components/places/tests/unit/test_history_sidebar.js
@@ -78,25 +78,25 @@ var visibleContainers = containers.filte
 
 /**
  * Asynchronous task that fills history and checks containers' labels.
  */
 function* task_fill_history() {
   print("\n\n*** TEST Fill History\n");
   // We can't use "now" because our hardcoded offsets would be invalid for some
   // date.  So we hardcode a date.
-  for (var i = 0; i < containers.length; i++) {
-    var container = containers[i];
+  for (let i = 0; i < containers.length; i++) {
+    let container = containers[i];
     var testURI = uri("http://mirror"+i+".mozilla.com/b");
     yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
-    var testURI = uri("http://mirror"+i+".mozilla.com/a");
+    testURI = uri("http://mirror"+i+".mozilla.com/a");
     yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
-    var testURI = uri("http://mirror"+i+".google.com/b");
+    testURI = uri("http://mirror"+i+".google.com/b");
     yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
-    var testURI = uri("http://mirror"+i+".google.com/a");
+    testURI = uri("http://mirror"+i+".google.com/a");
     yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
     // Bug 485703 - Hide date containers not containing additional entries
     //              compared to previous ones.
     // Check after every new container is added.
     check_visit(container.offset);
   }
 
   var options = hs.getNewQueryOptions();
@@ -105,18 +105,18 @@ function* task_fill_history() {
 
   var result = hs.executeQuery(query, options);
   var root = result.root;
   root.containerOpen = true;
 
   var cc = root.childCount;
   print("Found containers:");
   var previousLabels = [];
-  for (var i = 0; i < cc; i++) {
-    var container = visibleContainers[i];
+  for (let i = 0; i < cc; i++) {
+    let container = visibleContainers[i];
     var node = root.getChild(i);
     print(node.title);
     if (container.label)
       do_check_eq(node.title, container.label);
     // Check labels are not repeated.
     do_check_eq(previousLabels.indexOf(node.title), -1);
     previousLabels.push(node.title);
   }
@@ -196,35 +196,35 @@ function test_RESULTS_AS_DATE_SITE_QUERY
   // Inside of host sites are sorted by title
   var site1visit = site1.getChild(0);
   do_check_eq(site1visit.uri, "http://mirror0.google.com/a");
 
   // Bug 473157: changing sorting mode should not affect the containers
   result.sortingMode = options.SORT_BY_TITLE_DESCENDING;
 
   // Check one of the days
-  var dayNode = root.getChild(0)
+  dayNode = root.getChild(0)
                     .QueryInterface(Ci.nsINavHistoryContainerResultNode);
   dayNode.containerOpen = true;
   do_check_eq(dayNode.childCount, 2);
 
   // Hosts are still sorted by title
-  var site1 = dayNode.getChild(0)
+  site1 = dayNode.getChild(0)
                      .QueryInterface(Ci.nsINavHistoryContainerResultNode);
   do_check_eq(site1.title, "mirror0.google.com");
 
-  var site2 = dayNode.getChild(1)
+  site2 = dayNode.getChild(1)
                      .QueryInterface(Ci.nsINavHistoryContainerResultNode);
   do_check_eq(site2.title, "mirror0.mozilla.com");
 
   site1.containerOpen = true;
   do_check_eq(site1.childCount, 2);
 
   // But URLs are now sorted by title descending
-  var site1visit = site1.getChild(0);
+  site1visit = site1.getChild(0);
   do_check_eq(site1visit.uri, "http://mirror0.google.com/b");
 
   site1.containerOpen = false;
   dayNode.containerOpen = false;
   root.containerOpen = false;
 }
 
 /**
@@ -262,26 +262,26 @@ function test_RESULTS_AS_DATE_QUERY() {
 
   var visit2 = dayNode.getChild(3);
   do_check_eq(visit2.uri, "http://mirror0.mozilla.com/b");
 
   // Bug 473157: changing sorting mode should not affect the containers
   result.sortingMode = options.SORT_BY_TITLE_DESCENDING;
 
   // Check one of the days
-  var dayNode = root.getChild(0)
+  dayNode = root.getChild(0)
                     .QueryInterface(Ci.nsINavHistoryContainerResultNode);
   dayNode.containerOpen = true;
   do_check_eq(dayNode.childCount, 4);
 
   // But URLs are now sorted by title descending
-  var visit1 = dayNode.getChild(0);
+  visit1 = dayNode.getChild(0);
   do_check_eq(visit1.uri, "http://mirror0.mozilla.com/b");
 
-  var visit2 = dayNode.getChild(3);
+  visit2 = dayNode.getChild(3);
   do_check_eq(visit2.uri, "http://mirror0.google.com/a");
 
   dayNode.containerOpen = false;
   root.containerOpen = false;
 }
 
 /**
  * Queries history grouped by site, checking containers' labels and children.
@@ -326,17 +326,17 @@ function test_RESULTS_AS_SITE_QUERY() {
   do_check_eq(siteNode.childCount, 2);
 
   // Inside of host sites are sorted by title
   var visitNode = siteNode.getChild(0);
   do_check_eq(visitNode.uri, "http://mirror3.google.com/a");
 
   // Bug 473157: changing sorting mode should not affect the containers
   result.sortingMode = options.SORT_BY_TITLE_DESCENDING;
-  var siteNode = root.getChild(6)
+  siteNode = root.getChild(6)
                      .QueryInterface(Ci.nsINavHistoryContainerResultNode);
   do_check_eq(siteNode.title, "mirror3.google.com");
 
   siteNode.containerOpen = true;
   do_check_eq(siteNode.childCount, 2);
 
   // But URLs are now sorted by title descending
   var visit = siteNode.getChild(0);
--- a/toolkit/components/places/tests/unit/test_placeURIs.js
+++ b/toolkit/components/places/tests/unit/test_placeURIs.js
@@ -30,13 +30,13 @@ function run_test() {
   var options = histsvc.getNewQueryOptions();
   options.sortingAnnotation = "test anno";
   options.sortingMode = NHQO.SORT_BY_ANNOTATION_DESCENDING;
   var placeURI =
     "place:folder=PLACES_ROOT&sort=" + NHQO.SORT_BY_ANNOTATION_DESCENDING +
     "&sortingAnnotation=test%20anno";
   do_check_eq(histsvc.queriesToQueryString([query], 1, options),
               placeURI);
-  var options = {};
+  options = {};
   histsvc.queryStringToQueries(placeURI, { }, {}, options);
   do_check_eq(options.value.sortingAnnotation, "test anno");
   do_check_eq(options.value.sortingMode, NHQO.SORT_BY_ANNOTATION_DESCENDING);
 }
--- a/toolkit/components/printing/content/printProgress.js
+++ b/toolkit/components/printing/content/printProgress.js
@@ -23,22 +23,20 @@ function ellipseString(aStr, doFront)
   if (aStr.length > 3 && (aStr.substr(0, 3) == "..." || aStr.substr(aStr.length-4, 3) == "...")) {
     return aStr;
   }
 
   var fixedLen = 64;
   if (aStr.length > fixedLen) {
     if (doFront) {
       var endStr = aStr.substr(aStr.length-fixedLen, fixedLen);
-      var str = "..." + endStr;
-      return str;
+      return "..." + endStr;
     } else {
       var frontStr = aStr.substr(0, fixedLen);
-      var str = frontStr + "...";
-      return str;
+      return frontStr + "...";
     }
   }
   return aStr;
 }
 
 // all progress notifications are done through the nsIWebProgressListener implementation...
 var progressListener = {
     onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
--- a/toolkit/components/printing/content/printUtils.js
+++ b/toolkit/components/printing/content/printUtils.js
@@ -372,25 +372,25 @@ var PrintUtils = {
                               .getService(Components.interfaces.nsIPromptService);
     promptSvc.alert(window, title, msg);
   },
 
   receiveMessage(aMessage) {
     if (aMessage.name == "Printing:Error") {
       this.displayPrintingError(aMessage.data.nsresult,
                                 aMessage.data.isPrinting);
-      return;
+      return undefined;
     }
 
     // If we got here, then the message we've received must involve
     // updating the print progress UI.
     if (!this._webProgressPP.value) {
       // We somehow didn't get a nsIWebProgressListener to be updated...
       // I guess there's nothing to do.
-      return;
+      return undefined;
     }
 
     let listener = this._webProgressPP.value;
     let mm = aMessage.target.messageManager;
     let data = aMessage.data;
 
     switch (aMessage.name) {
       case "Printing:Preview:ProgressChange": {
--- a/toolkit/components/reader/JSDOMParser.js
+++ b/toolkit/components/reader/JSDOMParser.js
@@ -693,22 +693,22 @@
       var arr = [];
       getHTML(this);
       return arr.join("");
     },
 
     set innerHTML(html) {
       var parser = new JSDOMParser();
       var node = parser.parse(html);
-      for (var i = this.childNodes.length; --i >= 0;) {
+      for (let i = this.childNodes.length; --i >= 0;) {
         this.childNodes[i].parentNode = null;
       }
       this.childNodes = node.childNodes;
       this.children = node.children;
-      for (var i = this.childNodes.length; --i >= 0;) {
+      for (let i = this.childNodes.length; --i >= 0;) {
         this.childNodes[i].parentNode = this;
       }
     },
 
     set textContent(text) {
       // clear parentNodes for existing children
       for (var i = this.childNodes.length; --i >= 0;) {
         this.childNodes[i].parentNode = null;
@@ -1083,17 +1083,17 @@
       var c = this.nextChar();
 
       if (c === undefined)
         return null;
 
       // Read any text as Text node
       if (c !== "<") {
         --this.currentChar;
-        var node = new Text();
+        let node = new Text();
         var n = this.html.indexOf("<", this.currentChar);
         if (n === -1) {
           node.innerHTML = this.html.substring(this.currentChar, this.html.length);
           this.currentChar = this.html.length;
         } else {
           node.innerHTML = this.html.substring(this.currentChar, n);
           this.currentChar = n;
         }
--- a/toolkit/components/reader/Readability.js
+++ b/toolkit/components/reader/Readability.js
@@ -365,17 +365,17 @@ Readability.prototype = {
       // <p> block.
       var replaced = false;
 
       // If we find a <br> chain, remove the <br>s until we hit another element
       // or non-whitespace. This leaves behind the first <br> in the chain
       // (which will be replaced with a <p> later).
       while ((next = this._nextElement(next)) && (next.tagName == "BR")) {
         replaced = true;
-        var sibling = next.nextSibling;
+        let sibling = next.nextSibling;
         next.parentNode.removeChild(next);
         next = sibling;
       }
 
       // If we removed a <br> chain, replace the remaining <br> with a <p>. Add
       // all sibling nodes as children of the <p> until we hit another <br>
       // chain.
       if (replaced) {
@@ -387,17 +387,17 @@ Readability.prototype = {
           // If we've hit another <br><br>, we're done adding children to this <p>.
           if (next.tagName == "BR") {
             var nextElem = this._nextElement(next);
             if (nextElem && nextElem.tagName == "BR")
               break;
           }
 
           // Otherwise, make this node a child of the new <p>.
-          var sibling = next.nextSibling;
+          let sibling = next.nextSibling;
           p.appendChild(next);
           next = sibling;
         }
       }
     });
   },
 
   _setNodeTag: function (node, tag) {
@@ -1136,17 +1136,17 @@ Readability.prototype = {
    * This is the amount of text that is inside a link divided by the total text in the node.
    *
    * @param Element
    * @return number (float)
   **/
   _getLinkDensity: function(element) {
     var textLength = this._getInnerText(element).length;
     if (textLength === 0)
-      return;
+      return undefined;
 
     var linkLength = 0;
 
     // XXX implement _reduceNodeList?
     this._forEachNode(element.getElementsByTagName("a"), function(linkNode) {
       linkLength += this._getInnerText(linkNode).length;
     });
 
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -329,17 +329,17 @@ function makeMoveToDeletedStatement(aGui
     let queryTerms = makeQueryPredicates(aData);
 
     if (aGuid) {
       query += " VALUES (:guid, :timeDeleted)";
     } else {
       // TODO: Add these items to the deleted items table once we've sorted
       //       out the issues from bug 756701
       if (!queryTerms)
-        return;
+        return undefined;
 
       query += " SELECT guid, :timeDeleted FROM moz_formhistory WHERE " + queryTerms;
     }
 
     aData.timeDeleted = aNow;
 
     return dbCreateAsyncStatement(query, aData, aBindingArrays);
   }
--- a/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
+++ b/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
@@ -342,17 +342,17 @@ function runTest() {
         doKey("down");
       });
       break;
 
     case 201:
       // Adding an attribute after the first one while on the first then going
       // down and push enter. Value should be the on from the new suggestion.
       doKey("down");
-      var datalist = document.getElementById('suggest');
+      datalist = document.getElementById('suggest');
       var added = new Option("Foo");
       datalist.insertBefore(added, datalist.children[1]);
 
       SimpleTest.executeSoon(function() {
         doKey("down");
         doKey("down");
         doKey("return");
         checkForm("Foo");
@@ -363,50 +363,50 @@ function runTest() {
         restoreForm();
         doKey("down");
       });
       break;
 
     case 202:
       // Change the first element value attribute.
       doKey("down");
-      var datalist = document.getElementById('suggest');
+      datalist = document.getElementById('suggest');
       prevValue = datalist.children[0].value;
       datalist.children[0].value = "foo";
       expectPopup();
       break;
 
     case 203:
       doKey("down");
       doKey("return");
       checkForm("foo");
 
-      var datalist = document.getElementById('suggest');
+      datalist = document.getElementById('suggest');
       datalist.children[0].value = prevValue;
       expectPopup();
       restoreForm();
       doKey("down");
       break;
 
     case 204:
       // Change the textContent to update the value attribute.
       doKey("down");
-      var datalist = document.getElementById('suggest');
+      datalist = document.getElementById('suggest');
       prevValue = datalist.children[0].getAttribute('value');
       datalist.children[0].removeAttribute('value');
       datalist.children[0].textContent = "foobar";
       expectPopup();
       break;
 
     case 205:
       doKey("down");
       doKey("return");
       checkForm("foobar");
 
-      var datalist = document.getElementById('suggest');
+      datalist = document.getElementById('suggest');
       datalist.children[0].setAttribute('value', prevValue);
       testNum = 299;
       expectPopup();
       restoreForm();
       doKey("down");
       break;
 
     // Tests for filtering (or not).
--- a/toolkit/components/satchel/test/test_form_submission.html
+++ b/toolkit/components/satchel/test/test_form_submission.html
@@ -109,20 +109,20 @@
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
   <!-- input with sensitive data (15 digit credit card number) -->
   <form id="form16" onsubmit="return checkSubmit(16)">
     <script type="text/javascript">
-      var form = document.getElementById('form16');
-      for (var i = 0; i != 10; i++)
+      form = document.getElementById('form16');
+      for (i = 0; i != 10; i++)
       {
-        var input = document.createElement('input');
+        input = document.createElement('input');
         input.type = 'text';
         input.name = 'test' + (i + 1);
         form.appendChild(input);
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
@@ -211,36 +211,36 @@
     <input type="text" name="test6">
     <button type="submit">Submit</button>
   </form>
 
   <!-- input that looks like sensitive data but doesn't
        satisfy the requirements (Luhn check fails for 16 chars) -->
   <form id="form107" onsubmit="return checkSubmit(107)">
     <script type="text/javascript">
-      var form = document.getElementById('form107');
-      for (var i = 0; i != 10; i++)
+      form = document.getElementById('form107');
+      for (i = 0; i != 10; i++)
       {
-        var input = document.createElement('input');
+        input = document.createElement('input');
         input.type = 'text';
         input.name = 'test7_' + (i + 1);
         form.appendChild(input);
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
   <!-- input that looks like sensitive data but doesn't
        satisfy the requirements (Luhn check fails for 15 chars) -->
   <form id="form108" onsubmit="return checkSubmit(108)">
     <script type="text/javascript">
-      var form = document.getElementById('form108');
-      for (var i = 0; i != 10; i++)
+      form = document.getElementById('form108');
+      for (i = 0; i != 10; i++)
       {
-        var input = document.createElement('input');
+        input = document.createElement('input');
         input.type = 'text';
         input.name = 'test8_' + (i + 1);
         form.appendChild(input);
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
@@ -325,17 +325,17 @@ function startTest() {
   $_(14, "test1").value = "dontSaveThis";
 
   var testData = ccNumbers.valid16;
   for (var i = 0; i != testData.length; i++) {
     $_(15, "test" + (i + 1)).value = testData[i];
   }
 
   testData = ccNumbers.valid15;
-  for (var i = 0; i != testData.length; i++) {
+  for (i = 0; i != testData.length; i++) {
     $_(16, "test" + (i + 1)).value = testData[i];
   }
   $_(17, "test1").value = "001064088";
   $_(18, "test1").value = "0000-0000-0080-4609";
   $_(19, "test1").value = "0000 0000 0222 331";
   $_(20, "test1").value = "dontSaveThis";
   $_(22, "test1").value = "dontSaveThis";
   $_(23, "test1").value = "dontSaveThis";
@@ -343,23 +343,23 @@ function startTest() {
 
   $_(101, "test1").value = "savedValue";
   $_(102, "test2").value = "savedValue";
   $_(103, "test3").value = "savedValue";
   $_(104, "test4").value = " trimTrailingAndLeadingSpace ";
   $_(105, "test5").value = "\t trimTrailingAndLeadingWhitespace\t ";
   $_(106, "test6").value = "00000000109181";
 
-  var testData = ccNumbers.invalid16;
-  for (var i = 0; i != testData.length; i++) {
+  testData = ccNumbers.invalid16;
+  for (i = 0; i != testData.length; i++) {
     $_(107, "test7_" + (i + 1)).value = testData[i];
   }
 
-  var testData = ccNumbers.invalid15;
-  for (var i = 0; i != testData.length; i++) {
+  testData = ccNumbers.invalid15;
+  for (i = 0; i != testData.length; i++) {
     $_(108, "test8_" + (i + 1)).value = testData[i];
   }
 
   $_(109, "test9").value = "savedValue";
   $_(110, "test10").value = "savedValue";
 
   // submit the first form.
   var button = getFormSubmitButton(1);
@@ -430,17 +430,17 @@ function checkSubmit(formNum) {
         checkForSave("test6", "00000000109181", "checking saved value");
         break;
     case 107:
         for (var i = 0; i != ccNumbers.invalid16.length; i++) {
           checkForSave("test7_" + (i + 1), ccNumbers.invalid16[i], "checking saved value");
         }
         break;
     case 108:
-        for (var i = 0; i != ccNumbers.invalid15.length; i++) {
+        for (i = 0; i != ccNumbers.invalid15.length; i++) {
           checkForSave("test8_" + (i + 1), ccNumbers.invalid15[i], "checking saved value");
         }
         break;
     case 109:
         checkForSave("test9", "savedValue", "checking saved value");
         break;
     case 110:
         checkForSave("test10", "savedValue", "checking saved value");
--- a/toolkit/components/satchel/test/unit/test_notify.js
+++ b/toolkit/components/satchel/test/unit/test_notify.js
@@ -53,18 +53,18 @@ try {
 var testnum = 0;
 var testdesc = "Setup of test form history entries";
 
 var entry1 = ["entry1", "value1"];
 var entry2 = ["entry2", "value2"];
 
 
 /* ========== 1 ========== */
-var testnum = 1;
-var testdesc = "Initial connection to storage module"
+testnum = 1;
+testdesc = "Initial connection to storage module"
 
 yield updateEntry("remove", null, null, next_test);
 yield countEntries(null, null, function (num) { do_check_false(num, "Checking initial DB is empty"); next_test(); });
 
 // Add the observer
 var os = Cc["@mozilla.org/observer-service;1"].
          getService(Ci.nsIObserverService);
 os.addObserver(TestObserver, "satchel-storage-changed", false);
--- a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js
+++ b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js
@@ -23,17 +23,17 @@ function test_expired_histogram() {
   do_check_eq(Telemetry.histogramSnapshots[clone_id], undefined);
   do_check_eq(rh[test_expired_id], undefined);
 }
 
 function test_histogram(histogram_type, name, min, max, bucket_count) {
   var h = Telemetry.newHistogram(name, "never", histogram_type, min, max, bucket_count);
   var r = h.snapshot().ranges;
   var sum = 0;
-  for(var i=0;i<r.length;i++) {
+  for(let i=0;i<r.length;i++) {
     var v = r[i];
     sum += v;
     h.add(v);
   }
   var s = h.snapshot();
   // verify properties
   do_check_eq(sum, s.sum);
   if (histogram_type == Telemetry.HISTOGRAM_EXPONENTIAL) {
@@ -41,36 +41,36 @@ function test_histogram(histogram_type, 
     do_check_false("sum_squares_hi" in s);
   } else {
     // Doing the math to verify sum_squares was reflected correctly is
     // tedious in JavaScript.  Just make sure we have something.
     do_check_neq(s.sum_squares_lo + s.sum_squares_hi, 0);
   }
 
   // there should be exactly one element per bucket
-  for (var i of s.counts) {
+  for (let i of s.counts) {
     do_check_eq(i, 1);
   }
   var hgrams = Telemetry.histogramSnapshots
   gh = hgrams[name]
   do_check_eq(gh.histogram_type, histogram_type);
 
   do_check_eq(gh.min, min)
   do_check_eq(gh.max, max)
 
   // Check that booleans work with nonboolean histograms
   h.add(false);
   h.add(true);
-  var s = h.snapshot().counts;
+  s = h.snapshot().counts;
   do_check_eq(s[0], 2)
   do_check_eq(s[1], 2)
 
   // Check that clearing works.
   h.clear();
-  var s = h.snapshot();
+  s = h.snapshot();
   for (var i of s.counts) {
     do_check_eq(i, 0);
   }
   do_check_eq(s.sum, 0);
   if (histogram_type != Telemetry.HISTOGRAM_EXPONENTIAL) {
     do_check_eq(s.sum_squares_lo, 0);
     do_check_eq(s.sum_squares_hi, 0);
   }
--- a/toolkit/components/thumbnails/test/browser_thumbnails_storage.js
+++ b/toolkit/components/thumbnails/test/browser_thumbnails_storage.js
@@ -58,17 +58,17 @@ function* runTests() {
     yield promiseClearFile(file, URL);    
 
     info("Done");
   });
 }
 
 var promiseClearFile = Task.async(function*(aFile, aURL) {
   if (!aFile.exists()) {
-    return;
+    return undefined;
   }
   // Re-add our URL to the history so that history observer's onDeleteURI()
   // is called again.
   yield PlacesTestUtils.addVisits(makeURI(aURL));
   yield promiseClearHistory(true);
   // Then retry.
   return promiseClearFile(aFile, aURL);
 });
--- a/toolkit/components/viewsource/content/viewSource.js
+++ b/toolkit/components/viewsource/content/viewSource.js
@@ -296,17 +296,17 @@ ViewSourceChrome.prototype = {
         viewSourceNavigation.setAttribute("disabled", "true");
         viewSourceNavigation.setAttribute("hidden", "true");
       }
     }
 
     // We require the first argument to do any loading of source.
     // otherwise, we're done.
     if (!window.arguments[0]) {
-      return;
+      return undefined;
     }
 
     if (typeof window.arguments[0] == "string") {
       // We're using the deprecated API
       return this._loadViewSourceDeprecated(window.arguments);
     }
 
     // We're using the modern API, which allows us to view the
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -624,25 +624,25 @@ var FindBar = {
       should = BrowserUtils.shouldFastFind(elt, win);
     }
     return { can, should }
   },
 
   _onKeypress(event) {
     // Useless keys:
     if (event.ctrlKey || event.altKey || event.metaKey || event.defaultPrevented) {
-      return;
+      return undefined;
     }
 
     // Check the focused element etc.
     let fastFind = this._canAndShouldFastFind();
 
     // Can we even use find in this page at all?
     if (!fastFind.can) {
-      return;
+      return undefined;
     }
 
     let fakeEvent = {};
     for (let k in event) {
       if (typeof event[k] != "object" && typeof event[k] != "function" &&
           !(k in content.KeyboardEvent)) {
         fakeEvent[k] = event[k];
       }
@@ -961,17 +961,17 @@ var ViewSelectionSource = {
 
     // walk up the tree to the top-level element (e.g., <math>, <svg>)
     var topTag = "math";
     var topNode = this._targetNode;
     while (topNode && topNode.localName != topTag) {
       topNode = topNode.parentNode;
     }
     if (!topNode)
-      return;
+      return undefined;
 
     // serialize
     const VIEW_SOURCE_CSS = "resource://gre-resources/viewsource.css";
     const BUNDLE_URL = "chrome://global/locale/viewSource.properties";
 
     let bundle = Services.strings.createBundle(BUNDLE_URL);
     var title = bundle.GetStringFromName("viewMathMLSourceTitle");
     var wrapClass = this.wrapLongLines ? ' class="wrap"' : '';
--- a/toolkit/content/customizeToolbar.js
+++ b/toolkit/content/customizeToolbar.js
@@ -724,17 +724,17 @@ function onToolbarDrop(aEvent)
   while (toolbar.localName != "toolbar")
     toolbar = toolbar.parentNode;
 
   var draggedPaletteWrapper = document.getElementById("wrapper-"+draggedItemId);
   if (!draggedPaletteWrapper) {
     // The wrapper has been dragged from the toolbar.
     // Get the wrapper from the toolbar document and make sure that
     // it isn't being dropped on itself.
-    var wrapper = gToolboxDocument.getElementById("wrapper-"+draggedItemId);
+    let wrapper = gToolboxDocument.getElementById("wrapper-"+draggedItemId);
     if (wrapper == gCurrentDragOverItem)
        return;
 
     // Don't allow non-removable kids (e.g., the menubar) to move.
     if (wrapper.firstChild.getAttribute("removable") != "true")
       return;
 
     // Remove the item from its place in the toolbar.
@@ -751,17 +751,17 @@ function onToolbarDrop(aEvent)
     if (gCurrentDragOverItem != dropToolbar)
       dropToolbar.insertBefore(wrapper, gCurrentDragOverItem);
     else
       dropToolbar.appendChild(wrapper);
   } else {
     // The item has been dragged from the palette
 
     // Create a new wrapper for the item. We don't know the id yet.
-    var wrapper = createWrapper("", gToolboxDocument);
+    let wrapper = createWrapper("", gToolboxDocument);
 
     // Ask the toolbar to clone the item's template, place it inside the wrapper, and insert it in the toolbar.
     var newItem = toolbar.insertItem(draggedItemId, gCurrentDragOverItem == toolbar ? null : gCurrentDragOverItem, wrapper);
 
     // Prepare the item and wrapper to look good on the toolbar.
     cleanupItemForToolbar(newItem, wrapper);
     wrapper.id = "wrapper-"+newItem.id;
     wrapper.flex = newItem.flex;
--- a/toolkit/content/tests/widgets/tree_shared.js
+++ b/toolkit/content/tests/widgets/tree_shared.js
@@ -387,18 +387,18 @@ function testtag_tree_TreeSelection_UI(t
   selection.select(4);
   synthesizeKeyExpectEvent("VK_UP", { accelKey: true }, tree, "!select", "key up with accel");
   testtag_tree_TreeSelection_State(tree, testid + "key up with accel", multiple ? 3 : 4, [4]);
   if (!multiple)
     is(tree.treeBoxObject.getFirstVisibleRow(), 3, testid + "key up with accel and scroll");
 
   // do this three times, one for each state of pageUpOrDownMovesSelection,
   // and then once with the accel key pressed
-  for (var t = 0; t < 3; t++) {
-    var testidmod = (t == 2) ? " with accel" : (t == 1) ? " rev" : "";
+  for (let t = 0; t < 3; t++) {
+    let testidmod = (t == 2) ? " with accel" : (t == 1) ? " rev" : "";
     var keymod = (t == 2) ? { accelKey: true } : { };
 
     var moveselection = tree.pageUpOrDownMovesSelection;
     if (t == 2)
       moveselection = !moveselection;
 
     tree.treeBoxObject.scrollToRow(4);
     selection.currentIndex = 6;
@@ -481,18 +481,18 @@ function testtag_tree_TreeSelection_UI(t
     testtag_tree_TreeSelection_State(tree, testid + "key shift down to unselect", 1, [1]);
     is(selection.shiftSelectPivot, 1, testid + "key shift down to unselect shiftSelectPivot");
   }
 
   // do this twice, one for each state of pageUpOrDownMovesSelection, however
   // when selecting with the shift key, pageUpOrDownMovesSelection is ignored
   // and the selection always changes
   var lastidx = tree.view.rowCount - 1;
-  for (var t = 0; t < 2; t++) {
-    var testidmod = (t == 0) ? "" : " rev";
+  for (let t = 0; t < 2; t++) {
+    let testidmod = (t == 0) ? "" : " rev";
 
     // If the top or bottom visible row is the current row, pressing shift and
     // page down / page up selects one page up or one page down. Otherwise, the
     // selection is made to the top or bottom of the visible area.
     tree.treeBoxObject.scrollToRow(lastidx - 3);
     selection.currentIndex = 6;
     selection.select(6);
     synthesizeKeyExpectEvent("VK_PAGE_UP", { shiftKey: true }, tree, eventExpected, "key shift page up");
@@ -775,17 +775,17 @@ function testtag_tree_TreeSelection_UI_c
     synthesizeKeyExpectEvent("VK_PAGE_UP", {}, tree, "!select", "key page up");
     testtag_tree_TreeSelection_State(tree, testid + "key page up" + testidmod,
                                      expectedrow, [expectedrow],
                                      tree.pageUpOrDownMovesSelection ? lastidx - 3 : 0, lastcolumn);
 
     tree.treeBoxObject.scrollToRow(1);
     selection.select(1);
     selection.currentIndex = 1;
-    var expectedrow = tree.pageUpOrDownMovesSelection ? 4 : 1;
+    expectedrow = tree.pageUpOrDownMovesSelection ? 4 : 1;
     synthesizeKeyExpectEvent("VK_PAGE_DOWN", {}, tree, "!select", "key page down");
     testtag_tree_TreeSelection_State(tree, testid + "key page down" + testidmod,
                                      expectedrow, [expectedrow],
                                      tree.pageUpOrDownMovesSelection ? 1 : lastidx - 3, lastcolumn);
 
     tree.pageUpOrDownMovesSelection = !tree.pageUpOrDownMovesSelection;
   }
 
@@ -1099,52 +1099,52 @@ function testtag_tree_column_reorder()
   var numColumns = tree.columns.count;
 
   var reference = [];
   for (var i = 0; i < numColumns; i++) {
     reference.push("col_" + i);
   }
 
   // Drag the first column to each position
-  for (var i = 0; i < numColumns - 1; i++) {
+  for (let i = 0; i < numColumns - 1; i++) {
     synthesizeColumnDrag(tree, i, i + 1, true);
     arrayMove(reference, i, i + 1, true);
     checkColumns(tree, reference, "drag first column right");
   }
 
   // And back
-  for (var i = numColumns - 1; i >= 1; i--) {
+  for (let i = numColumns - 1; i >= 1; i--) {
     synthesizeColumnDrag(tree, i, i - 1, false);
     arrayMove(reference, i, i - 1, false);
     checkColumns(tree, reference, "drag last column left");
   }
 
   // Drag each column one column left
-  for (var i = 1; i < numColumns; i++) {
+  for (let i = 1; i < numColumns; i++) {
     synthesizeColumnDrag(tree, i, i - 1, false);
     arrayMove(reference, i, i - 1, false);
     checkColumns(tree, reference, "drag each column left");
   }
 
   // And back
-  for (var i = numColumns - 2; i >= 0; i--) {
+  for (let i = numColumns - 2; i >= 0; i--) {
     synthesizeColumnDrag(tree, i, i + 1, true);
     arrayMove(reference, i, i + 1, true);
     checkColumns(tree, reference, "drag each column right");
   }
 
   // Drag each column 5 to the right
-  for (var i = 0; i < numColumns - 5; i++) {
+  for (let i = 0; i < numColumns - 5; i++) {
     synthesizeColumnDrag(tree, i, i + 5, true);
     arrayMove(reference, i, i + 5, true);
     checkColumns(tree, reference, "drag each column 5 to the right");
   }
 
   // And to the left
-  for (var i = numColumns - 6; i >= 5; i--) {
+  for (let i = numColumns - 6; i >= 5; i--) {
     synthesizeColumnDrag(tree, i, i - 5, false);
     arrayMove(reference, i, i - 5, false);
     checkColumns(tree, reference, "drag each column 5 to the left");
   }
 
   // Test that moving a column after itself does not move anything
   synthesizeColumnDrag(tree, 0, 0, true);
   checkColumns(tree, reference, "drag to itself");
@@ -1230,24 +1230,24 @@ function synthesizeColumnDrag(aTree, aMo
   synthesizeMouse(down, splitterHitWidth, 3, { type: "mousedown"});
 
   var offsetX = 0;
   if (aAfter) {
     offsetX = columnWidth;
   }
 
   if (aMouseUpColumnNumber > aMouseDownColumnNumber) {
-    for (var i = aMouseDownColumnNumber; i <= aMouseUpColumnNumber; i++) {
-      var move = columns[i].element;
+    for (let i = aMouseDownColumnNumber; i <= aMouseUpColumnNumber; i++) {
+      let move = columns[i].element;
       synthesizeMouse(move, offsetX, 3, { type: "mousemove"});
     }
   }
   else {
-    for (var i = aMouseDownColumnNumber; i >= aMouseUpColumnNumber; i--) {
-      var move = columns[i].element;
+    for (let i = aMouseDownColumnNumber; i >= aMouseUpColumnNumber; i--) {
+      let move = columns[i].element;
       synthesizeMouse(move, offsetX, 3, { type: "mousemove"});
     }
   }
 
   synthesizeMouse(up, offsetX, 3, { type: "mouseup"});
 }
 
 function arrayMove(aArray, aFrom, aTo, aAfter)
--- a/toolkit/content/treeUtils.js
+++ b/toolkit/content/treeUtils.js
@@ -19,26 +19,26 @@ var gTreeUtils = {
   {
     var selection = aTree.view.selection;
     selection.selectEventsSuppressed = true;
 
     var rc = selection.getRangeCount();
     for (var i = 0; i < rc; ++i) {
       var min = { }; var max = { };
       selection.getRangeAt(i, min, max);
-      for (var j = min.value; j <= max.value; ++j) {
+      for (let j = min.value; j <= max.value; ++j) {
         aDeletedItems.push(aItems[j]);
         aItems[j] = null;
       }
     }
 
     var nextSelection = 0;
     for (i = 0; i < aItems.length; ++i) {
       if (!aItems[i]) {
-        var j = i;
+        let j = i;
         while (j < aItems.length && !aItems[j])
           ++j;
         aItems.splice(i, j - i);
         nextSelection = j < aView.rowCount ? j - 1 : j - 2;
         aView._rowCount -= j - i;
         aTree.treeBoxObject.rowCountChanged(i, i - j);
       }
     }
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -1194,17 +1194,17 @@
               "_textZoom",
               "_isSyntheticDocument",
               "_innerWindowID",
             ]);
           }
 
           var ourFieldValues = {};
           var otherFieldValues = {};
-          for (var field of fieldsToSwap) {
+          for (let field of fieldsToSwap) {
             ourFieldValues[field] = this[field];
             otherFieldValues[field] = aOtherBrowser[field];
           }
 
           if (window.PopupNotifications)
             PopupNotifications._swapBrowserNotifications(aOtherBrowser, this);
 
           this.QueryInterface(Components.interfaces.nsIFrameLoaderOwner)
@@ -1212,17 +1212,17 @@
 
           // Before we swap the actual docShell property we need to detach the
           // form fill controller from those docShells.
           if (!this.isRemoteBrowser) {
             this.detachFormFill();
             aOtherBrowser.detachFormFill();
           }
 
-          for (var field of fieldsToSwap) {
+          for (let field of fieldsToSwap) {
             this[field] = otherFieldValues[field];
             aOtherBrowser[field] = ourFieldValues[field];
           }
 
           // Re-attach the docShells to the form fill controller.
           if (!this.isRemoteBrowser) {
             this.attachFormFill();
             aOtherBrowser.attachFormFill();
--- a/toolkit/content/widgets/datetimepicker.xml
+++ b/toolkit/content/widgets/datetimepicker.xml
@@ -668,25 +668,25 @@
         </body>
       </method>
       <method name="_setFieldValue">
         <parameter name="aField"/>
         <parameter name="aValue"/>
         <body>
           <![CDATA[
             if (aField == this.yearField) {
-              var oldDate = this.date;
+              let oldDate = this.date;
               this._dateValue.setFullYear(aValue);
               if (oldDate != this.date) {
                 this._dateValue.setDate(0);
                 this._updateUI(this.dateField, this.date);
               }
             }
             else if (aField == this.monthField) {
-              var oldDate = this.date;
+              let oldDate = this.date;
               this._dateValue.setMonth(aValue);
               if (oldDate != this.date) {
                 this._dateValue.setDate(0);
                 this._updateUI(this.dateField, this.date);
               }
             }
             else if (aField == this.dateField) {
               this._dateValue.setDate(aValue);
--- a/toolkit/content/widgets/findbar.xml
+++ b/toolkit/content/widgets/findbar.xml
@@ -794,17 +794,17 @@
         ]]></body>
       </method>
 
       <!-- See nsIMessageListener -->
       <method name="receiveMessage">
         <parameter name="aMessage"/>
         <body><![CDATA[
           if (aMessage.target != this._browser) {
-            return;
+            return undefined;
           }
           switch (aMessage.name) {
             case "Findbar:Mouseup":
               if (!this.hidden && this._findMode != this.FIND_NORMAL)
                 this.close();
               break;
 
             case "Findbar:Keypress":
@@ -1094,17 +1094,17 @@
           if (!findString)
             return this.startFind();
 
           // We dispatch the findAgain event here instead of in _findAgain since
           // if there is a find event handler that prevents the default then
           // finder.searchString will never get updated which in turn means
           // there would never be findAgain events because of the logic below.
           if (!this._dispatchFindEvent("again", aFindPrevious))
-            return;
+            return undefined;
 
           // user explicitly requested another search, so do it even if we think it'll fail
           this._findFailedString = null;
 
           // Ensure the stored SearchString is in sync with what we want to find
           if (this._findField.value != this._browser.finder.searchString)
             this._find(this._findField.value);
           else
--- a/toolkit/content/widgets/menulist.xml
+++ b/toolkit/content/widgets/menulist.xml
@@ -245,17 +245,17 @@
               this.removeAttribute('label');
               this.removeAttribute('description');
             }
 
             var event = document.createEvent("Events");
             event.initEvent("select", true, true);
             this.dispatchEvent(event);
 
-            var event = document.createEvent("Events");
+            event = document.createEvent("Events");
             event.initEvent("ValueChange", true, true);
             this.dispatchEvent(event);
 
             return val;
           ]]>
         </setter>
       </property>
 
@@ -510,17 +510,17 @@
               this.removeAttribute('value');
               this.removeAttribute('label');
             }
 
             var event = document.createEvent("Events");
             event.initEvent("select", true, true);
             this.dispatchEvent(event);
 
-            var event = document.createEvent("Events");
+            event = document.createEvent("Events");
             event.initEvent("ValueChange", true, true);
             this.dispatchEvent(event);
 
             return val;
           ]]>
         </setter>
       </property>
       <property name="disableautoselect"
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -322,17 +322,17 @@
           <![CDATA[
             var isblock = aNotification &&
                           aNotification.priority == this.PRIORITY_CRITICAL_BLOCK;
             var canvas = this._blockingCanvas;
             if (isblock) {
               if (!canvas)
                 canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
               const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-              var content = this.firstChild;
+              let content = this.firstChild;
               if (!content ||
                    content.namespaceURI != XULNS ||
                    content.localName != "browser")
                 return;
 
               var width = content.boxObject.width;
               var height = content.boxObject.height;
               content.collapsed = true;
@@ -356,17 +356,17 @@
                 context.drawWindow(win, win.scrollX, win.scrollY,
                                    width, height, bgcolor);
               }
               catch(ex) { };
             }
             else if (canvas) {
               canvas.parentNode.removeChild(canvas);
               this._blockingCanvas = null;
-              var content = this.firstChild;
+              let content = this.firstChild;
               if (content)
                 content.collapsed = false;
             }
           ]]>
         </body>
       </method>
 
     </implementation>
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -1066,39 +1066,39 @@
         if (!this._fireEvent("beforeaccept", this)){
           return false;
         }
 
         var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
                     .getService(Components.interfaces.nsIScriptSecurityManager);
         if (this.type == "child" && window.opener &&
             secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
-          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+          let psvc = Components.classes["@mozilla.org/preferences-service;1"]
                                .getService(Components.interfaces.nsIPrefBranch);
           var pdocEl = window.opener.document.documentElement;
           if (pdocEl.instantApply) {
-            var panes = this.preferencePanes;
-            for (var i = 0; i < panes.length; ++i)
+            let panes = this.preferencePanes;
+            for (let i = 0; i < panes.length; ++i)
               panes[i].writePreferences(true);
           }
           else {
             // Clone all the preferences elements from the child document and
             // insert them into the pane collection of the parent. 
             var pdoc = window.opener.document;
             if (pdoc.documentElement.localName == "prefwindow") {
               var currentPane = pdoc.documentElement.currentPane;
               var id = window.location.href + "#childprefs";
               var childPrefs = pdoc.getElementById(id);
               if (!childPrefs) {
-                var childPrefs = pdoc.createElement("preferences");
+                childPrefs = pdoc.createElement("preferences");
                 currentPane.appendChild(childPrefs);
                 childPrefs.id = id;
               }
-              var panes = this.preferencePanes;
-              for (var i = 0; i < panes.length; ++i) {
+              let panes = this.preferencePanes;
+              for (let i = 0; i < panes.length; ++i) {
                 var preferences = panes[i].preferences;
                 for (var j = 0; j < preferences.length; ++j) {
                   // Try to find a preference element for the same preference.
                   var preference = null;
                   var parentPreferences = pdoc.getElementsByTagName("preferences");
                   for (var k = 0; (k < parentPreferences.length && !preference); ++k) {
                     var parentPrefs = parentPreferences[k]
                                          .getElementsByAttribute("name", preferences[j].name);
@@ -1119,21 +1119,21 @@
                   }
                   preference.value = preferences[j].value;
                 }
               }
             }
           }
         }
         else {
-          var panes = this.preferencePanes;
+          let panes = this.preferencePanes;
           for (var i = 0; i < panes.length; ++i)
             panes[i].writePreferences(false);
 
-          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+          let psvc = Components.classes["@mozilla.org/preferences-service;1"]
                                .getService(Components.interfaces.nsIPrefService);
           psvc.savePrefFile(null);
         }
 
         return true;
       ]]>
       </handler>
       <handler event="command">
--- a/toolkit/content/widgets/richlistbox.xml
+++ b/toolkit/content/widgets/richlistbox.xml
@@ -352,17 +352,17 @@
             // first look for the last-selected attribute
             var state = this.getAttribute("last-selected");
             if (state) {
               var ids = state.split(" ");
 
               var suppressSelect = this._suppressOnSelect;
               this._suppressOnSelect = true;
               this.clearSelection();
-              for (var i = 1; i < ids.length; i++) {
+              for (let i = 1; i < ids.length; i++) {
                 var selectedItem = document.getElementById(ids[i]);
                 if (selectedItem)
                   this.addItemToSelection(selectedItem);
               }
 
               var currentItem = document.getElementById(ids[0]);
               if (!currentItem && this._currentIndex)
                 currentItem = this.getItemAtIndex(Math.min(
@@ -389,22 +389,22 @@
               this._fireOnSelect();
               return;
             }
 
             // try to restore the selected items according to their IDs
             // (applies after a template rebuild, if last-selected was not set)
             if (this.selectedItems) {
               let itemIds = [];
-              for (i = this.selectedCount - 1; i >= 0; i--) {
+              for (let i = this.selectedCount - 1; i >= 0; i--) {
                 let selectedItem = this.selectedItems[i];
                 itemIds.push(selectedItem.id);
                 this.selectedItems.remove(selectedItem);
               }
-              for (i = 0; i < itemIds.length; i++) {
+              for (let i = 0; i < itemIds.length; i++) {
                 let selectedItem = document.getElementById(itemIds[i]);
                 if (selectedItem) {
                   this.selectedItems.append(selectedItem);
                 }
               }
             }
             if (this.currentItem && this.currentItem.id)
               this.currentItem = document.getElementById(this.currentItem.id);
@@ -414,17 +414,17 @@
             // if we have no previously current item or if the above check fails to
             // find the previous nodes (which causes it to clear selection)
             if (!this.currentItem && this.selectedCount == 0) {
               this.currentIndex = this._currentIndex ? this._currentIndex - 1 : 0;
 
               // cf. listbox constructor:
               // select items according to their attributes
               var children = this.children;
-              for (var i = 0; i < children.length; ++i) {
+              for (let i = 0; i < children.length; ++i) {
                 if (children[i].getAttribute("selected") == "true")
                   this.selectedItems.append(children[i]);
               }
             }
 
             if (this.selType != "multiple" && this.selectedCount == 0)
               this.selectedItem = this.currentItem;
           ]]>
--- a/toolkit/content/widgets/tabbox.xml
+++ b/toolkit/content/widgets/tabbox.xml
@@ -179,17 +179,17 @@
                                      .direction == "ltr" ? -1 : 1;
                   this.tabs.advanceSelectedTab(offset, true);
                   event.preventDefault();
                 }
               break;
             case event.DOM_VK_RIGHT:
               if (event.metaKey && event.altKey && !event.shiftKey && !event.ctrlKey)
                 if (this.tabs && this._handleMetaAltArrows) {
-                  var offset = window.getComputedStyle(this, "")
+                  offset = window.getComputedStyle(this, "")
                                      .direction == "ltr" ? 1 : -1;
                   this.tabs.advanceSelectedTab(offset, true);
                   event.preventDefault();
                 }
               break;
           }
         ]]>
         </body>
--- a/toolkit/content/widgets/tree.xml
+++ b/toolkit/content/widgets/tree.xml
@@ -845,31 +845,31 @@
               var c = row + 1;
               var view = this.view;
               if (c < view.rowCount &&
                   view.getParentIndex(c) == row) {
                 // If already opened, select the first child.
                 // The getParentIndex test above ensures that the children
                 // are already populated and ready.
                 if (cellSelType && !this.view.isSelectable(c , currentColumn)) {
-                  var col = this._getNextColumn(c, false);
+                  let col = this._getNextColumn(c, false);
                   if (col) {
                     this.view.selection.currentColumn = col;
                   }
                 }
                 this.view.selection.timedSelect(c, this._selectDelay);
                 this.treeBoxObject.ensureRowIsVisible(c);
                 event.preventDefault();
                 return;
               }
             }
           }
 
           if (cellSelType) {
-            var col = this._getNextColumn(row, false);
+            let col = this._getNextColumn(row, false);
             if (col) {
               this.view.selection.currentColumn = col;
               this.treeBoxObject.ensureCellIsVisible(row, col);
               event.preventDefault();
             }
           }
         ]]>
       </handler>
--- a/toolkit/crashreporter/google-breakpad/src/third_party/glog/doc/glog.html
+++ b/toolkit/crashreporter/google-breakpad/src/third_party/glog/doc/glog.html
@@ -540,15 +540,15 @@ There are two known workarounds to avoid
 <p>See <a href="http://code.google.com/p/google-glog/issues/detail?id=33">
 this issue</a> for more detail.
 
 <hr>
 <address>
 Shinichiro Hamaji<br>
 Gregor Hohpe<br>
 <script type=text/javascript>
-  var lm = new Date(document.lastModified);
+  lm = new Date(document.lastModified);
   document.write(lm.toDateString());
 </script>
 </address>
 
 </body>
 </html>
--- a/toolkit/modules/BrowserUtils.jsm
+++ b/toolkit/modules/BrowserUtils.jsm
@@ -34,17 +34,17 @@ this.BrowserUtils = {
                        .createInstance(Ci.nsISupportsPRBool);
     Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
     if (cancelQuit.data) { // The quit request has been canceled.
       return false;
     }
     //if already in safe mode restart in safe mode
     if (Services.appinfo.inSafeMode) {
       appStartup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
-      return;
+      return undefined;
     }
     appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
   },
 
   /**
    * urlSecurityCheck: JavaScript wrapper for checkLoadURIWithPrincipal
    * and checkLoadURIStrWithPrincipal.
    * If |aPrincipal| is not allowed to link to |aURL|, this function throws with
--- a/toolkit/modules/Sqlite.jsm
+++ b/toolkit/modules/Sqlite.jsm
@@ -396,17 +396,17 @@ ConnectionData.prototype = Object.freeze
       return this._deferredClose.promise;
     }
 
     this._log.debug("Request to close connection.");
     this._clearIdleShrinkTimer();
 
     return this._barrier.wait().then(() => {
       if (!this._dbConn) {
-        return;
+        return undefined;
       }
       return this._finalize();
     });
   },
 
   clone: function (readOnly=false) {
     this.ensureOpen();
 
--- a/toolkit/modules/tests/browser/browser_WebRequest_cookies.js
+++ b/toolkit/modules/tests/browser/browser_WebRequest_cookies.js
@@ -8,17 +8,17 @@ const BASE = "http://example.com/browser
 const URL = BASE + "/WebRequest_dynamic.sjs";
 
 var countBefore = 0;
 var countAfter = 0;
 
 function onBeforeSendHeaders(details)
 {
   if (details.url != URL) {
-    return;
+    return undefined;
   }
 
   countBefore++;
 
   info(`onBeforeSendHeaders ${details.url}`);
   let found = false;
   let headers = [];
   for (let {name, value} of details.requestHeaders) {
--- a/toolkit/mozapps/downloads/content/helperApps.js
+++ b/toolkit/mozapps/downloads/content/helperApps.js
@@ -200,17 +200,17 @@ HelperApps.prototype = {
   },
    
   GetTarget: function (aSource, aProperty, aTruthValue) {
     if (this._isRootTypeResource(aSource)) {
       var typeInfo = this.getMIMEInfo(aSource);
       if (typeInfo) {
         var bundle = document.getElementById("strings");
         if (aProperty.EqualsNode(this._handleAutoArc)) {
-          var handler = this.GetTarget(aSource, this._handlerPropArc, true);
+          let handler = this.GetTarget(aSource, this._handlerPropArc, true);
           if (handler) {
             handler = handler.QueryInterface(Components.interfaces.nsIRDFResource);
             return gRDF.GetLiteral(!(this.getLiteralValue(handler.Value, "alwaysAsk") == "true"));
           }
         }
         else if (aProperty.EqualsNode(this._fileTypeArc)) {
           if (typeInfo.description == "") {
             try {
@@ -221,17 +221,17 @@ HelperApps.prototype = {
               // Wow, this sucks, just show the MIME type as a last ditch effort to display
               // the type of file that this is. 
               return gRDF.GetLiteral(typeInfo.MIMEType);
             }
           }
           return gRDF.GetLiteral(typeInfo.description);
         }
         else if (aProperty.EqualsNode(this._fileHandlerArc)) {
-          var handler = this.GetTarget(aSource, this._handlerPropArc, true);
+          let handler = this.GetTarget(aSource, this._handlerPropArc, true);
           if (handler) {
             handler = handler.QueryInterface(Components.interfaces.nsIRDFResource);
             if (this.getLiteralValue(handler.Value, "saveToDisk") == "true") {
               var saveToDisk = bundle.getString("saveToDisk");
               return gRDF.GetLiteral(saveToDisk);
             }
             else if (this.getLiteralValue(handler.Value, "useSystemDefault") == "false") {
               var extApp = this.GetTarget(handler, this._externalAppArc, true);
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -243,25 +243,25 @@ function callProvider(aProvider, aMethod
  *         The provider to call
  * @param  aMethod
  *         The method name to call
  */
 function callProviderAsync(aProvider, aMethod, ...aArgs) {
   let callback = aArgs[aArgs.length - 1];
   if (!(aMethod in aProvider)) {
     callback(undefined);
-    return;
+    return undefined;
   }
   try {
     return aProvider[aMethod].apply(aProvider, aArgs);
   }
   catch (e) {
     reportProviderError(aProvider, aMethod, e);
     callback(undefined);
-    return;
+    return undefined;
   }
 }
 
 /**
  * Calls a method on a provider if it exists and consumes any thrown exception.
  * Parameters after aMethod are passed to aProvider.aMethod() and an additional
  * callback is added for the provider to return a result to.
  *
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -1910,20 +1910,21 @@ var gCategories = {
 
     if (this.node.selectedItem &&
         this.node.selectedItem.value == aId) {
       this.node.selectedItem.hidden = false;
       this.node.selectedItem.disabled = false;
       return;
     }
 
+    var item;
     if (view.type == "search")
-      var item = this._search;
+      item = this._search;
     else
-      var item = this.get(aId);
+      item = this.get(aId);
 
     if (item) {
       item.hidden = false;
       item.disabled = false;
       this.node.suppressOnSelect = true;
       this.node.selectedItem = item;
       this.node.suppressOnSelect = false;
       this.node.ensureElementIsVisible(item);
@@ -3145,17 +3146,17 @@ var gDetailView = {
 
   updateState: function() {
     gViewController.updateCommands();
 
     var pending = this._addon.pendingOperations;
     if (pending != AddonManager.PENDING_NONE) {
       this.node.removeAttribute("notification");
 
-      var pending = null;
+      pending = null;
       const PENDING_OPERATIONS = ["enable", "disable", "install", "uninstall",
                                   "upgrade"];
       for (let op of PENDING_OPERATIONS) {
         if (isPending(this._addon, op))
           pending = op;
       }
 
       this.node.setAttribute("pending", pending);
@@ -3176,17 +3177,17 @@ var gDetailView = {
         errorLink.value = gStrings.ext.GetStringFromName("details.notification.blocked.link");
         errorLink.href = this._addon.blocklistURL;
         errorLink.hidden = false;
       } else if (!isCorrectlySigned(this._addon) && SIGNING_REQUIRED) {
         this.node.setAttribute("notification", "error");
         document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
           "details.notification.unsignedAndDisabled", [this._addon.name, gStrings.brandShortName], 2
         );
-        var errorLink = document.getElementById("detail-error-link");
+        let errorLink = document.getElementById("detail-error-link");
         errorLink.value = gStrings.ext.GetStringFromName("details.notification.unsigned.link");
         errorLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
         errorLink.hidden = false;
       } else if (!this._addon.isCompatible && (AddonManager.checkCompatibility ||
         (this._addon.blocklistState != Ci.nsIBlocklistService.STATE_SOFTBLOCKED))) {
         this.node.setAttribute("notification", "warning");
         document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
           "details.notification.incompatible",
@@ -3203,47 +3204,47 @@ var gDetailView = {
         warningLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
         warningLink.hidden = false;
       } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
         this.node.setAttribute("notification", "warning");
         document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
           "details.notification.softblocked",
           [this._addon.name], 1
         );
-        var warningLink = document.getElementById("detail-warning-link");
+        let warningLink = document.getElementById("detail-warning-link");
         warningLink.value = gStrings.ext.GetStringFromName("details.notification.softblocked.link");
         warningLink.href = this._addon.blocklistURL;
         warningLink.hidden = false;
       } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
         this.node.setAttribute("notification", "warning");
         document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
           "details.notification.outdated",
           [this._addon.name], 1
         );
-        var warningLink = document.getElementById("detail-warning-link");
+        let warningLink = document.getElementById("detail-warning-link");
         warningLink.value = gStrings.ext.GetStringFromName("details.notification.outdated.link");
         warningLink.href = Services.urlFormatter.formatURLPref("plugins.update.url");
         warningLink.hidden = false;
       } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE) {
         this.node.setAttribute("notification", "error");
         document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
           "details.notification.vulnerableUpdatable",
           [this._addon.name], 1
         );
-        var errorLink = document.getElementById("detail-error-link");
+        let errorLink = document.getElementById("detail-error-link");
         errorLink.value = gStrings.ext.GetStringFromName("details.notification.vulnerableUpdatable.link");
         errorLink.href = this._addon.blocklistURL;
         errorLink.hidden = false;
       } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE) {
         this.node.setAttribute("notification", "error");
         document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
           "details.notification.vulnerableNoUpdate",
           [this._addon.name], 1
         );
-        var errorLink = document.getElementById("detail-error-link");
+        let errorLink = document.getElementById("detail-error-link");
         errorLink.value = gStrings.ext.GetStringFromName("details.notification.vulnerableNoUpdate.link");
         errorLink.href = this._addon.blocklistURL;
         errorLink.hidden = false;
       } else if (this._addon.isGMPlugin && !this._addon.isInstalled &&
                  this._addon.isActive) {
         this.node.setAttribute("notification", "warning");
         let warning = document.getElementById("detail-warning");
         warning.textContent =
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -1174,17 +1174,17 @@
         <body><![CDATA[
           if (this.parentNode.selectedItem == this)
             gViewController.updateCommands();
 
           var pending = this.mAddon.pendingOperations;
           if (pending != AddonManager.PENDING_NONE) {
             this.removeAttribute("notification");
 
-            var pending = null;
+            pending = null;
             const PENDING_OPERATIONS = ["enable", "disable", "install",
                                         "uninstall", "upgrade"];
             for (let op of PENDING_OPERATIONS) {
               if (this.isPending(op))
                 pending = op;
             }
 
             this.setAttribute("pending", pending);
--- a/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
@@ -270,17 +270,17 @@ function sanitizeUpdateURL(aUpdate, aReq
  * @param  aManifestData
  *         The pre-parsed manifest, as a bare XML DOM document
  * @return an array of update objects
  * @throws if the update manifest is invalid in any way
  */
 function parseRDFManifest(aId, aUpdateKey, aRequest, aManifestData) {
   if (aManifestData.documentElement.namespaceURI != PREFIX_NS_RDF) {
     throw Components.Exception("Update manifest had an unrecognised namespace: " + xml.documentElement.namespaceURI);
-    return;
+    return undefined;
   }
 
   function EM_R(aProp) {
     return gRDF.GetResource(PREFIX_NS_EM + aProp);
   }
 
   function getValue(aLiteral) {
     if (aLiteral instanceof Ci.nsIRDFLiteral)
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -2880,21 +2880,21 @@ this.XPIProvider = {
     // Ensure any changes to the add-ons list are flushed to disk
     Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS,
                                !XPIDatabase.writeAddonsList());
   },
 
   updateSystemAddons: Task.async(function*() {
     let systemAddonLocation = XPIProvider.installLocationsByName[KEY_APP_SYSTEM_ADDONS];
     if (!systemAddonLocation)
-      return;
+      return undefined;
 
     // Don't do anything in safe mode
     if (Services.appinfo.inSafeMode)
-      return;
+      return undefined;
 
     // Download the list of system add-ons
     let url = Preferences.get(PREF_SYSTEM_ADDON_UPDATE_URL, null);
     if (!url)
       return systemAddonLocation.cleanDirectories();
 
     url = UpdateUtils.formatUpdateURL(url);
 
@@ -5380,17 +5380,17 @@ AddonInstall.prototype = {
       this.removeTemporaryFile();
       try {
         yield this.loadManifest(file);
         logger.debug("Base multi-package XPI install came from " + entryName);
         this.file = file;
         this.ownsTempFile = true;
 
         yield this._createLinkedInstalls(files.filter(f => f.file != file));
-        return;
+        return undefined;
       }
       catch (e) {
         // _createLinkedInstalls will log errors when it tries to process this
         // file
       }
     }
 
     // No valid add-on was found, delete all the temporary files
@@ -6881,17 +6881,17 @@ AddonWrapper.prototype = {
 
   get applyBackgroundUpdates() {
     return addonFor(this).applyBackgroundUpdates;
   },
   set applyBackgroundUpdates(val) {
     let addon = addonFor(this);
     if (this.type == "experiment") {
       logger.warn("Setting applyBackgroundUpdates on an experiment is not supported.");
-      return;
+      return addon.applyBackgroundUpdates;
     }
 
     if (val != AddonManager.AUTOUPDATE_DEFAULT &&
         val != AddonManager.AUTOUPDATE_DISABLE &&
         val != AddonManager.AUTOUPDATE_ENABLE) {
       val = val ? AddonManager.AUTOUPDATE_DEFAULT :
                   AddonManager.AUTOUPDATE_DISABLE;
     }
--- a/toolkit/mozapps/extensions/test/browser/browser_bug581076.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_bug581076.js
@@ -40,20 +40,21 @@ function search(aRemoteSearch, aCallback
   waitForFocus(function() {
     var searchBox = gManagerWindow.document.getElementById("header-search");
     searchBox.value = SEARCH_QUERY;
 
     EventUtils.synthesizeMouseAtCenter(searchBox, { }, gManagerWindow);
     EventUtils.synthesizeKey("VK_RETURN", { }, gManagerWindow);
 
     wait_for_view_load(gManagerWindow, function() {
+      let filter;
       if (aRemoteSearch)
-        var filter = gManagerWindow.document.getElementById("search-filter-remote");
+        filter = gManagerWindow.document.getElementById("search-filter-remote");
       else
-        var filter = gManagerWindow.document.getElementById("search-filter-local");
+        filter = gManagerWindow.document.getElementById("search-filter-local");
       EventUtils.synthesizeMouseAtCenter(filter, { }, gManagerWindow);
 
       executeSoon(aCallback);
     });
   }, gManagerWindow);
 }
 
 function check_allresultslink(aShouldShow) {
--- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
@@ -213,54 +213,54 @@ add_test(function() {
     is(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getBoolPref("extensions.inlinesettings1.bool"), true, "Bool pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(input, { clickCount: 1 }, gManagerWindow);
     isnot(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getBoolPref("extensions.inlinesettings1.bool"), false, "Bool pref should have been updated");
 
     ok(!settings[1].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setIntPref("extensions.inlinesettings1.boolint", 0);
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input");
     isnot(input.checked, true, "Checkbox should have initial value");
     EventUtils.synthesizeMouseAtCenter(input, { clickCount: 1 }, gManagerWindow);
     is(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.boolint"), 1, "BoolInt pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(input, { clickCount: 1 }, gManagerWindow);
     isnot(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.boolint"), 2, "BoolInt pref should have been updated");
 
     ok(!settings[2].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setIntPref("extensions.inlinesettings1.integer", 0);
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input");
     is(input.value, "0", "Number box should have initial value");
     input.select();
     EventUtils.synthesizeKey("1", {}, gManagerWindow);
     EventUtils.synthesizeKey("3", {}, gManagerWindow);
     is(input.value, "13", "Number box should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.integer"), 13, "Integer pref should have been updated");
     EventUtils.synthesizeKey("VK_DOWN", {}, gManagerWindow);
     is(input.value, "12", "Number box should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.integer"), 12, "Integer pref should have been updated");
 
     ok(!settings[3].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setCharPref("extensions.inlinesettings1.string", "foo");
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input");
     is(input.value, "foo", "Text box should have initial value");
     input.select();
     EventUtils.synthesizeKey("b", {}, gManagerWindow);
     EventUtils.synthesizeKey("a", {}, gManagerWindow);
     EventUtils.synthesizeKey("r", {}, gManagerWindow);
     is(input.value, "bar", "Text box should have updated value");
     EventUtils.synthesizeKey("/", {}, gManagerWindow);
     is(input.value, "bar/", "Text box should have updated value");
     is(gManagerWindow.document.getBindingParent(gManagerWindow.document.activeElement), input, "Search box should not have focus");
     is(Services.prefs.getCharPref("extensions.inlinesettings1.string"), "bar/", "String pref should have been updated");
 
     ok(!settings[4].hasAttribute("first-row"), "Not the first row");
-    var input = settings[4].firstElementChild;
+    input = settings[4].firstElementChild;
     is(input.value, "1", "Menulist should have initial value");
     input.focus();
     EventUtils.synthesizeKey("b", {}, gManagerWindow);
     is(input.value, "2", "Menulist should have updated value");
     is(gManagerWindow._testValue, "2", "Menulist oncommand handler should've updated the test value");
     delete gManagerWindow._testValue;
 
     ok(!settings[5].hasAttribute("first-row"), "Not the first row");
@@ -359,28 +359,28 @@ add_test(function() {
     is(radios[1].selected, true, "Correct radio button should be selected");
     EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getBoolPref("extensions.inlinesettings3.radioBool"), true, "Radio pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(radios[1], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getBoolPref("extensions.inlinesettings3.radioBool"), false, "Radio pref should have been updated");
 
     ok(!settings[1].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setIntPref("extensions.inlinesettings3.radioInt", 5);
-    var radios = settings[1].getElementsByTagName("radio");
+    radios = settings[1].getElementsByTagName("radio");
     isnot(radios[0].selected, true, "Correct radio button should be selected");
     is(radios[1].selected, true, "Correct radio button should be selected");
     isnot(radios[2].selected, true, "Correct radio button should be selected");
     EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getIntPref("extensions.inlinesettings3.radioInt"), 4, "Radio pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(radios[2], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getIntPref("extensions.inlinesettings3.radioInt"), 6, "Radio pref should have been updated");
 
     ok(!settings[2].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setCharPref("extensions.inlinesettings3.radioString", "juliet");
-    var radios = settings[2].getElementsByTagName("radio");
+    radios = settings[2].getElementsByTagName("radio");
     isnot(radios[0].selected, true, "Correct radio button should be selected");
     is(radios[1].selected, true, "Correct radio button should be selected");
     isnot(radios[2].selected, true, "Correct radio button should be selected");
     EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "india", "Radio pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(radios[2], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "kilo", "Radio pref should have been updated");
 
@@ -441,17 +441,17 @@ add_test(function() {
     is(description.textContent, "This is a test, all this text should be visible", "Description node should contain description");
     var button = node.firstElementChild;
     isnot(button, null, "There should be a button");
 
     node = settings[4];
     is_element_hidden(node, "Unsupported settings should not be visible");
     ok(!node.hasAttribute("first-row"), "Hidden row is not the first row");
 
-    var button = gManagerWindow.document.getElementById("detail-prefs-btn");
+    button = gManagerWindow.document.getElementById("detail-prefs-btn");
     is_element_hidden(button, "Preferences button should not be visible");
 
     gCategoryUtilities.openType("extension", run_next_test);
   });
 });
 
 // Addon with non-inline preferences as optionsURL
 add_test(function() {
@@ -603,23 +603,23 @@ add_test(function() {
     observer.checkDisplayed("inlinesettings1@tests.mozilla.org");
 
     var grid = gManagerWindow.document.getElementById("detail-grid");
     var settings = grid.querySelectorAll("rows > setting");
 
     var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[0], "anonid", "input");
     is(input.checked, false, "Checkbox should have initial value");
 
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input");
     is(input.checked, true, "Checkbox should have initial value");
 
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input");
     is(input.value, "12", "Number box should have initial value");
 
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input");
     is(input.value, "bar/", "Text box should have initial value");
 
     input = gManagerWindow.document.getAnonymousElementByAttribute(settings[5], "anonid", "input");
     is(input.color, "#FF9900", "Color picker should have initial value");
 
     input = gManagerWindow.document.getAnonymousElementByAttribute(settings[6], "anonid", "input");
     is(input.value, profD.path, "Label should have initial value");
     is(input.tooltipText, profD.path, "Label tooltip should have initial value");
@@ -654,22 +654,22 @@ add_test(function() {
 
     var grid = gManagerWindow.document.getElementById("detail-grid");
     var settings = grid.querySelectorAll("rows > setting");
 
     var radios = settings[0].getElementsByTagName("radio");
     isnot(radios[0].selected, true, "Correct radio button should be selected");
     is(radios[1].selected, true, "Correct radio button should be selected");
 
-    var radios = settings[1].getElementsByTagName("radio");
+    radios = settings[1].getElementsByTagName("radio");
     isnot(radios[0].selected, true, "Correct radio button should be selected");
     isnot(radios[1].selected, true, "Correct radio button should be selected");
     is(radios[2].selected, true, "Correct radio button should be selected");
 
-    var radios = settings[2].getElementsByTagName("radio");
+    radios = settings[2].getElementsByTagName("radio");
     isnot(radios[0].selected, true, "Correct radio button should be selected");
     isnot(radios[1].selected, true, "Correct radio button should be selected");
     is(radios[2].selected, true, "Correct radio button should be selected");
 
     var input = settings[3].firstElementChild;
     is(input.value, "9", "Menulist should have initial value");
 
     gCategoryUtilities.openType("extension", run_next_test);
--- a/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_inlinesettings_info.js
@@ -209,51 +209,51 @@ add_test(function() {
     is(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getBoolPref("extensions.inlinesettings1.bool"), true, "Bool pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(input, { clickCount: 1 }, gManagerWindow);
     isnot(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getBoolPref("extensions.inlinesettings1.bool"), false, "Bool pref should have been updated");
 
     ok(!settings[1].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setIntPref("extensions.inlinesettings1.boolint", 0);
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[1], "anonid", "input");
     isnot(input.checked, true, "Checkbox should have initial value");
     EventUtils.synthesizeMouseAtCenter(input, { clickCount: 1 }, gManagerWindow);
     is(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.boolint"), 1, "BoolInt pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(input, { clickCount: 1 }, gManagerWindow);
     isnot(input.checked, true, "Checkbox should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.boolint"), 2, "BoolInt pref should have been updated");
 
     ok(!settings[2].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setIntPref("extensions.inlinesettings1.integer", 0);
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[2], "anonid", "input");
     is(input.value, "0", "Number box should have initial value");
     input.select();
     EventUtils.synthesizeKey("1", {}, gManagerWindow);
     EventUtils.synthesizeKey("3", {}, gManagerWindow);
     is(input.value, "13", "Number box should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.integer"), 13, "Integer pref should have been updated");
     EventUtils.synthesizeKey("VK_DOWN", {}, gManagerWindow);
     is(input.value, "12", "Number box should have updated value");
     is(Services.prefs.getIntPref("extensions.inlinesettings1.integer"), 12, "Integer pref should have been updated");
 
     ok(!settings[3].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setCharPref("extensions.inlinesettings1.string", "foo");
-    var input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input");
+    input = gManagerWindow.document.getAnonymousElementByAttribute(settings[3], "anonid", "input");
     is(input.value, "foo", "Text box should have initial value");
     input.select();
     EventUtils.synthesizeKey("b", {}, gManagerWindow);
     EventUtils.synthesizeKey("a", {}, gManagerWindow);
     EventUtils.synthesizeKey("r", {}, gManagerWindow);
     is(input.value, "bar", "Text box should have updated value");
     is(Services.prefs.getCharPref("extensions.inlinesettings1.string"), "bar", "String pref should have been updated");
 
     ok(!settings[4].hasAttribute("first-row"), "Not the first row");
-    var input = settings[4].firstElementChild;
+    input = settings[4].firstElementChild;
     is(input.value, "1", "Menulist should have initial value");
     input.focus();
     EventUtils.synthesizeKey("b", {}, gManagerWindow);
     is(input.value, "2", "Menulist should have updated value");
     is(gManagerWindow._testValue, "2", "Menulist oncommand handler should've updated the test value");
     delete gManagerWindow._testValue;
 
     ok(!settings[5].hasAttribute("first-row"), "Not the first row");
@@ -353,28 +353,28 @@ add_test(function() {
     is(radios[1].selected, true, "Correct radio button should be selected");
     EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getBoolPref("extensions.inlinesettings3.radioBool"), true, "Radio pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(radios[1], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getBoolPref("extensions.inlinesettings3.radioBool"), false, "Radio pref should have been updated");
 
     ok(!settings[1].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setIntPref("extensions.inlinesettings3.radioInt", 5);
-    var radios = settings[1].getElementsByTagName("radio");
+    radios = settings[1].getElementsByTagName("radio");
     isnot(radios[0].selected, true, "Correct radio button should be selected");
     is(radios[1].selected, true, "Correct radio button should be selected");
     isnot(radios[2].selected, true, "Correct radio button should be selected");
     EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getIntPref("extensions.inlinesettings3.radioInt"), 4, "Radio pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(radios[2], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getIntPref("extensions.inlinesettings3.radioInt"), 6, "Radio pref should have been updated");
 
     ok(!settings[2].hasAttribute("first-row"), "Not the first row");
     Services.prefs.setCharPref("extensions.inlinesettings3.radioString", "juliet");
-    var radios = settings[2].getElementsByTagName("radio");
+    radios = settings[2].getElementsByTagName("radio");
     isnot(radios[0].selected, true, "Correct radio button should be selected");
     is(radios[1].selected, true, "Correct radio button should be selected");
     isnot(radios[2].selected, true, "Correct radio button should be selected");
     EventUtils.synthesizeMouseAtCenter(radios[0], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "india", "Radio pref should have been updated");
     EventUtils.synthesizeMouseAtCenter(radios[2], { clickCount: 1 }, gManagerWindow);
     is(Services.prefs.getCharPref("extensions.inlinesettings3.radioString"), "kilo", "Radio pref should have been updated");
 
@@ -435,17 +435,17 @@ add_test(function() {
     is(description.textContent, "This is a test, all this text should be visible", "Description node should contain description");
     var button = node.firstElementChild;
     isnot(button, null, "There should be a button");
 
     node = settings[4];
     is_element_hidden(node, "Unsupported settings should not be visible");
     ok(!node.hasAttribute("first-row"), "Hidden row is not the first row");
 
-    var button = gManagerWindow.document.getElementById("detail-prefs-btn");
+    button = gManagerWindow.document.getElementById("detail-prefs-btn");
     is_element_hidden(button, "Preferences button should not be visible");
 
     gCategoryUtilities.openType("extension", run_next_test);
   });
 });
 
 // Addon with non-inline preferences as optionsURL
 add_test(function() {
--- a/toolkit/mozapps/extensions/test/browser/browser_purchase.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_purchase.js
@@ -116,17 +116,17 @@ add_test(function() {
   is(get_node(items[1], "name").value, "Cheap Add-on", "Add-on 1 should be in expected position");
   is(get_node(items[2], "name").value, "Reasonable Add-on", "Add-on 2 should be in expected position");
   is(get_node(items[3], "name").value, "More Expensive Add-on", "Add-on 3 should be in expected position");
   is(get_node(items[4], "name").value, "Ludicrously Expensive Add-on", "Add-on 4 should be in expected position");
 
   info("Changing sort order");
   EventUtils.synthesizeMouseAtCenter(priceSorter, { }, gManagerWindow);
 
-  var items = Array.filter(list.childNodes, function(e) {
+  items = Array.filter(list.childNodes, function(e) {
     return e.tagName == "richlistitem";
   });
 
   is(get_node(items[0], "name").value, "Ludicrously Expensive Add-on", "Add-on 0 should be in expected position");
   is(get_node(items[1], "name").value, "More Expensive Add-on", "Add-on 1 should be in expected position");
   is(get_node(items[2], "name").value, "Reasonable Add-on", "Add-on 2 should be in expected position");
   is(get_node(items[3], "name").value, "Cheap Add-on", "Add-on 3 should be in expected position");
   is(get_node(items[4], "name").value, "Free Add-on", "Add-on 4 should be in expected position");
--- a/toolkit/mozapps/extensions/test/browser/browser_searching.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_searching.js
@@ -170,25 +170,25 @@ function get_actual_results() {
 
     if (item.mInstall || item.isPending("install")) {
       var sourceURI = item.mInstall.sourceURI.spec;
       if (sourceURI == REMOTE_INSTALL_URL) {
         results.push({name: REMOTE_TO_INSTALL, item: item});
         continue;
       }
 
-      var result = sourceURI.match(/^http:\/\/example\.com\/(.+)\.xpi$/);
+      let result = sourceURI.match(/^http:\/\/example\.com\/(.+)\.xpi$/);
       if (result != null) {
         is(item.mInstall.name.indexOf("PASS"), 0, "Install name should start with PASS");
         results.push({name: result[1], item: item});
         continue;
       }
     }
     else if (item.mAddon) {
-      var result = item.mAddon.id.match(/^(.+)@tests\.mozilla\.org$/);
+      let result = item.mAddon.id.match(/^(.+)@tests\.mozilla\.org$/);
       if (result != null) {
         is(item.mAddon.name.indexOf("PASS"), 0, "Addon name should start with PASS");
         results.push({name: result[1], item: item});
         continue;
       }
     }
     else {
       ok(false, "Found an item in the list that was neither installing or installed");
@@ -622,17 +622,17 @@ add_test(function() {
     gCategoryUtilities = new CategoryUtilities(gManagerWindow);
 
     Services.prefs.setBoolPref(PREF_STRICT_COMPAT, false);
     search("incompatible", false, function() {
       var item = get_addon_item("remote5");
       is_element_visible(item, "Incompatible addon should be visible");
       isnot(item.getAttribute("notification"), "warning", "Compatibility warning should not be shown");
   
-      var item = get_addon_item("remote6");
+      item = get_addon_item("remote6");
       is(item, null, "Addon incompatible with the product should not be visible");
   
       Services.prefs.setBoolPref(PREF_STRICT_COMPAT, true);
       run_next_test();
     });
   });
 });
 
--- a/toolkit/mozapps/extensions/test/browser/browser_select_confirm.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_select_confirm.js
@@ -110,17 +110,17 @@ add_test(function disabling_test() {
     ok(gWin.document.getElementById("update-list").hidden, "Update list should be hidden");
 
     var list = gWin.document.getElementById("disable-list");
     ok(!list.hidden, "Disable list should be visible");
     is(list.childNodes.length, 2, "Should be one add-on getting disabled (plus the header)");
     is(list.childNodes[1].id, "test2@tests.mozilla.org", "Should be the right add-on ID");
     is(list.childNodes[1].getAttribute("name"), "Test Add-on 2", "Should be the right add-on name");
 
-    var list = gWin.document.getElementById("enable-list");
+    list = gWin.document.getElementById("enable-list");
     ok(!list.hidden, "Enable list should be visible");
     is(list.childNodes.length, 2, "Should be one add-on getting disabled (plus the header)");
     is(list.childNodes[1].id, "test3@tests.mozilla.org", "Should be the right add-on ID");
     is(list.childNodes[1].getAttribute("name"), "Test Add-on 3", "Should be the right add-on name");
 
     ok(gWin.document.getElementById("next").hidden, "Next button should be hidden");
     ok(!gWin.document.getElementById("done").hidden, "Done button should be visible");
     gWin.close();
--- a/toolkit/mozapps/extensions/test/browser/browser_uninstalling.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_uninstalling.js
@@ -112,17 +112,17 @@ add_test(function() {
 
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should be pending uninstall");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(!button.hidden, "Restart button should not be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       EventUtils.synthesizeMouseAtCenter(button, { }, gManagerWindow);
 
       // Force XBL to apply
@@ -164,17 +164,17 @@ add_test(function() {
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should not be pending uninstall");
       ok(!aAddon.isActive, "Add-on should be inactive");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(button.hidden, "Restart button should be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       EventUtils.synthesizeMouseAtCenter(button, { }, gManagerWindow);
 
       // Force XBL to apply
@@ -219,17 +219,17 @@ add_test(function() {
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should not be pending uninstall");
       ok(!aAddon.isActive, "Add-on should be inactive");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(button.hidden, "Restart button should be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       EventUtils.synthesizeMouseAtCenter(button, { }, gManagerWindow);
 
       // Force XBL to apply
@@ -280,17 +280,17 @@ add_test(function() {
 
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should be pending uninstall");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(!button.hidden, "Restart button should not be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       EventUtils.synthesizeMouseAtCenter(button, { }, gManagerWindow);
 
       // Force XBL to apply
@@ -340,17 +340,17 @@ add_test(function() {
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should not be pending uninstall");
       ok(!aAddon.isActive, "Add-on should be inactive");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(button.hidden, "Restart button should be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       EventUtils.synthesizeMouseAtCenter(button, { }, gManagerWindow);
 
       // Force XBL to apply
@@ -403,17 +403,17 @@ add_test(function() {
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should not be pending uninstall");
       ok(!aAddon.isActive, "Add-on should be inactive");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(button.hidden, "Restart button should be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       EventUtils.synthesizeMouseAtCenter(button, { }, gManagerWindow);
 
       // Force XBL to apply
@@ -654,17 +654,17 @@ add_test(function() {
 
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should be pending uninstall");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(!button.hidden, "Restart button should not be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       gCategoryUtilities.openType("plugin", function() {
         is(gCategoryUtilities.selectedCategory, "plugin", "View should have changed to plugin");
         gCategoryUtilities.openType("extension", function() {
@@ -1044,17 +1044,17 @@ add_test(function() {
       // Force XBL to apply
       item.clientTop;
 
       is(item.getAttribute("pending"), "uninstall", "Add-on should be uninstalling");
 
       ok(!(aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL), "Add-on should not be pending uninstall");
       ok(!aAddon.isActive, "Add-on should be inactive");
 
-      var button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
+      button = gDocument.getAnonymousElementByAttribute(item, "anonid", "restart-btn");
       isnot(button, null, "Should have a restart button");
       ok(button.hidden, "Restart button should be hidden");
       button = gDocument.getAnonymousElementByAttribute(item, "anonid", "undo-btn");
       isnot(button, null, "Should have an undo button");
 
       item = get_item_in_list(ID2, list);
       isnot(item, null, "Should have found the add-on in the list");
 
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -1235,27 +1235,27 @@ MockAddon.prototype = {
     if (currentActive == newActive)
       return;
 
     if (newActive == this.isActive) {
       this.pendingOperations -= (newActive ? AddonManager.PENDING_DISABLE : AddonManager.PENDING_ENABLE);
       AddonManagerPrivate.callAddonListeners("onOperationCancelled", this);
     }
     else if (newActive) {
-      var needsRestart = !!(this.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE);
+      let needsRestart = !!(this.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE);
       this.pendingOperations |= AddonManager.PENDING_ENABLE;
       AddonManagerPrivate.callAddonListeners("onEnabling", this, needsRestart);
       if (!needsRestart) {
         this.isActive = newActive;
         this.pendingOperations -= AddonManager.PENDING_ENABLE;
         AddonManagerPrivate.callAddonListeners("onEnabled", this);
       }
     }
     else {
-      var needsRestart = !!(this.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_DISABLE);
+      let needsRestart = !!(this.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_DISABLE);
       this.pendingOperations |= AddonManager.PENDING_DISABLE;
       AddonManagerPrivate.callAddonListeners("onDisabling", this, needsRestart);
       if (!needsRestart) {
         this.isActive = newActive;
         this.pendingOperations -= AddonManager.PENDING_DISABLE;
         AddonManagerPrivate.callAddonListeners("onDisabled", this);
       }
     }
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug449027.js
@@ -253,17 +253,17 @@ var PluginHost = {
 // Don't need the full interface, attempts to call other methods will just
 // throw which is just fine
 var WindowWatcher = {
   openWindow: function(parent, url, name, features, args) {
     // Should be called to list the newly blocklisted items
     do_check_eq(url, URI_EXTENSION_BLOCKLIST_DIALOG);
     do_check_neq(gCallback, null);
 
-    var args = args.wrappedJSObject;
+    args = args.wrappedJSObject;
 
     gNewBlocks = [];
     var list = args.list;
     for (let listItem of list)
       gNewBlocks.push(listItem.name + " " + listItem.version);
 
     // Call the callback after the blocklist has finished up
     do_timeout(0, gCallback);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_error.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_error.js
@@ -61,30 +61,30 @@ function run_test_4() {
     do_check_eq(install.state, AddonManager.STATE_DOWNLOAD_FAILED);
     do_check_eq(install.error, AddonManager.ERROR_INCORRECT_HASH);
 
     run_test_5();
   }, "application/x-xpinstall", "sha1:foo");
 }
 
 // Checks that a file that doesn't exist shows an error
-function run_test_4() {
+function run_test_5() {
   let file = do_get_file("data");
   file.append("missing.xpi");
   AddonManager.getInstallForFile(file, function(install) {
     do_check_neq(install, null);
     do_check_eq(install.state, AddonManager.STATE_DOWNLOAD_FAILED);
     do_check_eq(install.error, AddonManager.ERROR_NETWORK_FAILURE);
 
-    run_test_5();
+    run_test_6();
   });
 }
 
 // Checks that an add-on with an illegal ID shows an error
-function run_test_5() {
+function run_test_6() {
   AddonManager.getInstallForFile(do_get_addon("test_bug567173"), function(install) {
     do_check_neq(install, null);
     do_check_eq(install.state, AddonManager.STATE_DOWNLOAD_FAILED);
     do_check_eq(install.error, AddonManager.ERROR_CORRUPT_FILE);
 
     do_execute_soon(do_test_finished);
   });
 }
--- a/toolkit/mozapps/extensions/test/xpcshell/test_fuel.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_fuel.js
@@ -124,17 +124,17 @@ function run_test() {
 
       // test setting and getting a value
       inspector.prefs.get(testdata.dummy).value = "dummy2";
       itemValue = inspector.prefs.get(testdata.dummy).value;
       do_check_eq(itemValue, "dummy2");
 
       // test resetting a pref [since there is no default value, the pref should disappear]
       inspector.prefs.get(testdata.dummy).reset();
-      var itemValue = inspector.prefs.getValue(testdata.dummy, "default");
+      itemValue = inspector.prefs.getValue(testdata.dummy, "default");
       do_check_eq(itemValue, "default");
 
       // test to see if a non-existant property exists
       do_check_true(!inspector.prefs.has(testdata.dummy));
 
       inspector.prefs.events.addListener("change", onPrefChange);
       inspector.prefs.setValue("fuel.fuel-test", "change event");
     });
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_localfile.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_localfile.js
@@ -4,20 +4,21 @@ function test() {
   Harness.installEndedCallback = install_ended;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                      .getService(Components.interfaces.nsIChromeRegistry);
 
   var chromeroot = extractChromeRoot(gTestPath);
+  var xpipath = chromeroot + "unsigned.xpi";
   try {
-    var xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec;
+    xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec;
   } catch (ex) {
-    var xpipath = chromeroot + "unsigned.xpi"; //scenario where we are running from a .jar and already extracted
+    //scenario where we are running from a .jar and already extracted
   }
 
   gBrowser.selectedTab = gBrowser.addTab("about:blank");
   BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
     gBrowser.loadURI(xpipath);
   });
 }
 
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_localfile2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_localfile2.js
@@ -3,20 +3,21 @@
 // web content
 function test() {
   waitForExplicitFinish();
 
   var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                      .getService(Components.interfaces.nsIChromeRegistry);
   
   var chromeroot = getChromeRoot(gTestPath);              
+  var xpipath = chromeroot + "unsigned.xpi";
   try {
-    var xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec;
+    xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec;
   } catch (ex) {
-    var xpipath = chromeroot + "unsigned.xpi"; //scenario where we are running from a .jar and already extracted
+    //scenario where we are running from a .jar and already extracted
   }
   
   var triggers = encodeURIComponent(JSON.stringify({
     "Unsigned XPI": xpipath
   }));
   gBrowser.selectedTab = gBrowser.addTab();
 
   function loadListener() {
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_localfile3.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_localfile3.js
@@ -8,20 +8,21 @@ function test() {
 
   // Disable direct request whitelisting, installing from file should be blocked.
   Services.prefs.setBoolPref("xpinstall.whitelist.directRequest", false);
 
   var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                      .getService(Components.interfaces.nsIChromeRegistry);
 
   var chromeroot = extractChromeRoot(gTestPath);
+  var xpipath = chromeroot + "unsigned.xpi";
   try {
-    var xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec;
+    xpipath = cr.convertChromeURL(makeURI(chromeroot + "unsigned.xpi")).spec;
   } catch (ex) {
-    var xpipath = chromeroot + "unsigned.xpi"; //scenario where we are running from a .jar and already extracted
+    //scenario where we are running from a .jar and already extracted
   }
 
   gBrowser.selectedTab = gBrowser.addTab("about:blank");
   BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
     gBrowser.loadURI(xpipath);
   });
 }
 
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_localfile4.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_localfile4.js
@@ -8,20 +8,21 @@ function test() {
 
   // Disable file request whitelisting, installing by file referrer should be blocked.
   Services.prefs.setBoolPref("xpinstall.whitelist.fileRequest", false);
 
   var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                      .getService(Components.interfaces.nsIChromeRegistry);
 
   var chromeroot = extractChromeRoot(gTestPath);
+  var xpipath = chromeroot;
   try {
-    var xpipath = cr.convertChromeURL(makeURI(chromeroot)).spec;
+    xpipath = cr.convertChromeURL(makeURI(chromeroot)).spec;
   } catch (ex) {
-    var xpipath = chromeroot; //scenario where we are running from a .jar and already extracted
+    //scenario where we are running from a .jar and already extracted
   }
   var triggers = encodeURIComponent(JSON.stringify({
     "Unsigned XPI": TESTROOT + "unsigned.xpi"
   }));
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.loadURI(xpipath + "installtrigger.html?" + triggers);
 }
 
--- a/toolkit/mozapps/installer/precompile_cache.js
+++ b/toolkit/mozapps/installer/precompile_cache.js
@@ -44,27 +44,27 @@ function dir_entries(baseDir, subpath, e
       entries.push(subpath + "/" + file.leafName);
     }
   }
   return entries;
 }
 
 function get_modules_under(uri) {
   if (uri instanceof Ci.nsIJARURI) {
-    var jar = uri.QueryInterface(Ci.nsIJARURI);
-    var jarReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
-    var file = jar.JARFile.QueryInterface(Ci.nsIFileURL);
+    let jar = uri.QueryInterface(Ci.nsIJARURI);
+    let jarReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
+    let file = jar.JARFile.QueryInterface(Ci.nsIFileURL);
     jarReader.open(file.file);
-    var entries = jar_entries(jarReader, "components/*.js")
+    let entries = jar_entries(jarReader, "components/*.js")
                   .concat(jar_entries(jarReader, "modules/*.js"))
                   .concat(jar_entries(jarReader, "modules/*.jsm"));
     jarReader.close();
     return entries;
   } else if (uri instanceof Ci.nsIFileURL){
-    var file = uri.QueryInterface(Ci.nsIFileURL);
+    let file = uri.QueryInterface(Ci.nsIFileURL);
     return dir_entries(file.file, "components", ".js")
            .concat(dir_entries(file.file, "modules", ".js"))
            .concat(dir_entries(file.file, "modules", ".jsm"));
   } else {
     throw "Expected a nsIJARURI or nsIFileURL";
   }
 }