Bug 1311043 - make eslint much more strict in browser/components/migration/, and fix issues, r=mikedeboer
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 18 Oct 2016 16:03:06 +0100
changeset 345376 05d46ac826ac6cfd07e54d16e8a2db41cea99510
parent 345375 0f5bb48b0bc3e5bcd53cc114664dfeafe1db9db8
child 345377 c2753c9ba68ebd62aa8c086e7f36835ebd064044
child 345445 faec341f8952a452b64878da0b99c64c43a7fea8
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1311043
milestone52.0a1
Bug 1311043 - make eslint much more strict in browser/components/migration/, and fix issues, r=mikedeboer MozReview-Commit-ID: RXO68w3Kv3
browser/components/migration/.eslintrc.js
browser/components/migration/360seProfileMigrator.js
browser/components/migration/AutoMigrate.jsm
browser/components/migration/ChromeProfileMigrator.js
browser/components/migration/ESEDBReader.jsm
browser/components/migration/EdgeProfileMigrator.js
browser/components/migration/FirefoxProfileMigrator.js
browser/components/migration/IEProfileMigrator.js
browser/components/migration/MSMigrationUtils.jsm
browser/components/migration/MigrationUtils.jsm
browser/components/migration/SafariProfileMigrator.js
browser/components/migration/content/migration.js
browser/components/migration/tests/unit/.eslintrc.js
browser/components/migration/tests/unit/head_migration.js
browser/components/migration/tests/unit/test_Chrome_cookies.js
browser/components/migration/tests/unit/test_Chrome_passwords.js
browser/components/migration/tests/unit/test_Edge_availability.js
browser/components/migration/tests/unit/test_Edge_db_migration.js
browser/components/migration/tests/unit/test_IE7_passwords.js
browser/components/migration/tests/unit/test_IE_bookmarks.js
browser/components/migration/tests/unit/test_IE_cookies.js
browser/components/migration/tests/unit/test_Safari_bookmarks.js
browser/components/migration/tests/unit/test_automigration.js
browser/components/migration/tests/unit/test_fx_telemetry.js
new file mode 100644
--- /dev/null
+++ b/browser/components/migration/.eslintrc.js
@@ -0,0 +1,82 @@
+"use strict";
+
+module.exports = { // eslint-disable-line no-undef
+  "extends": [
+    "../../.eslintrc.js"
+  ],
+
+  "globals": {
+    "Components": true,
+    "dump": true,
+    "Iterator": true
+  },
+
+  "env": { "browser": true },
+
+  "rules": {
+    "block-scoped-var": 2,
+    // "brace-style": [1, "1tbs", {"allowSingleLine": true}],
+    "comma-dangle": 0,
+    "comma-spacing": [1, {"before": false, "after": true}],
+    "comma-style": [1, "last"],
+    // "complexity": 1,
+    "consistent-return": 2,
+    //"curly": 2,
+    "dot-notation": 2,
+    "eol-last": 2,
+    "indent": [1, 2, {"SwitchCase": 1}],
+    // "key-spacing": [1, {"beforeColon": false, "afterColon": true}],
+    "keyword-spacing": 1,
+    "max-nested-callbacks": [2, 3],
+    "new-parens": 2,
+    "no-array-constructor": 2,
+    "no-cond-assign": 2,
+    "no-control-regex": 2,
+    "no-debugger": 2,
+    "no-delete-var": 2,
+    "no-dupe-args": 2,
+    "no-dupe-keys": 2,
+    "no-duplicate-case": 2,
+    "no-else-return": 2,
+    "no-eval": 2,
+    "no-extend-native": 2,
+    // "no-extra-bind": 2,
+    "no-extra-boolean-cast": 2,
+    "no-extra-semi": 1,
+    "no-fallthrough": ["error", { "commentPattern": ".*[Ii]ntentional(?:ly)?\\s+fall(?:ing)?[\\s-]*through.*" }],
+    "no-lonely-if": 2,
+    "no-mixed-spaces-and-tabs": 2,
+    "no-multi-spaces": 1,
+    "no-multi-str": 1,
+    "no-native-reassign": 2,
+    "no-nested-ternary": 2,
+    "no-redeclare": 2,
+    "no-return-assign": 2,
+    "no-self-compare": 2,
+    "no-sequences": 2,
+    "no-shadow": 1,
+    "no-shadow-restricted-names": 2,
+    // "no-spaced-func": 1,
+    "no-throw-literal": 2,
+    "no-trailing-spaces": 2,
+    "no-undef": 2,
+    "no-unneeded-ternary": 2,
+    "no-unreachable": 2,
+    "no-unused-vars": ["error", { "varsIgnorePattern": "^C[ciur]$" }],
+    "no-with": 2,
+    "padded-blocks": [1, "never"],
+    "quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
+    "semi": [2, "always", {"omitLastInOneLineBlock": true }],
+    "semi-spacing": [1, {"before": false, "after": true}],
+    "space-before-blocks": [1, "always"],
+    // "space-before-function-paren": [1, "never"],
+    "space-in-parens": [1, "never"],
+    "space-infix-ops": [1, {"int32Hint": true}],
+    // "space-unary-ops": [1, { "words": true, "nonwords": false }],
+    "strict": [2, "global"],
+    "use-isnan": 2,
+    "valid-typeof": 2,
+    "yoda": 2
+  }
+};
+
--- a/browser/components/migration/360seProfileMigrator.js
+++ b/browser/components/migration/360seProfileMigrator.js
@@ -6,18 +6,18 @@
 
 const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
+Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
+Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
                                   "resource://gre/modules/Sqlite.jsm");
 
 const kBookmarksFileName = "360sefav.db";
 
