Bug 1046964 - Fix some JS warnings (r=ttaubert)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 19 Aug 2014 17:27:58 -0700
changeset 222104 b62a942fd62254ef12497f41ef1d0e7af339934b
parent 222103 1f8622ef4253ee6f60d0cfef595c9d0cb20bcd51
child 222105 66def87a0e4919ceda39e6a3abe7e09510afdeae
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1046964
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1046964 - Fix some JS warnings (r=ttaubert)
addon-sdk/source/lib/toolkit/loader.js
services/fxaccounts/FxAccountsCommon.js
services/fxaccounts/FxAccountsOAuthClient.jsm
services/healthreport/providers.jsm
services/sync/modules/status.js
toolkit/components/crashes/CrashManager.jsm
toolkit/components/search/nsSearchService.js
toolkit/modules/Sqlite.jsm
toolkit/modules/sessionstore/FormData.jsm
--- a/addon-sdk/source/lib/toolkit/loader.js
+++ b/addon-sdk/source/lib/toolkit/loader.js
@@ -402,28 +402,28 @@ const nodeResolve = iced(function nodeRe
   // Resolve again
   id = exports.resolve(id, requirer);
 
   // we assume that extensions are correct, i.e., a directory doesnt't have '.js'
   // and a js file isn't named 'file.json.js'
   let fullId = join(rootURI, id);
 
   let resolvedPath;
-  if (resolvedPath = loadAsFile(fullId))
+  if ((resolvedPath = loadAsFile(fullId)))
     return stripBase(rootURI, resolvedPath);
-  else if (resolvedPath = loadAsDirectory(fullId))
+  else if ((resolvedPath = loadAsDirectory(fullId)))
     return stripBase(rootURI, resolvedPath);
   // If manifest has dependencies, attempt to look up node modules
   // in the `dependencies` list
   else {
     let dirs = getNodeModulePaths(dirname(join(rootURI, requirer))).map(dir => join(dir, id));
     for (let i = 0; i < dirs.length; i++) {
-      if (resolvedPath = loadAsFile(dirs[i]))
+      if ((resolvedPath = loadAsFile(dirs[i])))
         return stripBase(rootURI, resolvedPath);
-      if (resolvedPath = loadAsDirectory(dirs[i]))
+      if ((resolvedPath = loadAsDirectory(dirs[i])))
         return stripBase(rootURI, resolvedPath);
     }
   }
 
   // We would not find lookup for things like `sdk/tabs`, as that's part of
   // the alias mapping. If during `generateMap`, the runtime lookup resolves
   // with `resolveURI` -- if during runtime, then `resolve` will throw.
   return void 0;
@@ -454,17 +454,17 @@ function loadAsFile (path) {
 function loadAsDirectory (path) {
   let found;
   try {
     // If `path/package.json` exists, parse the `main` entry
     // and attempt to load that
     let main = getManifestMain(JSON.parse(readURI(path + '/package.json')));
     if (main != null) {
       let tmpPath = join(path, main);
-      if (found = loadAsFile(tmpPath))
+      if ((found = loadAsFile(tmpPath)))
         return found
     }
     try {
       let tmpPath = path + '/index.js';
       readURI(tmpPath);
       return tmpPath;
     } catch (e) {}
   } catch (e) {
--- a/services/fxaccounts/FxAccountsCommon.js
+++ b/services/fxaccounts/FxAccountsCommon.js
@@ -16,17 +16,19 @@ const PREF_LOG_LEVEL = "identity.fxaccou
 // The level of messages that will be dumped to the console.  If not specified,
 // "Error" will be used.
 const PREF_LOG_LEVEL_DUMP = "identity.fxaccounts.log.appender.dump";
 
 // A pref that can be set so "sensitive" information (eg, personally
 // identifiable info, credentials, etc) will be logged.
 const PREF_LOG_SENSITIVE_DETAILS = "identity.fxaccounts.log.sensitive";
 
-XPCOMUtils.defineLazyGetter(this, 'log', function() {
+let exports = Object.create(null);
+
+XPCOMUtils.defineLazyGetter(exports, 'log', function() {
   let log = Log.repository.getLogger("FirefoxAccounts");
   // We set the log level to debug, but the default dump appender is set to
   // the level reflected in the pref.  Other code that consumes FxA may then
   // choose to add another appender at a different level.
   log.level = Log.Level.Debug;
   let appender = new Log.DumpAppender();
   appender.level = Log.Level.Error;
 
@@ -47,119 +49,141 @@ XPCOMUtils.defineLazyGetter(this, 'log',
     log.error(e);
   }
 
   return log;
 });
 
 // A boolean to indicate if personally identifiable information (or anything
 // else sensitive, such as credentials) should be logged.
-XPCOMUtils.defineLazyGetter(this, 'logPII', function() {
+XPCOMUtils.defineLazyGetter(exports, 'logPII', function() {
   try {
     return Services.prefs.getBoolPref(PREF_LOG_SENSITIVE_DETAILS);
   } catch (_) {
     return false;
   }
 });
 
-this.FXACCOUNTS_PERMISSION = "firefox-accounts";
+exports.FXACCOUNTS_PERMISSION = "firefox-accounts";
 
-this.DATA_FORMAT_VERSION = 1;
-this.DEFAULT_STORAGE_FILENAME = "signedInUser.json";
+exports.DATA_FORMAT_VERSION = 1;
+exports.DEFAULT_STORAGE_FILENAME = "signedInUser.json";
 
 // Token life times.
 // Having this parameter be short has limited security value and can cause
 // spurious authentication values if the client's clock is skewed and
 // we fail to adjust. See Bug 983256.
-this.ASSERTION_LIFETIME = 1000 * 3600 * 24 * 365 * 25; // 25 years
+exports.ASSERTION_LIFETIME = 1000 * 3600 * 24 * 365 * 25; // 25 years
 // This is a time period we want to guarantee that the assertion will be
 // valid after we generate it (e.g., the signed cert won't expire in this
 // period).
-this.ASSERTION_USE_PERIOD = 1000 * 60 * 5; // 5 minutes
-this.CERT_LIFETIME      = 1000 * 3600 * 6;  // 6 hours
-this.KEY_LIFETIME       = 1000 * 3600 * 12; // 12 hours
+exports.ASSERTION_USE_PERIOD = 1000 * 60 * 5; // 5 minutes
+exports.CERT_LIFETIME      = 1000 * 3600 * 6;  // 6 hours
+exports.KEY_LIFETIME       = 1000 * 3600 * 12; // 12 hours
 
 // Polling timings.
-this.POLL_SESSION       = 1000 * 60 * 5;    // 5 minutes
-this.POLL_STEP          = 1000 * 3;         // 3 seconds
+exports.POLL_SESSION       = 1000 * 60 * 5;    // 5 minutes
+exports.POLL_STEP          = 1000 * 3;         // 3 seconds
 
 // Observer notifications.
-this.ONLOGIN_NOTIFICATION = "fxaccounts:onlogin";
-this.ONVERIFIED_NOTIFICATION = "fxaccounts:onverified";
-this.ONLOGOUT_NOTIFICATION = "fxaccounts:onlogout";
+exports.ONLOGIN_NOTIFICATION = "fxaccounts:onlogin";
+exports.ONVERIFIED_NOTIFICATION = "fxaccounts:onverified";
+exports.ONLOGOUT_NOTIFICATION = "fxaccounts:onlogout";
 // Internal to services/fxaccounts only
-this.ON_FXA_UPDATE_NOTIFICATION = "fxaccounts:update";
+exports.ON_FXA_UPDATE_NOTIFICATION = "fxaccounts:update";
 
 // UI Requests.
-this.UI_REQUEST_SIGN_IN_FLOW = "signInFlow";
-this.UI_REQUEST_REFRESH_AUTH = "refreshAuthentication";
+exports.UI_REQUEST_SIGN_IN_FLOW = "signInFlow";
+exports.UI_REQUEST_REFRESH_AUTH = "refreshAuthentication";
 
 // Server errno.
 // From https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-format
-this.ERRNO_ACCOUNT_ALREADY_EXISTS         = 101;
-this.ERRNO_ACCOUNT_DOES_NOT_EXIST         = 102;
-this.ERRNO_INCORRECT_PASSWORD             = 103;
-this.ERRNO_UNVERIFIED_ACCOUNT             = 104;
-this.ERRNO_INVALID_VERIFICATION_CODE      = 105;
-this.ERRNO_NOT_VALID_JSON_BODY            = 106;
-this.ERRNO_INVALID_BODY_PARAMETERS        = 107;
-this.ERRNO_MISSING_BODY_PARAMETERS        = 108;
-this.ERRNO_INVALID_REQUEST_SIGNATURE      = 109;
-this.ERRNO_INVALID_AUTH_TOKEN             = 110;
-this.ERRNO_INVALID_AUTH_TIMESTAMP         = 111;
-this.ERRNO_MISSING_CONTENT_LENGTH         = 112;
-this.ERRNO_REQUEST_BODY_TOO_LARGE         = 113;
-this.ERRNO_TOO_MANY_CLIENT_REQUESTS       = 114;
-this.ERRNO_INVALID_AUTH_NONCE             = 115;
-this.ERRNO_ENDPOINT_NO_LONGER_SUPPORTED   = 116;
-this.ERRNO_INCORRECT_LOGIN_METHOD         = 117;
-this.ERRNO_INCORRECT_KEY_RETRIEVAL_METHOD = 118;
-this.ERRNO_INCORRECT_API_VERSION          = 119;
-this.ERRNO_INCORRECT_EMAIL_CASE           = 120;
-this.ERRNO_SERVICE_TEMP_UNAVAILABLE       = 201;
-this.ERRNO_UNKNOWN_ERROR                  = 999;
+exports.ERRNO_ACCOUNT_ALREADY_EXISTS         = 101;
+exports.ERRNO_ACCOUNT_DOES_NOT_EXIST         = 102;
+exports.ERRNO_INCORRECT_PASSWORD             = 103;
+exports.ERRNO_UNVERIFIED_ACCOUNT             = 104;
+exports.ERRNO_INVALID_VERIFICATION_CODE      = 105;
+exports.ERRNO_NOT_VALID_JSON_BODY            = 106;
+exports.ERRNO_INVALID_BODY_PARAMETERS        = 107;
+exports.ERRNO_MISSING_BODY_PARAMETERS        = 108;
+exports.ERRNO_INVALID_REQUEST_SIGNATURE      = 109;
+exports.ERRNO_INVALID_AUTH_TOKEN             = 110;
+exports.ERRNO_INVALID_AUTH_TIMESTAMP         = 111;
+exports.ERRNO_MISSING_CONTENT_LENGTH         = 112;
+exports.ERRNO_REQUEST_BODY_TOO_LARGE         = 113;
+exports.ERRNO_TOO_MANY_CLIENT_REQUESTS       = 114;
+exports.ERRNO_INVALID_AUTH_NONCE             = 115;
+exports.ERRNO_ENDPOINT_NO_LONGER_SUPPORTED   = 116;
+exports.ERRNO_INCORRECT_LOGIN_METHOD         = 117;
+exports.ERRNO_INCORRECT_KEY_RETRIEVAL_METHOD = 118;
+exports.ERRNO_INCORRECT_API_VERSION          = 119;
+exports.ERRNO_INCORRECT_EMAIL_CASE           = 120;
+exports.ERRNO_SERVICE_TEMP_UNAVAILABLE       = 201;
+exports.ERRNO_UNKNOWN_ERROR                  = 999;
 
 // Errors.
-this.ERROR_ACCOUNT_ALREADY_EXISTS         = "ACCOUNT_ALREADY_EXISTS";
-this.ERROR_ACCOUNT_DOES_NOT_EXIST         = "ACCOUNT_DOES_NOT_EXIST ";
-this.ERROR_ALREADY_SIGNED_IN_USER         = "ALREADY_SIGNED_IN_USER";
-this.ERROR_ENDPOINT_NO_LONGER_SUPPORTED   = "ENDPOINT_NO_LONGER_SUPPORTED";
-this.ERROR_INCORRECT_API_VERSION          = "INCORRECT_API_VERSION";
-this.ERROR_INCORRECT_EMAIL_CASE           = "INCORRECT_EMAIL_CASE";
-this.ERROR_INCORRECT_KEY_RETRIEVAL_METHOD = "INCORRECT_KEY_RETRIEVAL_METHOD";
-this.ERROR_INCORRECT_LOGIN_METHOD         = "INCORRECT_LOGIN_METHOD";
-this.ERROR_INVALID_EMAIL                  = "INVALID_EMAIL";
-this.ERROR_INVALID_AUDIENCE               = "INVALID_AUDIENCE";
-this.ERROR_INVALID_AUTH_TOKEN             = "INVALID_AUTH_TOKEN";
-this.ERROR_INVALID_AUTH_TIMESTAMP         = "INVALID_AUTH_TIMESTAMP";
-this.ERROR_INVALID_AUTH_NONCE             = "INVALID_AUTH_NONCE";
-this.ERROR_INVALID_BODY_PARAMETERS        = "INVALID_BODY_PARAMETERS";
-this.ERROR_INVALID_PASSWORD               = "INVALID_PASSWORD";
-this.ERROR_INVALID_VERIFICATION_CODE      = "INVALID_VERIFICATION_CODE";
-this.ERROR_INVALID_REFRESH_AUTH_VALUE     = "INVALID_REFRESH_AUTH_VALUE";
-this.ERROR_INVALID_REQUEST_SIGNATURE      = "INVALID_REQUEST_SIGNATURE";
-this.ERROR_INTERNAL_INVALID_USER          = "INTERNAL_ERROR_INVALID_USER";
-this.ERROR_MISSING_BODY_PARAMETERS        = "MISSING_BODY_PARAMETERS";
-this.ERROR_MISSING_CONTENT_LENGTH         = "MISSING_CONTENT_LENGTH";
-this.ERROR_NO_TOKEN_SESSION               = "NO_TOKEN_SESSION";
-this.ERROR_NO_SILENT_REFRESH_AUTH         = "NO_SILENT_REFRESH_AUTH";
-this.ERROR_NOT_VALID_JSON_BODY            = "NOT_VALID_JSON_BODY";
-this.ERROR_OFFLINE                        = "OFFLINE";
-this.ERROR_PERMISSION_DENIED              = "PERMISSION_DENIED";
-this.ERROR_REQUEST_BODY_TOO_LARGE         = "REQUEST_BODY_TOO_LARGE";
-this.ERROR_SERVER_ERROR                   = "SERVER_ERROR";
-this.ERROR_TOO_MANY_CLIENT_REQUESTS       = "TOO_MANY_CLIENT_REQUESTS";
-this.ERROR_SERVICE_TEMP_UNAVAILABLE       = "SERVICE_TEMPORARY_UNAVAILABLE";
-this.ERROR_UI_ERROR                       = "UI_ERROR";
-this.ERROR_UI_REQUEST                     = "UI_REQUEST";
-this.ERROR_UNKNOWN                        = "UNKNOWN_ERROR";
-this.ERROR_UNVERIFIED_ACCOUNT             = "UNVERIFIED_ACCOUNT";
+exports.ERROR_ACCOUNT_ALREADY_EXISTS         = "ACCOUNT_ALREADY_EXISTS";
+exports.ERROR_ACCOUNT_DOES_NOT_EXIST         = "ACCOUNT_DOES_NOT_EXIST ";
+exports.ERROR_ALREADY_SIGNED_IN_USER         = "ALREADY_SIGNED_IN_USER";
+exports.ERROR_ENDPOINT_NO_LONGER_SUPPORTED   = "ENDPOINT_NO_LONGER_SUPPORTED";
+exports.ERROR_INCORRECT_API_VERSION          = "INCORRECT_API_VERSION";
+exports.ERROR_INCORRECT_EMAIL_CASE           = "INCORRECT_EMAIL_CASE";
+exports.ERROR_INCORRECT_KEY_RETRIEVAL_METHOD = "INCORRECT_KEY_RETRIEVAL_METHOD";
+exports.ERROR_INCORRECT_LOGIN_METHOD         = "INCORRECT_LOGIN_METHOD";
+exports.ERROR_INVALID_EMAIL                  = "INVALID_EMAIL";
+exports.ERROR_INVALID_AUDIENCE               = "INVALID_AUDIENCE";
+exports.ERROR_INVALID_AUTH_TOKEN             = "INVALID_AUTH_TOKEN";
+exports.ERROR_INVALID_AUTH_TIMESTAMP         = "INVALID_AUTH_TIMESTAMP";
+exports.ERROR_INVALID_AUTH_NONCE             = "INVALID_AUTH_NONCE";
+exports.ERROR_INVALID_BODY_PARAMETERS        = "INVALID_BODY_PARAMETERS";
+exports.ERROR_INVALID_PASSWORD               = "INVALID_PASSWORD";
+exports.ERROR_INVALID_VERIFICATION_CODE      = "INVALID_VERIFICATION_CODE";
+exports.ERROR_INVALID_REFRESH_AUTH_VALUE     = "INVALID_REFRESH_AUTH_VALUE";
+exports.ERROR_INVALID_REQUEST_SIGNATURE      = "INVALID_REQUEST_SIGNATURE";
+exports.ERROR_INTERNAL_INVALID_USER          = "INTERNAL_ERROR_INVALID_USER";
+exports.ERROR_MISSING_BODY_PARAMETERS        = "MISSING_BODY_PARAMETERS";
+exports.ERROR_MISSING_CONTENT_LENGTH         = "MISSING_CONTENT_LENGTH";
+exports.ERROR_NO_TOKEN_SESSION               = "NO_TOKEN_SESSION";
+exports.ERROR_NO_SILENT_REFRESH_AUTH         = "NO_SILENT_REFRESH_AUTH";
+exports.ERROR_NOT_VALID_JSON_BODY            = "NOT_VALID_JSON_BODY";
+exports.ERROR_OFFLINE                        = "OFFLINE";
+exports.ERROR_PERMISSION_DENIED              = "PERMISSION_DENIED";
+exports.ERROR_REQUEST_BODY_TOO_LARGE         = "REQUEST_BODY_TOO_LARGE";
+exports.ERROR_SERVER_ERROR                   = "SERVER_ERROR";
+exports.ERROR_TOO_MANY_CLIENT_REQUESTS       = "TOO_MANY_CLIENT_REQUESTS";
+exports.ERROR_SERVICE_TEMP_UNAVAILABLE       = "SERVICE_TEMPORARY_UNAVAILABLE";
+exports.ERROR_UI_ERROR                       = "UI_ERROR";
+exports.ERROR_UI_REQUEST                     = "UI_REQUEST";
+exports.ERROR_UNKNOWN                        = "UNKNOWN_ERROR";
+exports.ERROR_UNVERIFIED_ACCOUNT             = "UNVERIFIED_ACCOUNT";
+
+// FxAccounts has the ability to "split" the credentials between a plain-text
+// JSON file in the profile dir and in the login manager.
+// These constants relate to that.
+
+// The fields we save in the plaintext JSON.
+// See bug 1013064 comments 23-25 for why the sessionToken is "safe"
+exports.FXA_PWDMGR_PLAINTEXT_FIELDS = ["email", "verified", "authAt",
+                                       "sessionToken", "uid"];
+// The pseudo-host we use in the login manager
+exports.FXA_PWDMGR_HOST = "chrome://FirefoxAccounts";
+// The realm we use in the login manager.
+exports.FXA_PWDMGR_REALM = "Firefox Accounts credentials";
 
 // Error matching.
-this.SERVER_ERRNO_TO_ERROR = {};
+exports.SERVER_ERRNO_TO_ERROR = {};
+
+for (let id in exports) {
+  this[id] = exports[id];
+}
+
+// Allow this file to be imported via Components.utils.import().
+this.EXPORTED_SYMBOLS = Object.keys(exports);
+
+// Set these up now that everything has been loaded into |this|.
 SERVER_ERRNO_TO_ERROR[ERRNO_ACCOUNT_ALREADY_EXISTS]         = ERROR_ACCOUNT_ALREADY_EXISTS;
 SERVER_ERRNO_TO_ERROR[ERRNO_ACCOUNT_DOES_NOT_EXIST]         = ERROR_ACCOUNT_DOES_NOT_EXIST;
 SERVER_ERRNO_TO_ERROR[ERRNO_INCORRECT_PASSWORD]             = ERROR_INVALID_PASSWORD;
 SERVER_ERRNO_TO_ERROR[ERRNO_UNVERIFIED_ACCOUNT]             = ERROR_UNVERIFIED_ACCOUNT;
 SERVER_ERRNO_TO_ERROR[ERRNO_INVALID_VERIFICATION_CODE]      = ERROR_INVALID_VERIFICATION_CODE;
 SERVER_ERRNO_TO_ERROR[ERRNO_NOT_VALID_JSON_BODY]            = ERROR_NOT_VALID_JSON_BODY;
 SERVER_ERRNO_TO_ERROR[ERRNO_INVALID_BODY_PARAMETERS]        = ERROR_INVALID_BODY_PARAMETERS;
 SERVER_ERRNO_TO_ERROR[ERRNO_MISSING_BODY_PARAMETERS]        = ERROR_MISSING_BODY_PARAMETERS;
@@ -172,24 +196,8 @@ SERVER_ERRNO_TO_ERROR[ERRNO_TOO_MANY_CLI
 SERVER_ERRNO_TO_ERROR[ERRNO_INVALID_AUTH_NONCE]             = ERROR_INVALID_AUTH_NONCE;
 SERVER_ERRNO_TO_ERROR[ERRNO_ENDPOINT_NO_LONGER_SUPPORTED]   = ERROR_ENDPOINT_NO_LONGER_SUPPORTED;
 SERVER_ERRNO_TO_ERROR[ERRNO_INCORRECT_LOGIN_METHOD]         = ERROR_INCORRECT_LOGIN_METHOD;
 SERVER_ERRNO_TO_ERROR[ERRNO_INCORRECT_KEY_RETRIEVAL_METHOD] = ERROR_INCORRECT_KEY_RETRIEVAL_METHOD;
 SERVER_ERRNO_TO_ERROR[ERRNO_INCORRECT_API_VERSION]          = ERROR_INCORRECT_API_VERSION;
 SERVER_ERRNO_TO_ERROR[ERRNO_INCORRECT_EMAIL_CASE]           = ERROR_INCORRECT_EMAIL_CASE;
 SERVER_ERRNO_TO_ERROR[ERRNO_SERVICE_TEMP_UNAVAILABLE]       = ERROR_SERVICE_TEMP_UNAVAILABLE;
 SERVER_ERRNO_TO_ERROR[ERRNO_UNKNOWN_ERROR]                  = ERROR_UNKNOWN;
-
-// FxAccounts has the ability to "split" the credentials between a plain-text
-// JSON file in the profile dir and in the login manager.
-// These constants relate to that.
-
-// The fields we save in the plaintext JSON.
-// See bug 1013064 comments 23-25 for why the sessionToken is "safe"
-this.FXA_PWDMGR_PLAINTEXT_FIELDS = ["email", "verified", "authAt",
-                                    "sessionToken", "uid"];
-// The pseudo-host we use in the login manager
-this.FXA_PWDMGR_HOST = "chrome://FirefoxAccounts";
-// The realm we use in the login manager.
-this.FXA_PWDMGR_REALM = "Firefox Accounts credentials";
-
-// Allow this file to be imported via Components.utils.import().
-this.EXPORTED_SYMBOLS = Object.keys(this);
--- a/services/fxaccounts/FxAccountsOAuthClient.jsm
+++ b/services/fxaccounts/FxAccountsOAuthClient.jsm
@@ -6,16 +6,17 @@
  * Firefox Accounts OAuth browser login helper.
  * Uses the WebChannel component to receive OAuth messages and complete login flows.
  */
 
 this.EXPORTED_SYMBOLS = ["FxAccountsOAuthClient"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FxAccountsCommon.js");
 XPCOMUtils.defineLazyModuleGetter(this, "WebChannel",
                                   "resource://gre/modules/WebChannel.jsm");
 Cu.importGlobalProperties(["URL"]);
 
 /**
--- a/services/healthreport/providers.jsm
+++ b/services/healthreport/providers.jsm
@@ -860,22 +860,22 @@ AddonsProvider.prototype = Object.freeze
 
   collectConstantData: function () {
     return this._collectAndStoreAddons();
   },
 
   _collectAndStoreAddons: function () {
     let deferred = Promise.defer();
 
-    AddonManager.getAllAddons(function onAllAddons(addons) {
+    AddonManager.getAllAddons(function onAllAddons(allAddons) {
       let data;
       let addonsField;
       let pluginsField;
       try {
-        data = this._createDataStructure(addons);
+        data = this._createDataStructure(allAddons);
         addonsField = JSON.stringify(data.addons);
         pluginsField = JSON.stringify(data.plugins);
       } catch (ex) {
         this._log.warn("Exception when populating add-ons data structure: " +
                        CommonUtils.exceptionStr(ex));
         deferred.reject(ex);
         return;
       }
--- a/services/sync/modules/status.js
+++ b/services/sync/modules/status.js
@@ -37,17 +37,17 @@ this.Status = {
     return this.__authManager;
   },
 
   get service() {
     return this._service;
   },
 
   set service(code) {
-    this._log.debug("Status.service: " + this._service + " => " + code);
+    this._log.debug("Status.service: " + (this._service || undefined) + " => " + code);
     this._service = code;
   },
 
   get login() {
     return this._login;
   },
 
   set login(code) {
--- a/toolkit/components/crashes/CrashManager.jsm
+++ b/toolkit/components/crashes/CrashManager.jsm
@@ -390,17 +390,17 @@ this.CrashManager.prototype = Object.fre
                                      id, date)) {
         yield store.save();
       }
     }.bind(this));
   },
 
   _addSubmissionAsCrash: function (store, processType, crashType, succeeded,
                                    id, date) {
-    let id = id + "-" + this.PROCESS_TYPE_SUBMISSION;
+    id += "-" + this.PROCESS_TYPE_SUBMISSION;
     let process = processType + "-" + crashType + "-" +
                   this.PROCESS_TYPE_SUBMISSION;
     let submission_type = (
       succeeded ? this.SUBMISSION_TYPE_SUCCEEDED : this.SUBMISSION_TYPE_FAILED);
 
     return store.addCrash(process, submission_type, id, date);
   },
 
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -4405,17 +4405,17 @@ SearchService.prototype = {
 
     if (!getBoolPref(BROWSER_SEARCH_PREF + "update", true))
       return;
 
     // Our timer has expired, but unfortunately, we can't get any data from it.
     // Therefore, we need to walk our engine-list, looking for expired engines
     var currentTime = Date.now();
     LOG("currentTime: " + currentTime);
-    for each (engine in this._engines) {
+    for each (let engine in this._engines) {
       engine = engine.wrappedJSObject;
       if (!engine._hasUpdates)
         continue;
 
       LOG("checking " + engine.name);
 
       var expirTime = engineMetadataService.getAttr(engine, "updateexpir");
       LOG("expirTime: " + expirTime + "\nupdateURL: " + engine._updateURL +
--- a/toolkit/modules/Sqlite.jsm
+++ b/toolkit/modules/Sqlite.jsm
@@ -726,23 +726,23 @@ function openConnection(options) {
   let basename = OS.Path.basename(path);
   let number = connectionCounters.get(basename) || 0;
   connectionCounters.set(basename, number + 1);
 
   let identifier = basename + "#" + number;
 
   log.info("Opening database: " + path + " (" + identifier + ")");
   let deferred = Promise.defer();
-  let options = null;
+  let dbOptions = null;
   if (!sharedMemoryCache) {
-    options = Cc["@mozilla.org/hash-property-bag;1"].
+    dbOptions = Cc["@mozilla.org/hash-property-bag;1"].
       createInstance(Ci.nsIWritablePropertyBag);
-    options.setProperty("shared", false);
+    dbOptions.setProperty("shared", false);
   }
-  Services.storage.openAsyncDatabase(file, options, function(status, connection) {
+  Services.storage.openAsyncDatabase(file, dbOptions, function(status, connection) {
     if (!connection) {
       log.warn("Could not open connection: " + status);
       deferred.reject(new Error("Could not open connection: " + status));
       return;
     }
     log.info("Connection opened");
     try {
       deferred.resolve(
--- a/toolkit/modules/sessionstore/FormData.jsm
+++ b/toolkit/modules/sessionstore/FormData.jsm
@@ -134,17 +134,17 @@ let FormDataInternal = {
     let node;
     let ret = {};
 
     // Limit the number of XPath expressions for performance reasons. See
     // bug 477564.
     const MAX_TRAVERSED_XPATHS = 100;
     let generatedCount = 0;
 
-    while (node = formNodes.iterateNext()) {
+    while ((node = formNodes.iterateNext())) {
       let hasDefaultValue = true;
       let value;
 
       // Only generate a limited number of XPath expressions for perf reasons
       // (cf. bug 477564)
       if (!node.id && generatedCount > MAX_TRAVERSED_XPATHS) {
         continue;
       }