@@ -104,17 +104,17 @@ function Bookmarks(aProfileFolder) {
 }
 Bookmarks.prototype = {
   type: MigrationUtils.resourceTypes.BOOKMARKS,
 
   get exists() {
     return this._file.exists() && this._file.isReadable();
   },
 
-  migrate: function (aCallback) {
+  migrate(aCallback) {
     return Task.spawn(function* () {
       let idToGuid = new Map();
       let folderGuid = PlacesUtils.bookmarks.toolbarGuid;
       if (!MigrationUtils.isStartupMigration) {
         folderGuid =
           yield MigrationUtils.createImportedBookmarksFolder("360se", folderGuid);
       }
       idToGuid.set(0, folderGuid);
@@ -132,21 +132,21 @@ Bookmarks.prototype = {
              SELECT f.id, f.parent_id, f.is_folder, f.title, f.url, f.pos
              FROM tb_fav AS f
              JOIN bookmark AS b ON f.parent_id = b.id
              ORDER BY f.pos ASC
            )
            SELECT id, parent_id, is_folder, title, url FROM bookmark WHERE id`);
 
         for (let row of rows) {
-          let id = parseInt(row.getResultByName("id"), 10),
-              parent_id = parseInt(row.getResultByName("parent_id"), 10),
-              is_folder = parseInt(row.getResultByName("is_folder"), 10),
-              title = row.getResultByName("title"),
-              url = row.getResultByName("url");
+          let id = parseInt(row.getResultByName("id"), 10);
+          let parent_id = parseInt(row.getResultByName("parent_id"), 10);
+          let is_folder = parseInt(row.getResultByName("is_folder"), 10);
+          let title = row.getResultByName("title");
+          let url = row.getResultByName("url");
 
           let parentGuid = idToGuid.get(parent_id) || idToGuid.get("fallback");
           if (!parentGuid) {
             parentGuid = PlacesUtils.bookmarks.unfiledGuid;
             if (!MigrationUtils.isStartupMigration) {
               parentGuid =
                 yield MigrationUtils.createImportedBookmarksFolder("360se", parentGuid);
             }
@@ -208,18 +208,20 @@ function Qihoo360seProfileMigrator() {
 
 Qihoo360seProfileMigrator.prototype = Object.create(MigratorPrototype);
 
 Object.defineProperty(Qihoo360seProfileMigrator.prototype, "sourceProfiles", {
   get: function() {
     if ("__sourceProfiles" in this)
       return this.__sourceProfiles;
 
-    if (!this._usersDir)
-      return this.__sourceProfiles = [];
+    if (!this._usersDir) {
+      this.__sourceProfiles = [];
+      return this.__sourceProfiles;
+    }
 
     let profiles = [];
     let noLoggedInUser = true;
     try {
       let loginIni = this._usersDir.clone();
       loginIni.append("login.ini");
       if (!loginIni.exists()) {
         throw new Error("360 Secure Browser's 'login.ini' does not exist.");
@@ -271,20 +273,21 @@ Object.defineProperty(Qihoo360seProfileM
       Cu.reportError("Error detecting 360 Secure Browser profiles: " + e);
     } finally {
       profiles[noLoggedInUser ? "unshift" : "push"]({
         id: this._defaultUserPath,
         name: "Default",
       });
     }
 
-    return this.__sourceProfiles = profiles.filter(profile => {
+    this.__sourceProfiles = profiles.filter(profile => {
       let resources = this.getResources(profile);
       return resources && resources.length > 0;
     });
+    return this.__sourceProfiles;
   }
 });
 
 Qihoo360seProfileMigrator.prototype._getIdFromConfig = function(aConfig) {
   return aConfig.UserMd5 || getHash(aConfig.email);
 };
 
 Qihoo360seProfileMigrator.prototype.getResources = function(aProfile) {
@@ -304,17 +307,17 @@ Qihoo360seProfileMigrator.prototype.getR
 Qihoo360seProfileMigrator.prototype.getLastUsedDate = function() {
   let bookmarksPaths = this.sourceProfiles.map(({id}) => {
     return OS.Path.join(this._usersDir.path, id, kBookmarksFileName);
   });
   if (!bookmarksPaths.length) {
     return Promise.resolve(new Date(0));
   }
   let datePromises = bookmarksPaths.map(path => {
-    return OS.File.stat(path).catch(_ => null).then(info => {
+    return OS.File.stat(path).catch(() => null).then(info => {
       return info ? info.lastModificationDate : 0;
     });
   });
   return Promise.all(datePromises).then(dates => {
     return new Date(Math.max.apply(Math, dates));
   });
 };
 
--- a/browser/components/migration/AutoMigrate.jsm
+++ b/browser/components/migration/AutoMigrate.jsm
@@ -117,17 +117,17 @@ const AutoMigrate = {
 
     let resourceTypes = migrator.getMigrateData(profileToMigrate, profileStartup);
     if (!(resourceTypes & this.resourceTypesToUse)) {
       throw new Error("No usable resources were found for the selected browser!");
     }
     histogram.add(15);
 
     let sawErrors = false;
-    let migrationObserver = (subject, topic, data) => {
+    let migrationObserver = (subject, topic) => {
       if (topic == "Migration:ItemError") {
         sawErrors = true;
       } else if (topic == "Migration:Ended") {
         histogram.add(25);
         if (sawErrors) {
           histogram.add(26);
         }
         Services.obs.removeObserver(migrationObserver, "Migration:Ended");
--- a/browser/components/migration/ChromeProfileMigrator.js
+++ b/browser/components/migration/ChromeProfileMigrator.js
@@ -19,19 +19,19 @@ const AUTH_TYPE = {
   SCHEME_DIGEST: 2
 };
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
+Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
                                   "resource://gre/modules/OSCrypto.jsm");
 /**
  * Get an nsIFile instance representing the expected location of user data
  * for this copy of Chrome/Chromium/Canary on different OSes.
@@ -61,17 +61,17 @@ function getDataFolder(subfoldersWin, su
  * @param   aTime
  *          Chrome time
  * @return  converted Date object
  * @note    Google Chrome uses FILETIME / 10 as time.
  *          FILETIME is based on same structure of Windows.
  */
 function chromeTimeToDate(aTime)
 {
-  return new Date((aTime * S100NS_PER_MS - S100NS_FROM1601TO1970 ) / 10000);
+  return new Date((aTime * S100NS_PER_MS - S100NS_FROM1601TO1970) / 10000);
 }
 
 /**
  * Insert bookmark items into specific folder.
  *
  * @param   parentGuid
  *          GUID of the folder where items will be inserted
  * @param   items
@@ -132,21 +132,20 @@ ChromeProfileMigrator.prototype.getResou
       }
     }
     return [];
   };
 
 ChromeProfileMigrator.prototype.getLastUsedDate =
   function Chrome_getLastUsedDate() {
     let datePromises = this.sourceProfiles.map(profile => {
-      let profileFolder = this._chromeUserDataFolder.clone();
       let basePath = OS.Path.join(this._chromeUserDataFolder.path, profile.id);
       let fileDatePromises = ["Bookmarks", "History", "Cookies"].map(leafName => {
         let path = OS.Path.join(basePath, leafName);
-        return OS.File.stat(path).catch(_ => null).then(info => {
+        return OS.File.stat(path).catch(() => null).then(info => {
           return info ? info.lastModificationDate : 0;
         });
       });
       return Promise.all(fileDatePromises).then(dates => {
         return Math.max.apply(Math, dates);
       });
     });
     return Promise.all(datePromises).then(dates => {
@@ -195,32 +194,33 @@ Object.defineProperty(ChromeProfileMigra
         profiles = [{
           id: "Default",
           name: "Default",
         }];
       }
     }
 
     // Only list profiles from which any data can be imported
-    return this.__sourceProfiles = profiles.filter(function(profile) {
+    this.__sourceProfiles = profiles.filter(function(profile) {
       let resources = this.getResources(profile);
       return resources && resources.length > 0;
     }, this);
+    return this.__sourceProfiles;
   }
 });
 
 Object.defineProperty(ChromeProfileMigrator.prototype, "sourceHomePageURL", {
   get: function Chrome_sourceHomePageURL() {
     let prefsFile = this._chromeUserDataFolder.clone();
     prefsFile.append("Preferences");
     if (prefsFile.exists()) {
       // XXX reading and parsing JSON is synchronous.
       let fstream = Cc[FILE_INPUT_STREAM_CID].
                     createInstance(Ci.nsIFileInputStream);
-      fstream.init(file, -1, 0, 0);
+      fstream.init(prefsFile, -1, 0, 0);
       try {
         return JSON.parse(
           NetUtil.readInputStreamToString(fstream, fstream.available(),
                                           { charset: "UTF-8" })
             ).homepage;
       }
       catch (e) {
         Cu.reportError("Error parsing Chrome's preferences file: " + e);
@@ -244,30 +244,30 @@ function GetBookmarksResource(aProfileFo
     return null;
 
   return {
     type: MigrationUtils.resourceTypes.BOOKMARKS,
 
     migrate: function(aCallback) {
       return Task.spawn(function* () {
         let gotErrors = false;
-        let errorGatherer = () => gotErrors = true;
-        let jsonStream = yield new Promise(resolve =>
-          NetUtil.asyncFetch({ uri: NetUtil.newURI(bookmarksFile),
-                               loadUsingSystemPrincipal: true
-                             },
-                             (inputStream, resultCode) => {
-                               if (Components.isSuccessCode(resultCode)) {
-                                 resolve(inputStream);
-                               } else {
-                                 reject(new Error("Could not read Bookmarks file"));
-                               }
-                             }
-          )
-        );
+        let errorGatherer = function() { gotErrors = true };
+        let jsonStream = yield new Promise((resolve, reject) => {
+          let options = {
+            uri: NetUtil.newURI(bookmarksFile),
+            loadUsingSystemPrincipal: true
+          };
+          NetUtil.asyncFetch(options, (inputStream, resultCode) => {
+            if (Components.isSuccessCode(resultCode)) {
+              resolve(inputStream);
+            } else {
+              reject(new Error("Could not read Bookmarks file"));
+            }
+          });
+        });
 
         // Parse Chrome bookmark file that is JSON format
         let bookmarkJSON = NetUtil.readInputStreamToString(
           jsonStream, jsonStream.available(), { charset : "UTF-8" });
         let roots = JSON.parse(bookmarkJSON).roots;
 
         // Importing bookmark bar items
         if (roots.bookmark_bar.children &&
@@ -288,41 +288,35 @@ function GetBookmarksResource(aProfileFo
           let parentGuid = PlacesUtils.bookmarks.menuGuid;
           if (!MigrationUtils.isStartupMigration) {
             parentGuid =
               yield MigrationUtils.createImportedBookmarksFolder("Chrome", parentGuid);
           }
           yield insertBookmarkItems(parentGuid, roots.other.children, errorGatherer);
         }
         if (gotErrors) {
-          throw "The migration included errors.";
+          throw new Error("The migration included errors.");
         }
       }.bind(this)).then(() => aCallback(true),
-                          e => aCallback(false));
+                         () => aCallback(false));
     }
   };
 }
 
 function GetHistoryResource(aProfileFolder) {
   let historyFile = aProfileFolder.clone();
   historyFile.append("History");
   if (!historyFile.exists())
     return null;
 
   return {
     type: MigrationUtils.resourceTypes.HISTORY,
 
     migrate(aCallback) {
       Task.spawn(function* () {
-        let dbOptions = {
-          readOnly: true,
-          ignoreLockingMode: true,
-          path: historyFile.path
-        };
-
         let rows = yield MigrationUtils.getRowsFromDBWithoutLocks(historyFile.path, "Chrome history",
           `SELECT url, title, last_visit_time, typed_count FROM urls WHERE hidden = 0`);
         let places = [];
         for (let row of rows) {
           try {
             // if having typed_count, we changes transition type to typed.
             let transType = PlacesUtils.history.TRANSITION_LINK;
             if (row.getResultByName("typed_count") > 0)
@@ -357,17 +351,17 @@ function GetHistoryResource(aProfileFold
                   resolve();
                 } else {
                   reject(new Error("Couldn't add visits"));
                 }
               }
             });
           });
         }
-      }).then(() => { aCallback(true); },
+      }).then(() => { aCallback(true) },
               ex => {
                 Cu.reportError(ex);
                 aCallback(false);
               });
     }
   };
 }
 
@@ -381,19 +375,19 @@ function GetCookiesResource(aProfileFold
     type: MigrationUtils.resourceTypes.COOKIES,
 
     migrate: Task.async(function* (aCallback) {
       // We don't support decrypting cookies yet so only import plaintext ones.
       let rows = yield MigrationUtils.getRowsFromDBWithoutLocks(cookiesFile.path, "Chrome cookies",
        `SELECT host_key, name, value, path, expires_utc, secure, httponly, encrypted_value
         FROM cookies
         WHERE length(encrypted_value) = 0`).catch(ex => {
-        Cu.reportError(ex);
-        aCallback(false);
-      });
+          Cu.reportError(ex);
+          aCallback(false);
+        });
       // If the promise was rejected we will have already called aCallback,
       // so we can just return here.
       if (!rows) {
         return;
       }
 
       for (let row of rows) {
         let host_key = row.getResultByName("host_key");
@@ -432,19 +426,19 @@ function GetWindowsPasswordsResource(aPr
   return {
     type: MigrationUtils.resourceTypes.PASSWORDS,
 
     migrate: Task.async(function* (aCallback) {
       let rows = yield MigrationUtils.getRowsFromDBWithoutLocks(loginFile.path, "Chrome passwords",
        `SELECT origin_url, action_url, username_element, username_value,
         password_element, password_value, signon_realm, scheme, date_created,
         times_used FROM logins WHERE blacklisted_by_user = 0`).catch(ex => {
-        Cu.reportError(ex);
-        aCallback(false);
-      });
+          Cu.reportError(ex);
+          aCallback(false);
+        });
       // If the promise was rejected we will have already called aCallback,
       // so we can just return here.
       if (!rows) {
         return;
       }
       let crypto = new OSCrypto();
 
       for (let row of rows) {
--- a/browser/components/migration/ESEDBReader.jsm
+++ b/browser/components/migration/ESEDBReader.jsm
@@ -1,15 +1,15 @@
 /* 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/. */
 
 "use strict";
 
-this.EXPORTED_SYMBOLS = ["ESEDBReader"];
+this.EXPORTED_SYMBOLS = ["ESEDBReader"]; /* exported ESEDBReader */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/ctypes.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI;
@@ -384,17 +384,17 @@ ESEDB.prototype = {
           let [buffer, bufferSize] = this._getBufferForColumn(column);
           // We handle errors manually so we accurately deal with NULL values.
           let err = ESE.ManualRetrieveColumn(this._sessionId, tableId,
                                              column.id, buffer.address(),
                                              bufferSize, null, 0, null);
           rowContents[column.name] = this._convertResult(column, buffer, err);
         }
         yield rowContents;
-      } while (0 === ESE.ManualMove(this._sessionId, tableId, 1 /* JET_MoveNext */, 0));
+      } while (ESE.ManualMove(this._sessionId, tableId, 1 /* JET_MoveNext */, 0) === 0);
     } catch (ex) {
       if (tableOpened) {
         this._closeTable(tableId);
       }
       throw ex;
     }
     this._closeTable(tableId);
   },
@@ -435,17 +435,17 @@ ESEDB.prototype = {
         Cu.reportError("Unexpected JET error: " + err + ";" + " retrieving value for column " + column.name);
         throw new Error(convertESEError(err));
       }
     }
     if (column.type == "string") {
       return buffer ? buffer.readString() : "";
     }
     if (column.type == "boolean") {
-      return buffer ? (255 == buffer.value) : false;
+      return buffer ? (buffer.value == 255) : false;
     }
     if (column.type == "guid") {
       if (buffer.length != 16) {
         Cu.reportError("Buffer size for guid field " + column.id + " should have been 16!");
         return "";
       }
       let rv = "{";
       for (let i = 0; i < 16; i++) {
--- a/browser/components/migration/EdgeProfileMigrator.js
+++ b/browser/components/migration/EdgeProfileMigrator.js
@@ -1,20 +1,22 @@
 /* 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/. */
 
+"use strict";
+
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
+Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
 Cu.import("resource:///modules/MSMigrationUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ESEDBReader",
                                   "resource:///modules/ESEDBReader.jsm");
 
 const kEdgeRegistryRoot = "SOFTWARE\\Classes\\Local Settings\\Software\\" +
   "Microsoft\\Windows\\CurrentVersion\\AppContainer\\Storage\\" +
@@ -52,17 +54,17 @@ XPCOMUtils.defineLazyGetter(this, "gEdge
  *                                      reference once opened.
  * @param {function}          filterFn  a function that is called for each row.
  *                                      Only rows for which it returns a truthy
  *                                      value are included in the result.
  * @param {nsIFile}           dbFile    the database file to use. Defaults to
  *                                      the main Edge database.
  * @returns {Array} An array of row objects.
  */
-function readTableFromEdgeDB(tableName, columns, filterFn, dbFile=gEdgeDatabase) {
+function readTableFromEdgeDB(tableName, columns, filterFn, dbFile = gEdgeDatabase) {
   let database;
   let rows = [];
   try {
     let logFile = dbFile.parent;
     logFile.append("LogFiles");
     database = ESEDBReader.openDB(dbFile.parent, dbFile, logFile);
 
     if (typeof columns == "function") {
@@ -101,17 +103,16 @@ EdgeTypedURLMigrator.prototype = {
     return this.__typedURLs;
   },
 
   get exists() {
     return this._typedURLs.size > 0;
   },
 
   migrate: function(aCallback) {
-    let rv = true;
     let typedURLs = this._typedURLs;
     let places = [];
     for (let [urlString, time] of typedURLs) {
       let uri;
       try {
         uri = Services.io.newURI(urlString, null, null);
         if (["http", "https", "ftp"].indexOf(uri.scheme) == -1) {
           continue;
@@ -144,17 +145,17 @@ EdgeTypedURLMigrator.prototype = {
         this._success = true;
       },
       handleError: function() {},
       handleCompletion: function() {
         aCallback(this._success);
       }
     });
   },
-}
+};
 
 function EdgeReadingListMigrator() {
 }
 
 EdgeReadingListMigrator.prototype = {
   type: MigrationUtils.resourceTypes.BOOKMARKS,
 
   get exists() {
@@ -226,25 +227,25 @@ EdgeReadingListMigrator.prototype = {
 
 function EdgeBookmarksMigrator(dbOverride) {
   this.dbOverride = dbOverride;
 }
 
 EdgeBookmarksMigrator.prototype = {
   type: MigrationUtils.resourceTypes.BOOKMARKS,
 
-  get db() { return this.dbOverride || gEdgeDatabase; },
+  get db() { return this.dbOverride || gEdgeDatabase },
 
   get TABLE_NAME() { return "Favorites" },
 
   get exists() {
-    if ("_exists" in this) {
-      return this._exists;
+    if (!("_exists" in this)) {
+      this._exists = !!this.db && this._checkTableExists();
     }
-    return this._exists = (!!this.db && this._checkTableExists());
+    return this._exists;
   },
 
   _checkTableExists() {
     let database;
     let rv;
     try {
       let logFile = this.db.parent;
       logFile.append("LogFiles");
@@ -314,17 +315,17 @@ EdgeBookmarksMigrator.prototype = {
         // If we couldn't sort out a parent, fall back to importing on the root:
         parentGuid = rootGuid;
       }
       let placesInfo = {
         parentGuid,
         url: bookmark.URL,
         dateAdded: bookmark.DateUpdated || new Date(),
         title: bookmark.Title,
-      }
+      };
 
       yield PlacesUtils.bookmarks.insert(placesInfo).catch(ex => {
         if (!exceptionThrown) {
           exceptionThrown = ex;
         }
         Cu.reportError(ex);
       });
     }
@@ -348,17 +349,17 @@ EdgeBookmarksMigrator.prototype = {
     let filterFn = row => {
       if (row.IsDeleted) {
         return false;
       }
       if (row.IsFolder) {
         folderMap.set(row.ItemId, row);
       }
       return true;
-    }
+    };
     let bookmarks = readTableFromEdgeDB(this.TABLE_NAME, columns, filterFn, this.db);
     return {bookmarks, folderMap};
   },
 
   _getGuidForFolder: Task.async(function*(folderId, folderMap, rootGuid) {
     // If the folderId is not known as a folder in the folder map, we assume
     // we just need the root
     if (!folderMap.has(folderId)) {
@@ -372,31 +373,33 @@ EdgeBookmarksMigrator.prototype = {
 
     // Hacks! The bookmarks bar is special:
     if (folder.Title == "_Favorites_Bar_") {
       let toolbarGuid = PlacesUtils.bookmarks.toolbarGuid;
       if (!MigrationUtils.isStartupMigration) {
         toolbarGuid =
           yield MigrationUtils.createImportedBookmarksFolder("Edge", toolbarGuid);
       }
-      return folder._guid = toolbarGuid;
+      folder._guid = toolbarGuid;
+      return folder._guid;
     }
     // Otherwise, get the right parent guid recursively:
     let parentGuid = yield this._getGuidForFolder(folder.ParentId, folderMap, rootGuid);
     let folderInfo = {
       title: folder.Title,
       type: PlacesUtils.bookmarks.TYPE_FOLDER,
       dateAdded: folder.DateUpdated || new Date(),
       parentGuid,
     };
     // and add ourselves as a kid, and return the guid we got.
     let parentBM = yield PlacesUtils.bookmarks.insert(folderInfo);
-    return folder._guid = parentBM.guid;
+    folder._guid = parentBM.guid;
+    return folder._guid;
   }),
-}
+};
 
 function EdgeProfileMigrator() {
   this.wrappedJSObject = this;
 }
 
 EdgeProfileMigrator.prototype = Object.create(MigratorPrototype);
 
 EdgeProfileMigrator.prototype.getESEMigratorForTesting = function(dbOverride) {
@@ -427,17 +430,17 @@ EdgeProfileMigrator.prototype.getLastUse
   if (this.sourceProfiles !== null || !gEdgeDatabase) {
     return Promise.resolve(new Date(0));
   }
   let logFilePath = OS.Path.join(gEdgeDatabase.parent.path, "LogFiles", "edb.log");
   let dbPath = gEdgeDatabase.path;
   let cookieMigrator = MSMigrationUtils.getCookiesMigrator(MSMigrationUtils.MIGRATION_TYPE_EDGE);
   let cookiePaths = cookieMigrator._cookiesFolders.map(f => f.path);
   let datePromises = [logFilePath, dbPath, ... cookiePaths].map(path => {
-    return OS.File.stat(path).catch(_ => null).then(info => {
+    return OS.File.stat(path).catch(() => null).then(info => {
       return info ? info.lastModificationDate : 0;
     });
   });
   datePromises.push(new Promise(resolve => {
     let typedURLs = new Map();
     try {
       typedURLs = MSMigrationUtils.getTypedURLs(kEdgeRegistryRoot);
     } catch (ex) {}
@@ -455,18 +458,18 @@ EdgeProfileMigrator.prototype.getLastUse
  * See MigrationUtils.jsm for slightly more info on how sourceProfiles is used.
  */
 EdgeProfileMigrator.prototype.__defineGetter__("sourceProfiles", function() {
   let isWin10OrHigher = AppConstants.isPlatformAndVersionAtLeast("win", "10");
   return isWin10OrHigher ? null : [];
 });
 
 EdgeProfileMigrator.prototype.__defineGetter__("sourceLocked", function() {
-    // There is an exclusive lock on some databases. Assume they are locked for now.
-    return true;
+  // There is an exclusive lock on some databases. Assume they are locked for now.
+  return true;
 });
 
 
 EdgeProfileMigrator.prototype.classDescription = "Edge Profile Migrator";
 EdgeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=edge";
 EdgeProfileMigrator.prototype.classID = Components.ID("{62e8834b-2d17-49f5-96ff-56344903a2ae}");
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([EdgeProfileMigrator]);
--- a/browser/components/migration/FirefoxProfileMigrator.js
+++ b/browser/components/migration/FirefoxProfileMigrator.js
@@ -11,17 +11,17 @@
  * user's profile.  Data is only migrated where the benefits outweigh the
  * potential problems caused by importing undesired/invalid configurations
  * from the source profile.
  */
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
+Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesBackups",
                                   "resource://gre/modules/PlacesBackups.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "SessionMigration",
                                   "resource:///modules/sessionstore/SessionMigration.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
@@ -34,17 +34,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 
 
 function FirefoxProfileMigrator() {
   this.wrappedJSObject = this; // for testing...
 }
 
 FirefoxProfileMigrator.prototype = Object.create(MigratorPrototype);
 
-FirefoxProfileMigrator.prototype._getAllProfiles = function () {
+FirefoxProfileMigrator.prototype._getAllProfiles = function() {
   let allProfiles = new Map();
   let profiles =
     Components.classes["@mozilla.org/toolkit/profile-service;1"]
               .getService(Components.interfaces.nsIToolkitProfileService)
               .profiles;
   while (profiles.hasMoreElements()) {
     let profile = profiles.getNext().QueryInterface(Ci.nsIToolkitProfile);
     let rootDir = profile.rootDir;
@@ -89,27 +89,27 @@ FirefoxProfileMigrator.prototype.getReso
   // Being a startup-only migrator, we can rely on
   // MigrationUtils.profileStartup being set.
   let currentProfileDir = MigrationUtils.profileStartup.directory;
 
   // Surely data cannot be imported from the current profile.
   if (sourceProfileDir.equals(currentProfileDir))
     return null;
 
-  return this._getResourcesInternal(sourceProfileDir, currentProfileDir, aProfile);
+  return this._getResourcesInternal(sourceProfileDir, currentProfileDir);
 };
 
 FirefoxProfileMigrator.prototype.getLastUsedDate = function() {
   // We always pretend we're really old, so that we don't mess
   // up the determination of which browser is the most 'recent'
   // to import from.
   return Promise.resolve(new Date(0));
 };
 
-FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileDir, currentProfileDir, aProfile) {
+FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileDir, currentProfileDir) {
   let getFileResource = function(aMigrationType, aFileNames) {
     let files = [];
     for (let fileName of aFileNames) {
       let file = this._getFileObject(sourceProfileDir, fileName);
       if (file)
         files.push(file);
     }
     if (!files.length) {
@@ -195,23 +195,23 @@ FirefoxProfileMigrator.prototype._getRes
         let dir = currentProfileDir.clone();
         dir.append(name);
         dir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
         return dir;
       };
 
       // If the 'datareporting' directory exists we migrate files from it.
       let haveStateFile = false;
-      let subdir = this._getFileObject(sourceProfileDir, "datareporting");
-      if (subdir && subdir.isDirectory()) {
+      let dataReportingDir = this._getFileObject(sourceProfileDir, "datareporting");
+      if (dataReportingDir && dataReportingDir.isDirectory()) {
         // Copy only specific files.
         let toCopy = ["state.json", "session-state.json"];
 
         let dest = createSubDir("datareporting");
-        let enumerator = subdir.directoryEntries;
+        let enumerator = dataReportingDir.directoryEntries;
         while (enumerator.hasMoreElements()) {
           let file = enumerator.getNext().QueryInterface(Ci.nsIFile);
           if (file.isDirectory() || toCopy.indexOf(file.leafName) == -1) {
             continue;
           }
 
           if (file.leafName == "state.json") {
             haveStateFile = true;
@@ -220,29 +220,29 @@ FirefoxProfileMigrator.prototype._getRes
         }
       }
 
       if (!haveStateFile) {
         // Fall back to migrating the state file that contains the client id from healthreport/.
         // We first moved the client id management from the FHR implementation to the datareporting
         // service.
         // Consequently, we try to migrate an existing FHR state file here as a fallback.
-        let subdir = this._getFileObject(sourceProfileDir, "healthreport");
-        if (subdir && subdir.isDirectory()) {
-          let stateFile = this._getFileObject(subdir, "state.json");
+        let healthReportDir = this._getFileObject(sourceProfileDir, "healthreport");
+        if (healthReportDir && healthReportDir.isDirectory()) {
+          let stateFile = this._getFileObject(healthReportDir, "state.json");
           if (stateFile) {
             let dest = createSubDir("healthreport");
             stateFile.copyTo(dest, "");
           }
         }
       }
 
       aCallback(true);
     }
-  }
+  };
 
   return [places, cookies, passwords, formData, dictionary, bookmarksBackups,
           session, times, telemetry].filter(r => r);
 };
 
 Object.defineProperty(FirefoxProfileMigrator.prototype, "startupOnlyMigrator", {
   get: () => true
 });
--- a/browser/components/migration/IEProfileMigrator.js
+++ b/browser/components/migration/IEProfileMigrator.js
@@ -8,40 +8,38 @@ const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 const kLoginsKey = "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2";
 const kMainKey = "Software\\Microsoft\\Internet Explorer\\Main";
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
+Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
 Cu.import("resource:///modules/MSMigrationUtils.jsm");
 Cu.import("resource://gre/modules/LoginHelper.jsm");
 
 
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
                                   "resource://gre/modules/ctypes.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
                                   "resource://gre/modules/OSCrypto.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
                                   "resource://gre/modules/WindowsRegistry.jsm");
 
 Cu.importGlobalProperties(["URL"]);
 
-var CtypesKernelHelpers = MSMigrationUtils.CtypesKernelHelpers;
-
 ////////////////////////////////////////////////////////////////////////////////
-//// Resources
+// Resources
 
 
 function History() {
 }
 
 History.prototype = {
   type: MigrationUtils.resourceTypes.HISTORY,
 
@@ -105,17 +103,17 @@ History.prototype = {
       handleCompletion: function() {
         aCallback(this._success);
       }
     });
   }
 };
 
 // IE form password migrator supporting windows from XP until 7 and IE from 7 until 11
-function IE7FormPasswords () {
+function IE7FormPasswords() {
   // used to distinguish between this migrator and other passwords migrators in tests.
   this.name = "IE7FormPasswords";
 }
 
 IE7FormPasswords.prototype = {
   type: MigrationUtils.resourceTypes.PASSWORDS,
 
   get exists() {
@@ -245,17 +243,17 @@ IE7FormPasswords.prototype = {
     for (let ieLogin of ieLogins) {
       try {
         // create a new login
         let login = {
           username: ieLogin.username,
           password: ieLogin.password,
           hostname: ieLogin.url,
           timeCreated: ieLogin.creation,
-          };
+        };
         LoginHelper.maybeImportLogin(login);
       } catch (e) {
         Cu.reportError(e);
       }
     }
   },
 
   /**
@@ -358,17 +356,17 @@ Settings.prototype = {
     // Converts from yes/no to a boolean.
     let yesNoToBoolean = v => v == "yes";
 
     // Converts source format like "en-us,ar-kw;q=0.7,ar-om;q=0.3" into
     // destination format like "en-us, ar-kw, ar-om".
     // Final string is sorted by quality (q=) param.
     function parseAcceptLanguageList(v) {
       return v.match(/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/gi)
-              .sort(function (a, b) {
+              .sort(function(a, b) {
                 let qA = parseFloat(a.split(";q=")[1]) || 1.0;
                 let qB = parseFloat(b.split(";q=")[1]) || 1.0;
                 return qB - qA;
               })
               .map(a => a.split(";")[0]);
     }
 
     // For reference on some of the available IE Registry settings:
@@ -403,33 +401,33 @@ Settings.prototype = {
               v => yesNoToBoolean(v) ? 1 : 2);
     this._set(kMainKey,
               "Move System Caret",
               "accessibility.browsewithcaret",
               yesNoToBoolean);
     this._set("Software\\Microsoft\\Internet Explorer\\Settings",
               "Always Use My Colors",
               "browser.display.document_color_use",
-              v => !Boolean(v) ? 0 : 2);
+              v => (!v ? 0 : 2));
     this._set("Software\\Microsoft\\Internet Explorer\\Settings",
               "Always Use My Font Face",
               "browser.display.use_document_fonts",
-              v => !Boolean(v));
+              v => !v);
     this._set(kMainKey,
               "SmoothScroll",
               "general.smoothScroll",
               Boolean);
     this._set("Software\\Microsoft\\Internet Explorer\\TabbedBrowsing\\",
               "WarnOnClose",
               "browser.tabs.warnOnClose",
               Boolean);
     this._set("Software\\Microsoft\\Internet Explorer\\TabbedBrowsing\\",
               "OpenInForeground",
               "browser.tabs.loadInBackground",
-              v => !Boolean(v));
+              v => !v);
 
     aCallback(true);
   },
 
   /**
    * Reads a setting from the Registry and stores the converted result into
    * the appropriate Firefox preference.
    *
@@ -447,64 +445,64 @@ Settings.prototype = {
                                            aPath, aKey);
     // Don't import settings that have never been flipped.
     if (value === undefined)
       return;
 
     if (aTransformFn)
       value = aTransformFn(value);
 
-    switch (typeof(value)) {
+    switch (typeof value) {
       case "string":
         Services.prefs.setCharPref(aPref, value);
         break;
       case "number":
         Services.prefs.setIntPref(aPref, value);
         break;
       case "boolean":
         Services.prefs.setBoolPref(aPref, value);
         break;
       default:
-        throw new Error("Unexpected value type: " + typeof(value));
+        throw new Error("Unexpected value type: " + (typeof value));
     }
   }
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Migrator
 
 function IEProfileMigrator()
 {
   this.wrappedJSObject = this; // export this to be able to use it in the unittest.
 }
 
 IEProfileMigrator.prototype = Object.create(MigratorPrototype);
 
 IEProfileMigrator.prototype.getResources = function IE_getResources() {
   let resources = [
-    MSMigrationUtils.getBookmarksMigrator()
-  , new History()
-  , MSMigrationUtils.getCookiesMigrator()
-  , new Settings()
+    MSMigrationUtils.getBookmarksMigrator(),
+    new History(),
+    MSMigrationUtils.getCookiesMigrator(),
+    new Settings(),
   ];
   // Only support the form password migrator for Windows XP to 7.
   if (AppConstants.isPlatformAndVersionAtMost("win", "6.1")) {
     resources.push(new IE7FormPasswords());
   }
   let windowsVaultFormPasswordsMigrator =
     MSMigrationUtils.getWindowsVaultFormPasswordsMigrator();
   windowsVaultFormPasswordsMigrator.name = "IEVaultFormPasswords";
   resources.push(windowsVaultFormPasswordsMigrator);
   return resources.filter(r => r.exists);
 };
 
 IEProfileMigrator.prototype.getLastUsedDate = function IE_getLastUsedDate() {
   let datePromises = ["Favs", "CookD"].map(dirId => {
     let {path} = Services.dirsvc.get(dirId, Ci.nsIFile);
-    return OS.File.stat(path).catch(_ => null).then(info => {
+    return OS.File.stat(path).catch(() => null).then(info => {
       return info ? info.lastModificationDate : 0;
     });
   });
   datePromises.push(new Promise(resolve => {
     let typedURLs = new Map();
     try {
       typedURLs = MSMigrationUtils.getTypedURLs("Software\\Microsoft\\Internet Explorer");
     } catch (ex) {}
--- a/browser/components/migration/MSMigrationUtils.jsm
+++ b/browser/components/migration/MSMigrationUtils.jsm
@@ -10,17 +10,17 @@ const { classes: Cc, interfaces: Ci, uti
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource:///modules/MigrationUtils.jsm");
 Cu.import("resource://gre/modules/LoginHelper.jsm");
 
-Cu.importGlobalProperties(['FileReader']);
+Cu.importGlobalProperties(["FileReader"]);
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
                                   "resource://gre/modules/WindowsRegistry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
                                   "resource://gre/modules/ctypes.jsm");
 
@@ -49,17 +49,17 @@ const wintypes = {
   DWORD: ctypes.uint32_t,
   DWORDLONG: ctypes.uint64_t,
   CHAR: ctypes.char,
   PCHAR: ctypes.char.ptr,
   LPCWSTR: ctypes.char16_t.ptr,
   PDWORD: ctypes.uint32_t.ptr,
   VOIDP: ctypes.voidptr_t,
   WORD: ctypes.uint16_t,
-}
+};
 
 // TODO: Bug 1202978 - Refactor MSMigrationUtils ctypes helpers
 function CtypesKernelHelpers() {
   this._structs = {};
   this._functions = {};
   this._libs = {};
 
   this._structs.SYSTEMTIME = new ctypes.StructType("SYSTEMTIME", [
@@ -257,17 +257,17 @@ CtypesVaultHelpers.prototype = {
   finalize() {
     this._structs = {};
     this._functions = {};
     try {
       this._vaultcliLib.close();
     } catch (ex) {}
     this._vaultcliLib = null;
   }
-}
+};
 
 /**
  * Checks whether an host is an IP (v4 or v6) address.
  *
  * @param aHost
  *        The host to check.
  * @return whether aHost is an IP address.
  */
@@ -328,25 +328,25 @@ Bookmarks.prototype = {
     return this._migrationType == MSMigrationUtils.MIGRATION_TYPE_IE ? "IE" : "Edge";
   },
 
   __favoritesFolder: null,
   get _favoritesFolder() {
     if (!this.__favoritesFolder) {
       if (this._migrationType == MSMigrationUtils.MIGRATION_TYPE_IE) {
         let favoritesFolder = Services.dirsvc.get("Favs", Ci.nsIFile);
-        if (favoritesFolder.exists() && favoritesFolder.isReadable())
-          return this.__favoritesFolder = favoritesFolder;
-      }
-      if (this._migrationType == MSMigrationUtils.MIGRATION_TYPE_EDGE) {
+        if (favoritesFolder.exists() && favoritesFolder.isReadable()) {
+          this.__favoritesFolder = favoritesFolder;
+        }
+      } else if (this._migrationType == MSMigrationUtils.MIGRATION_TYPE_EDGE) {
         let edgeDir = getEdgeLocalDataFolder();
         if (edgeDir) {
           edgeDir.appendRelativePath(EDGE_FAVORITES);
           if (edgeDir.exists() && edgeDir.isReadable() && edgeDir.isDirectory()) {
-            return this.__favoritesFolder = edgeDir;
+            this.__favoritesFolder = edgeDir;
           }
         }
       }
     }
     return this.__favoritesFolder;
   },
 
   __toolbarFolderName: null,
@@ -372,17 +372,17 @@ Bookmarks.prototype = {
       // Import to the bookmarks menu.
       let folderGuid = PlacesUtils.bookmarks.menuGuid;
       if (!MigrationUtils.isStartupMigration) {
         folderGuid =
           yield MigrationUtils.createImportedBookmarksFolder(this.importedAppLabel, folderGuid);
       }
       yield this._migrateFolder(this._favoritesFolder, folderGuid);
     }.bind(this)).then(() => aCallback(true),
-                        e => { Cu.reportError(e); aCallback(false) });
+                       e => { Cu.reportError(e); aCallback(false) });
   },
 
   _migrateFolder: Task.async(function* (aSourceFolder, aDestFolderGuid) {
     // TODO (bug 741993): the favorites order is stored in the Registry, at
     // HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Favorites
     // for IE, and in a similar location for Edge.
     // Until we support it, bookmarks are imported in alphabetical order.
     let entries = aSourceFolder.directoryEntries;
@@ -502,17 +502,18 @@ Cookies.prototype = {
         let folder = edgeDir.clone();
         let fullPath = path + EDGE_COOKIES_SUFFIX;
         folder.appendRelativePath(fullPath);
         if (folder.exists() && folder.isReadable() && folder.isDirectory()) {
           folders.push(folder);
         }
       }
     }
-    return this.__cookiesFolders = folders.length ? folders : null;
+    this.__cookiesFolders = folders.length ? folders : null;
+    return this.__cookiesFolders;
   },
 
   migrate(aCallback) {
     this.ctypesKernelHelpers = new CtypesKernelHelpers();
 
     let cookiesGenerator = (function* genCookie() {
       let success = false;
       let folders = this._migrationType == MSMigrationUtils.MIGRATION_TYPE_EDGE ?
@@ -689,18 +690,18 @@ function getTypedURLs(registryKeyPath) {
           let urlTimeHex = [];
           for (let i = 0; i < 8; i++) {
             let c = urlTime.charCodeAt(i).toString(16);
             if (c.length == 1)
               c = "0" + c;
             urlTimeHex.unshift(c);
           }
           try {
-            let hi = parseInt(urlTimeHex.slice(0, 4).join(''), 16);
-            let lo = parseInt(urlTimeHex.slice(4, 8).join(''), 16);
+            let hi = parseInt(urlTimeHex.slice(0, 4).join(""), 16);
+            let lo = parseInt(urlTimeHex.slice(4, 8).join(""), 16);
             // Convert to seconds since epoch:
             timeTyped = cTypes.fileTimeToSecondsSinceEpoch(hi, lo);
             // Callers expect PRTime, which is microseconds since epoch:
             timeTyped *= 1000 * 1000;
           } catch (ex) {
             // Ignore conversion exceptions. Callers will have to deal
             // with the fallback value (0).
           }
@@ -760,33 +761,30 @@ WindowsVaultFormPasswords.prototype = {
     }
 
     let ctypesVaultHelpers = new CtypesVaultHelpers();
     let ctypesKernelHelpers = new CtypesKernelHelpers();
     let migrationSucceeded = true;
     let successfulVaultOpen = false;
     let error, vault;
     try {
-
       // web credentials vault id
       let vaultGuid = new ctypesVaultHelpers._structs.GUID(WEB_CREDENTIALS_VAULT_ID);
-      // number of available vaults
-      let vaultCount = new wintypes.DWORD;
-      error = new wintypes.DWORD;
+      error = new wintypes.DWORD();
       // web credentials vault
-      vault = new wintypes.VOIDP;
+      vault = new wintypes.VOIDP();
       // open the current vault using the vaultGuid
       error = ctypesVaultHelpers._functions.VaultOpenVault(vaultGuid.address(), 0, vault.address());
       if (error != RESULT_SUCCESS) {
         throw new Error("Unable to open Vault: " + error);
       }
       successfulVaultOpen = true;
 
-      let item = new ctypesVaultHelpers._structs.VAULT_ELEMENT.ptr;
-      let itemCount = new wintypes.DWORD;
+      let item = new ctypesVaultHelpers._structs.VAULT_ELEMENT.ptr();
+      let itemCount = new wintypes.DWORD();
       // enumerate all the available items. This api is going to return a table of all the
       // available items and item is going to point to the first element of this table.
       error = ctypesVaultHelpers._functions.VaultEnumerateItems(vault, VAULT_ENUMERATE_ALL_ITEMS,
                                                                 itemCount.address(),
                                                                 item.address());
       if (error != RESULT_SUCCESS) {
         throw new Error("Unable to enumerate Vault items: " + error);
       }
@@ -808,17 +806,17 @@ WindowsVaultFormPasswords.prototype = {
 
           // if aOnlyCheckExists is set to true, the purpose of the call is to return true if there is at
           // least a password which is true in this case because a password was by now already found
           if (aOnlyCheckExists) {
             return true;
           }
           let username = item.contents.pIdentityElement.contents.itemValue.readString();
           // the current login credential object
-          let credential = new ctypesVaultHelpers._structs.VAULT_ELEMENT.ptr;
+          let credential = new ctypesVaultHelpers._structs.VAULT_ELEMENT.ptr();
           error = ctypesVaultHelpers._functions.VaultGetItem(vault,
                                                              item.contents.schemaId.address(),
                                                              item.contents.pResourceElement,
                                                              item.contents.pIdentityElement, null,
                                                              0, 0, credential.address());
           if (error != RESULT_SUCCESS) {
             throw new Error("Unable to get item: " + error);
           }
--- a/browser/components/migration/MigrationUtils.jsm
+++ b/browser/components/migration/MigrationUtils.jsm
@@ -135,17 +135,17 @@ this.MigratorPrototype = {
    *
    * @param aProfile
    *        The profile from which data may be imported, or an empty string
    *        in the case of a single-profile migrator.
    *        In the case of multiple-profiles migrator, it is guaranteed that
    *        aProfile is a value returned by the sourceProfiles getter (see
    *        above).
    */
-  getResources: function MP_getResources(aProfile) {
+  getResources: function MP_getResources(/* aProfile */) {
     throw new Error("getResources must be overridden");
   },
 
   /**
    * OVERRIDE in order to provide an estimate of when the last time was
    * that somebody used the browser. It is OK that this is somewhat fuzzy -
    * history may not be available (or be wiped or not present due to e.g.
    * incognito mode).
@@ -196,17 +196,17 @@ this.MigratorPrototype = {
    * @see nsIBrowserProfileMigrator
    */
   getMigrateData: function MP_getMigrateData(aProfile) {
     let resources = this._getMaybeCachedResources(aProfile);
     if (!resources) {
       return [];
     }
     let types = resources.map(r => r.type);
-    return types.reduce((a, b) => a |= b, 0);
+    return types.reduce((a, b) => { a |= b; return a }, 0);
   },
 
   getKey: function MP_getKey() {
     return this.contractID.match(/\=([^\=]+)$/)[1];
   },
 
   /**
    * DO NOT OVERRIDE - After deCOMing migration, the UI will just call
@@ -256,25 +256,25 @@ this.MigratorPrototype = {
 
     // Called either directly or through the bookmarks import callback.
     let doMigrate = Task.async(function*() {
       let resourcesGroupedByItems = new Map();
       resources.forEach(function(resource) {
         if (!resourcesGroupedByItems.has(resource.type)) {
           resourcesGroupedByItems.set(resource.type, new Set());
         }
-        resourcesGroupedByItems.get(resource.type).add(resource)
+        resourcesGroupedByItems.get(resource.type).add(resource);
       });
 
       if (resourcesGroupedByItems.size == 0)
         throw new Error("No items to import");
 
       let notify = function(aMsg, aItemType) {
         Services.obs.notifyObservers(null, aMsg, aItemType);
-      }
+      };
 
       notify("Migration:Started");
       for (let [key, value] of resourcesGroupedByItems) {
         // Workaround bug 449811.
         let migrationType = key, itemResources = value;
 
         notify("Migration:ItemBeforeMigrate", migrationType);
 
@@ -293,17 +293,17 @@ this.MigratorPrototype = {
                      "Migration:ItemAfterMigrate" : "Migration:ItemError",
                      migrationType);
               resourcesGroupedByItems.delete(migrationType);
               if (resourcesGroupedByItems.size == 0) {
                 notify("Migration:Ended");
               }
             }
             completeDeferred.resolve();
-          }
+          };
 
           // If migrate throws, an error occurred, and the callback
           // (itemMayBeDone) might haven't been called.
           try {
             resource.migrate(resourceDone);
           }
           catch (ex) {
             Cu.reportError(ex);
@@ -393,17 +393,18 @@ this.MigratorPrototype = {
     let profileKey = aProfile ? aProfile.id : "";
     if (this._resourcesByProfile) {
       if (profileKey in this._resourcesByProfile)
         return this._resourcesByProfile[profileKey];
     }
     else {
       this._resourcesByProfile = { };
     }
-    return this._resourcesByProfile[profileKey] = this.getResources(aProfile);
+    this._resourcesByProfile[profileKey] = this.getResources(aProfile);
+    return this._resourcesByProfile[profileKey];
   }
 };
 
 this.MigrationUtils = Object.freeze({
   resourceTypes: {
     SETTINGS:   Ci.nsIBrowserProfileMigrator.SETTINGS,
     COOKIES:    Ci.nsIBrowserProfileMigrator.COOKIES,
     HISTORY:    Ci.nsIBrowserProfileMigrator.HISTORY,
@@ -458,17 +459,17 @@ this.MigrationUtils = Object.freeze({
       }
       catch (ex) {
         Cu.reportError(ex);
       }
       // Do not change this to call aCallback directly in try try & catch
       // blocks, because if aCallback throws, we may end up calling aCallback
       // twice.
       aCallback(success);
-    }
+    };
   },
 
   /**
    * Gets a string from the migration bundle.  Shorthand for
    * nsIStringBundle.GetStringFromName, if aReplacements isn't passed, or for
    * nsIStringBundle.formatStringFromName if it is.
    *
    * This method also takes care of "bumped" keys (See bug 737381 comment 8 for
@@ -607,17 +608,20 @@ this.MigrationUtils = Object.freeze({
       if (!rows) {
         throw new Error("Couldn't get rows from the " + description + " database.");
       }
       return rows;
     });
   },
 
   get _migrators() {
-    return gMigrators ? gMigrators : gMigrators = new Map();
+    if (!gMigrators) {
+      gMigrators = new Map();
+    }
+    return gMigrators;
   },
 
   /*
    * Returns the migrator for the given source, if any data is available
    * for this source, or null otherwise.
    *
    * @param aKey internal name of the migration source.
    *             Supported values: ie (windows),
@@ -672,23 +676,22 @@ this.MigrationUtils = Object.freeze({
       "Firefox":                           "firefox",
       "Google Chrome":                     "chrome",  // Windows, Linux
       "Chrome":                            "chrome",  // OS X
       "Chromium":                          "chromium", // Windows, OS X
       "Chromium Web Browser":              "chromium", // Linux
       "360\u5b89\u5168\u6d4f\u89c8\u5668": "360se",
     };
 
-    let browserDesc = "";
     let key = "";
     try {
       let browserDesc =
-        Cc["@mozilla.org/uriloader/external-protocol-service;1"].
-        getService(Ci.nsIExternalProtocolService).
-        getApplicationDescription("http");
+        Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+          .getService(Ci.nsIExternalProtocolService)
+          .getApplicationDescription("http");
       key = APP_DESC_TO_KEY[browserDesc] || "";
     }
     catch (ex) {
       Cu.reportError("Could not detect default browser: " + ex);
     }
 
     // "firefox" is the least useful entry here, and might just be because we've set
     // ourselves as the default (on Windows 7 and below). In that case, check if we
@@ -790,16 +793,18 @@ this.MigrationUtils = Object.freeze({
               break;
 
             case "undefined":
             case "object":
               if (!item) {
                 comtaminatedVal = null;
                 break;
               }
+              /* intentionally falling through to error out here for
+                 non-null/undefined things: */
             default:
               throw new Error("Unexpected parameter type " + (typeof item) + ": " + item);
           }
         }
         params.appendElement(comtaminatedVal, false);
       }
     } else {
       params = aParams;
--- a/browser/components/migration/SafariProfileMigrator.js
+++ b/browser/components/migration/SafariProfileMigrator.js
@@ -5,21 +5,21 @@
 "use strict";
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
+Cu.import("resource://gre/modules/osfile.jsm"); /* globals OS */
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
+Cu.import("resource:///modules/MigrationUtils.jsm"); /* globals MigratorPrototype */
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PropertyListUtils",
                                   "resource://gre/modules/PropertyListUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
@@ -127,20 +127,20 @@ Bookmarks.prototype = {
         }
         break;
       }
       case this.READING_LIST_COLLECTION: {
         // Reading list items are imported as regular bookmarks.
         // They are imported under their own folder, created either under the
         // bookmarks menu (in the case of startup migration).
         folderGuid = (yield PlacesUtils.bookmarks.insert({
-            parentGuid: PlacesUtils.bookmarks.menuGuid,
-            type: PlacesUtils.bookmarks.TYPE_FOLDER,
-            title: MigrationUtils.getLocalizedString("importedSafariReadingList"),
-          })).guid;
+          parentGuid: PlacesUtils.bookmarks.menuGuid,
+          type: PlacesUtils.bookmarks.TYPE_FOLDER,
+          title: MigrationUtils.getLocalizedString("importedSafariReadingList"),
+        })).guid;
         break;
       }
       default:
         throw new Error("Unexpected value for aCollection!");
     }
     if (folderGuid == -1)
       throw new Error("Invalid folder GUID");
 
@@ -220,17 +220,17 @@ History.prototype = {
               places.push({ uri: NetUtil.newURI(entry.get("")),
                             title: entry.get("title"),
                             visits: [{ transitionType: transType,
                                        visitDate: visitDate }] });
             }
             catch (ex) {
               // Safari's History file may contain malformed URIs which
               // will be ignored.
-              Cu.reportError(ex)
+              Cu.reportError(ex);
             }
           }
         }
         if (places.length > 0) {
           PlacesUtils.asyncHistory.updatePlaces(places, {
             _success: false,
             handleResult: function() {
               // Importing any entry is considered a successful import.
@@ -343,17 +343,16 @@ Preferences.prototype = {
         // Blocked                          FALSE     2
         // Allowed                          TRUE      1
         // Allowed, originating site only   --        3
         this._set("WebKitDisplayImagesKey", "permissions.default.image",
                   webkitVal => webkitVal ? 1 : 2);
 
         this._migrateFontSettings();
         yield this._migrateDownloadsFolder();
-
       }.bind(this)).then(() => aCallback(true), ex => {
         Cu.reportError(ex);
         aCallback(false);
       }).catch(Cu.reportError);
     });
   },
 
   /**
@@ -371,30 +370,30 @@ Preferences.prototype = {
    *        at all.
    * @return whether or not aMozPref was set.
    */
   _set: function MPR_set(aSafariKey, aMozPref, aConvertFunction) {
     if (this._dict.has(aSafariKey)) {
       let safariVal = this._dict.get(aSafariKey);
       let mozVal = aConvertFunction !== undefined ?
                    aConvertFunction(safariVal) : safariVal;
-      switch (typeof(mozVal)) {
+      switch (typeof mozVal) {
         case "string":
           Services.prefs.setCharPref(aMozPref, mozVal);
           break;
         case "number":
           Services.prefs.setIntPref(aMozPref, mozVal);
           break;
         case "boolean":
           Services.prefs.setBoolPref(aMozPref, mozVal);
           break;
         case "undefined":
           return false;
         default:
-          throw new Error("Unexpected value type: " + typeof(mozVal));
+          throw new Error("Unexpected value type: " + (typeof mozVal));
       }
     }
     return true;
   },
 
   // Fonts settings are quite problematic for migration, for a couple of
   // reasons:
   // (a) Every font preference in Gecko is set for a particular language.
@@ -418,17 +417,17 @@ Preferences.prototype = {
   // we set it for all languages.
   // As for the font type of the default font (serif/sans-serif), the default
   // type for the given language is used (set in font.default.LANGGROUP).
   _migrateFontSettings: function MPR__migrateFontSettings() {
     // If "Never use font sizes smaller than [ ] is set", migrate it for all
     // languages.
     if (this._dict.has("WebKitMinimumFontSize")) {
       let minimumSize = this._dict.get("WebKitMinimumFontSize");
-      if (typeof(minimumSize) == "number") {
+      if (typeof minimumSize == "number") {
         let prefs = Services.prefs.getChildList("font.minimum-size");
         for (let pref of prefs) {
           Services.prefs.setIntPref(pref, minimumSize);
         }
       }
       else {
         Cu.reportError("WebKitMinimumFontSize was set to an invalid value: " +
                        minimumSize);
@@ -583,18 +582,16 @@ SafariProfileMigrator.prototype.getResou
 
   // The Reading List feature was introduced at the same time in Windows and
   // Mac versions of Safari.  Not surprisingly, they are stored in the same
   // format in both versions.  Surpsingly, only on Windows there is a
   // separate property list for it.  This code is used on mac too, because
   // Apple may fix this at some point.
   pushProfileFileResource("ReadingList.plist", Bookmarks);
 
-  let prefsDir = FileUtils.getDir("UsrPrfs", [], false);
-
   let prefs = this.mainPreferencesPropertyList;
   if (prefs) {
     resources.push(new Preferences(prefs));
     resources.push(new SearchStrings(prefs));
   }
 
   let wfFile = FileUtils.getFile("UsrPrfs", ["com.apple.WebFoundation.plist"]);
   if (wfFile.exists())
@@ -602,37 +599,39 @@ SafariProfileMigrator.prototype.getResou
 
   return resources;
 };
 
 SafariProfileMigrator.prototype.getLastUsedDate = function SM_getLastUsedDate() {
   let profileDir = FileUtils.getDir("ULibDir", ["Safari"], false);
   let datePromises = ["Bookmarks.plist", "History.plist"].map(file => {
     let path = OS.Path.join(profileDir.path, file);
-    return OS.File.stat(path).catch(_ => null).then(info => {
+    return OS.File.stat(path).catch(() => null).then(info => {
       return info ? info.lastModificationDate : 0;
     });
   });
   return Promise.all(datePromises).then(dates => {
     return new Date(Math.max.apply(Math, dates));
   });
 };
 
 Object.defineProperty(SafariProfileMigrator.prototype, "mainPreferencesPropertyList", {
   get: function get_mainPreferencesPropertyList() {
     if (this._mainPreferencesPropertyList === undefined) {
       let file = FileUtils.getDir("UsrPrfs", [], false);
       if (file.exists()) {
         file.append("com.apple.Safari.plist");
         if (file.exists()) {
-          return this._mainPreferencesPropertyList =
+          this._mainPreferencesPropertyList =
             new MainPreferencesPropertyList(file);
+          return this._mainPreferencesPropertyList;
         }
       }
-      return this._mainPreferencesPropertyList = null;
+      this._mainPreferencesPropertyList = null;
+      return this._mainPreferencesPropertyList;
     }
     return this._mainPreferencesPropertyList;
   }
 });
 
 Object.defineProperty(SafariProfileMigrator.prototype, "sourceHomePageURL", {
   get: function get_sourceHomePageURL() {
     if (this.mainPreferencesPropertyList) {
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -1,23 +1,25 @@
 /* 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/. */
 
+"use strict";
+
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cu = Components.utils;
 
 const kIMig = Ci.nsIBrowserProfileMigrator;
 const kIPStartup = Ci.nsIProfileStartup;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource:///modules/MigrationUtils.jsm");
 
-var MigrationWizard = {
+var MigrationWizard = { /* exported MigrationWizard */
   _source: "",                  // Source Profile Migrator ContractID suffix
   _itemsFlags: kIMig.ALL,       // Selected Import Data Sources (16-bit bitfield)
   _selectedProfile: null,       // Selected Profile name to import from
   _wiz: null,
   _migrator: null,
   _autoMigrate: null,
 
   init: function ()
@@ -33,17 +35,17 @@ var MigrationWizard = {
 
     let args = window.arguments;
     let entryPointId = args[0] || MigrationUtils.MIGRATION_ENTRYPOINT_UNKNOWN;
     Services.telemetry.getHistogramById("FX_MIGRATION_ENTRY_POINT").add(entryPointId);
     this.isInitialMigration = entryPointId == MigrationUtils.MIGRATION_ENTRYPOINT_FIRSTRUN;
 
     if (args.length > 1) {
       this._source = args[1];
-      this._migrator = args[2] instanceof kIMig ?  args[2] : null;
+      this._migrator = args[2] instanceof kIMig ? args[2] : null;
       this._autoMigrate = args[3].QueryInterface(kIPStartup);
       this._skipImportSourcePage = args[4];
       if (this._migrator && args[5]) {
         let sourceProfiles = this._migrator.sourceProfiles;
         this._selectedProfile = sourceProfiles.find(profile => profile.id == args[5]);
       }
 
       if (this._autoMigrate) {
@@ -262,17 +264,17 @@ var MigrationWizard = {
     this._itemsFlags = 0;
     for (var i = 0; i < dataSources.childNodes.length; ++i) {
       var checkbox = dataSources.childNodes[i];
       if (checkbox.localName == "checkbox" && checkbox.checked)
         this._itemsFlags |= parseInt(checkbox.id);
     }
   },
 
-  onImportItemCommand: function (aEvent)
+  onImportItemCommand: function ()
   {
     var items = document.getElementById("dataSources");
     var checkboxes = items.getElementsByTagName("checkbox");
 
     var oneChecked = false;
     for (var i = 0; i < checkboxes.length; ++i) {
       if (checkboxes[i].checked) {
         oneChecked = true;
@@ -288,22 +290,23 @@ var MigrationWizard = {
   {
     // only want this on the first run
     if (!this._autoMigrate) {
       this._wiz.advance();
       return;
     }
 
     var brandBundle = document.getElementById("brandBundle");
+    var pageTitle, pageDesc, mainStr;
     // These strings don't exist when not using official branding. If that's
     // the case, just skip this page.
     try {
-      var pageTitle = brandBundle.getString("homePageMigrationPageTitle");
-      var pageDesc = brandBundle.getString("homePageMigrationDescription");
-      var mainStr = brandBundle.getString("homePageSingleStartMain");
+      pageTitle = brandBundle.getString("homePageMigrationPageTitle");
+      pageDesc = brandBundle.getString("homePageMigrationDescription");
+      mainStr = brandBundle.getString("homePageSingleStartMain");
     }
     catch (e) {
       this._wiz.advance();
       return;
     }
 
     document.getElementById("homePageImport").setAttribute("label", pageTitle);
     document.getElementById("homePageImportDesc").setAttribute("value", pageDesc);
@@ -370,28 +373,27 @@ var MigrationWizard = {
       let hist = Services.telemetry.getKeyedHistogramById("FX_MIGRATION_USAGE");
       let exp = 0;
       let items = this._itemsFlags;
       while (items) {
         if (items & 1) {
           hist.add(this._source, exp);
         }
         items = items >> 1;
-        exp++
+        exp++;
       }
     }
   },
 
   _listItems: function (aID)
   {
     var items = document.getElementById(aID);
     while (items.hasChildNodes())
       items.removeChild(items.firstChild);
 
-    var brandBundle = document.getElementById("brandBundle");
     var itemID;
     for (var i = 0; i < 16; ++i) {
       itemID = (this._itemsFlags >> i) & 0x1 ? Math.pow(2, i) : 0;
       if (itemID > 0) {
         var label = document.createElement("label");
         label.id = itemID + "_migrated";
         try {
           label.setAttribute("value",
@@ -406,114 +408,114 @@ var MigrationWizard = {
       }
     }
   },
 
   observe: function (aSubject, aTopic, aData)
   {
     var label;
     switch (aTopic) {
-    case "Migration:Started":
-      break;
-    case "Migration:ItemBeforeMigrate":
-      label = document.getElementById(aData + "_migrated");
-      if (label)
-        label.setAttribute("style", "font-weight: bold");
-      break;
-    case "Migration:ItemAfterMigrate":
-      label = document.getElementById(aData + "_migrated");
-      if (label)
-        label.removeAttribute("style");
-      break;
-    case "Migration:Ended":
-      if (this.isInitialMigration) {
-        // Ensure errors in reporting data recency do not affect the rest of the migration.
-        try {
-          this.reportDataRecencyTelemetry();
-        } catch (ex) {
-          Cu.reportError(ex);
-        }
-      }
-      if (this._autoMigrate) {
-        let hasImportedHomepage = !!(this._newHomePage && this._newHomePage != "DEFAULT");
-        Services.telemetry.getKeyedHistogramById("FX_MIGRATION_IMPORTED_HOMEPAGE")
-                          .add(this._source, hasImportedHomepage);
-        if (this._newHomePage) {
+      case "Migration:Started":
+        break;
+      case "Migration:ItemBeforeMigrate":
+        label = document.getElementById(aData + "_migrated");
+        if (label)
+          label.setAttribute("style", "font-weight: bold");
+        break;
+      case "Migration:ItemAfterMigrate":
+        label = document.getElementById(aData + "_migrated");
+        if (label)
+          label.removeAttribute("style");
+        break;
+      case "Migration:Ended":
+        if (this.isInitialMigration) {
+          // Ensure errors in reporting data recency do not affect the rest of the migration.
           try {
-            // set homepage properly
-            var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
-                                    .getService(Components.interfaces.nsIPrefService);
-            var prefBranch = prefSvc.getBranch(null);
-
-            if (this._newHomePage == "DEFAULT") {
-              prefBranch.clearUserPref("browser.startup.homepage");
-            }
-            else {
-              var str = Components.classes["@mozilla.org/supports-string;1"]
-                                .createInstance(Components.interfaces.nsISupportsString);
-              str.data = this._newHomePage;
-              prefBranch.setComplexValue("browser.startup.homepage",
-                                         Components.interfaces.nsISupportsString,
-                                         str);
-            }
-
-            var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
-                                   .getService(Components.interfaces.nsIProperties);
-            var prefFile = dirSvc.get("ProfDS", Components.interfaces.nsIFile);
-            prefFile.append("prefs.js");
-            prefSvc.savePrefFile(prefFile);
+            this.reportDataRecencyTelemetry();
           } catch (ex) {
-            dump(ex);
+            Cu.reportError(ex);
           }
         }
-
-        // We're done now.
-        this._wiz.canAdvance = true;
-        this._wiz.advance();
+        if (this._autoMigrate) {
+          let hasImportedHomepage = !!(this._newHomePage && this._newHomePage != "DEFAULT");
+          Services.telemetry.getKeyedHistogramById("FX_MIGRATION_IMPORTED_HOMEPAGE")
+                            .add(this._source, hasImportedHomepage);
+          if (this._newHomePage) {
+            try {
+              // set homepage properly
+              var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
+                                      .getService(Components.interfaces.nsIPrefService);
+              var prefBranch = prefSvc.getBranch(null);
 
-        setTimeout(close, 5000);
-      }
-      else {
-        this._wiz.canAdvance = true;
-        var nextButton = this._wiz.getButton("next");
-        nextButton.click();
-      }
-      break;
-    case "Migration:ItemError":
-      let type = "undefined";
-      let numericType = parseInt(aData);
-      switch (numericType) {
-      case Ci.nsIBrowserProfileMigrator.SETTINGS:
-        type = "settings";
-        break;
-      case Ci.nsIBrowserProfileMigrator.COOKIES:
-        type = "cookies";
+              if (this._newHomePage == "DEFAULT") {
+                prefBranch.clearUserPref("browser.startup.homepage");
+              }
+              else {
+                var str = Components.classes["@mozilla.org/supports-string;1"]
+                                  .createInstance(Components.interfaces.nsISupportsString);
+                str.data = this._newHomePage;
+                prefBranch.setComplexValue("browser.startup.homepage",
+                                           Components.interfaces.nsISupportsString,
+                                           str);
+              }
+
+              var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
+                                     .getService(Components.interfaces.nsIProperties);
+              var prefFile = dirSvc.get("ProfDS", Components.interfaces.nsIFile);
+              prefFile.append("prefs.js");
+              prefSvc.savePrefFile(prefFile);
+            } catch (ex) {
+              dump(ex);
+            }
+          }
+
+          // We're done now.
+          this._wiz.canAdvance = true;
+          this._wiz.advance();
+
+          setTimeout(close, 5000);
+        }
+        else {
+          this._wiz.canAdvance = true;
+          var nextButton = this._wiz.getButton("next");
+          nextButton.click();
+        }
         break;
-      case Ci.nsIBrowserProfileMigrator.HISTORY:
-        type = "history";
-        break;
-      case Ci.nsIBrowserProfileMigrator.FORMDATA:
-        type = "form data";
-        break;
-      case Ci.nsIBrowserProfileMigrator.PASSWORDS:
-        type = "passwords";
+      case "Migration:ItemError":
+        let type = "undefined";
+        let numericType = parseInt(aData);
+        switch (numericType) {
+          case Ci.nsIBrowserProfileMigrator.SETTINGS:
+            type = "settings";
+            break;
+          case Ci.nsIBrowserProfileMigrator.COOKIES:
+            type = "cookies";
+            break;
+          case Ci.nsIBrowserProfileMigrator.HISTORY:
+            type = "history";
+            break;
+          case Ci.nsIBrowserProfileMigrator.FORMDATA:
+            type = "form data";
+            break;
+          case Ci.nsIBrowserProfileMigrator.PASSWORDS:
+            type = "passwords";
+            break;
+          case Ci.nsIBrowserProfileMigrator.BOOKMARKS:
+            type = "bookmarks";
+            break;
+          case Ci.nsIBrowserProfileMigrator.OTHERDATA:
+            type = "misc. data";
+            break;
+        }
+        Cc["@mozilla.org/consoleservice;1"]
+          .getService(Ci.nsIConsoleService)
+          .logStringMessage("some " + type + " did not successfully migrate.");
+        Services.telemetry.getKeyedHistogramById("FX_MIGRATION_ERRORS")
+                          .add(this._source, Math.log2(numericType));
         break;
-      case Ci.nsIBrowserProfileMigrator.BOOKMARKS:
-        type = "bookmarks";
-        break;
-      case Ci.nsIBrowserProfileMigrator.OTHERDATA:
-        type = "misc. data";
-        break;
-      }
-      Cc["@mozilla.org/consoleservice;1"]
-        .getService(Ci.nsIConsoleService)
-        .logStringMessage("some " + type + " did not successfully migrate.");
-      Services.telemetry.getKeyedHistogramById("FX_MIGRATION_ERRORS")
-                        .add(this._source, Math.log2(numericType));
-      break;
     }
   },
 
   onDonePageShow: function ()
   {
     this._wiz.getButton("cancel").disabled = true;
     this._wiz.canRewind = false;
     this._listItems("doneItems");
@@ -532,16 +534,16 @@ var MigrationWizard = {
           diffInHours = ONE_YEAR;
         }
         histogram.add(localKey, diffInHours);
         return [localKey, diffInHours];
       }));
     }
     Promise.all(lastUsedPromises).then(migratorUsedTimeDiff => {
       // Sort low to high.
-      migratorUsedTimeDiff.sort(([keyA, diffA], [keyB, diffB]) => diffA - diffB);
+      migratorUsedTimeDiff.sort(([keyA, diffA], [keyB, diffB]) => diffA - diffB); /* eslint no-unused-vars: off */
       let usedMostRecentBrowser = migratorUsedTimeDiff.length && this._source == migratorUsedTimeDiff[0][0];
       let usedRecentBrowser =
         Services.telemetry.getKeyedHistogramById("FX_STARTUP_MIGRATION_USED_RECENT_BROWSER");
       usedRecentBrowser.add(this._source, usedMostRecentBrowser);
     });
   },
 };
--- a/browser/components/migration/tests/unit/.eslintrc.js
+++ b/browser/components/migration/tests/unit/.eslintrc.js
@@ -1,7 +1,7 @@
 "use strict";
 
-module.exports = {
+module.exports = { // eslint-disable-line no-undef
   "extends": [
     "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
   ]
 };
--- a/browser/components/migration/tests/unit/head_migration.js
+++ b/browser/components/migration/tests/unit/head_migration.js
@@ -1,8 +1,12 @@
+"use strict";
+
+/* exported gProfD, promiseMigration, registerFakePath */
+
 var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
 
 Cu.importGlobalProperties([ "URL" ]);
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
@@ -10,17 +14,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "MigrationUtils",
                                   "resource:///modules/MigrationUtils.jsm");
 
 // Initialize profile.
 var gProfD = do_get_profile();
 
-Cu.import("resource://testing-common/AppInfo.jsm");
+Cu.import("resource://testing-common/AppInfo.jsm"); /* globals updateAppInfo */
 updateAppInfo();
 
 /**
  * Migrates the requested resource and waits for the migration to be complete.
  */
 function promiseMigration(migrator, resourceType, aProfile = null) {
   // Ensure resource migration is available.
   let availableSources = migrator.getMigrateData(aProfile, false);
--- a/browser/components/migration/tests/unit/test_Chrome_cookies.js
+++ b/browser/components/migration/tests/unit/test_Chrome_cookies.js
@@ -1,8 +1,10 @@
+"use strict";
+
 Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
 
 add_task(function* () {
   registerFakePath("ULibDir", do_get_file("Library/"));
   let migrator = MigrationUtils.getMigrator("chrome");
 
   Assert.ok(migrator.sourceExists, "Sanity check the source exists");
 
@@ -41,10 +43,9 @@ add_task(function* () {
   for (let prop of Object.keys(COOKIE)) {
     Assert.equal(foundCookie[prop], COOKIE[prop], "Check cookie " + prop);
   }
 
   // Cleanup.
   ForgetAboutSite.removeDataFromDomain(COOKIE.host);
   Assert.equal(Services.cookies.countCookiesFromHost(COOKIE.host), 0,
                "There are no cookies after cleanup");
-
 });
--- a/browser/components/migration/tests/unit/test_Chrome_passwords.js
+++ b/browser/components/migration/tests/unit/test_Chrome_passwords.js
@@ -1,8 +1,10 @@
+"use strict";
+
 Cu.import("resource://gre/modules/OSCrypto.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 const PROFILE = {
   id: "Default",
   name: "Person 1",
 };
 
--- a/browser/components/migration/tests/unit/test_Edge_availability.js
+++ b/browser/components/migration/tests/unit/test_Edge_availability.js
@@ -1,8 +1,10 @@
+"use strict";
+
 const EDGE_AVAILABLE_MIGRATIONS =
   MigrationUtils.resourceTypes.COOKIES |
   MigrationUtils.resourceTypes.BOOKMARKS |
   MigrationUtils.resourceTypes.HISTORY |
   MigrationUtils.resourceTypes.PASSWORDS;
 
 add_task(function* () {
   let migrator = MigrationUtils.getMigrator("edge");
--- a/browser/components/migration/tests/unit/test_Edge_db_migration.js
+++ b/browser/components/migration/tests/unit/test_Edge_db_migration.js
@@ -35,30 +35,31 @@ function createColumnCreationWrapper({na
   wrapper.name = new wchar_tArray(name.length + 1);
   wrapper.name.value = String(name);
   wrapper.column.szColumnName = wrapper.name;
   wrapper.column.coltyp = type;
   let fallback = 0;
   switch (type) {
     case COLUMN_TYPES.JET_coltypText:
       fallback = 255;
+      // Intentional fall-through
     case COLUMN_TYPES.JET_coltypLongText:
       wrapper.column.cbMax = cbMax || fallback || 64 * 1024;
       break;
     case COLUMN_TYPES.JET_coltypGUID:
       wrapper.column.cbMax = 16;
       break;
     case COLUMN_TYPES.JET_coltypBit:
       wrapper.column.cbMax = 1;
       break;
     case COLUMN_TYPES.JET_coltypLongLong:
       wrapper.column.cbMax = 8;
       break;
     default:
-      throw "Unknown column type!";
+      throw new Error("Unknown column type!");
   }
 
   wrapper.column.columnid = new ESE.JET_COLUMNID();
   wrapper.column.grbit = 0;
   wrapper.column.pvDefault = null;
   wrapper.column.cbDefault = 0;
   wrapper.column.cp = 0;
 
@@ -231,18 +232,18 @@ let eseDBWritingHelpers = {
         // created column ids.
         let columnCount = ctypes.UInt64.lo(tableCreationWrapper.table.cColumns);
         let columnsPassed = tableCreationWrapper.table.rgcolumncreate;
         for (let i = 0; i < columnCount; i++) {
           let column = columnsPassed.contents;
           columnIdMap.set(column.szColumnName.readString(), column);
           columnsPassed = columnsPassed.increment();
         }
-        let rv = ESE.ManualMove(this._sessionId, this._tableId,
-                                -2147483648 /* JET_MoveFirst */, 0);
+        ESE.ManualMove(this._sessionId, this._tableId,
+                       -2147483648 /* JET_MoveFirst */, 0);
         ESE.BeginTransaction(this._sessionId);
         for (let row of rows) {
           ESE.PrepareUpdate(this._sessionId, this._tableId, 0 /* JET_prepInsert */);
           for (let columnName in row) {
             let col = columnIdMap.get(columnName);
             let colId = col.columnid;
             let [val, valSize] = convertValueForWriting(row[columnName], col.coltyp);
             /* JET_bitSetOverwriteLV */
@@ -255,17 +256,16 @@ let eseDBWritingHelpers = {
       }
     } finally {
       try {
         this._close();
       } catch (ex) {
         Cu.reportError(ex);
       }
     }
-
   },
 
   _close() {
     if (this._tableId) {
       ESE.FailSafeCloseTable(this._sessionId, this._tableId);
       delete this._tableId;
     }
     if (this._opened) {
@@ -396,17 +396,17 @@ add_task(function*() {
       seenBookmarks.push({itemId, parentId, index, itemType, url, title, dateAdded, itemGuid, parentGuid});
     },
     onBeginUpdateBatch() {},
     onEndUpdateBatch() {},
     onItemRemoved() {},
     onItemChanged() {},
     onItemVisited() {},
     onItemMoved() {},
-  }
+  };
   PlacesUtils.bookmarks.addObserver(bookmarkObserver, false);
 
   let migrateResult = yield new Promise(resolve => bookmarksMigrator.migrate(resolve)).catch(ex => {
     Cu.reportError(ex);
     Assert.ok(false, "Got an exception trying to migrate data! " + ex);
     return false;
   });
   PlacesUtils.bookmarks.removeObserver(bookmarkObserver);
@@ -447,17 +447,17 @@ add_task(function*() {
       Assert.ok(true, "Expect toolbar and menu folders to not be in menu or toolbar");
     } else {
       // Bit hacky, but we do need to check this.
       Assert.equal(bookmark.title, "Item in folder", "Subfoldered item shouldn't be in menu or toolbar");
       let parent = seenBookmarks.find(maybeParent => maybeParent.itemGuid == bookmark.parentGuid);
       Assert.equal(parent && parent.title, "Folder", "Subfoldered item should be in subfolder labeled 'Folder'");
     }
 
-    let dbItem = itemsInDB.find(dbItem => bookmark.title == dbItem.Title);
+    let dbItem = itemsInDB.find(someItem => bookmark.title == someItem.Title);
     if (!dbItem) {
       Assert.equal(bookmark.title, importParentFolderName, "Only the extra layer of folders isn't in the input we stuck in the DB.");
       Assert.ok([menuParentGuid, toolbarParentGuid].includes(bookmark.itemGuid), "This item should be one of the containers");
     } else {
       Assert.equal(dbItem.URL || null, bookmark.url && bookmark.url.spec, "URL is correct");
       Assert.equal(dbItem.DateUpdated.valueOf(), (new Date(bookmark.dateAdded / 1000)).valueOf(), "Date added is correct");
     }
   }
--- a/browser/components/migration/tests/unit/test_IE7_passwords.js
+++ b/browser/components/migration/tests/unit/test_IE7_passwords.js
@@ -1,19 +1,20 @@
+"use strict";
+
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
                                   "resource://gre/modules/WindowsRegistry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
                                   "resource://gre/modules/OSCrypto.jsm");
 
-const CRYPT_PROTECT_UI_FORBIDDEN = 1;
 const IE7_FORM_PASSWORDS_MIGRATOR_NAME = "IE7FormPasswords";
-const LOGINS_KEY =  "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2";
+const LOGINS_KEY = "Software\\Microsoft\\Internet Explorer\\IntelliForms\\Storage2";
 const EXTENSION = "-backup";
 const TESTED_WEBSITES = {
   twitter: {
     uri: makeURI("https://twitter.com"),
     hash: "A89D42BC6406E27265B1AD0782B6F376375764A301",
     data: [12, 0, 0, 0, 56, 0, 0, 0, 38, 0, 0, 0, 87, 73, 67, 75, 24, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 36, 67, 124, 118, 212, 208, 1, 8, 0, 0, 0, 18, 0, 0, 0, 68, 36, 67, 124, 118, 212, 208, 1, 9, 0, 0, 0, 97, 0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0, 103, 0, 104, 0, 0, 0, 49, 0, 50, 0, 51, 0, 52, 0, 53, 0, 54, 0, 55, 0, 56, 0, 57, 0, 0, 0],
     logins: [
       {
@@ -43,18 +44,18 @@ const TESTED_WEBSITES = {
         formSubmitURL: "",
         httpRealm: null,
         usernameField: "",
         passwordField: "",
         timeCreated: 1439326966000,
         timeLastUsed: 1439326966000,
         timePasswordChanged: 1439326966000,
         timesUsed: 1,
-     },
-     {
+      },
+      {
         username: "username1",
         password: "password1",
         hostname: "https://www.facebook.com",
         formSubmitURL: "",
         httpRealm: null,
         usernameField: "",
         passwordField: "",
         timeCreated: 1439326997000,
@@ -102,17 +103,17 @@ const TESTED_WEBSITES = {
         formSubmitURL: "",
         httpRealm: null,
         usernameField: "",
         passwordField: "",
         timeCreated: 1439338767000,
         timeLastUsed: 1439338767000,
         timePasswordChanged: 1439338767000,
         timesUsed: 1,
-       },
+      },
     ],
   },
   reddit: {
     uri: makeURI("http://www.reddit.com/"),
     hash: "B644028D1C109A91EC2C4B9D1F145E55A1FAE42065",
     data: [12, 0, 0, 0, 152, 0, 0, 0, 212, 0, 0, 0, 87, 73, 67, 75, 24, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 8, 234, 114, 153, 212, 208, 1, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 97, 93, 131, 116, 153, 212, 208, 1, 3, 0, 0, 0, 14, 0, 0, 0, 97, 93, 131, 116, 153, 212, 208, 1, 16, 0, 0, 0, 48, 0, 0, 0, 88, 150, 78, 174, 153, 212, 208, 1, 4, 0, 0, 0, 58, 0, 0, 0, 88, 150, 78, 174, 153, 212, 208, 1, 29, 0, 0, 0, 118, 0, 0, 0, 79, 102, 137, 34, 154, 212, 208, 1, 15, 0, 0, 0, 150, 0, 0, 0, 79, 102, 137, 34, 154, 212, 208, 1, 30, 0, 0, 0, 97, 0, 0, 0, 0, 0, 252, 140, 173, 138, 146, 48, 0, 0, 66, 0, 105, 0, 116, 0, 116, 0, 101, 0, 32, 0, 98, 0, 101, 0, 115, 0, 116, 0, 228, 0, 116, 0, 105, 0, 103, 0, 101, 0, 110, 0, 0, 0, 205, 145, 110, 127, 198, 91, 1, 120, 0, 0, 31, 4, 48, 4, 64, 4, 62, 4, 59, 4, 76, 4, 32, 0, 67, 4, 65, 4, 63, 4, 53, 4, 72, 4, 61, 4, 62, 4, 32, 0, 65, 4, 49, 4, 64, 4, 62, 4, 72, 4, 53, 4, 61, 4, 46, 0, 32, 0, 18, 4, 62, 4, 57, 4, 66, 4, 56, 4, 0, 0, 40, 6, 51, 6, 69, 6, 32, 0, 39, 6, 68, 6, 68, 6, 71, 6, 32, 0, 39, 6, 68, 6, 49, 6, 45, 6, 69, 6, 70, 6, 0, 0, 118, 0, 101, 0, 117, 0, 105, 0, 108, 0, 108, 0, 101, 0, 122, 0, 32, 0, 108, 0, 101, 0, 32, 0, 118, 0, 233, 0, 114, 0, 105, 0, 102, 0, 105, 0, 101, 0, 114, 0, 32, 0, 224, 0, 32, 0, 110, 0, 111, 0, 117, 0, 118, 0, 101, 0, 97, 0, 117, 0, 0, 0],
     logins: [
       {
@@ -148,17 +149,17 @@ const TESTED_WEBSITES = {
         formSubmitURL: "",
         httpRealm: null,
         usernameField: "",
         passwordField: "",
         timeCreated: 1439341166000,
         timeLastUsed: 1439341166000,
         timePasswordChanged: 1439341166000,
         timesUsed: 1,
-     },
+      },
     ],
   },
 };
 
 const TESTED_URLS = [
   "http://a.foo.com",
   "http://b.foo.com",
   "http://c.foo.com",
@@ -250,17 +251,17 @@ function checkLoginsAreEqual(passwordMan
                  "The two logins ID " + id + " have the same " + attribute);
   }
 }
 
 function createRegistryPath(path) {
   let loginPath = path.split("\\");
   let parentKey = Cc["@mozilla.org/windows-registry-key;1"].
                   createInstance(nsIWindowsRegKey);
-  let currentPath =[];
+  let currentPath = [];
   for (let currentKey of loginPath) {
     parentKey.open(nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, currentPath.join("\\"),
                    nsIWindowsRegKey.ACCESS_ALL);
 
     if (!parentKey.hasChild(currentKey)) {
       parentKey.createChild(currentKey, 0);
     }
     currentPath.push(currentKey);
--- a/browser/components/migration/tests/unit/test_IE_bookmarks.js
+++ b/browser/components/migration/tests/unit/test_IE_bookmarks.js
@@ -1,8 +1,10 @@
+"use strict";
+
 add_task(function* () {
   let migrator = MigrationUtils.getMigrator("ie");
   // Sanity check for the source.
   Assert.ok(migrator.sourceExists);
 
   // Wait for the imported bookmarks.  Check that "From Internet Explorer"
   // folders are created in the menu and on the toolbar.
   let source = MigrationUtils.getLocalizedString("sourceNameIE");
--- a/browser/components/migration/tests/unit/test_IE_cookies.js
+++ b/browser/components/migration/tests/unit/test_IE_cookies.js
@@ -1,8 +1,10 @@
+"use strict";
+
 XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
                                   "resource://gre/modules/ctypes.jsm");
 
 add_task(function* () {
   let migrator = MigrationUtils.getMigrator("ie");
   // Sanity check for the source.
   Assert.ok(migrator.sourceExists);
 
--- a/browser/components/migration/tests/unit/test_Safari_bookmarks.js
+++ b/browser/components/migration/tests/unit/test_Safari_bookmarks.js
@@ -1,8 +1,10 @@
+"use strict";
+
 add_task(function* () {
   registerFakePath("ULibDir", do_get_file("Library/"));
 
   let migrator = MigrationUtils.getMigrator("safari");
   // Sanity check for the source.
   Assert.ok(migrator.sourceExists);
 
   // Wait for the imported bookmarks.  Check that "From Safari"
--- a/browser/components/migration/tests/unit/test_automigration.js
+++ b/browser/components/migration/tests/unit/test_automigration.js
@@ -1,14 +1,16 @@
+"use strict";
+
 Cu.import("resource:///modules/MigrationUtils.jsm");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://testing-common/TestUtils.jsm");
 Cu.import("resource://testing-common/PlacesTestUtils.jsm");
-let AutoMigrateBackstage = Cu.import("resource:///modules/AutoMigrate.jsm");
+let AutoMigrateBackstage = Cu.import("resource:///modules/AutoMigrate.jsm"); /* globals AutoMigrate */
 
 let gShimmedMigratorKeyPicker = null;
 let gShimmedMigrator = null;
 
 const kUsecPerMin = 60 * 1000000;
 
 // This is really a proxy on MigrationUtils, but if we specify that directly,
 // we get in trouble because the object itself is frozen, and Proxies can't
--- a/browser/components/migration/tests/unit/test_fx_telemetry.js
+++ b/browser/components/migration/tests/unit/test_fx_telemetry.js
@@ -1,19 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-var {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {});
+/* globals do_get_tempdir */
 
+"use strict";
+
+/* exported run_test */
 function run_test() {
   run_next_test();
 }
 
 function readFile(file) {
-  let stream = Cc['@mozilla.org/network/file-input-stream;1']
+  let stream = Cc["@mozilla.org/network/file-input-stream;1"]
                .createInstance(Ci.nsIFileInputStream);
   stream.init(file, -1, -1, Ci.nsIFileInputStream.CLOSE_ON_EOF);
 
   let sis = Cc["@mozilla.org/scriptableinputstream;1"]
             .createInstance(Ci.nsIScriptableInputStream);
   sis.init(stream);
   let contents = sis.read(file.fileSize);
   sis.close();
@@ -86,19 +89,17 @@ function createSubDir(dir, subDirName) {
 
 function promiseMigrator(name, srcDir, targetDir) {
   let migrator = Cc["@mozilla.org/profile/migrator;1?app=browser&type=firefox"]
                  .createInstance(Ci.nsISupports)
                  .wrappedJSObject;
   let migrators = migrator._getResourcesInternal(srcDir, targetDir);
   for (let m of migrators) {
     if (m.name == name) {
-      return new Promise((resolve, reject) => {
-        m.migrate(resolve);
-      });
+      return new Promise(resolve => m.migrate(resolve));
     }
   }
   throw new Error("failed to find the " + name + " migrator");
 }
 
 function promiseTelemetryMigrator(srcDir, targetDir) {
   return promiseMigrator("telemetry", srcDir, targetDir);
 }
@@ -180,31 +181,31 @@ add_task(function* test_datareporting_no
 
   checkDirectoryContains(targetDir, {});
 });
 
 add_task(function* test_datareporting_empty() {
   let [srcDir, targetDir] = getTestDirs();
 
   // Migrate with an empty 'datareporting' subdir.
-  let subDir = createSubDir(srcDir, "datareporting");
+  createSubDir(srcDir, "datareporting");
   let ok = yield promiseTelemetryMigrator(srcDir, targetDir);
   Assert.ok(ok, "callback should have been true");
 
   // We should end up with no migrated files.
   checkDirectoryContains(targetDir, {
     "datareporting": {},
   });
 });
 
 add_task(function* test_healthreport_empty() {
   let [srcDir, targetDir] = getTestDirs();
 
   // Migrate with no 'datareporting' and an empty 'healthreport' subdir.
-  let subDir = createSubDir(srcDir, "healthreport");
+  createSubDir(srcDir, "healthreport");
   let ok = yield promiseTelemetryMigrator(srcDir, targetDir);
   Assert.ok(ok, "callback should have been true");
 
   // We should end up with no migrated files.
   checkDirectoryContains(targetDir, {});
 });
 
 add_task(function* test_datareporting_many() {