Bug 1330014 - Add .eslintrc.js file to /services and run eslint --fix to automatically fix most of the errors. --fix brings the error count down from 4083 to 321 errors. r=markh,standard8
authorJared Wein <jwein@mozilla.com>
Tue, 10 Jan 2017 12:09:02 -0500
changeset 376571 4a4bd6ca18c3860d74f5a3b63ce316b6e142ce94
parent 376570 ef323d404a2fcb78cfc1ade71f98b5ef93f97aea
child 376572 9677f72cddc9d45b09039ccea3ed84241eac74c3
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh, standard8
bugs1330014
milestone53.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 1330014 - Add .eslintrc.js file to /services and run eslint --fix to automatically fix most of the errors. --fix brings the error count down from 4083 to 321 errors. r=markh,standard8 MozReview-Commit-ID: EjyAssqiQk8
.eslintignore
services/.eslintrc.js
services/cloudsync/CloudSync.jsm
services/cloudsync/CloudSyncAdapters.jsm
services/cloudsync/CloudSyncBookmarks.jsm
services/cloudsync/CloudSyncBookmarksFolderCache.jsm
services/cloudsync/CloudSyncEventSource.jsm
services/cloudsync/CloudSyncLocal.jsm
services/cloudsync/CloudSyncPlacesWrapper.jsm
services/cloudsync/CloudSyncTabs.jsm
services/cloudsync/tests/mochitest/browser_tabEvents.js
services/cloudsync/tests/xpcshell/head.js
services/cloudsync/tests/xpcshell/test_bookmarks.js
services/cloudsync/tests/xpcshell/test_module.js
services/cloudsync/tests/xpcshell/test_tabs.js
services/common/async.js
services/common/blocklist-clients.js
services/common/hawkclient.js
services/common/hawkrequest.js
services/common/kinto-storage-adapter.js
services/common/modules-testing/storageserver.js
services/common/observers.js
services/common/rest.js
services/common/stringbundle.js
services/common/tests/unit/head_helpers.js
services/common/tests/unit/test_async_chain.js
services/common/tests/unit/test_async_querySpinningly.js
services/common/tests/unit/test_blocklist_certificates.js
services/common/tests/unit/test_blocklist_clients.js
services/common/tests/unit/test_blocklist_pinning.js
services/common/tests/unit/test_blocklist_signatures.js
services/common/tests/unit/test_blocklist_updater.js
services/common/tests/unit/test_hawkclient.js
services/common/tests/unit/test_hawkrequest.js
services/common/tests/unit/test_kinto.js
services/common/tests/unit/test_load_modules.js
services/common/tests/unit/test_observers.js
services/common/tests/unit/test_restrequest.js
services/common/tests/unit/test_storage_adapter.js
services/common/tests/unit/test_storage_server.js
services/common/tests/unit/test_tokenauthenticatedrequest.js
services/common/tests/unit/test_tokenserverclient.js
services/common/tests/unit/test_utils_convert_string.js
services/common/tests/unit/test_utils_encodeBase64URL.js
services/common/tests/unit/test_utils_json.js
services/common/tests/unit/test_utils_namedTimer.js
services/common/tokenserverclient.js
services/common/utils.js
services/crypto/component/tests/unit/test_jpake.js
services/crypto/modules/WeaveCrypto.js
services/crypto/modules/utils.js
services/crypto/tests/unit/head_helpers.js
services/crypto/tests/unit/test_utils_hawk.js
services/crypto/tests/unit/test_utils_httpmac.js
services/crypto/tests/unit/test_utils_pbkdf2.js
services/fxaccounts/Credentials.jsm
services/fxaccounts/FxAccounts.jsm
services/fxaccounts/FxAccountsClient.jsm
services/fxaccounts/FxAccountsManager.jsm
services/fxaccounts/FxAccountsOAuthClient.jsm
services/fxaccounts/FxAccountsOAuthGrantClient.jsm
services/fxaccounts/FxAccountsProfile.jsm
services/fxaccounts/FxAccountsProfileClient.jsm
services/fxaccounts/FxAccountsPush.js
services/fxaccounts/FxAccountsStorage.jsm
services/fxaccounts/FxAccountsWebChannel.jsm
services/fxaccounts/tests/xpcshell/test_accounts.js
services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js
services/fxaccounts/tests/xpcshell/test_client.js
services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
services/fxaccounts/tests/xpcshell/test_oauth_grant_client_server.js
services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js
services/fxaccounts/tests/xpcshell/test_oauth_tokens.js
services/fxaccounts/tests/xpcshell/test_profile.js
services/fxaccounts/tests/xpcshell/test_profile_client.js
services/fxaccounts/tests/xpcshell/test_push_service.js
services/fxaccounts/tests/xpcshell/test_storage_manager.js
services/fxaccounts/tests/xpcshell/test_web_channel.js
services/sync/Weave.js
services/sync/modules-testing/fakeservices.js
services/sync/modules-testing/fxa_utils.js
services/sync/modules-testing/utils.js
services/sync/modules/SyncedTabs.jsm
services/sync/modules/addonsreconciler.js
services/sync/modules/addonutils.js
services/sync/modules/bookmark_validator.js
services/sync/modules/browserid_identity.js
services/sync/modules/collection_validator.js
services/sync/modules/engines.js
services/sync/modules/engines/addons.js
services/sync/modules/engines/bookmarks.js
services/sync/modules/engines/clients.js
services/sync/modules/engines/extension-storage.js
services/sync/modules/engines/forms.js
services/sync/modules/engines/history.js
services/sync/modules/engines/passwords.js
services/sync/modules/engines/prefs.js
services/sync/modules/engines/tabs.js
services/sync/modules/identity.js
services/sync/modules/jpakeclient.js
services/sync/modules/main.js
services/sync/modules/policies.js
services/sync/modules/record.js
services/sync/modules/resource.js
services/sync/modules/service.js
services/sync/modules/stages/declined.js
services/sync/modules/stages/enginesync.js
services/sync/modules/status.js
services/sync/modules/telemetry.js
services/sync/modules/userapi.js
services/sync/modules/util.js
services/sync/services-sync.js
services/sync/tests/tps/mozmill_sanity.js
services/sync/tests/tps/test_bug563989.js
services/sync/tests/tps/test_bug575423.js
services/sync/tests/tps/test_formdata.js
services/sync/tests/tps/test_sync.js
services/sync/tests/unit/fake_login_manager.js
services/sync/tests/unit/head_helpers.js
services/sync/tests/unit/head_http_server.js
services/sync/tests/unit/test_addon_utils.js
services/sync/tests/unit/test_addons_engine.js
services/sync/tests/unit/test_addons_store.js
services/sync/tests/unit/test_addons_tracker.js
services/sync/tests/unit/test_bookmark_batch_fail.js
services/sync/tests/unit/test_bookmark_duping.js
services/sync/tests/unit/test_bookmark_engine.js
services/sync/tests/unit/test_bookmark_smart_bookmarks.js
services/sync/tests/unit/test_bookmark_store.js
services/sync/tests/unit/test_bookmark_tracker.js
services/sync/tests/unit/test_bookmark_validator.js
services/sync/tests/unit/test_browserid_identity.js
services/sync/tests/unit/test_clients_engine.js
services/sync/tests/unit/test_collections_recovery.js
services/sync/tests/unit/test_corrupt_keys.js
services/sync/tests/unit/test_engine.js
services/sync/tests/unit/test_engine_abort.js
services/sync/tests/unit/test_errorhandler_1.js
services/sync/tests/unit/test_errorhandler_2.js
services/sync/tests/unit/test_errorhandler_eol.js
services/sync/tests/unit/test_errorhandler_filelog.js
services/sync/tests/unit/test_errorhandler_sync_checkServerError.js
services/sync/tests/unit/test_extension_storage_crypto.js
services/sync/tests/unit/test_forms_tracker.js
services/sync/tests/unit/test_fxa_migration.js
services/sync/tests/unit/test_fxa_node_reassignment.js
services/sync/tests/unit/test_history_engine.js
services/sync/tests/unit/test_hmac_error.js
services/sync/tests/unit/test_httpd_sync_server.js
services/sync/tests/unit/test_interval_triggers.js
services/sync/tests/unit/test_jpakeclient.js
services/sync/tests/unit/test_keys.js
services/sync/tests/unit/test_node_reassignment.js
services/sync/tests/unit/test_password_store.js
services/sync/tests/unit/test_places_guid_downgrade.js
services/sync/tests/unit/test_postqueue.js
services/sync/tests/unit/test_records_crypto.js
services/sync/tests/unit/test_records_wbo.js
services/sync/tests/unit/test_resource.js
services/sync/tests/unit/test_resource_async.js
services/sync/tests/unit/test_resource_header.js
services/sync/tests/unit/test_resource_ua.js
services/sync/tests/unit/test_sendcredentials_controller.js
services/sync/tests/unit/test_service_detect_upgrade.js
services/sync/tests/unit/test_service_getStorageInfo.js
services/sync/tests/unit/test_service_login.js
services/sync/tests/unit/test_service_migratePrefs.js
services/sync/tests/unit/test_service_passwordUTF8.js
services/sync/tests/unit/test_service_startOver.js
services/sync/tests/unit/test_service_startup.js
services/sync/tests/unit/test_service_sync_401.js
services/sync/tests/unit/test_service_sync_locked.js
services/sync/tests/unit/test_service_sync_remoteSetup.js
services/sync/tests/unit/test_service_verifyLogin.js
services/sync/tests/unit/test_service_wipeServer.js
services/sync/tests/unit/test_syncedtabs.js
services/sync/tests/unit/test_syncengine_sync.js
services/sync/tests/unit/test_syncscheduler.js
services/sync/tests/unit/test_syncstoragerequest.js
services/sync/tests/unit/test_tab_engine.js
services/sync/tests/unit/test_tab_store.js
services/sync/tests/unit/test_tab_tracker.js
services/sync/tests/unit/test_telemetry.js
services/sync/tests/unit/test_utils_catch.js
services/sync/tests/unit/test_utils_json.js
services/sync/tests/unit/test_utils_lock.js
services/sync/tests/unit/test_utils_notify.js
services/sync/tests/unit/test_warn_on_truncated_response.js
services/sync/tps/extensions/tps/components/tps-cmdline.js
services/sync/tps/extensions/tps/resource/logger.jsm
services/sync/tps/extensions/tps/resource/modules/bookmarks.jsm
services/sync/tps/extensions/tps/resource/modules/forms.jsm
services/sync/tps/extensions/tps/resource/modules/history.jsm
services/sync/tps/extensions/tps/resource/modules/passwords.jsm
services/sync/tps/extensions/tps/resource/modules/prefs.jsm
services/sync/tps/extensions/tps/resource/modules/tabs.jsm
services/sync/tps/extensions/tps/resource/modules/windows.jsm
services/sync/tps/extensions/tps/resource/quit.js
services/sync/tps/extensions/tps/resource/tps.jsm
--- a/.eslintignore
+++ b/.eslintignore
@@ -179,16 +179,22 @@ mobile/android/components/Snippets.js
 # Bug 1178739: Ignore this file as a quick fix for "Illegal yield expression"
 mobile/android/modules/HomeProvider.jsm
 
 # services/ exclusions
 
 # Uses `#filter substitution`
 services/sync/modules/constants.js
 
+# Third party services
+services/sync/tps/extensions/mozmill/resource/stdlib/json2.js
+services/common/kinto-http-client.js
+services/common/kinto-offline-client.js
+services/sync/tps/extensions/mozmill
+
 # toolkit/ exclusions
 
 # Not part of the default build
 toolkit/components/help/**
 
 # Intentionally invalid JS
 toolkit/components/workerloader/tests/moduleF-syntax-error.js
 
new file mode 100644
--- /dev/null
+++ b/services/.eslintrc.js
@@ -0,0 +1,29 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "../toolkit/.eslintrc.js"
+  ],
+  rules: {
+    /* These rules are only set to warn temporarily
+       until they get fixed, at which point their
+       respective line in this file should be removed. */
+    "brace-style": "warn",
+    "consistent-return": "warn",
+    "no-cond-assign": "warn",
+    "no-else-return": "warn",
+    "no-empty": "warn",
+    "no-ex-assign": "warn",
+    "no-func-assign": "warn",
+    "no-irregular-whitespace": "warn",
+    "no-mixed-spaces-and-tabs": "warn",
+    "no-native-reassign": "warn",
+    "no-nested-ternary": "warn",
+    "no-octal": "warn",
+    "no-redeclare": "warn",
+    "no-unreachable": "warn",
+    "no-unsafe-finally": "warn",
+    "no-unused-vars": "warn",
+    "no-useless-call": "warn"
+  }
+};
--- a/services/cloudsync/CloudSync.jsm
+++ b/services/cloudsync/CloudSync.jsm
@@ -14,76 +14,76 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://gre/modules/CloudSyncLocal.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Bookmarks",
                                   "resource://gre/modules/CloudSyncBookmarks.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Tabs",
                                   "resource://gre/modules/CloudSyncTabs.jsm");
 
 var API_VERSION = 1;
 
-var _CloudSync = function () {
+var _CloudSync = function() {
 };
 
 _CloudSync.prototype = {
   _adapters: null,
 
-  get adapters () {
+  get adapters() {
     if (!this._adapters) {
       this._adapters = new Adapters();
     }
     return this._adapters;
   },
 
   _bookmarks: null,
 
-  get bookmarks () {
+  get bookmarks() {
     if (!this._bookmarks) {
       this._bookmarks = new Bookmarks();
     }
     return this._bookmarks;
   },
 
   _local: null,
 
-  get local () {
+  get local() {
     if (!this._local) {
       this._local = new Local();
     }
     return this._local;
   },
 
   _tabs: null,
 
-  get tabs () {
+  get tabs() {
     if (!this._tabs) {
       this._tabs = new Tabs();
     }
     return this._tabs;
   },
 
-  get tabsReady () {
-    return this._tabs ? true: false;
+  get tabsReady() {
+    return this._tabs ? true : false;
   },
 
-  get version () {
+  get version() {
     return API_VERSION;
   },
 };
 
-this.CloudSync = function CloudSync () {
+this.CloudSync = function CloudSync() {
   return _cloudSyncInternal.instance;
 };
 
 Object.defineProperty(CloudSync, "ready", {
-  get: function () {
+  get() {
     return _cloudSyncInternal.ready;
   }
 });
 
 var _cloudSyncInternal = {
   instance: null,
   ready: false,
 };
 
-XPCOMUtils.defineLazyGetter(_cloudSyncInternal, "instance", function () {
+XPCOMUtils.defineLazyGetter(_cloudSyncInternal, "instance", function() {
   _cloudSyncInternal.ready = true;
   return new _CloudSync();
-}.bind(this));
+});
--- a/services/cloudsync/CloudSyncAdapters.jsm
+++ b/services/cloudsync/CloudSyncAdapters.jsm
@@ -4,73 +4,73 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Adapters"];
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/CloudSyncEventSource.jsm");
 
-this.Adapters = function () {
+this.Adapters = function() {
   let eventTypes = [
     "sync",
   ];
 
   let suspended = true;
 
-  let suspend = function () {
+  let suspend = function() {
     if (!suspended) {
       Services.obs.removeObserver(observer, "cloudsync:user-sync");
       suspended = true;
     }
-  }.bind(this);
+  };
 
-  let resume = function () {
+  let resume = function() {
     if (suspended) {
       Services.obs.addObserver(observer, "cloudsync:user-sync", false);
       suspended = false;
     }
-  }.bind(this);
+  };
 
   let eventSource = new EventSource(eventTypes, suspend, resume);
   let registeredAdapters = new Map();
 
-  function register (name, opts) {
+  function register(name, opts) {
     opts = opts || {};
     registeredAdapters.set(name, opts);
   }
 
-  function unregister (name) {
+  function unregister(name) {
     if (!registeredAdapters.has(name)) {
       throw new Error("adapter is not registered: " + name)
     }
     registeredAdapters.delete(name);
   }
 
-  function getAdapterNames () {
+  function getAdapterNames() {
     let result = [];
     for (let name of registeredAdapters.keys()) {
       result.push(name);
     }
     return result;
   }
 
-  function getAdapter (name) {
+  function getAdapter(name) {
     if (!registeredAdapters.has(name)) {
       throw new Error("adapter is not registered: " + name)
     }
     return registeredAdapters.get(name);
   }
 
-  function countAdapters () {
+  function countAdapters() {
     return registeredAdapters.size;
   }
 
   let observer = {
-    observe: function (subject, topic, data) {
+    observe(subject, topic, data) {
       switch (topic) {
         case "cloudsync:user-sync":
           eventSource.emit("sync");
           break;
       }
     }
   };
 
--- a/services/cloudsync/CloudSyncBookmarks.jsm
+++ b/services/cloudsync/CloudSyncBookmarks.jsm
@@ -44,28 +44,28 @@ const DATA_VERSION = 1;
 
 function asyncCallback(ctx, func, args) {
   function invoke() {
     func.apply(ctx, args);
   }
   CommonUtils.nextTick(invoke);
 }
 
-var Record = function (params) {
+var Record = function(params) {
   this.id = params.guid;
   this.parent = params.parent || null;
   this.index = params.position;
   this.title = params.title;
-  this.dateAdded = Math.floor(params.dateAdded/1000);
-  this.lastModified = Math.floor(params.lastModified/1000);
+  this.dateAdded = Math.floor(params.dateAdded / 1000);
+  this.lastModified = Math.floor(params.lastModified / 1000);
   this.uri = params.url;
 
   let annos = params.annos || {};
   Object.defineProperty(this, "annos", {
-    get: function () {
+    get() {
       return annos;
     },
     enumerable: false
   });
 
   switch (params.type) {
     case PlacesUtils.bookmarks.TYPE_FOLDER:
       if (PlacesUtils.LMANNO_FEEDURI in annos) {
@@ -90,18 +90,18 @@ var Record = function (params) {
       this.type = CS_UNKNOWN;
   }
 };
 
 Record.prototype = {
   version: DATA_VERSION,
 };
 
-var Bookmarks = function () {
-  let createRootFolder = function (name) {
+var Bookmarks = function() {
+  let createRootFolder = function(name) {
     let ROOT_FOLDER_ANNO = "cloudsync/rootFolder/" + name;
     let ROOT_SHORTCUT_ANNO = "cloudsync/rootShortcut/" + name;
 
     let deferred = Promise.defer();
     let placesRootId = PlacesUtils.placesRootId;
     let rootFolderId;
     let rootShortcutId;
 
@@ -137,17 +137,17 @@ var Bookmarks = function () {
       .then(setRootFolderCloudSyncAnnotation)
       .then(setRootShortcutCloudSyncAnnotation)
       .then(setRootFolderExcludeFromBackupAnnotation)
       .then(finish, deferred.reject);
 
     return deferred.promise;
   };
 
-  let getRootFolder = function (name) {
+  let getRootFolder = function(name) {
     let ROOT_FOLDER_ANNO = "cloudsync/rootFolder/" + name;
     let ROOT_SHORTCUT_ANNO = "cloudsync/rootShortcut/" + name;
     let deferred = Promise.defer();
 
     function checkRootFolder(folderIds) {
       if (!folderIds.length) {
         return createRootFolder(name);
       }
@@ -161,17 +161,17 @@ var Bookmarks = function () {
     PlacesWrapper.getLocalIdsWithAnnotation(ROOT_FOLDER_ANNO)
       .then(checkRootFolder, deferred.reject)
       .then(createFolderObject)
       .then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   };
 
-  let deleteRootFolder = function (name) {
+  let deleteRootFolder = function(name) {
     let ROOT_FOLDER_ANNO = "cloudsync/rootFolder/" + name;
     let ROOT_SHORTCUT_ANNO = "cloudsync/rootShortcut/" + name;
 
     let deferred = Promise.defer();
     let placesRootId = PlacesUtils.placesRootId;
 
     function getRootShortcutId() {
       return PlacesWrapper.getLocalIdsWithAnnotation(ROOT_SHORTCUT_ANNO);
@@ -192,17 +192,17 @@ var Bookmarks = function () {
       let deleteFolderDeferred = Promise.defer();
 
       if (!folderIds.length) {
         return Promise.resolve();
       }
 
       let rootFolderId = folderIds[0];
       PlacesWrapper.removeFolderChildren(rootFolderId).then(
-        function () {
+        function() {
           return PlacesWrapper.removeItem(rootFolderId);
         }
       ).then(deleteFolderDeferred.resolve, deleteFolderDeferred.reject);
 
       return deleteFolderDeferred.promise;
     }
 
     getRootShortcutId().then(deleteShortcut)
@@ -216,60 +216,60 @@ var Bookmarks = function () {
   /* PUBLIC API */
   this.getRootFolder = getRootFolder.bind(this);
   this.deleteRootFolder = deleteRootFolder.bind(this);
 
 };
 
 this.Bookmarks = Bookmarks;
 
-var RootFolder = function (rootId, rootName) {
+var RootFolder = function(rootId, rootName) {
   let suspended = true;
   let ignoreAll = false;
 
-  let suspend = function () {
+  let suspend = function() {
     if (!suspended) {
       PlacesUtils.bookmarks.removeObserver(observer);
       suspended = true;
     }
-  }.bind(this);
+  };
 
-  let resume = function () {
+  let resume = function() {
     if (suspended) {
       PlacesUtils.bookmarks.addObserver(observer, false);
       suspended = false;
     }
-  }.bind(this);
+  };
 
   let eventTypes = [
     "add",
     "remove",
     "change",
     "move",
   ];
 
   let eventSource = new EventSource(eventTypes, suspend, resume);
 
   let folderCache = new FolderCache;
   folderCache.insert(rootId, null);
 
-  let getCachedFolderIds = function (cache, roots) {
+  let getCachedFolderIds = function(cache, roots) {
     let nodes = [...roots];
     let results = [];
 
     while (nodes.length) {
       let node = nodes.shift();
       results.push(node);
       let children = cache.getChildren(node);
       nodes = nodes.concat([...children]);
     }
     return results;
   };
 
-  let getLocalItems = function () {
+  let getLocalItems = function() {
     let deferred = Promise.defer();
 
     let folders = getCachedFolderIds(folderCache, folderCache.getChildren(rootId));
 
     function getFolders(ids) {
       let types = [
         PlacesUtils.bookmarks.TYPE_FOLDER,
       ];
@@ -283,35 +283,35 @@ var RootFolder = function (rootId, rootN
         PlacesUtils.bookmarks.TYPE_SEPARATOR,
       ];
       return PlacesWrapper.getItemsByParentId(parents, types)
     }
 
     function getParentGuids(results) {
       results = Array.prototype.concat.apply([], results);
       let promises = [];
-      results.map(function (result) {
+      results.map(function(result) {
         let promise = PlacesWrapper.localIdToGuid(result.parent).then(
-          function (guidResult) {
+          function(guidResult) {
             result.parent = guidResult;
             return Promise.resolve(result);
           },
           Promise.reject.bind(Promise)
         );
         promises.push(promise);
       });
       return Promise.all(promises);
     }
 
     function getAnnos(results) {
       results = Array.prototype.concat.apply([], results);
       let promises = [];
-      results.map(function (result) {
+      results.map(function(result) {
         let promise = PlacesWrapper.getItemAnnotationsForLocalId(result.id).then(
-          function (annos) {
+          function(annos) {
             result.annos = annos;
             return Promise.resolve(result);
           },
           Promise.reject.bind(Promise)
         );
         promises.push(promise);
       });
       return Promise.all(promises);
@@ -320,62 +320,62 @@ var RootFolder = function (rootId, rootN
     let promises = [
       getFolders(folders),
       getContents(folders),
     ];
 
     Promise.all(promises)
            .then(getParentGuids)
            .then(getAnnos)
-           .then(function (results) {
+           .then(function(results) {
                    results = results.map((result) => new Record(result));
                    deferred.resolve(results);
                  },
                  deferred.reject);
 
     return deferred.promise;
   };
 
-  let getLocalItemsById = function (guids) {
+  let getLocalItemsById = function(guids) {
     let deferred = Promise.defer();
 
     let types = [
       PlacesUtils.bookmarks.TYPE_BOOKMARK,
       PlacesUtils.bookmarks.TYPE_FOLDER,
       PlacesUtils.bookmarks.TYPE_SEPARATOR,
       PlacesUtils.bookmarks.TYPE_DYNAMIC_CONTAINER,
     ];
 
     function getParentGuids(results) {
       let promises = [];
-      results.map(function (result) {
+      results.map(function(result) {
         let promise = PlacesWrapper.localIdToGuid(result.parent).then(
-          function (guidResult) {
+          function(guidResult) {
             result.parent = guidResult;
             return Promise.resolve(result);
           },
           Promise.reject.bind(Promise)
         );
         promises.push(promise);
       });
       return Promise.all(promises);
     }
 
     PlacesWrapper.getItemsByGuid(guids, types)
                  .then(getParentGuids)
-                 .then(function (results) {
+                 .then(function(results) {
                          results = results.map((result) => new Record(result));
                          deferred.resolve(results);
                        },
                        deferred.reject);
 
     return deferred.promise;
   };
 
-  let _createItem = function (item) {
+  let _createItem = function(item) {
     let deferred = Promise.defer();
 
     function getFolderId() {
       if (item.parent) {
         return PlacesWrapper.guidToLocalId(item.parent);
       }
       return Promise.resolve(rootId);
     }
@@ -427,34 +427,34 @@ var RootFolder = function (rootId, rootN
     }
 
     getFolderId().then(create)
                  .then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   };
 
-  let _deleteItem = function (item) {
+  let _deleteItem = function(item) {
     let deferred = Promise.defer();
 
     PlacesWrapper.guidToLocalId(item.id).then(
-      function (localId) {
+      function(localId) {
         folderCache.remove(localId);
         return PlacesWrapper.removeItem(localId);
       }
     ).then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   };
 
-  let _updateItem = function (item) {
+  let _updateItem = function(item) {
     let deferred = Promise.defer();
 
     PlacesWrapper.guidToLocalId(item.id).then(
-      function (localId) {
+      function(localId) {
         let promises = [];
 
         if (item.hasOwnProperty("dateAdded")) {
           promises.push(PlacesWrapper.setItemDateAdded(localId, item.dateAdded));
         }
 
         if (item.hasOwnProperty("lastModified")) {
           promises.push(PlacesWrapper.setItemLastModified(localId, item.lastModified));
@@ -467,17 +467,17 @@ var RootFolder = function (rootId, rootN
         if (CS_BOOKMARK & item.type && item.hasOwnProperty("uri")) {
           promises.push(PlacesWrapper.changeBookmarkURI(localId, item.uri));
         }
 
         if (item.hasOwnProperty("parent")) {
           let deferred = Promise.defer();
           PlacesWrapper.guidToLocalId(item.parent)
             .then(
-                function (parent) {
+                function(parent) {
                   let index = item.hasOwnProperty("index") ? item.index : PlacesUtils.bookmarks.DEFAULT_INDEX;
                   if (CS_FOLDER & item.type) {
                     folderCache.setParent(localId, parent);
                   }
                   return PlacesWrapper.moveItem(localId, parent, index);
                 }
               )
             .then(deferred.resolve, deferred.reject);
@@ -499,52 +499,52 @@ var RootFolder = function (rootId, rootN
         Promise.all(promises)
                .then(deferred.resolve, deferred.reject);
       }
     );
 
     return deferred.promise;
   };
 
-  let mergeRemoteItems = function (items) {
+  let mergeRemoteItems = function(items) {
     ignoreAll = true;
     let deferred = Promise.defer();
 
     let newFolders = {};
     let newItems = [];
     let updatedItems = [];
     let deletedItems = [];
 
-    let sortItems = function () {
+    let sortItems = function() {
       let promises = [];
 
-      let exists = function (item) {
+      let exists = function(item) {
         let existsDeferred = Promise.defer();
         if (!item.id) {
           Object.defineProperty(item, "__exists__", {
             value: false,
             enumerable: false
           });
           existsDeferred.resolve(item);
         } else {
           PlacesWrapper.guidToLocalId(item.id).then(
-            function (localId) {
+            function(localId) {
               Object.defineProperty(item, "__exists__", {
                 value: localId ? true : false,
                 enumerable: false
               });
               existsDeferred.resolve(item);
             },
             existsDeferred.reject
           );
         }
         return existsDeferred.promise;
       }
 
-      let handleSortedItem = function (item) {
+      let handleSortedItem = function(item) {
         if (!item.__exists__ && !item.deleted) {
           if (CS_FOLDER == item.type) {
             newFolders[item.id] = item;
             item._children = [];
           } else {
             newItems.push(item);
           }
         } else if (item.__exists__ && item.deleted) {
@@ -561,59 +561,59 @@ var RootFolder = function (rootId, rootN
 
         let promise = exists(item).then(handleSortedItem, Promise.reject.bind(Promise));
         promises.push(promise);
       }
 
       return Promise.all(promises);
     }
 
-    let processNewFolders = function () {
+    let processNewFolders = function() {
       let newFolderGuids = Object.keys(newFolders);
       let newFolderRoots = [];
 
       for (let guid of newFolderGuids) {
         let item = newFolders[guid];
         if (item.parent && newFolderGuids.indexOf(item.parent) >= 0) {
           let parent = newFolders[item.parent];
           parent._children.push(item.id);
         } else {
           newFolderRoots.push(guid);
         }
-      };
+      }
 
       let promises = [];
       for (let guid of newFolderRoots) {
         let root = newFolders[guid];
         let promise = Promise.resolve();
         promise = promise.then(
-          function () {
+          function() {
             return _createItem(root);
           },
           Promise.reject.bind(Promise)
         );
         let items = [].concat(root._children);
 
         while (items.length) {
           let item = newFolders[items.shift()];
           items = items.concat(item._children);
           promise = promise.then(
-            function () {
+            function() {
               return _createItem(item);
             },
             Promise.reject.bind(Promise)
           );
         }
         promises.push(promise);
       }
 
       return Promise.all(promises);
     }
 
-    let processItems = function () {
+    let processItems = function() {
       let promises = [];
 
       for (let item of newItems) {
         promises.push(_createItem(item));
       }
 
       for (let item of updatedItems) {
         promises.push(_updateItem(item));
@@ -623,76 +623,76 @@ var RootFolder = function (rootId, rootN
         _deleteItem(item);
       }
 
       return Promise.all(promises);
     }
 
     sortItems().then(processNewFolders)
                .then(processItems)
-               .then(function () {
+               .then(function() {
                        ignoreAll = false;
                        deferred.resolve(items);
                      },
-                     function (err) {
+                     function(err) {
                        ignoreAll = false;
                        deferred.reject(err);
                      });
 
     return deferred.promise;
   };
 
-  let ignore = function (id, parent) {
+  let ignore = function(id, parent) {
     if (ignoreAll) {
       return true;
     }
 
     if (rootId == parent || folderCache.has(parent)) {
       return false;
     }
 
     return true;
   };
 
-  let handleItemAdded = function (id, parent, index, type, uri, title, dateAdded, guid, parentGuid) {
+  let handleItemAdded = function(id, parent, index, type, uri, title, dateAdded, guid, parentGuid) {
     let deferred = Promise.defer();
 
     if (PlacesUtils.bookmarks.TYPE_FOLDER == type) {
       folderCache.insert(id, parent);
     }
 
     eventSource.emit("add", guid);
     deferred.resolve();
 
     return deferred.promise;
   };
 
-  let handleItemRemoved = function (id, parent, index, type, uri, guid, parentGuid) {
+  let handleItemRemoved = function(id, parent, index, type, uri, guid, parentGuid) {
     let deferred = Promise.defer();
 
     if (PlacesUtils.bookmarks.TYPE_FOLDER == type) {
       folderCache.remove(id);
     }
 
     eventSource.emit("remove", guid);
     deferred.resolve();
 
     return deferred.promise;
   };
 
-  let handleItemChanged = function (id, property, isAnnotation, newValue, lastModified, type, parent, guid, parentGuid) {
+  let handleItemChanged = function(id, property, isAnnotation, newValue, lastModified, type, parent, guid, parentGuid) {
     let deferred = Promise.defer();
 
     eventSource.emit('change', guid);
     deferred.resolve();
 
     return deferred.promise;
   };
 
-  let handleItemMoved = function (id, oldParent, oldIndex, newParent, newIndex, type, guid, oldParentGuid, newParentGuid) {
+  let handleItemMoved = function(id, oldParent, oldIndex, newParent, newIndex, type, guid, oldParentGuid, newParentGuid) {
     let deferred = Promise.defer();
 
     function complete() {
       eventSource.emit('move', guid);
       deferred.resolve();
     }
 
     if (PlacesUtils.bookmarks.TYPE_FOLDER != type) {
@@ -713,77 +713,77 @@ var RootFolder = function (rootId, rootN
       PlacesWrapper.updateCachedFolderIds(folderCache, oldParent)
                    .then(complete, complete);
     }
 
     return deferred.promise;
   };
 
   let observer = {
-    onBeginBatchUpdate: function () {
+    onBeginBatchUpdate() {
     },
 
-    onEndBatchUpdate: function () {
+    onEndBatchUpdate() {
     },
 
-    onItemAdded: function (id, parent, index, type, uri, title, dateAdded, guid, parentGuid) {
+    onItemAdded(id, parent, index, type, uri, title, dateAdded, guid, parentGuid) {
       if (ignore(id, parent)) {
         return;
       }
 
       asyncCallback(this, handleItemAdded, Array.prototype.slice.call(arguments));
     },
 
-    onItemRemoved: function (id, parent, index, type, uri, guid, parentGuid) {
+    onItemRemoved(id, parent, index, type, uri, guid, parentGuid) {
       if (ignore(id, parent)) {
         return;
       }
 
       asyncCallback(this, handleItemRemoved, Array.prototype.slice.call(arguments));
     },
 
-    onItemChanged: function (id, property, isAnnotation, newValue, lastModified, type, parent, guid, parentGuid) {
+    onItemChanged(id, property, isAnnotation, newValue, lastModified, type, parent, guid, parentGuid) {
       if (ignore(id, parent)) {
         return;
       }
 
       asyncCallback(this, handleItemChanged, Array.prototype.slice.call(arguments));
     },
 
-    onItemMoved: function (id, oldParent, oldIndex, newParent, newIndex, type, guid, oldParentGuid, newParentGuid) {
+    onItemMoved(id, oldParent, oldIndex, newParent, newIndex, type, guid, oldParentGuid, newParentGuid) {
       if (ignore(id, oldParent) && ignore(id, newParent)) {
         return;
       }
 
       asyncCallback(this, handleItemMoved, Array.prototype.slice.call(arguments));
     }
   };
 
   /* PUBLIC API */
   this.addEventListener = eventSource.addEventListener;
   this.removeEventListener = eventSource.removeEventListener;
   this.getLocalItems = getLocalItems.bind(this);
   this.getLocalItemsById = getLocalItemsById.bind(this);
   this.mergeRemoteItems = mergeRemoteItems.bind(this);
 
   let rootGuid = null; // resolved before becoming ready (below)
-  this.__defineGetter__("id", function () {
+  this.__defineGetter__("id", function() {
     return rootGuid;
   });
-  this.__defineGetter__("name", function () {
+  this.__defineGetter__("name", function() {
     return rootName;
   });
 
   let deferred = Promise.defer();
-  let getGuidForRootFolder = function () {
+  let getGuidForRootFolder = function() {
     return PlacesWrapper.localIdToGuid(rootId);
   }
   PlacesWrapper.updateCachedFolderIds(folderCache, rootId)
                .then(getGuidForRootFolder, getGuidForRootFolder)
-               .then(function (guid) {
+               .then(function(guid) {
                        rootGuid = guid;
                        deferred.resolve(this);
                      }.bind(this),
                      deferred.reject);
   return deferred.promise;
 };
 
 RootFolder.prototype = {
--- a/services/cloudsync/CloudSyncBookmarksFolderCache.jsm
+++ b/services/cloudsync/CloudSyncBookmarksFolderCache.jsm
@@ -2,26 +2,26 @@
  * 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 = ["FolderCache"];
 
 // Cache for bookmarks folder heirarchy.
-var FolderCache = function () {
+var FolderCache = function() {
   this.cache = new Map();
 }
 
 FolderCache.prototype = {
-  has: function (id) {
+  has(id) {
     return this.cache.has(id);
   },
 
-  insert: function (id, parentId) {
+  insert(id, parentId) {
     if (this.cache.has(id)) {
       return;
     }
 
     if (parentId && !(this.cache.has(parentId))) {
       throw new Error("insert :: parentId not found in cache: " + parentId);
     }
 
@@ -30,34 +30,34 @@ FolderCache.prototype = {
       children: new Set(),
     });
 
     if (parentId) {
       this.cache.get(parentId).children.add(id);
     }
   },
 
-  remove: function (id) {
+  remove(id) {
     if (!(this.cache.has(id))) {
       throw new Error("remote :: id not found in cache: " + id);
     }
 
     let parentId = this.cache.get(id).parent;
     if (parentId) {
       this.cache.get(parentId).children.delete(id);
     }
 
     for (let child of this.cache.get(id).children) {
       this.cache.get(child).parent = null;
     }
 
     this.cache.delete(id);
   },
 
-  setParent: function (id, parentId) {
+  setParent(id, parentId) {
     if (!(this.cache.has(id))) {
       throw new Error("setParent :: id not found in cache: " + id);
     }
 
     if (parentId && !(this.cache.has(parentId))) {
       throw new Error("setParent :: parentId not found in cache: " + parentId);
     }
 
@@ -66,40 +66,40 @@ FolderCache.prototype = {
       this.cache.get(oldParent).children.delete(id);
     }
     this.cache.get(id).parent = parentId;
     this.cache.get(parentId).children.add(id);
 
     return true;
   },
 
-  getParent: function (id) {
+  getParent(id) {
     if (this.cache.has(id)) {
       return this.cache.get(id).parent;
     }
 
     throw new Error("getParent :: id not found in cache: " + id);
   },
 
-  getChildren: function (id) {
+  getChildren(id) {
     if (this.cache.has(id)) {
       return this.cache.get(id).children;
     }
 
     throw new Error("getChildren :: id not found in cache: " + id);
   },
 
-  setChildren: function (id, children) {
+  setChildren(id, children) {
     for (let child of children) {
       if (!this.cache.has(child)) {
         this.insert(child, id);
       } else {
         this.setParent(child, id);
       }
     }
   },
 
-  dump: function () {
+  dump() {
     dump("FolderCache: " + JSON.stringify(this.cache) + "\n");
   },
 };
 
 this.FolderCache = FolderCache;
--- a/services/cloudsync/CloudSyncEventSource.jsm
+++ b/services/cloudsync/CloudSyncEventSource.jsm
@@ -1,63 +1,63 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["EventSource"];
 
 Components.utils.import("resource://services-common/utils.js");
 
-var EventSource = function (types, suspendFunc, resumeFunc) {
+var EventSource = function(types, suspendFunc, resumeFunc) {
   this.listeners = new Map();
   for (let type of types) {
     this.listeners.set(type, new Set());
   }
 
-  this.suspend = suspendFunc || function () {};
-  this.resume = resumeFunc || function () {};
+  this.suspend = suspendFunc || function() {};
+  this.resume = resumeFunc || function() {};
 
   this.addEventListener = this.addEventListener.bind(this);
   this.removeEventListener = this.removeEventListener.bind(this);
 };
 
 EventSource.prototype = {
-  addEventListener: function (type, listener) {
+  addEventListener(type, listener) {
     if (!this.listeners.has(type)) {
       return;
     }
     this.listeners.get(type).add(listener);
     this.resume();
   },
 
-  removeEventListener: function (type, listener) {
+  removeEventListener(type, listener) {
     if (!this.listeners.has(type)) {
       return;
     }
     this.listeners.get(type).delete(listener);
     if (!this.hasListeners()) {
       this.suspend();
     }
   },
 
-  hasListeners: function () {
+  hasListeners() {
     for (let l of this.listeners.values()) {
       if (l.size > 0) {
         return true;
       }
     }
     return false;
   },
 
-  emit: function (type, arg) {
+  emit(type, arg) {
     if (!this.listeners.has(type)) {
       return;
     }
     CommonUtils.nextTick(
-      function () {
+      function() {
         for (let listener of this.listeners.get(type)) {
           listener.call(undefined, arg);
         }
       },
       this
     );
   },
 };
--- a/services/cloudsync/CloudSyncLocal.jsm
+++ b/services/cloudsync/CloudSyncLocal.jsm
@@ -24,27 +24,27 @@ function lazyStrings(name) {
 this.Str = {};
 XPCOMUtils.defineLazyGetter(Str, "errors", lazyStrings("errors"));
 XPCOMUtils.defineLazyGetter(Str, "sync", lazyStrings("sync"));
 
 function makeGUID() {
   return CommonUtils.encodeBase64URL(CryptoUtils.generateRandomBytes(9));
 }
 
-this.Local = function () {
+this.Local = function() {
   let prefs = new Preferences("services.cloudsync.");
-  this.__defineGetter__("prefs", function () {
+  this.__defineGetter__("prefs", function() {
     return prefs;
   });
 };
 
 Local.prototype = {
   get id() {
     let clientId = this.prefs.get("client.GUID", "");
-    return clientId == "" ? this.id = makeGUID(): clientId;
+    return clientId == "" ? this.id = makeGUID() : clientId;
   },
 
   set id(value) {
     this.prefs.set("client.GUID", value);
   },
 
   get name() {
     let clientName = this.prefs.get("client.name", "");
--- a/services/cloudsync/CloudSyncPlacesWrapper.jsm
+++ b/services/cloudsync/CloudSyncPlacesWrapper.jsm
@@ -9,39 +9,39 @@ this.EXPORTED_SYMBOLS = ["PlacesWrapper"
 const {interfaces: Ci, utils: Cu} = Components;
 const REASON_ERROR = Ci.mozIStorageStatementCallback.REASON_ERROR;
 
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 Cu.import("resource:///modules/PlacesUIUtils.jsm");
 Cu.import("resource://services-common/utils.js");
 
-var PlacesQueries = function () {
+var PlacesQueries = function() {
 }
 
 PlacesQueries.prototype = {
   cachedStmts: {},
 
-  getQuery: function (queryString) {
+  getQuery(queryString) {
     if (queryString in this.cachedStmts) {
       return this.cachedStmts[queryString];
     }
 
     let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
     return this.cachedStmts[queryString] = db.createAsyncStatement(queryString);
   }
 };
 
-var PlacesWrapper = function () {
+var PlacesWrapper = function() {
 }
 
 PlacesWrapper.prototype = {
   placesQueries: new PlacesQueries(),
 
-  guidToLocalId: function (guid) {
+  guidToLocalId(guid) {
     let deferred = Promise.defer();
 
     let stmt = "SELECT id AS item_id " +
                "FROM moz_bookmarks " +
                "WHERE guid = :guid";
     let query = this.placesQueries.getQuery(stmt);
 
     function getLocalId(results) {
@@ -53,17 +53,17 @@ PlacesWrapper.prototype = {
 
     this.asyncQuery(query, ["item_id"])
         .then(getLocalId, deferred.reject)
         .then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   },
 
-  localIdToGuid: function (id) {
+  localIdToGuid(id) {
     let deferred = Promise.defer();
 
     let stmt = "SELECT guid " +
                "FROM moz_bookmarks " +
                "WHERE id = :item_id";
     let query = this.placesQueries.getQuery(stmt);
 
     function getGuid(results) {
@@ -75,74 +75,74 @@ PlacesWrapper.prototype = {
 
     this.asyncQuery(query, ["guid"])
         .then(getGuid, deferred.reject)
         .then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   },
 
-  getItemsById: function (ids, types) {
+  getItemsById(ids, types) {
     let deferred = Promise.defer();
     let stmt = "SELECT b.id, b.type, b.parent, b.position, b.title, b.guid, b.dateAdded, b.lastModified, p.url " +
                "FROM moz_bookmarks b " +
                "LEFT JOIN moz_places p ON b.fk = p.id " +
                "WHERE b.id in (" + ids.join(",") + ") AND b.type in (" + types.join(",") + ")";
     let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
     let query = db.createAsyncStatement(stmt);
 
     this.asyncQuery(query, ["id", "type", "parent", "position", "title", "guid", "dateAdded", "lastModified", "url"])
         .then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   },
 
-  getItemsByParentId: function (parents, types) {
+  getItemsByParentId(parents, types) {
     let deferred = Promise.defer();
     let stmt = "SELECT b.id, b.type, b.parent, b.position, b.title, b.guid, b.dateAdded, b.lastModified, p.url " +
                "FROM moz_bookmarks b " +
                "LEFT JOIN moz_places p ON b.fk = p.id " +
                "WHERE b.parent in (" + parents.join(",") + ") AND b.type in (" + types.join(",") + ")";
     let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
     let query = db.createAsyncStatement(stmt);
 
     this.asyncQuery(query, ["id", "type", "parent", "position", "title", "guid", "dateAdded", "lastModified", "url"])
         .then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   },
 
-  getItemsByGuid: function (guids, types) {
+  getItemsByGuid(guids, types) {
     let deferred = Promise.defer();
     guids = guids.map(JSON.stringify);
     let stmt = "SELECT b.id, b.type, b.parent, b.position, b.title, b.guid, b.dateAdded, b.lastModified, p.url " +
                "FROM moz_bookmarks b " +
                "LEFT JOIN moz_places p ON b.fk = p.id " +
                "WHERE b.guid in (" + guids.join(",") + ") AND b.type in (" + types.join(",") + ")";
     let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
     let query = db.createAsyncStatement(stmt);
 
     this.asyncQuery(query, ["id", "type", "parent", "position", "title", "guid", "dateAdded", "lastModified", "url"])
         .then(deferred.resolve, deferred.reject);
 
     return deferred.promise;
   },
 
-  updateCachedFolderIds: function (folderCache, folder) {
+  updateCachedFolderIds(folderCache, folder) {
     let deferred = Promise.defer();
     let stmt = "SELECT id, guid " +
                "FROM moz_bookmarks " +
                "WHERE parent = :parent_id AND type = :item_type";
     let query = this.placesQueries.getQuery(stmt);
 
     query.params.parent_id = folder;
     query.params.item_type = PlacesUtils.bookmarks.TYPE_FOLDER;
 
     this.asyncQuery(query, ["id", "guid"]).then(
-      function (items) {
+      function(items) {
         let previousIds = folderCache.getChildren(folder);
         let currentIds = new Set();
         for (let item of items) {
           currentIds.add(item.id);
         }
         let newIds = new Set();
         let missingIds = new Set();
 
@@ -170,200 +170,200 @@ PlacesWrapper.prototype = {
           folderCache.remove(missingId);
         }
       }.bind(this)
     );
 
     return deferred.promise;
   },
 
-  getLocalIdsWithAnnotation: function (anno) {
+  getLocalIdsWithAnnotation(anno) {
     let deferred = Promise.defer();
     let stmt = "SELECT a.item_id " +
                "FROM moz_anno_attributes n " +
                "JOIN moz_items_annos a ON n.id = a.anno_attribute_id " +
                "WHERE n.name = :anno_name";
     let query = this.placesQueries.getQuery(stmt);
 
     query.params.anno_name = anno.toString();
 
     this.asyncQuery(query, ["item_id"])
-        .then(function (items) {
+        .then(function(items) {
                 let results = [];
                 for (let item of items) {
                   results.push(item.item_id);
                 }
                 deferred.resolve(results);
               },
               deferred.reject);
 
     return deferred.promise;
   },
 
-  getItemAnnotationsForLocalId: function (id) {
+  getItemAnnotationsForLocalId(id) {
     let deferred = Promise.defer();
     let stmt = "SELECT a.name, b.content " +
                "FROM moz_anno_attributes a " +
                "JOIN moz_items_annos b ON a.id = b.anno_attribute_id " +
                "WHERE b.item_id = :item_id";
     let query = this.placesQueries.getQuery(stmt);
 
     query.params.item_id = id;
 
     this.asyncQuery(query, ["name", "content"])
-        .then(function (results) {
+        .then(function(results) {
                 let annos = {};
                 for (let result of results) {
                   annos[result.name] = result.content;
                 }
                 deferred.resolve(annos);
               },
               deferred.reject);
 
     return deferred.promise;
   },
 
-  insertBookmark: function (parent, uri, index, title, guid) {
+  insertBookmark(parent, uri, index, title, guid) {
     let parsedURI;
     try {
       parsedURI = CommonUtils.makeURI(uri)
     } catch (e) {
       return Promise.reject("unable to parse URI '" + uri + "': " + e);
     }
 
     try {
       let id = PlacesUtils.bookmarks.insertBookmark(parent, parsedURI, index, title, guid);
       return Promise.resolve(id);
     } catch (e) {
       return Promise.reject("unable to insert bookmark " + JSON.stringify(arguments) + ": " + e);
     }
   },
 
-  setItemAnnotation: function (item, anno, value, flags, exp) {
+  setItemAnnotation(item, anno, value, flags, exp) {
     try {
       return Promise.resolve(PlacesUtils.annotations.setItemAnnotation(item, anno, value, flags, exp));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  itemHasAnnotation: function (item, anno) {
+  itemHasAnnotation(item, anno) {
     try {
       return Promise.resolve(PlacesUtils.annotations.itemHasAnnotation(item, anno));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  createFolder: function (parent, name, index, guid) {
+  createFolder(parent, name, index, guid) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.createFolder(parent, name, index, guid));
     } catch (e) {
       return Promise.reject("unable to create folder ['" + name + "']: " + e);
     }
   },
 
-  removeFolderChildren: function (folder) {
+  removeFolderChildren(folder) {
     try {
       PlacesUtils.bookmarks.removeFolderChildren(folder);
       return Promise.resolve();
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  insertSeparator: function (parent, index, guid) {
+  insertSeparator(parent, index, guid) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.insertSeparator(parent, index, guid));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  removeItem: function (item) {
+  removeItem(item) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.removeItem(item));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  setItemDateAdded: function (item, dateAdded) {
+  setItemDateAdded(item, dateAdded) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.setItemDateAdded(item, dateAdded));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  setItemLastModified: function (item, lastModified) {
+  setItemLastModified(item, lastModified) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.setItemLastModified(item, lastModified));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  setItemTitle: function (item, title) {
+  setItemTitle(item, title) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.setItemTitle(item, title));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  changeBookmarkURI: function (item, uri) {
+  changeBookmarkURI(item, uri) {
     try {
       uri = CommonUtils.makeURI(uri);
       return Promise.resolve(PlacesUtils.bookmarks.changeBookmarkURI(item, uri));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  moveItem: function (item, parent, index) {
+  moveItem(item, parent, index) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.moveItem(item, parent, index));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  setItemIndex: function (item, index) {
+  setItemIndex(item, index) {
     try {
       return Promise.resolve(PlacesUtils.bookmarks.setItemIndex(item, index));
     } catch (e) {
       return Promise.reject(e);
     }
   },
 
-  asyncQuery: function (query, names) {
+  asyncQuery(query, names) {
     let deferred = Promise.defer();
     let storageCallback = {
       results: [],
-      handleResult: function (results) {
+      handleResult(results) {
         if (!names) {
           return;
         }
 
         let row;
         while ((row = results.getNextRow()) != null) {
           let item = {};
           for (let name of names) {
             item[name] = row.getResultByName(name);
           }
           this.results.push(item);
         }
       },
 
-      handleError: function (error) {
+      handleError(error) {
         deferred.reject(error);
       },
 
-      handleCompletion: function (reason) {
+      handleCompletion(reason) {
         if (REASON_ERROR == reason) {
           return;
         }
 
         deferred.resolve(this.results);
       }
     };
 
--- a/services/cloudsync/CloudSyncTabs.jsm
+++ b/services/cloudsync/CloudSyncTabs.jsm
@@ -14,64 +14,64 @@ Cu.import("resource://gre/modules/CloudS
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://services-common/observers.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "Session", "@mozilla.org/browser/sessionstore;1", "nsISessionStore");
 
 const DATA_VERSION = 1;
 
-var ClientRecord = function (params) {
+var ClientRecord = function(params) {
   this.id = params.id;
   this.name = params.name || "?";
   this.tabs = new Set();
 }
 
 ClientRecord.prototype = {
   version: DATA_VERSION,
 
-  update: function (params) {
+  update(params) {
     if (this.id !== params.id) {
       throw new Error("expected " + this.id + " to equal " + params.id);
     }
 
     this.name = params.name;
   }
 };
 
-var TabRecord = function (params) {
+var TabRecord = function(params) {
   this.url = params.url || "";
   this.update(params);
 };
 
 TabRecord.prototype = {
   version: DATA_VERSION,
 
-  update: function (params) {
+  update(params) {
     if (this.url && this.url !== params.url) {
       throw new Error("expected " + this.url + " to equal " + params.url);
     }
 
     if (params.lastUsed && params.lastUsed < this.lastUsed) {
       return;
     }
 
     this.title = params.title || "";
     this.icon = params.icon || "";
     this.lastUsed = params.lastUsed || 0;
   },
 };
 
-var TabCache = function () {
+var TabCache = function() {
   this.tabs = new Map();
   this.clients = new Map();
 };
 
 TabCache.prototype = {
-  merge: function (client, tabs) {
+  merge(client, tabs) {
     if (!client || !client.id) {
       return;
     }
 
     if (!tabs) {
       return;
     }
 
@@ -108,150 +108,150 @@ TabCache.prototype = {
       if (tab.deleted) {
         cRecord.tabs.delete(tRecord);
       } else {
         cRecord.tabs.add(tRecord);
       }
     }
   },
 
-  clear: function (client) {
+  clear(client) {
     if (client) {
       this.clients.delete(client.id);
     } else {
       this.clients = new Map();
       this.tabs = new Map();
     }
   },
 
-  get: function () {
+  get() {
     let results = [];
     for (let client of this.clients.values()) {
       results.push(client);
     }
     return results;
   },
 
-  isEmpty: function () {
+  isEmpty() {
     return 0 == this.clients.size;
   },
 
 };
 
-this.Tabs = function () {
+this.Tabs = function() {
   let suspended = true;
 
   let topics = [
     "pageshow",
     "TabOpen",
     "TabClose",
     "TabSelect",
   ];
 
-  let update = function (event) {
+  let update = function(event) {
     if (event.originalTarget.linkedBrowser) {
       if (PrivateBrowsingUtils.isBrowserPrivate(event.originalTarget.linkedBrowser) &&
           !PrivateBrowsingUtils.permanentPrivateBrowsing) {
         return;
       }
     }
 
     eventSource.emit("change");
   };
 
-  let registerListenersForWindow = function (window) {
+  let registerListenersForWindow = function(window) {
     for (let topic of topics) {
       window.addEventListener(topic, update, false);
     }
     window.addEventListener("unload", unregisterListeners, false);
   };
 
-  let unregisterListenersForWindow = function (window) {
+  let unregisterListenersForWindow = function(window) {
     window.removeEventListener("unload", unregisterListeners, false);
     for (let topic of topics) {
       window.removeEventListener(topic, update, false);
     }
   };
 
-  let unregisterListeners = function (event) {
+  let unregisterListeners = function(event) {
     unregisterListenersForWindow(event.target);
   };
 
   let observer = {
-    observe: function (subject, topic, data) {
+    observe(subject, topic, data) {
       switch (topic) {
         case "domwindowopened":
           let onLoad = () => {
             subject.removeEventListener("load", onLoad, false);
             // Only register after the window is done loading to avoid unloads.
             registerListenersForWindow(subject);
           };
 
           // Add tab listeners now that a window has opened.
           subject.addEventListener("load", onLoad, false);
           break;
       }
     }
   };
 
-  let resume = function () {
+  let resume = function() {
     if (suspended) {
       Observers.add("domwindowopened", observer);
       let wins = Services.wm.getEnumerator("navigator:browser");
       while (wins.hasMoreElements()) {
         registerListenersForWindow(wins.getNext());
       }
     }
-  }.bind(this);
+  };
 
-  let suspend = function () {
+  let suspend = function() {
     if (!suspended) {
       Observers.remove("domwindowopened", observer);
       let wins = Services.wm.getEnumerator("navigator:browser");
       while (wins.hasMoreElements()) {
         unregisterListenersForWindow(wins.getNext());
       }
     }
-  }.bind(this);
+  };
 
   let eventTypes = [
     "change",
   ];
 
   let eventSource = new EventSource(eventTypes, suspend, resume);
 
   let tabCache = new TabCache();
 
-  let getWindowEnumerator = function () {
+  let getWindowEnumerator = function() {
     return Services.wm.getEnumerator("navigator:browser");
   };
 
-  let shouldSkipWindow = function (win) {
+  let shouldSkipWindow = function(win) {
     return win.closed ||
            PrivateBrowsingUtils.isWindowPrivate(win);
   };
 
-  let getTabState = function (tab) {
+  let getTabState = function(tab) {
     return JSON.parse(Session.getTabState(tab));
   };
 
-  let getLocalTabs = function (filter) {
+  let getLocalTabs = function(filter) {
     let deferred = Promise.defer();
 
     filter = (undefined === filter) ? true : filter;
     let filteredUrls = new RegExp("^(about:.*|chrome://weave/.*|wyciwyg:.*|file:.*)$"); // FIXME: should be a pref (B#1044304)
 
     let allTabs = [];
 
     let currentState = JSON.parse(Session.getBrowserState());
-    currentState.windows.forEach(function (window) {
+    currentState.windows.forEach(function(window) {
       if (window.isPrivate) {
         return;
       }
-      window.tabs.forEach(function (tab) {
+      window.tabs.forEach(function(tab) {
         if (!tab.entries.length) {
           return;
         }
 
         // Get only the latest entry
         // FIXME: support full history (B#1044306)
         let entry = tab.entries[tab.index - 1];
 
@@ -268,43 +268,43 @@ this.Tabs = function () {
       });
     });
 
     deferred.resolve(allTabs);
 
     return deferred.promise;
   };
 
-  let mergeRemoteTabs = function (client, tabs) {
+  let mergeRemoteTabs = function(client, tabs) {
     let deferred = Promise.defer();
 
     deferred.resolve(tabCache.merge(client, tabs));
     Observers.notify("cloudsync:tabs:update");
 
     return deferred.promise;
   };
 
-  let clearRemoteTabs = function (client) {
+  let clearRemoteTabs = function(client) {
     let deferred = Promise.defer();
 
     deferred.resolve(tabCache.clear(client));
     Observers.notify("cloudsync:tabs:update");
 
     return deferred.promise;
   };
 
-  let getRemoteTabs = function () {
+  let getRemoteTabs = function() {
     let deferred = Promise.defer();
 
     deferred.resolve(tabCache.get());
 
     return deferred.promise;
   };
 
-  let hasRemoteTabs = function () {
+  let hasRemoteTabs = function() {
     return !tabCache.isEmpty();
   };
 
   /* PUBLIC API */
   this.addEventListener = eventSource.addEventListener;
   this.removeEventListener = eventSource.removeEventListener;
   this.getLocalTabs = getLocalTabs.bind(this);
   this.mergeRemoteTabs = mergeRemoteTabs.bind(this);
--- a/services/cloudsync/tests/mochitest/browser_tabEvents.js
+++ b/services/cloudsync/tests/mochitest/browser_tabEvents.js
@@ -12,40 +12,40 @@ function test() {
   let cloudSync = local.CloudSync();
   let opentabs = [];
 
   waitForExplicitFinish();
 
   let testURL = "chrome://mochitests/content/browser/services/cloudsync/tests/mochitest/other_window.html";
   let expected = [
     testURL,
-    testURL+"?x=1",
-    testURL+"?x=%20a",
+    testURL + "?x=1",
+    testURL + "?x=%20a",
     // testURL+"?x=å",
   ];
 
   let nevents = 0;
   let nflushed = 0;
-  function handleTabChangeEvent () {
+  function handleTabChangeEvent() {
     cloudSync.tabs.removeEventListener("change", handleTabChangeEvent);
-    ++ nevents;
+    ++nevents;
     info("tab change event " + nevents);
     next();
   }
 
   function getLocalTabs() {
     cloudSync.tabs.getLocalTabs().then(
-      function (tabs) {
+      function(tabs) {
         for (let tab of tabs) {
           ok(expected.indexOf(tab.url) >= 0, "found an expected tab");
         }
 
         is(tabs.length, expected.length, "found the right number of tabs");
 
-        opentabs.forEach(function (tab) {
+        opentabs.forEach(function(tab) {
           gBrowser.removeTab(tab);
         });
 
         is(nevents, 1, "expected number of change events");
 
         finish();
       }
     )
@@ -54,17 +54,17 @@ function test() {
   cloudSync.tabs.addEventListener("change", handleTabChangeEvent);
 
   expected.forEach(function(url) {
     let tab = gBrowser.addTab(url);
 
     function flush() {
       tab.linkedBrowser.removeEventListener("load", flush, true);
       local.TabStateFlusher.flush(tab.linkedBrowser).then(() => {
-        ++ nflushed;
+        ++nflushed;
         info("flushed " + nflushed);
         next();
       });
     }
 
     tab.linkedBrowser.addEventListener("load", flush, true);
 
     opentabs.push(tab);
--- a/services/cloudsync/tests/xpcshell/head.js
+++ b/services/cloudsync/tests/xpcshell/head.js
@@ -1,10 +1,10 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
 "use strict";
 
-(function initCloudSyncTestingInfrastructure () {
+(function initCloudSyncTestingInfrastructure() {
   do_get_profile();
 }).call(this);
--- a/services/cloudsync/tests/xpcshell/test_bookmarks.js
+++ b/services/cloudsync/tests/xpcshell/test_bookmarks.js
@@ -1,50 +1,50 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 Cu.import("resource://gre/modules/CloudSync.jsm");
 
-function run_test () {
+function run_test() {
   run_next_test();
 }
 
-function cleanup () {
+function cleanup() {
 
 }
 
-add_task(function* test_merge_bookmarks_flat () {
+add_task(function* test_merge_bookmarks_flat() {
   try {
 	  let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
 	  ok(rootFolder.id, "root folder id is ok");
 
 	  let items = [
-		{"id":"G_UL4ZhOyX8m","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 1","uri":"http://www.reddit.com",index:2},
-		{"id":"G_UL4ZhOyX8n","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 2","uri":"http://www.reddit.com?1",index:1},
+		{"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
+		{"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com?1", index:1},
 	  ];
 	  yield rootFolder.mergeRemoteItems(items);
 
 	  let localItems = yield rootFolder.getLocalItems();
 	  equal(Object.keys(localItems).length, items.length, "found merged items");
   } finally {
   	yield CloudSync().bookmarks.deleteRootFolder("TEST");
   }
 });
 
-add_task(function* test_merge_bookmarks_in_folders () {
+add_task(function* test_merge_bookmarks_in_folders() {
   try {
 	  let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
 	  ok(rootFolder.id, "root folder id is ok");
 
 	  let items = [
-	  	{"id":"G_UL4ZhOyX8m","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 1","uri":"http://www.reddit.com",index:2},
-	    {"id":"G_UL4ZhOyX8n","type":rootFolder.BOOKMARK,parent:"G_UL4ZhOyX8x","title":"reddit: the front page of the internet 2","uri":"http://www.reddit.com/?a=å%20ä%20ö",index:1},
-	    {"id":"G_UL4ZhOyX8x","type":rootFolder.FOLDER},
+	  	{"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
+	    {"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, parent:"G_UL4ZhOyX8x", "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com/?a=å%20ä%20ö", index:1},
+	    {"id":"G_UL4ZhOyX8x", "type":rootFolder.FOLDER},
 	  ];
 	  yield rootFolder.mergeRemoteItems(items);
 
 	  let localItems = yield rootFolder.getLocalItems();
 	  equal(localItems.length, items.length, "found merged items");
 
 	  localItems.forEach(function(item) {
 	    ok(item.id == "G_UL4ZhOyX8m" ||
@@ -65,9 +65,9 @@ add_task(function* test_merge_bookmarks_
 	  equal(bookmark.id, "G_UL4ZhOyX8n");
 	  equal(bookmark.parent, "G_UL4ZhOyX8x");
 	  equal(bookmark.title, "reddit: the front page of the internet 2");
 	  equal(bookmark.index, 0);
 	  equal(bookmark.uri, "http://www.reddit.com/?a=%C3%A5%20%C3%A4%20%C3%B6");
   } finally {
 	yield CloudSync().bookmarks.deleteRootFolder("TEST");
   }
-});
\ No newline at end of file
+});
--- a/services/cloudsync/tests/xpcshell/test_module.js
+++ b/services/cloudsync/tests/xpcshell/test_module.js
@@ -1,19 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 Cu.import("resource://gre/modules/CloudSync.jsm");
 
-function run_test () {
+function run_test() {
   run_next_test();
 }
 
-add_task(function test_module_load () {
+add_task(function test_module_load() {
   ok(CloudSync);
   let cloudSync = CloudSync();
   ok(cloudSync.adapters);
   ok(cloudSync.bookmarks);
   ok(cloudSync.local);
   ok(cloudSync.tabs);
 });
--- a/services/cloudsync/tests/xpcshell/test_tabs.js
+++ b/services/cloudsync/tests/xpcshell/test_tabs.js
@@ -1,29 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 Cu.import("resource://gre/modules/CloudSync.jsm");
 
-function run_test () {
+function run_test() {
   run_next_test();
 }
 
-add_task(function* test_get_remote_tabs () {
+add_task(function* test_get_remote_tabs() {
   let cloudSync = CloudSync();
   let clients = yield cloudSync.tabs.getRemoteTabs();
   equal(clients.length, 0);
 
   yield cloudSync.tabs.mergeRemoteTabs({
       id: "001",
       name: "FakeClient",
-    },[
-      {url:"https://www.google.ca?a=å%20ä%20ö",title:"Google Canada",icon:"https://www.google.ca/favicon.ico",lastUsed:0},
-      {url:"http://www.reddit.com",title:"Reddit",icon:"http://www.reddit.com/favicon.ico",lastUsed:1},
+    }, [
+      {url:"https://www.google.ca?a=å%20ä%20ö", title:"Google Canada", icon:"https://www.google.ca/favicon.ico", lastUsed:0},
+      {url:"http://www.reddit.com", title:"Reddit", icon:"http://www.reddit.com/favicon.ico", lastUsed:1},
     ]);
   ok(cloudSync.tabs.hasRemoteTabs());
 
   clients = yield cloudSync.tabs.getRemoteTabs();
   equal(clients.length, 1);
   equal(clients[0].tabs.size, 2);
 });
--- a/services/common/async.js
+++ b/services/common/async.js
@@ -221,16 +221,16 @@ this.Async = {
     storageCallback.names = names;
     storageCallback.syncCb = Async.makeSyncCallback();
     query.executeAsync(storageCallback);
     return Async.waitForSyncCallback(storageCallback.syncCb);
   },
 
   promiseSpinningly(promise) {
     let cb = Async.makeSpinningCallback();
-    promise.then(result =>  {
+    promise.then(result => {
       cb(null, result);
     }, err => {
       cb(err || new Error("Promise rejected without explicit error"));
     });
     return cb.wait();
   },
 };
--- a/services/common/blocklist-clients.js
+++ b/services/common/blocklist-clients.js
@@ -87,17 +87,17 @@ function fetchRemoteCollection(collectio
  * URL and bucket name. It uses the `FirefoxAdapter` which relies on SQLite to
  * persist the local DB.
  */
 function kintoClient(connection, bucket) {
   let base = Services.prefs.getCharPref(PREF_SETTINGS_SERVER);
 
   let config = {
     remote: base,
-    bucket: bucket,
+    bucket,
     adapter: FirefoxAdapter,
     adapterOptions: {sqliteHandle: connection},
   };
 
   return new Kinto(config);
 }
 
 
@@ -275,17 +275,17 @@ function* updatePinningList(records) {
         .getService(Ci.nsISiteSecurityService);
 
     // clear the current preload list
     siteSecurityService.clearPreloads();
 
     // write each KeyPin entry to the preload list
     for (let item of records) {
       try {
-        const {pinType, pins=[], versions} = item;
+        const {pinType, pins = [], versions} = item;
         if (versions.indexOf(appInfo.version) != -1) {
           if (pinType == "KeyPin" && pins.length) {
             siteSecurityService.setKeyPins(item.hostName,
                 item.includeSubdomains,
                 item.expires,
                 pins.length,
                 pins, true);
           }
@@ -296,18 +296,16 @@ function* updatePinningList(records) {
           }
         }
       } catch (e) {
         // prevent errors relating to individual preload entries from causing
         // sync to fail. We will accumulate telemetry for such failures in bug
         // 1254099.
       }
     }
-  } else {
-    return;
   }
 }
 
 /**
  * Write list of records into JSON file, and notify nsBlocklistService.
  *
  * @param {String} filename  path relative to profile dir.
  * @param {Object} records   current records in the local db.
@@ -315,19 +313,19 @@ function* updatePinningList(records) {
 function* updateJSONBlocklist(filename, records) {
   // Write JSON dump for synchronous load at startup.
   const path = OS.Path.join(OS.Constants.Path.profileDir, filename);
   const serialized = JSON.stringify({data: records}, null, 2);
   try {
     yield OS.File.writeAtomic(path, serialized, {tmpPath: path + ".tmp"});
 
     // Notify change to `nsBlocklistService`
-    const eventData = {filename: filename};
+    const eventData = {filename};
     Services.cpmm.sendAsyncMessage("Blocklist:reload-from-disk", eventData);
-  } catch(e) {
+  } catch (e) {
     Cu.reportError(e);
   }
 }
 
 this.OneCRLBlocklistClient = new BlocklistClient(
   Services.prefs.getCharPref(PREF_BLOCKLIST_ONECRL_COLLECTION),
   PREF_BLOCKLIST_ONECRL_CHECKED_SECONDS,
   updateCertBlocklist,
--- a/services/common/hawkclient.js
+++ b/services/common/hawkclient.js
@@ -109,19 +109,19 @@ this.HawkClient.prototype = {
    * Construct an error message for a response.  Private.
    *
    * @param restResponse
    *        A RESTResponse object from a RESTRequest
    *
    * @param error
    *        A string or object describing the error
    */
-  _constructError: function(restResponse, error) {
+  _constructError(restResponse, error) {
     let errorObj = {
-      error: error,
+      error,
       // This object is likely to be JSON.stringify'd, but neither Error()
       // objects nor Components.Exception objects do the right thing there,
       // so we add a new element which is simply the .toString() version of
       // the error object, so it does appear in JSON'd values.
       errorString: error.toString(),
       message: restResponse.statusText,
       code: restResponse.status,
       errno: restResponse.status,
@@ -151,22 +151,22 @@ this.HawkClient.prototype = {
    * easier, even though the value will not have millisecond accuracy.
    *
    * @param dateString
    *        An RFC 1123 date string (e.g., "Mon, 13 Jan 2014 21:45:06 GMT")
    *
    * For HAWK clock skew and replay protection, see
    * https://github.com/hueniverse/hawk#replay-protection
    */
-  _updateClockOffset: function(dateString) {
+  _updateClockOffset(dateString) {
     try {
       let serverDateMsec = Date.parse(dateString);
       this._localtimeOffsetMsec = serverDateMsec - this.now();
       log.debug("Clock offset vs " + this.host + ": " + this._localtimeOffsetMsec);
-    } catch(err) {
+    } catch (err) {
       log.warn("Bad date header in server response: " + dateString);
     }
   },
 
   /*
    * Get the current clock offset in milliseconds.
    *
    * The offset is the number of milliseconds that must be added to the client
@@ -175,17 +175,17 @@ this.HawkClient.prototype = {
    */
   get localtimeOffsetMsec() {
     return this._localtimeOffsetMsec;
   },
 
   /*
    * return current time in milliseconds
    */
-  now: function() {
+  now() {
     return Date.now();
   },
 
   /* A general method for sending raw RESTRequest calls authorized using HAWK
    *
    * @param path
    *        API endpoint path
    * @param method
@@ -198,18 +198,18 @@ this.HawkClient.prototype = {
    * @param extraHeaders
    *        An object with header/value pairs to send with the request.
    * @return Promise
    *        Returns a promise that resolves to the response of the API call,
    *        or is rejected with an error.  If the server response can be parsed
    *        as JSON and contains an 'error' property, the promise will be
    *        rejected with this JSON-parsed response.
    */
-  request: function(path, method, credentials=null, payloadObj={}, extraHeaders = {},
-                    retryOK=true) {
+  request(path, method, credentials = null, payloadObj = {}, extraHeaders = {},
+                    retryOK = true) {
     method = method.toLowerCase();
 
     let deferred = Promise.defer();
     let uri = this.host + path;
     let self = this;
 
     function _onComplete(error) {
       // |error| can be either a normal caught error or an explicitly created
@@ -258,29 +258,29 @@ this.HawkClient.prototype = {
       //
       // In the case of a 401, in which we are probably being rejected for a
       // bad timestamp, retry exactly once, during which time clock offset will
       // be adjusted.
 
       let jsonResponse = {};
       try {
         jsonResponse = JSON.parse(restResponse.body);
-      } catch(notJSON) {}
+      } catch (notJSON) {}
 
       let okResponse = (200 <= status && status < 300);
       if (!okResponse || jsonResponse.error) {
         if (jsonResponse.error) {
           return deferred.reject(jsonResponse);
         }
         return deferred.reject(self._constructError(restResponse, "Request failed"));
       }
       // It's up to the caller to know how to decode the response.
       // We just return the whole response.
       deferred.resolve(this.response);
-    };
+    }
 
     function onComplete(error) {
       try {
         // |this| is the RESTRequest object and we need to ensure _onComplete
         // gets the same one.
         _onComplete.call(this, error);
       } catch (ex) {
         log.error("Unhandled exception processing response", ex);
@@ -314,17 +314,17 @@ this.HawkClient.prototype = {
    * allows the handler of notifications to be sure they are handling
    * notifications for the service they expect.
    *
    * If not set, no notifications will be sent.
    */
   observerPrefix: null,
 
   // Given an optional header value, notify that a backoff has been requested.
-  _maybeNotifyBackoff: function (response, headerName) {
+  _maybeNotifyBackoff(response, headerName) {
     if (!this.observerPrefix || !response.headers) {
       return;
     }
     let headerVal = response.headers[headerName];
     if (!headerVal) {
       return;
     }
     let backoffInterval;
@@ -334,13 +334,13 @@ this.HawkClient.prototype = {
       log.error("hawkclient response had invalid backoff value in '" +
                 headerName + "' header: " + headerVal);
       return;
     }
     Observers.notify(this.observerPrefix + ":backoff:interval", backoffInterval);
   },
 
   // override points for testing.
-  newHAWKAuthenticatedRESTRequest: function(uri, credentials, extra) {
+  newHAWKAuthenticatedRESTRequest(uri, credentials, extra) {
     return new HAWKAuthenticatedRESTRequest(uri, credentials, extra);
   },
 
 }
--- a/services/common/hawkrequest.js
+++ b/services/common/hawkrequest.js
@@ -48,17 +48,17 @@ const Prefs = new Preferences("services.
  *
  * extra.localtimeOffsetMsec is the value in milliseconds that must be added to
  * the local clock to make it agree with the server's clock.  For instance, if
  * the local clock is two minutes ahead of the server, the time offset in
  * milliseconds will be -120000.
  */
 
 this.HAWKAuthenticatedRESTRequest =
- function HawkAuthenticatedRESTRequest(uri, credentials, extra={}) {
+ function HawkAuthenticatedRESTRequest(uri, credentials, extra = {}) {
   RESTRequest.call(this, uri);
 
   this.credentials = credentials;
   this.now = extra.now || Date.now();
   this.localtimeOffsetMsec = extra.localtimeOffsetMsec || 0;
   this._log.trace("local time, offset: " + this.now + ", " + (this.localtimeOffsetMsec));
   this.extraHeaders = extra.headers || {};
 
@@ -74,17 +74,17 @@ HAWKAuthenticatedRESTRequest.prototype =
       contentType = "application/json";
     }
     if (this.credentials) {
       let options = {
         now: this.now,
         localtimeOffsetMsec: this.localtimeOffsetMsec,
         credentials: this.credentials,
         payload: data && JSON.stringify(data) || "",
-        contentType: contentType,
+        contentType,
       };
       let header = CryptoUtils.computeHAWK(this.uri, method, options);
       this.setHeader("Authorization", header.field);
       this._log.trace("hawk auth header: " + header.field);
     }
 
     for (let header in this.extraHeaders) {
       this.setHeader(header, this.extraHeaders[header]);
@@ -152,29 +152,29 @@ this.Intl = function Intl() {
   this._accepted = "";
   this._everRead = false;
   this._log = Log.repository.getLogger("Services.common.RESTRequest");
   this._log.level = Log.Level[Prefs.get("log.logger.rest.request")];
   this.init();
 };
 
 this.Intl.prototype = {
-  init: function() {
+  init() {
     Services.prefs.addObserver("intl.accept_languages", this, false);
   },
 
-  uninit: function() {
+  uninit() {
     Services.prefs.removeObserver("intl.accept_languages", this);
   },
 
-  observe: function(subject, topic, data) {
+  observe(subject, topic, data) {
     this.readPref();
   },
 
-  readPref: function() {
+  readPref() {
     this._everRead = true;
     try {
       this._accepted = Services.prefs.getComplexValue(
         "intl.accept_languages", Ci.nsIPrefLocalizedString).data;
     } catch (err) {
       this._log.error("Error reading intl.accept_languages pref", err);
     }
   },
--- a/services/common/kinto-storage-adapter.js
+++ b/services/common/kinto-storage-adapter.js
@@ -324,35 +324,35 @@ class FirefoxAdapter extends Kinto.adapt
    */
   loadDump(records) {
     const connection = this._connection;
     const collection_name = this.collection;
     return Task.spawn(function* () {
       yield connection.executeTransaction(function* doImport() {
         for (let record of records) {
           const params = {
-            collection_name: collection_name,
+            collection_name,
             record_id: record.id,
             record: JSON.stringify(record),
           };
           yield connection.execute(statements.importData, params);
         }
         const lastModified = Math.max(...records.map(record => record.last_modified));
         const params = {
-          collection_name: collection_name,
+          collection_name,
         };
         const previousLastModified = yield connection.execute(
           statements.getLastModified, params).then(result => {
             return result.length > 0
               ? result[0].getResultByName("last_modified")
               : -1;
           });
         if (lastModified > previousLastModified) {
           const params = {
-            collection_name: collection_name,
+            collection_name,
             last_modified: lastModified,
           };
           yield connection.execute(statements.saveLastModified, params);
         }
       });
       return records;
     });
   }
@@ -388,25 +388,24 @@ class FirefoxAdapter extends Kinto.adapt
     // We're going to use execute instead of executeCached, so build
     // in our own sanity check
     if (!this._connection) {
       throw new Error("The storage adapter is not open");
     }
 
     return this._connection.executeTransaction(function* (conn) {
       const promises = [];
-      yield conn.execute(statements.scanAllRecords, null, function (row) {
+      yield conn.execute(statements.scanAllRecords, null, function(row) {
         const record = JSON.parse(row.getResultByName("record"));
         const record_id = row.getResultByName("record_id");
         const collection_name = row.getResultByName("collection_name");
         if (record._status === "deleted") {
           // Garbage collect deleted records.
           promises.push(conn.execute(statements.deleteData, { collection_name, record_id }));
-        }
-        else {
+        } else {
           const newRecord = Object.assign({}, record, {
             _status: "created",
             last_modified: undefined,
           });
           promises.push(conn.execute(statements.updateData, {
             record: JSON.stringify(newRecord),
             record_id,
             collection_name,
--- a/services/common/modules-testing/storageserver.js
+++ b/services/common/modules-testing/storageserver.js
@@ -270,17 +270,17 @@ ServerBSO.prototype = {
  * @param acceptNew
  *        If true, POSTs to this collection URI will result in new BSOs being
  *        created and wired in on the fly.
  * @param timestamp
  *        An optional timestamp value to initialize the modified time of the
  *        collection. This should be in the format returned by new_timestamp().
  */
 this.StorageServerCollection =
- function StorageServerCollection(bsos, acceptNew, timestamp=new_timestamp()) {
+ function StorageServerCollection(bsos, acceptNew, timestamp = new_timestamp()) {
   this._bsos = bsos || {};
   this.acceptNew = acceptNew || false;
 
   /*
    * Track modified timestamp.
    * We can't just use the timestamps of contained BSOs: an empty collection
    * has a modified time.
    */
@@ -572,17 +572,17 @@ StorageServerCollection.prototype = {
         } else {
           failed[record.id] = "no bso configured";
         }
       } catch (ex) {
         this._log.info("Exception when processing BSO", ex);
         failed[record.id] = "Exception when processing.";
       }
     }
-    return {success: success, failed: failed};
+    return {success, failed};
   },
 
   delete: function delete_(options) {
     options = options || {};
 
     // Protocol 2.0 only allows the "ids" query string argument.
     let keys = Object.keys(options).filter(function(k) {
       return k != "ids";
@@ -800,17 +800,17 @@ StorageServerCollection.prototype = {
 
     response.setStatusLine(request.httpVersion, 204, "No Content");
   },
 
   handler: function handler() {
     let self = this;
 
     return function(request, response) {
-      switch(request.method) {
+      switch (request.method) {
         case "GET":
           return self.getHandler(request, response);
 
         case "POST":
           return self.postHandler(request, response);
 
         case "DELETE":
           return self.deleteHandler(request, response);
@@ -840,19 +840,19 @@ StorageServerCollection.prototype = {
     this._log.info("Conditional request rejected because client time older " +
                    "than collection timestamp.");
     response.setStatusLine(request.httpVersion, 412, "Precondition Failed");
     return true;
   },
 };
 
 
-//===========================================================================//
+// ===========================================================================//
 // httpd.js-based Storage server.                                            //
-//===========================================================================//
+// ===========================================================================//
 
 /**
  * In general, the preferred way of using StorageServer is to directly
  * introspect it. Callbacks are available for operations which are hard to
  * verify through introspection, such as deletions.
  *
  * One of the goals of this server is to provide enough hooks for test code to
  * find out what it needs without monkeypatching. Use this object as your
@@ -941,17 +941,17 @@ StorageServer.prototype = {
 
   /**
    * Start the server synchronously.
    *
    * @param port
    *        The numeric port on which to start. The default is to choose
    *        any available port.
    */
-  startSynchronous: function startSynchronous(port=-1) {
+  startSynchronous: function startSynchronous(port = -1) {
     let cb = Async.makeSpinningCallback();
     this.start(port, cb);
     cb.wait();
   },
 
   /**
    * Stop the StorageServer's HTTP server.
    *
@@ -991,17 +991,17 @@ StorageServer.prototype = {
     }
 
     if (!isFinite(parseInt(username))) {
       throw new Error("Usernames must be numeric: " + username);
     }
 
     this._log.info("Registering new user with server: " + username);
     this.users[username] = {
-      password: password,
+      password,
       collections: {},
       quota: this.DEFAULT_QUOTA,
     };
     return this.user(username);
   },
 
   userExists: function userExists(username) {
     return username in this.users;
@@ -1181,28 +1181,28 @@ StorageServer.prototype = {
    *   u.collection("bookmarks").bso("abcdefg").payload;  // Etc.
    *
    * @return a proxy for the user data stored in this server.
    */
   user: function user(username) {
     let collection       = this.getCollection.bind(this, username);
     let createCollection = this.createCollection.bind(this, username);
     let createContents   = this.createContents.bind(this, username);
-    let modified         = function (collectionName) {
+    let modified         = function(collectionName) {
       return collection(collectionName).timestamp;
     }
     let deleteCollections = this.deleteCollections.bind(this, username);
     let quota             = this.getQuota.bind(this, username);
     return {
-      collection:        collection,
-      createCollection:  createCollection,
-      createContents:    createContents,
-      deleteCollections: deleteCollections,
-      modified:          modified,
-      quota:             quota,
+      collection,
+      createCollection,
+      createContents,
+      deleteCollections,
+      modified,
+      quota,
     };
   },
 
   _pruneExpired: function _pruneExpired() {
     let now = Date.now();
 
     for (let username in this.users) {
       let user = this.users[username];
--- a/services/common/observers.js
+++ b/services/common/observers.js
@@ -28,17 +28,17 @@ this.Observers = {
    *          the callback; an Object that implements nsIObserver or a Function
    *          that gets called when the notification occurs
    *
    * @param   thisObject  {Object}  [optional]
    *          the object to use as |this| when calling a Function callback
    *
    * @returns the observer
    */
-  add: function(topic, callback, thisObject) {
+  add(topic, callback, thisObject) {
     let observer = new Observer(topic, callback, thisObject);
     this._cache.push(observer);
     this._service.addObserver(observer, topic, true);
 
     return observer;
   },
 
   /**
@@ -48,23 +48,23 @@ this.Observers = {
    *        the topic being observed
    *
    * @param callback    {Object}
    *        the callback doing the observing
    *
    * @param thisObject  {Object}  [optional]
    *        the object being used as |this| when calling a Function callback
    */
-  remove: function(topic, callback, thisObject) {
+  remove(topic, callback, thisObject) {
     // This seems fairly inefficient, but I'm not sure how much better
     // we can make it.  We could index by topic, but we can't index by callback
     // or thisObject, as far as I know, since the keys to JavaScript hashes
     // (a.k.a. objects) can apparently only be primitive values.
-    let [observer] = this._cache.filter(v => v.topic      == topic    &&
-                                             v.callback   == callback &&
+    let [observer] = this._cache.filter(v => v.topic == topic &&
+                                             v.callback == callback &&
                                              v.thisObject == thisObject);
     if (observer) {
       this._service.removeObserver(observer, topic);
       this._cache.splice(this._cache.indexOf(observer), 1);
     }
   },
 
   /**
@@ -78,19 +78,19 @@ this.Observers = {
    *
    * @param data    {String}  [optional] [deprecated]
    *        some more information about the topic; deprecated as the subject
    *        is sufficient to pass all needed information to the JS observers
    *        that this module targets; if you have multiple values to pass to
    *        the observer, wrap them in an object and pass them via the subject
    *        parameter (i.e.: { foo: 1, bar: "some string", baz: myObject })
    */
-  notify: function(topic, subject, data) {
+  notify(topic, subject, data) {
     subject = (typeof subject == "undefined") ? null : new Subject(subject);
-       data = (typeof    data == "undefined") ? null : data;
+       data = (typeof data == "undefined") ? null : data;
     this._service.notifyObservers(subject, topic, data);
   },
 
   _service: Cc["@mozilla.org/observer-service;1"].
             getService(Ci.nsIObserverService),
 
   /**
    * A cache of observers that have been added.
@@ -109,42 +109,41 @@ this.Observers = {
 function Observer(topic, callback, thisObject) {
   this.topic = topic;
   this.callback = callback;
   this.thisObject = thisObject;
 }
 
 Observer.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
-  observe: function(subject, topic, data) {
+  observe(subject, topic, data) {
     // Extract the wrapped object for subjects that are one of our wrappers
     // around a JS object.  This way we support both wrapped subjects created
     // using this module and those that are real XPCOM components.
     if (subject && typeof subject == "object" &&
         ("wrappedJSObject" in subject) &&
         ("observersModuleSubjectWrapper" in subject.wrappedJSObject))
       subject = subject.wrappedJSObject.object;
 
     if (typeof this.callback == "function") {
       if (this.thisObject)
         this.callback.call(this.thisObject, subject, data);
       else
         this.callback(subject, data);
-    }
-    else // typeof this.callback == "object" (nsIObserver)
+    } else // typeof this.callback == "object" (nsIObserver)
       this.callback.observe(subject, topic, data);
   }
 }
 
 
 function Subject(object) {
   // Double-wrap the object and set a property identifying the wrappedJSObject
   // as one of our wrappers to distinguish between subjects that are one of our
   // wrappers (which we should unwrap when notifying our observers) and those
   // that are real JS XPCOM components (which we should pass through unaltered).
-  this.wrappedJSObject = { observersModuleSubjectWrapper: true, object: object };
+  this.wrappedJSObject = { observersModuleSubjectWrapper: true, object };
 }
 
 Subject.prototype = {
   QueryInterface: XPCOMUtils.generateQI([]),
-  getScriptableHelper: function() {},
-  getInterfaces: function() {}
+  getScriptableHelper() {},
+  getInterfaces() {}
 };
--- a/services/common/rest.js
+++ b/services/common/rest.js
@@ -97,17 +97,17 @@ RESTRequest.prototype = {
   _logName: "Services.Common.RESTRequest",
 
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsIBadCertListener2,
     Ci.nsIInterfaceRequestor,
     Ci.nsIChannelEventSink
   ]),
 
-  /*** Public API: ***/
+  /** * Public API: ***/
 
   /**
    * A constant boolean that indicates whether this object will automatically
    * utf-8 encode request bodies passed as an object. Used for feature detection
    * so, eg, loop can use the same source code for old and new Firefox versions.
    */
   willUTF8EncodeObjectRequests: true,
 
@@ -288,17 +288,17 @@ RESTRequest.prototype = {
     this.channel.cancel(Cr.NS_BINDING_ABORTED);
 
     if (this.timeoutTimer) {
       // Clear the abort timer now that the channel is done.
       this.timeoutTimer.clear();
     }
   },
 
-  /*** Implementation stuff ***/
+  /** * Implementation stuff ***/
 
   dispatch: function dispatch(method, data, onComplete, onProgress) {
     if (this.status != this.NOT_SENT) {
       throw "Request has already been sent!";
     }
 
     this.method = method;
     if (onComplete) {
@@ -407,17 +407,17 @@ RESTRequest.prototype = {
     if (!this.onComplete) {
       this._log.error("Unexpected error: onComplete not defined in " +
                       "abortTimeout.");
       return;
     }
     this.onComplete(error);
   },
 
-  /*** nsIStreamListener ***/
+  /** * nsIStreamListener ***/
 
   onStartRequest: function onStartRequest(channel) {
     if (this.status == this.ABORTED) {
       this._log.trace("Not proceeding with onStartRequest, request was aborted.");
       return;
     }
 
     try {
@@ -568,23 +568,23 @@ RESTRequest.prototype = {
       this.onComplete(ex);
       this.onComplete = this.onProgress = null;
       return;
     }
 
     this.delayTimeout();
   },
 
-  /*** nsIInterfaceRequestor ***/
+  /** * nsIInterfaceRequestor ***/
 
-  getInterface: function(aIID) {
+  getInterface(aIID) {
     return this.QueryInterface(aIID);
   },
 
-  /*** nsIBadCertListener2 ***/
+  /** * nsIBadCertListener2 ***/
 
   notifyCertProblem: function notifyCertProblem(socketInfo, sslStatus, targetHost) {
     this._log.warn("Invalid HTTPS certificate encountered!");
     // Suppress invalid HTTPS certificate warnings in the UI.
     // (The request will still fail.)
     return true;
   },
 
@@ -596,17 +596,17 @@ RESTRequest.prototype = {
   shouldCopyOnRedirect: function shouldCopyOnRedirect(oldChannel, newChannel, flags) {
     let isInternal = !!(flags & Ci.nsIChannelEventSink.REDIRECT_INTERNAL);
     let isSameURI  = newChannel.URI.equals(oldChannel.URI);
     this._log.debug("Channel redirect: " + oldChannel.URI.spec + ", " +
                     newChannel.URI.spec + ", internal = " + isInternal);
     return isInternal && isSameURI;
   },
 
-  /*** nsIChannelEventSink ***/
+  /** * nsIChannelEventSink ***/
   asyncOnChannelRedirect:
     function asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) {
 
     let oldSpec = (oldChannel && oldChannel.URI) ? oldChannel.URI.spec : "<undefined>";
     let newSpec = (newChannel && newChannel.URI) ? newChannel.URI.spec : "<undefined>";
     this._log.debug("Channel redirect: " + oldSpec + ", " + newSpec + ", " + flags);
 
     try {
@@ -702,17 +702,17 @@ RESTResponse.prototype = {
   /**
    * Object containing HTTP headers (keyed as lower case)
    */
   get headers() {
     let headers = {};
     try {
       this._log.trace("Processing response headers.");
       let channel = this.request.channel.QueryInterface(Ci.nsIHttpChannel);
-      channel.visitResponseHeaders(function (header, value) {
+      channel.visitResponseHeaders(function(header, value) {
         headers[header.toLowerCase()] = value;
       });
     } catch (ex) {
       this._log.debug("Caught exception processing response headers", ex);
       return null;
     }
 
     Object.defineProperty(this, "headers", {value: headers});
--- a/services/common/stringbundle.js
+++ b/services/common/stringbundle.js
@@ -40,18 +40,17 @@ StringBundle.prototype = {
    * @type nsILocale
    * @private
    */
   get _appLocale() {
     try {
       return Cc["@mozilla.org/intl/nslocaleservice;1"].
              getService(Ci.nsILocaleService).
              getApplicationLocale();
-    }
-    catch(ex) {
+    } catch (ex) {
       return null;
     }
   },
 
   /**
    * the wrapped nsIStringBundle
    * @type nsIStringBundle
    * @private
@@ -85,30 +84,30 @@ StringBundle.prototype = {
    *
    * @param key {String}
    *        the identifier of the string to get
    * @param args {array} [optional]
    *        an array of arguments that replace occurrences of %S in the string
    *
    * @returns {String} the value of the string
    */
-  get: function(key, args) {
+  get(key, args) {
     if (args)
       return this.stringBundle.formatStringFromName(key, args, args.length);
     else
       return this.stringBundle.GetStringFromName(key);
   },
 
   /**
    * Get all the strings in the bundle.
    *
    * @returns {Array}
    *          an array of objects with key and value properties
    */
-  getAll: function() {
+  getAll() {
     let strings = [];
 
     // FIXME: for performance, return an enumerable array that wraps the string
     // bundle's nsISimpleEnumerator (does JavaScript already support this?).
 
     let enumerator = this.stringBundle.getSimpleEnumeration();
 
     while (enumerator.hasMoreElements()) {
@@ -165,33 +164,33 @@ StringBundle.prototype = {
    * @deprecated use |get| instead
    *
    * @param key {String}
    *        the identifier of the string to get
    *
    * @returns {String}
    *          the value of the string
    */
-  getString: function(key) {
+  getString(key) {
     return this.get(key);
   },
 
   /**
    * Get a formatted string from the bundle.
    * @deprecated use |get| instead
    *
    * @param key {string}
    *        the identifier of the string to get
    * @param args {array}
    *        an array of arguments that replace occurrences of %S in the string
    *
    * @returns {String}
    *          the formatted value of the string
    */
-  getFormattedString: function(key, args) {
+  getFormattedString(key, args) {
     return this.get(key, args);
   },
 
   /**
    * Get an enumeration of the strings in the bundle.
    * @deprecated use |getAll| instead
    *
    * @returns {nsISimpleEnumerator}
--- a/services/common/tests/unit/head_helpers.js
+++ b/services/common/tests/unit/head_helpers.js
@@ -64,17 +64,17 @@ function do_check_throws_message(aFunc, 
  *        Any number of arguments to print out
  * @usage _("Hello World") -> prints "Hello World"
  * @usage _(1, 2, 3) -> prints "1 2 3"
  */
 var _ = function(some, debug, text, to) {
   print(Array.slice(arguments).join(" "));
 };
 
-function httpd_setup (handlers, port=-1) {
+function httpd_setup(handlers, port = -1) {
   let server = new HttpServer();
   for (let path in handlers) {
     server.registerPathHandler(path, handlers[path]);
   }
   try {
     server.start(port);
   } catch (ex) {
     _("==========================================");
--- a/services/common/tests/unit/test_async_chain.js
+++ b/services/common/tests/unit/test_async_chain.js
@@ -2,27 +2,27 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 Cu.import("resource://services-common/async.js");
 
 function run_test() {
   _("Chain a few async methods, making sure the 'this' object is correct.");
 
   let methods = {
-    save: function(x, callback) {
+    save(x, callback) {
       this.x = x;
       callback(x);
     },
-    addX: function(x, callback) {
+    addX(x, callback) {
       callback(x + this.x);
     },
-    double: function(x, callback) {
+    double(x, callback) {
       callback(x * 2);
     },
-    neg: function(x, callback) {
+    neg(x, callback) {
       callback(-x);
     }
   };
   methods.chain = Async.chain;
 
   // ((1 + 1 + 1) * (-1) + 1) * 2 + 1 = -3
   methods.chain(methods.save, methods.addX, methods.addX, methods.neg,
                 methods.addX, methods.double, methods.addX, methods.save)(1);
--- a/services/common/tests/unit/test_async_querySpinningly.js
+++ b/services/common/tests/unit/test_async_querySpinningly.js
@@ -80,20 +80,20 @@ function run_test() {
 
   _("Grabbing fewer fields than queried is fine");
   let r10 = querySpinningly("SELECT value, fieldname FROM moz_formhistory", ["fieldname"]);
   do_check_eq(r10.length, 3);
 
   _("Generate an execution error");
   let query = "INSERT INTO moz_formhistory (fieldname, value) VALUES ('one', NULL)";
   let stmt = Svc.Form.DBConnection.createStatement(query);
-  let r11, except; ;
+  let r11, except;
   try {
     r11 = Async.querySpinningly(stmt);
-  } catch(e) {
+  } catch (e) {
     except = e;
   }
   stmt.finalize()
   do_check_true(!!except);
   do_check_eq(except.result, SQLITE_CONSTRAINT_VIOLATION);
 
   _("Cleaning up");
   querySpinningly("DELETE FROM moz_formhistory");
--- a/services/common/tests/unit/test_blocklist_certificates.js
+++ b/services/common/tests/unit/test_blocklist_certificates.js
@@ -26,25 +26,25 @@ function do_get_kinto_collection(collect
   };
   return new Kinto(config).collection(collectionName);
 }
 
 // Some simple tests to demonstrate that the logic inside maybeSync works
 // correctly and that simple kinto operations are working as expected. There
 // are more tests for core Kinto.js (and its storage adapter) in the
 // xpcshell tests under /services/common
-add_task(function* test_something(){
+add_task(function* test_something() {
   const configPath = "/v1/";
   const recordsPath = "/v1/buckets/blocklists/collections/certificates/records";
 
   Services.prefs.setCharPref("services.settings.server",
                              `http://localhost:${server.identity.primaryPort}/v1`);
 
   // register a handler
-  function handleResponse (request, response) {
+  function handleResponse(request, response) {
     try {
       const sample = getSampleResponse(request, server.identity.primaryPort);
       if (!sample) {
         do_throw(`unexpected ${request.method} request for ${request.path}?${request.queryString}`);
       }
 
       response.setStatusLine(null, sample.status.status,
                              sample.status.statusText);
@@ -174,17 +174,17 @@ function getSampleResponse(req, port) {
         "Etag: \"4000\""
       ],
       "status": {status: 200, statusText: "OK"},
       "responseBody": JSON.stringify({"data":[{
         "issuerName":"MFkxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKjAoBgNVBAMTIVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPdmVyaGVpZCBDQQ",
         "serialNumber":"ATFpsA==",
         "id":"dabafde9-df4a-ddba-2548-748da04cc02c",
         "last_modified":4000
-      },{
+      }, {
         "subject":"MCIxIDAeBgNVBAMMF0Fub3RoZXIgVGVzdCBFbmQtZW50aXR5",
         "pubKeyHash":"VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=",
         "id":"dabafde9-df4a-ddba-2548-748da04cc02d",
         "last_modified":4000
       }]})
     },
     "GET:/v1/buckets/blocklists/collections/certificates/records?_sort=-last_modified&_since=4000": {
       "sampleHeaders": [
@@ -195,22 +195,22 @@ function getSampleResponse(req, port) {
         "Etag: \"5000\""
       ],
       "status": {status: 200, statusText: "OK"},
       "responseBody": JSON.stringify({"data":[{
         "issuerName":"not a base64 encoded issuer",
         "serialNumber":"not a base64 encoded serial",
         "id":"dabafde9-df4a-ddba-2548-748da04cc02e",
         "last_modified":5000
-      },{
+      }, {
         "subject":"not a base64 encoded subject",
         "pubKeyHash":"not a base64 encoded pubKeyHash",
         "id":"dabafde9-df4a-ddba-2548-748da04cc02f",
         "last_modified":5000
-      },{
+      }, {
         "subject":"MCIxIDAeBgNVBAMMF0Fub3RoZXIgVGVzdCBFbmQtZW50aXR5",
         "pubKeyHash":"VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=",
         "id":"dabafde9-df4a-ddba-2548-748da04cc02g",
         "last_modified":5000
       }]})
     }
   };
   return responses[`${req.method}:${req.path}?${req.queryString}`] ||
--- a/services/common/tests/unit/test_blocklist_clients.js
+++ b/services/common/tests/unit/test_blocklist_clients.js
@@ -12,19 +12,19 @@ const { Kinto } = Cu.import("resource://
 const { FirefoxAdapter } = Cu.import("resource://services-common/kinto-storage-adapter.js", {});
 const BlocklistClients = Cu.import("resource://services-common/blocklist-clients.js", {});
 
 const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
   "nsIBinaryInputStream", "setInputStream");
 const kintoFilename = "kinto.sqlite";
 
 const gBlocklistClients = [
-  {client: BlocklistClients.AddonBlocklistClient, filename: BlocklistClients.FILENAME_ADDONS_JSON, testData: ["i808","i720", "i539"]},
-  {client: BlocklistClients.PluginBlocklistClient, filename: BlocklistClients.FILENAME_PLUGINS_JSON, testData: ["p1044","p32","p28"]},
-  {client: BlocklistClients.GfxBlocklistClient, filename: BlocklistClients.FILENAME_GFX_JSON, testData: ["g204","g200","g36"]},
+  {client: BlocklistClients.AddonBlocklistClient, filename: BlocklistClients.FILENAME_ADDONS_JSON, testData: ["i808", "i720", "i539"]},
+  {client: BlocklistClients.PluginBlocklistClient, filename: BlocklistClients.FILENAME_PLUGINS_JSON, testData: ["p1044", "p32", "p28"]},
+  {client: BlocklistClients.GfxBlocklistClient, filename: BlocklistClients.FILENAME_GFX_JSON, testData: ["g204", "g200", "g36"]},
 ];
 
 
 let server;
 
 function kintoCollection(collectionName, sqliteHandle) {
   const config = {
     // Set the remote to be some server that will cause test failure when
@@ -113,58 +113,58 @@ function run_test() {
 
   run_next_test();
 
   do_register_cleanup(function() {
     server.stop(() => { });
   });
 }
 
-add_task(function* test_records_obtained_from_server_are_stored_in_db(){
+add_task(function* test_records_obtained_from_server_are_stored_in_db() {
   for (let {client} of gBlocklistClients) {
     // Test an empty db populates
     let result = yield client.maybeSync(2000, Date.now());
 
     // Open the collection, verify it's been populated:
     // Our test data has a single record; it should be in the local collection
     const sqliteHandle = yield FirefoxAdapter.openConnection({path: kintoFilename});
     let collection = kintoCollection(client.collectionName, sqliteHandle);
     let list = yield collection.list();
     equal(list.data.length, 1);
     yield sqliteHandle.close();
   }
 });
 add_task(clear_state);
 
-add_task(function* test_list_is_written_to_file_in_profile(){
+add_task(function* test_list_is_written_to_file_in_profile() {
   for (let {client, filename, testData} of gBlocklistClients) {
     const profFile = FileUtils.getFile(KEY_PROFILEDIR, [filename]);
     strictEqual(profFile.exists(), false);
 
     let result = yield client.maybeSync(2000, Date.now());
 
     strictEqual(profFile.exists(), true);
     const content = yield readJSON(profFile.path);
     equal(content.data[0].blockID, testData[testData.length - 1]);
   }
 });
 add_task(clear_state);
 
-add_task(function* test_current_server_time_is_saved_in_pref(){
+add_task(function* test_current_server_time_is_saved_in_pref() {
   for (let {client} of gBlocklistClients) {
     const before = Services.prefs.getIntPref(client.lastCheckTimePref);
     const serverTime = Date.now();
     yield client.maybeSync(2000, serverTime);
     const after = Services.prefs.getIntPref(client.lastCheckTimePref);
     equal(after, Math.round(serverTime / 1000));
   }
 });
 add_task(clear_state);
 
-add_task(function* test_update_json_file_when_addons_has_changes(){
+add_task(function* test_update_json_file_when_addons_has_changes() {
   for (let {client, filename, testData} of gBlocklistClients) {
     yield client.maybeSync(2000, Date.now() - 1000);
     const before = Services.prefs.getIntPref(client.lastCheckTimePref);
     const profFile = FileUtils.getFile(KEY_PROFILEDIR, [filename]);
     const fileLastModified = profFile.lastModifiedTime = profFile.lastModifiedTime - 1000;
     const serverTime = Date.now();
 
     yield client.maybeSync(3001, serverTime);
@@ -175,32 +175,32 @@ add_task(function* test_update_json_file
     deepEqual(content.data.map((r) => r.blockID), testData);
     // Server time was updated.
     const after = Services.prefs.getIntPref(client.lastCheckTimePref);
     equal(after, Math.round(serverTime / 1000));
   }
 });
 add_task(clear_state);
 
-add_task(function* test_sends_reload_message_when_blocklist_has_changes(){
+add_task(function* test_sends_reload_message_when_blocklist_has_changes() {
   for (let {client, filename} of gBlocklistClients) {
     let received = yield new Promise((resolve, reject) => {
       Services.ppmm.addMessageListener("Blocklist:reload-from-disk", {
         receiveMessage(aMsg) { resolve(aMsg) }
       });
 
       client.maybeSync(2000, Date.now() - 1000);
     });
 
     equal(received.data.filename, filename);
   }
 });
 add_task(clear_state);
 
-add_task(function* test_do_nothing_when_blocklist_is_up_to_date(){
+add_task(function* test_do_nothing_when_blocklist_is_up_to_date() {
   for (let {client, filename} of gBlocklistClients) {
     yield client.maybeSync(2000, Date.now() - 1000);
     const before = Services.prefs.getIntPref(client.lastCheckTimePref);
     const profFile = FileUtils.getFile(KEY_PROFILEDIR, [filename]);
     const fileLastModified = profFile.lastModifiedTime = profFile.lastModifiedTime - 1000;
     const serverTime = Date.now();
 
     yield client.maybeSync(3000, serverTime);
--- a/services/common/tests/unit/test_blocklist_pinning.js
+++ b/services/common/tests/unit/test_blocklist_pinning.js
@@ -19,17 +19,17 @@ var id = "xpcshell@tests.mozilla.org";
 var appName = "XPCShell";
 var version = "1";
 var platformVersion = "1.9.2";
 Cu.import("resource://testing-common/AppInfo.jsm", this);
 
 updateAppInfo({
   name: appName,
   ID: id,
-  version: version,
+  version,
   platformVersion: platformVersion ? platformVersion : "1.0",
   crashReporter: true,
 });
 
 let server;
 
 
 function do_get_kinto_collection(connection, collectionName) {
@@ -44,32 +44,32 @@ function do_get_kinto_collection(connect
     bucket: "pinning"
   };
   let kintoClient = new Kinto(config);
   return kintoClient.collection(collectionName);
 }
 
 // Some simple tests to demonstrate that the core preload sync operations work
 // correctly and that simple kinto operations are working as expected.
-add_task(function* test_something(){
+add_task(function* test_something() {
   // set the collection name explicitly - since there will be version
   // specific collection names in prefs
   Services.prefs.setCharPref(PREF_BLOCKLIST_PINNING_COLLECTION,
                              COLLECTION_NAME);
 
   const { PinningPreloadClient } = Cu.import("resource://services-common/blocklist-clients.js", {});
 
   const configPath = "/v1/";
   const recordsPath = "/v1/buckets/pinning/collections/pins/records";
 
   Services.prefs.setCharPref("services.settings.server",
                              `http://localhost:${server.identity.primaryPort}/v1`);
 
   // register a handler
-  function handleResponse (request, response) {
+  function handleResponse(request, response) {
     try {
       const sample = getSampleResponse(request, server.identity.primaryPort);
       if (!sample) {
         do_throw(`unexpected ${request.method} request for ${request.path}?${request.queryString}`);
       }
 
       response.setStatusLine(null, sample.status.status,
                              sample.status.statusText);
@@ -240,37 +240,37 @@ function getSampleResponse(req, port) {
         "hostName": "two.example.com",
         "includeSubdomains": false,
         "expires": new Date().getTime() + 1000000,
         "pins" : ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
                   "M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE="],
         "versions" : [appInfo.version],
         "id":"dabafde9-df4a-ddba-2548-748da04cc02c",
         "last_modified":4000
-      },{
+      }, {
         "pinType": "KeyPin",
         "hostName": "three.example.com",
         "includeSubdomains": false,
         "expires": new Date().getTime() + 1000000,
         "pins" : ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
                   "M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE="],
         "versions" : [appInfo.version, "some other version that won't match"],
         "id":"dabafde9-df4a-ddba-2548-748da04cc02d",
         "last_modified":4000
-      },{
+      }, {
         "pinType": "KeyPin",
         "hostName": "four.example.com",
         "includeSubdomains": false,
         "expires": new Date().getTime() + 1000000,
         "pins" : ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
                   "M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE="],
         "versions" : ["some version that won't match"],
         "id":"dabafde9-df4a-ddba-2548-748da04cc02e",
         "last_modified":4000
-      },{
+      }, {
         "pinType": "STSPin",
         "hostName": "five.example.com",
         "includeSubdomains": false,
         "expires": new Date().getTime() + 1000000,
         "versions" : [appInfo.version, "some version that won't match"],
         "id":"dabafde9-df4a-ddba-2548-748da04cc032",
         "last_modified":4000
       }]})
@@ -284,35 +284,35 @@ function getSampleResponse(req, port) {
         "Etag: \"5000\""
       ],
       "status": {status: 200, statusText: "OK"},
       "responseBody": JSON.stringify({"data":[{
         "irrelevant":"this entry looks nothing whatsoever like a pin preload",
         "pinType": "KeyPin",
         "id":"dabafde9-df4a-ddba-2548-748da04cc02f",
         "last_modified":5000
-      },{
+      }, {
         "irrelevant":"this entry has data of the wrong type",
         "pinType": "KeyPin",
         "hostName": 3,
         "includeSubdomains": "nonsense",
         "expires": "more nonsense",
-        "pins" : [1,2,3,4],
+        "pins" : [1, 2, 3, 4],
         "id":"dabafde9-df4a-ddba-2548-748da04cc030",
         "last_modified":5000
-      },{
+      }, {
         "irrelevant":"this entry is missing the actual pins",
         "pinType": "KeyPin",
         "hostName": "missingpins.example.com",
         "includeSubdomains": false,
         "expires": new Date().getTime() + 1000000,
         "versions" : [appInfo.version],
         "id":"dabafde9-df4a-ddba-2548-748da04cc031",
         "last_modified":5000
-      },{
+      }, {
         "pinType": "STSPin",
         "hostName": "five.example.com",
         "includeSubdomains": true,
         "expires": new Date().getTime() + 1000000,
         "versions" : [appInfo.version, "some version that won't match"],
         "id":"dabafde9-df4a-ddba-2548-748da04cc032",
         "last_modified":5000
       }]})
--- a/services/common/tests/unit/test_blocklist_signatures.js
+++ b/services/common/tests/unit/test_blocklist_signatures.js
@@ -60,17 +60,17 @@ function* checkRecordCount(count) {
   const base = Services.prefs.getCharPref(PREF_SETTINGS_SERVER);
   const bucket = Services.prefs.getCharPref(PREF_BLOCKLIST_BUCKET);
   const collectionName =
       Services.prefs.getCharPref(PREF_BLOCKLIST_ONECRL_COLLECTION);
 
   const sqliteHandle = yield FirefoxAdapter.openConnection({path: kintoFilename});
   const config = {
     remote: base,
-    bucket: bucket,
+    bucket,
     adapter: FirefoxAdapter,
     adapterOptions: {sqliteHandle},
   };
 
   const db = new Kinto(config);
   const collection = db.collection(collectionName);
 
   // Check we have the expected number of records
@@ -78,52 +78,52 @@ function* checkRecordCount(count) {
   do_check_eq(count, records.data.length);
 
   // Close the collection so the test can exit cleanly
   yield sqliteHandle.close();
 }
 
 // Check to ensure maybeSync is called with correct values when a changes
 // document contains information on when a collection was last modified
-add_task(function* test_check_signatures(){
+add_task(function* test_check_signatures() {
   const port = server.identity.primaryPort;
 
   // a response to give the client when the cert chain is expected
   function makeMetaResponseBody(lastModified, signature) {
     return {
       data: {
         id: "certificates",
         last_modified: lastModified,
         signature: {
           x5u: `http://localhost:${port}/test_blocklist_signatures/test_cert_chain.pem`,
           public_key: "fake",
           "content-signature": `x5u=http://localhost:${port}/test_blocklist_signatures/test_cert_chain.pem;p384ecdsa=${signature}`,
           signature_encoding: "rs_base64url",
-          signature: signature,
+          signature,
           hash_algorithm: "sha384",
           ref: "1yryrnmzou5rf31ou80znpnq8n"
         }
       }
     };
   }
 
   function makeMetaResponse(eTag, body, comment) {
     return {
-      comment: comment,
+      comment,
       sampleHeaders: [
         "Content-Type: application/json; charset=UTF-8",
         `ETag: \"${eTag}\"`
       ],
       status: {status: 200, statusText: "OK"},
       responseBody: JSON.stringify(body)
     };
   }
 
-  function registerHandlers(responses){
-    function handleResponse (serverTimeMillis, request, response) {
+  function registerHandlers(responses) {
+    function handleResponse(serverTimeMillis, request, response) {
       const key = `${request.method}:${request.path}?${request.queryString}`;
       const available = responses[key];
       const sampled = available.length > 1 ? available.shift() : available[0];
 
       if (!sampled) {
         do_throw(`unexpected ${request.method} request for ${request.path}?${request.queryString}`);
       }
 
--- a/services/common/tests/unit/test_blocklist_updater.js
+++ b/services/common/tests/unit/test_blocklist_updater.js
@@ -4,21 +4,21 @@ var server;
 
 const PREF_SETTINGS_SERVER = "services.settings.server";
 const PREF_LAST_UPDATE = "services.blocklist.last_update_seconds";
 const PREF_LAST_ETAG = "services.blocklist.last_etag";
 const PREF_CLOCK_SKEW_SECONDS = "services.blocklist.clock_skew_seconds";
 
 // Check to ensure maybeSync is called with correct values when a changes
 // document contains information on when a collection was last modified
-add_task(function* test_check_maybeSync(){
+add_task(function* test_check_maybeSync() {
   const changesPath = "/v1/buckets/monitor/collections/changes/records";
 
   // register a handler
-  function handleResponse (serverTimeMillis, request, response) {
+  function handleResponse(serverTimeMillis, request, response) {
     try {
       const sampled = getSampleResponse(request, server.identity.primaryPort);
       if (!sampled) {
         do_throw(`unexpected ${request.method} request for ${request.path}?${request.queryString}`);
       }
 
       response.setStatusLine(null, sampled.status.status,
                              sampled.status.statusText);
@@ -82,25 +82,25 @@ add_task(function* test_check_maybeSync(
   // Last timestamp was saved. An ETag header value is a quoted string.
   let lastEtag = Services.prefs.getCharPref(PREF_LAST_ETAG);
   do_check_eq(lastEtag, "\"1100\"");
 
   // Simulate a poll with up-to-date collection.
   Services.prefs.setIntPref(PREF_LAST_UPDATE, 0);
   // If server has no change, a 304 is received, maybeSync() is not called.
   updater.addTestBlocklistClient("test-collection", {
-    maybeSync: () => {throw new Error("Should not be called");}
+    maybeSync: () => { throw new Error("Should not be called"); }
   });
   yield updater.checkVersions();
   // Last update is overwritten
   do_check_eq(Services.prefs.getIntPref(PREF_LAST_UPDATE), 2);
 
 
   // Simulate a server error.
-  function simulateErrorResponse (request, response) {
+  function simulateErrorResponse(request, response) {
     response.setHeader("Date", (new Date(3000)).toUTCString());
     response.setHeader("Content-Type", "application/json; charset=UTF-8");
     response.write(JSON.stringify({
       code: 503,
       errno: 999,
       error: "Service Unavailable",
     }));
     response.setStatusLine(null, 503, "Service Unavailable");
--- a/services/common/tests/unit/test_hawkclient.js
+++ b/services/common/tests/unit/test_hawkclient.js
@@ -151,17 +151,17 @@ add_task(function* test_server_error() {
     }
   });
 
   let client = new HawkClient(server.baseURI);
 
   try {
     yield client.request("/foo", method, TEST_CREDS);
     do_throw("Expected an error");
-  } catch(err) {
+  } catch (err) {
     do_check_eq(418, err.code);
     do_check_eq("I am a Teapot", err.message);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_server_error_json() {
@@ -174,17 +174,17 @@ add_task(function* test_server_error_jso
     }
   });
 
   let client = new HawkClient(server.baseURI);
 
   try {
     yield client.request("/foo", method, TEST_CREDS);
     do_throw("Expected an error");
-  } catch(err) {
+  } catch (err) {
     do_check_eq("Cannot get ye flask.", err.error);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_offset_after_request() {
   let message = "Ohai!";
@@ -307,17 +307,17 @@ add_task(function* test_retry_request_on
         return;
       }
 
       // Second time through, timestamp should be corrected by client
       do_check_true(delta < MINUTE_MS);
       let message = "i love you!!!";
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.bodyOutputStream.write(message, message.length);
-      return;
+
     }
   });
 
   let client = new HawkClient(server.baseURI);
   function getOffset() {
     return client.localtimeOffsetMsec;
   }
 
@@ -412,17 +412,17 @@ add_task(function* test_500_no_retry() {
   client.now = () => {
     return Date.now() - 12 * HOUR_MS;
   };
 
   // Request will 500; no retries
   try {
     yield client.request("/no-shutup", method, credentials);
     do_throw("Expected an error");
-  } catch(err) {
+  } catch (err) {
     do_check_eq(err.code, 500);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_401_then_500() {
   // Like test_multiple_401_retry_once, but return a 500 to the
@@ -456,17 +456,17 @@ add_task(function* test_401_then_500() {
       }
 
       // Second time through, timestamp should be corrected by client
       // And fail on the client
       do_check_true(delta < MINUTE_MS);
       let message = "Cannot get ye flask.";
       response.setStatusLine(request.httpVersion, 500, "Internal server error");
       response.bodyOutputStream.write(message, message.length);
-      return;
+
     }
   });
 
   let client = new HawkClient(server.baseURI);
   function getOffset() {
     return client.localtimeOffsetMsec;
   }
 
@@ -475,38 +475,38 @@ add_task(function* test_401_then_500() {
   };
 
   // We begin with no offset
   do_check_eq(client.localtimeOffsetMsec, 0);
 
   // Request will have bad timestamp; client will retry once
   try {
     yield client.request("/maybe", method, credentials);
-  } catch(err) {
+  } catch (err) {
     do_check_eq(err.code, 500);
   }
   do_check_eq(attempts, 2);
 
   yield deferredStop(server);
 });
 
 add_task(function* throw_if_not_json_body() {
   let client = new HawkClient("https://example.com");
   try {
     yield client.request("/bogus", "GET", {}, "I am not json");
     do_throw("Expected an error");
-  } catch(err) {
+  } catch (err) {
     do_check_true(!!err.message);
   }
 });
 
 // End of tests.
 // Utility functions follow
 
-function getTimestampDelta(authHeader, now=Date.now()) {
+function getTimestampDelta(authHeader, now = Date.now()) {
   let tsMS = new Date(
       parseInt(/ts="(\d+)"/.exec(authHeader)[1], 10) * SECOND_MS);
   return Math.abs(tsMS - now);
 }
 
 function deferredStop(server) {
   let deferred = Promise.defer();
   server.stop(deferred.resolve);
--- a/services/common/tests/unit/test_hawkrequest.js
+++ b/services/common/tests/unit/test_hawkrequest.js
@@ -4,23 +4,23 @@
 "use strict";
 
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://services-common/hawkrequest.js");
 
 // https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol#wiki-use-session-certificatesign-etc
 var SESSION_KEYS = {
-  sessionToken: h("a0a1a2a3a4a5a6a7 a8a9aaabacadaeaf"+
+  sessionToken: h("a0a1a2a3a4a5a6a7 a8a9aaabacadaeaf" +
                   "b0b1b2b3b4b5b6b7 b8b9babbbcbdbebf"),
 
-  tokenID:      h("c0a29dcf46174973 da1378696e4c82ae"+
+  tokenID:      h("c0a29dcf46174973 da1378696e4c82ae" +
                   "10f723cf4f4d9f75 e39f4ae3851595ab"),
 
-  reqHMACkey:   h("9d8f22998ee7f579 8b887042466b72d5"+
+  reqHMACkey:   h("9d8f22998ee7f579 8b887042466b72d5" +
                   "3e56ab0c094388bf 65831f702d2febc0"),
 };
 
 function do_register_cleanup() {
   Services.prefs.resetUserPrefs();
 
   // remove the pref change listener
   let hawk = new HAWKAuthenticatedRESTRequest("https://example.com");
@@ -70,17 +70,17 @@ add_test(function test_intl_accept_langu
         setLanguagePref(languages[testCount]);
         return;
       }
 
       // We've checked all the entries in languages[]. Cleanup and move on.
       do_print("Checked " + testCount + " languages. Removing checkLanguagePref as pref observer.");
       Services.prefs.removeObserver("intl.accept_languages", checkLanguagePref);
       run_next_test();
-      return;
+
     });
   }
 });
 
 add_test(function test_hawk_authenticated_request() {
   let onProgressCalled = false;
   let postData = {your: "data"};
 
@@ -196,17 +196,17 @@ add_test(function test_hawk_language_pre
   // language.
   request = new HAWKAuthenticatedRESTRequest(url, credentials);
   CommonUtils.nextTick(testFirstLanguage);
 
   function testFirstLanguage() {
     do_check_eq(languages[0], request._intl.accept_languages);
 
     // Change the language pref ...
-    setLanguage(languages[1]); 
+    setLanguage(languages[1]);
     CommonUtils.nextTick(testRequest);
   }
 
   function testRequest() {
     // Change of language pref should be picked up, which we can see on the
     // server by inspecting the request headers.
     request = new HAWKAuthenticatedRESTRequest(url, credentials);
     request.post({}, function(error) {
--- a/services/common/tests/unit/test_kinto.js
+++ b/services/common/tests/unit/test_kinto.js
@@ -12,17 +12,17 @@ var server;
 
 // set up what we need to make storage adapters
 const kintoFilename = "kinto.sqlite";
 
 function do_get_kinto_sqliteHandle() {
   return FirefoxAdapter.openConnection({path: kintoFilename});
 }
 
-function do_get_kinto_collection(sqliteHandle, collection="test_collection") {
+function do_get_kinto_collection(sqliteHandle, collection = "test_collection") {
   let config = {
     remote:`http://localhost:${server.identity.primaryPort}/v1/`,
     headers: {Authorization: "Basic " + btoa("user:pass")},
     adapter: FirefoxAdapter,
     adapterOptions: {sqliteHandle},
   };
   return new Kinto(config).collection(collection);
 }
@@ -149,17 +149,17 @@ add_task(function* test_kinto_clear() {
     do_check_eq(list.data.length, 0);
   } finally {
     yield sqliteHandle.close();
   }
 });
 
 add_task(clear_collection);
 
-add_task(function* test_kinto_delete(){
+add_task(function* test_kinto_delete() {
   let sqliteHandle;
   try {
     sqliteHandle = yield do_get_kinto_sqliteHandle();
     const collection = do_get_kinto_collection(sqliteHandle);
     const newRecord = { foo: "bar" };
     // check a record is created
     let createResult = yield collection.create(newRecord);
     do_check_eq(createResult.data.foo, newRecord.foo);
@@ -175,17 +175,17 @@ add_task(function* test_kinto_delete(){
       getResult = yield collection.get(createResult.data.id);
       do_throw("there should not be a result");
     } catch (e) { }
   } finally {
     yield sqliteHandle.close();
   }
 });
 
-add_task(function* test_kinto_list(){
+add_task(function* test_kinto_list() {
   let sqliteHandle;
   try {
     sqliteHandle = yield do_get_kinto_sqliteHandle();
     const collection = do_get_kinto_collection(sqliteHandle);
     const expected = 10;
     const created = [];
     for (let i = 0; i < expected; i++) {
       let newRecord = { foo: "test " + i };
@@ -209,67 +209,67 @@ add_task(function* test_kinto_list(){
     }
   } finally {
     yield sqliteHandle.close();
   }
 });
 
 add_task(clear_collection);
 
-add_task(function* test_loadDump_ignores_already_imported_records(){
+add_task(function* test_loadDump_ignores_already_imported_records() {
   let sqliteHandle;
   try {
     sqliteHandle = yield do_get_kinto_sqliteHandle();
     const collection = do_get_kinto_collection(sqliteHandle);
     const record = {id: "41b71c13-17e9-4ee3-9268-6a41abf9730f", title: "foo", last_modified: 1457896541};
     yield collection.loadDump([record]);
     let impactedRecords = yield collection.loadDump([record]);
     do_check_eq(impactedRecords.length, 0);
   } finally {
     yield sqliteHandle.close();
   }
 });
 
 add_task(clear_collection);
 
-add_task(function* test_loadDump_should_overwrite_old_records(){
+add_task(function* test_loadDump_should_overwrite_old_records() {
   let sqliteHandle;
   try {
     sqliteHandle = yield do_get_kinto_sqliteHandle();
     const collection = do_get_kinto_collection(sqliteHandle);
     const record = {id: "41b71c13-17e9-4ee3-9268-6a41abf9730f", title: "foo", last_modified: 1457896541};
     yield collection.loadDump([record]);
     const updated = Object.assign({}, record, {last_modified: 1457896543});
     let impactedRecords = yield collection.loadDump([updated]);
     do_check_eq(impactedRecords.length, 1);
   } finally {
     yield sqliteHandle.close();
   }
 });
 
 add_task(clear_collection);
 
-add_task(function* test_loadDump_should_not_overwrite_unsynced_records(){
+add_task(function* test_loadDump_should_not_overwrite_unsynced_records() {
   let sqliteHandle;
   try {
     sqliteHandle = yield do_get_kinto_sqliteHandle();
     const collection = do_get_kinto_collection(sqliteHandle);
     const recordId = "41b71c13-17e9-4ee3-9268-6a41abf9730f";
     yield collection.create({id: recordId, title: "foo"}, {useRecordId: true});
     const record = {id: recordId, title: "bar", last_modified: 1457896541};
     let impactedRecords = yield collection.loadDump([record]);
     do_check_eq(impactedRecords.length, 0);
   } finally {
     yield sqliteHandle.close();
   }
 });
 
 add_task(clear_collection);
 
-add_task(function* test_loadDump_should_not_overwrite_records_without_last_modified(){
+add_task(function* test_loadDump_should_not_overwrite_records_without_last_modified() {
   let sqliteHandle;
   try {
     sqliteHandle = yield do_get_kinto_sqliteHandle();
     const collection = do_get_kinto_collection(sqliteHandle);
     const recordId = "41b71c13-17e9-4ee3-9268-6a41abf9730f";
     yield collection.create({id: recordId, title: "foo"}, {synced: true});
     const record = {id: recordId, title: "bar", last_modified: 1457896541};
     let impactedRecords = yield collection.loadDump([record]);
@@ -279,21 +279,21 @@ add_task(function* test_loadDump_should_
   }
 });
 
 add_task(clear_collection);
 
 // Now do some sanity checks against a server - we're not looking to test
 // core kinto.js functionality here (there is excellent test coverage in
 // kinto.js), more making sure things are basically working as expected.
-add_task(function* test_kinto_sync(){
+add_task(function* test_kinto_sync() {
   const configPath = "/v1/";
   const recordsPath = "/v1/buckets/default/collections/test_collection/records";
   // register a handler
-  function handleResponse (request, response) {
+  function handleResponse(request, response) {
     try {
       const sampled = getSampleResponse(request, server.identity.primaryPort);
       if (!sampled) {
         do_throw(`unexpected ${request.method} request for ${request.path}?${request.queryString}`);
       }
 
       response.setStatusLine(null, sampled.status.status,
                              sampled.status.statusText);
--- a/services/common/tests/unit/test_load_modules.js
+++ b/services/common/tests/unit/test_load_modules.js
@@ -20,32 +20,32 @@ const TEST_BASE = "resource://testing-co
 const shared_test_modules = [
   "logging.js",
 ];
 
 const non_android_test_modules = [
   "storageserver.js",
 ];
 
-function expectImportsToSucceed(mm, base=MODULE_BASE) {
+function expectImportsToSucceed(mm, base = MODULE_BASE) {
   for (let m of mm) {
     let resource = base + m;
     let succeeded = false;
     try {
       Components.utils.import(resource, {});
       succeeded = true;
     } catch (e) {}
 
     if (!succeeded) {
       throw "Importing " + resource + " should have succeeded!";
     }
   }
 }
 
-function expectImportsToFail(mm, base=MODULE_BASE) {
+function expectImportsToFail(mm, base = MODULE_BASE) {
   for (let m of mm) {
     let resource = base + m;
     let succeeded = false;
     try {
       Components.utils.import(resource, {});
       succeeded = true;
     } catch (e) {}
 
--- a/services/common/tests/unit/test_observers.js
+++ b/services/common/tests/unit/test_observers.js
@@ -31,17 +31,17 @@ add_test(function test_function_observer
   do_check_true(foo);
 
   run_next_test();
 });
 
 add_test(function test_method_observer() {
   let obj = {
     foo: false,
-    onFoo: function(subject, data) {
+    onFoo(subject, data) {
       this.foo = !this.foo;
       do_check_eq(subject, gSubject);
       do_check_eq(data, "some data");
     }
   };
 
   // The observer is notified after being added.
   Observers.add("foo", obj.onFoo, obj);
@@ -54,17 +54,17 @@ add_test(function test_method_observer()
   do_check_true(obj.foo);
 
   run_next_test();
 });
 
 add_test(function test_object_observer() {
   let obj = {
     foo: false,
-    observe: function(subject, topic, data) {
+    observe(subject, topic, data) {
       this.foo = !this.foo;
 
       do_check_eq(subject, gSubject);
       do_check_eq(topic, "foo");
       do_check_eq(data, "some data");
     }
   };
 
--- a/services/common/tests/unit/test_restrequest.js
+++ b/services/common/tests/unit/test_restrequest.js
@@ -71,17 +71,17 @@ add_test(function test_proxy_auth_redire
   let server = httpd_setup({
     "/original": original,
     "/pac3":     pacHandler
   });
   PACSystemSettings.PACURI = server.baseURI + "/pac3";
   installFakePAC();
 
   let res = new RESTRequest(server.baseURI + "/original");
-  res.get(function (error) {
+  res.get(function(error) {
     do_check_true(pacFetched);
     do_check_true(fetched);
     do_check_true(!error);
     do_check_true(this.response.success);
     do_check_eq("TADA!", this.response.body);
     uninstallFakePAC();
     server.stop(run_next_test);
   });
@@ -105,17 +105,17 @@ add_test(function test_forbidden_port() 
 
 /**
  * Demonstrate API short-hand: create a request and dispatch it immediately.
  */
 add_test(function test_simple_get() {
   let handler = httpd_handler(200, "OK", "Huzzah!");
   let server = httpd_setup({"/resource": handler});
 
-  let request = new RESTRequest(server.baseURI + "/resource").get(function (error) {
+  let request = new RESTRequest(server.baseURI + "/resource").get(function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "Huzzah!");
 
     server.stop(run_next_test);
@@ -129,51 +129,51 @@ add_test(function test_simple_get() {
  */
 add_test(function test_get() {
   let handler = httpd_handler(200, "OK", "Huzzah!");
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
   do_check_eq(request.status, request.NOT_SENT);
 
-  request.onProgress = request.onComplete = function () {
+  request.onProgress = request.onComplete = function() {
     do_throw("This function should have been overwritten!");
   };
 
   let onProgress_called = false;
   function onProgress() {
     onProgress_called = true;
     do_check_eq(this.status, request.IN_PROGRESS);
     do_check_true(this.response.body.length > 0);
 
     do_check_true(!!(this.channel.loadFlags & Ci.nsIRequest.LOAD_BYPASS_CACHE));
     do_check_true(!!(this.channel.loadFlags & Ci.nsIRequest.INHIBIT_CACHING));
-  };
+  }
 
   function onComplete(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "Huzzah!");
     do_check_eq(handler.request.method, "GET");
 
     do_check_true(onProgress_called);
-    CommonUtils.nextTick(function () {
+    CommonUtils.nextTick(function() {
       do_check_eq(request.onComplete, null);
       do_check_eq(request.onProgress, null);
       server.stop(run_next_test);
     });
-  };
+  }
 
   do_check_eq(request.get(onComplete, onProgress), request);
   do_check_eq(request.status, request.SENT);
   do_check_eq(request.method, "GET");
-  do_check_throws(function () {
+  do_check_throws(function() {
     request.get();
   });
 });
 
 /**
  * Test HTTP GET with UTF-8 content, and custom Content-Type.
  */
 add_test(function test_get_utf8() {
@@ -310,51 +310,51 @@ add_test(function test_charsets() {
 function check_posting_data(method) {
   let funcName = method.toLowerCase();
   let handler = httpd_handler(200, "OK", "Got it!");
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
   do_check_eq(request.status, request.NOT_SENT);
 
-  request.onProgress = request.onComplete = function () {
+  request.onProgress = request.onComplete = function() {
     do_throw("This function should have been overwritten!");
   };
 
   let onProgress_called = false;
   function onProgress() {
     onProgress_called = true;
     do_check_eq(this.status, request.IN_PROGRESS);
     do_check_true(this.response.body.length > 0);
-  };
+  }
 
   function onComplete(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "Got it!");
 
     do_check_eq(handler.request.method, method);
     do_check_eq(handler.request.body, "Hullo?");
     do_check_eq(handler.request.getHeader("Content-Type"), "text/plain");
 
     do_check_true(onProgress_called);
-    CommonUtils.nextTick(function () {
+    CommonUtils.nextTick(function() {
       do_check_eq(request.onComplete, null);
       do_check_eq(request.onProgress, null);
       server.stop(run_next_test);
     });
-  };
+  }
 
   do_check_eq(request[funcName]("Hullo?", onComplete, onProgress), request);
   do_check_eq(request.status, request.SENT);
   do_check_eq(request.method, method);
-  do_check_throws(function () {
+  do_check_throws(function() {
     request[funcName]("Hai!");
   });
 }
 
 /**
  * Test HTTP PATCH with a simple string argument and default Content-Type.
  */
 add_test(function test_patch() {
@@ -380,61 +380,61 @@ add_test(function test_post() {
  */
 add_test(function test_delete() {
   let handler = httpd_handler(200, "OK", "Got it!");
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
   do_check_eq(request.status, request.NOT_SENT);
 
-  request.onProgress = request.onComplete = function () {
+  request.onProgress = request.onComplete = function() {
     do_throw("This function should have been overwritten!");
   };
 
   let onProgress_called = false;
   function onProgress() {
     onProgress_called = true;
     do_check_eq(this.status, request.IN_PROGRESS);
     do_check_true(this.response.body.length > 0);
-  };
+  }
 
   function onComplete(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "Got it!");
     do_check_eq(handler.request.method, "DELETE");
 
     do_check_true(onProgress_called);
-    CommonUtils.nextTick(function () {
+    CommonUtils.nextTick(function() {
       do_check_eq(request.onComplete, null);
       do_check_eq(request.onProgress, null);
       server.stop(run_next_test);
     });
-  };
+  }
 
   do_check_eq(request.delete(onComplete, onProgress), request);
   do_check_eq(request.status, request.SENT);
   do_check_eq(request.method, "DELETE");
-  do_check_throws(function () {
+  do_check_throws(function() {
     request.delete();
   });
 });
 
 /**
  * Test an HTTP response with a non-200 status code.
  */
 add_test(function test_get_404() {
   let handler = httpd_handler(404, "Not Found", "Cannae find it!");
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
-  request.get(function (error) {
+  request.get(function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_false(this.response.success);
     do_check_eq(this.response.status, 404);
     do_check_eq(this.response.body, "Cannae find it!");
 
     server.stop(run_next_test);
@@ -450,17 +450,17 @@ add_test(function test_put_json() {
   let server = httpd_setup({"/resource": handler});
 
   let sample_data = {
     some: "sample_data",
     injson: "format",
     number: 42
   };
   let request = new RESTRequest(server.baseURI + "/resource");
-  request.put(sample_data, function (error) {
+  request.put(sample_data, function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     do_check_eq(handler.request.method, "PUT");
@@ -480,17 +480,17 @@ add_test(function test_post_json() {
   let server = httpd_setup({"/resource": handler});
 
   let sample_data = {
     some: "sample_data",
     injson: "format",
     number: 42
   };
   let request = new RESTRequest(server.baseURI + "/resource");
-  request.post(sample_data, function (error) {
+  request.post(sample_data, function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     do_check_eq(handler.request.method, "POST");
@@ -506,17 +506,17 @@ add_test(function test_post_json() {
  * to POST is already a string.
  */
 add_test(function test_post_json() {
   let handler = httpd_handler(200, "OK");
   let server = httpd_setup({"/resource": handler});
 
   let sample_data = "hello";
   let request = new RESTRequest(server.baseURI + "/resource");
-  request.post(sample_data, function (error) {
+  request.post(sample_data, function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     do_check_eq(handler.request.method, "POST");
@@ -531,17 +531,17 @@ add_test(function test_post_json() {
  * HTTP PUT with a custom Content-Type header.
  */
 add_test(function test_put_override_content_type() {
   let handler = httpd_handler(200, "OK");
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
   request.setHeader("Content-Type", "application/lolcat");
-  request.put("O HAI!!1!", function (error) {
+  request.put("O HAI!!1!", function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     do_check_eq(handler.request.method, "PUT");
@@ -556,17 +556,17 @@ add_test(function test_put_override_cont
  * HTTP POST with a custom Content-Type header.
  */
 add_test(function test_post_override_content_type() {
   let handler = httpd_handler(200, "OK");
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
   request.setHeader("Content-Type", "application/lolcat");
-  request.post("O HAI!!1!", function (error) {
+  request.post("O HAI!!1!", function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.status, this.COMPLETED);
     do_check_true(this.response.success);
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     do_check_eq(handler.request.method, "POST");
@@ -584,17 +584,17 @@ add_test(function test_get_no_headers() 
   let handler = httpd_handler(200, "OK");
   let server = httpd_setup({"/resource": handler});
 
   let ignore_headers = ["host", "user-agent", "accept", "accept-language",
                         "accept-encoding", "accept-charset", "keep-alive",
                         "connection", "pragma", "cache-control",
                         "content-length"];
 
-  new RESTRequest(server.baseURI + "/resource").get(function (error) {
+  new RESTRequest(server.baseURI + "/resource").get(function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     let server_headers = handler.request.headers;
     while (server_headers.hasMoreElements()) {
       let header = server_headers.getNext().toString();
@@ -611,17 +611,17 @@ add_test(function test_get_no_headers() 
  * Test changing the URI after having created the request.
  */
 add_test(function test_changing_uri() {
   let handler = httpd_handler(200, "OK");
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest("http://localhost:1234/the-wrong-resource");
   request.uri = CommonUtils.makeURI(server.baseURI + "/resource");
-  request.get(function (error) {
+  request.get(function(error) {
     do_check_eq(error, null);
     do_check_eq(this.response.status, 200);
     server.stop(run_next_test);
   });
 });
 
 /**
  * Test setting HTTP request headers.
@@ -631,17 +631,17 @@ add_test(function test_request_setHeader
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
 
   request.setHeader("X-What-Is-Weave", "awesome");
   request.setHeader("X-WHAT-is-Weave", "more awesomer");
   request.setHeader("Another-Header", "Hello World");
 
-  request.get(function (error) {
+  request.get(function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     do_check_eq(handler.request.getHeader("X-What-Is-Weave"), "more awesomer");
     do_check_eq(handler.request.getHeader("another-header"), "Hello World");
 
@@ -656,17 +656,17 @@ add_test(function test_response_headers(
   function handler(request, response) {
     response.setHeader("X-What-Is-Weave", "awesome");
     response.setHeader("Another-Header", "Hello World");
     response.setStatusLine(request.httpVersion, 200, "OK");
   }
   let server = httpd_setup({"/resource": handler});
   let request = new RESTRequest(server.baseURI + "/resource");
 
-  request.get(function (error) {
+  request.get(function(error) {
     do_check_eq(error, null);
 
     do_check_eq(this.response.status, 200);
     do_check_eq(this.response.body, "");
 
     do_check_eq(this.response.headers["x-what-is-weave"], "awesome");
     do_check_eq(this.response.headers["another-header"], "Hello World");
 
@@ -678,17 +678,17 @@ add_test(function test_response_headers(
  * The onComplete() handler gets called in case of any network errors
  * (e.g. NS_ERROR_CONNECTION_REFUSED).
  */
 add_test(function test_connection_refused() {
   let request = new RESTRequest("http://localhost:1234/resource");
   request.onProgress = function onProgress() {
     do_throw("Shouldn't have called request.onProgress()!");
   };
-  request.get(function (error) {
+  request.get(function(error) {
     do_check_eq(error.result, Cr.NS_ERROR_CONNECTION_REFUSED);
     do_check_eq(error.message, "NS_ERROR_CONNECTION_REFUSED");
     do_check_eq(this.status, this.COMPLETED);
     run_next_test();
   });
   do_check_eq(request.status, request.SENT);
 });
 
@@ -699,33 +699,33 @@ add_test(function test_abort() {
   function handler() {
     do_throw("Shouldn't have gotten here!");
   }
   let server = httpd_setup({"/resource": handler});
 
   let request = new RESTRequest(server.baseURI + "/resource");
 
   // Aborting a request that hasn't been sent yet is pointless and will throw.
-  do_check_throws(function () {
+  do_check_throws(function() {
     request.abort();
   });
 
-  request.onProgress = request.onComplete = function () {
+  request.onProgress = request.onComplete = function() {
     do_throw("Shouldn't have gotten here!");
   };
   request.get();
   request.abort();
 
   // Aborting an already aborted request is pointless and will throw.
-  do_check_throws(function () {
+  do_check_throws(function() {
     request.abort();
   });
 
   do_check_eq(request.status, request.ABORTED);
-  CommonUtils.nextTick(function () {
+  CommonUtils.nextTick(function() {
     server.stop(run_next_test);
   });
 });
 
 /**
  * A non-zero 'timeout' property specifies the amount of seconds to wait after
  * channel activity until the request is automatically canceled.
  */
@@ -741,17 +741,17 @@ add_test(function test_timeout() {
   };
   server.start();
   let identity = server.identity;
   let uri = identity.primaryScheme + "://" + identity.primaryHost + ":" +
             identity.primaryPort;
 
   let request = new RESTRequest(uri + "/resource");
   request.timeout = 0.1; // 100 milliseconds
-  request.get(function (error) {
+  request.get(function(error) {
     do_check_eq(error.result, Cr.NS_ERROR_NET_TIMEOUT);
     do_check_eq(this.status, this.ABORTED);
 
     // server_connection is undefined on the Android emulator for reasons
     // unknown. Yet, we still get here. If this test is refactored, we should
     // investigate the reason why the above callback is behaving differently.
     if (server_connection) {
       _("Closing connection.");
@@ -813,17 +813,17 @@ add_test(function test_new_channel() {
     response.bodyOutputStream.write(body, body.length);
   }
 
   let server1 = httpd_setup({"/redirect": redirectHandler});
   let server2 = httpd_setup({"/resource": resourceHandler});
   redirectURL = server2.baseURI + "/resource";
 
   function advance() {
-    server1.stop(function () {
+    server1.stop(function() {
       server2.stop(run_next_test);
     });
   }
 
   let request = new RESTRequest(server1.baseURI + "/redirect");
   request.setHeader("User-Agent", "foo bar");
 
   // Swizzle in our own fakery, because this redirect is neither
@@ -858,16 +858,16 @@ add_test(function test_not_sending_cooki
   let server = httpd_setup({"/test": handler});
 
   let cookieSer = Cc["@mozilla.org/cookieService;1"]
                     .getService(Ci.nsICookieService);
   let uri = CommonUtils.makeURI(server.baseURI);
   cookieSer.setCookieString(uri, null, "test=test; path=/;", null);
 
   let res = new RESTRequest(server.baseURI + "/test");
-  res.get(function (error) {
+  res.get(function(error) {
     do_check_null(error);
     do_check_true(this.response.success);
     do_check_eq("COOKIE!", this.response.body);
     server.stop(run_next_test);
   });
 });
 
--- a/services/common/tests/unit/test_storage_adapter.js
+++ b/services/common/tests/unit/test_storage_adapter.js
@@ -18,17 +18,17 @@ function do_get_kinto_adapter(sqliteHand
 function do_get_kinto_db() {
   let profile = do_get_profile();
   let kintoDB = profile.clone();
   kintoDB.append(kintoFilename);
   return kintoDB;
 }
 
 function cleanup_kinto() {
-  add_test(function cleanup_kinto_files(){
+  add_test(function cleanup_kinto_files() {
     let kintoDB = do_get_kinto_db();
     // clean up the db
     kintoDB.remove(false);
     run_next_test();
   });
 }
 
 function test_collection_operations() {
@@ -246,17 +246,17 @@ add_test(function test_db_creation() {
 // existing database
 add_test(function test_creation_from_empty_db() {
   add_test(function test_create_from_empty_db() {
     // place an empty kinto db file in the profile
     let profile = do_get_profile();
     let kintoDB = do_get_kinto_db();
 
     let emptyDB = do_get_file("test_storage_adapter/empty.sqlite");
-    emptyDB.copyTo(profile,kintoFilename);
+    emptyDB.copyTo(profile, kintoFilename);
 
     run_next_test();
   });
 
   test_collection_operations();
 
   cleanup_kinto();
   run_next_test();
--- a/services/common/tests/unit/test_storage_server.js
+++ b/services/common/tests/unit/test_storage_server.js
@@ -7,17 +7,17 @@ Cu.import("resource://services-common/ut
 Cu.import("resource://testing-common/services/common/storageserver.js");
 
 const DEFAULT_USER = "123";
 const DEFAULT_PASSWORD = "password";
 
 /**
  * Helper function to prepare a RESTRequest against the server.
  */
-function localRequest(server, path, user=DEFAULT_USER, password=DEFAULT_PASSWORD) {
+function localRequest(server, path, user = DEFAULT_USER, password = DEFAULT_PASSWORD) {
   _("localRequest: " + path);
   let identity = server.server.identity;
   let url = identity.primaryScheme + "://" + identity.primaryHost + ":" +
             identity.primaryPort + path;
   _("url: " + url);
   let req = new RESTRequest(url);
 
   let header = basic_auth_header(user, password);
@@ -116,17 +116,17 @@ add_test(function test_creation() {
   _("Ensure a simple server can be created.");
 
   // Explicit callback for this one.
   let server = new StorageServer({
     __proto__: StorageServerCallback,
   });
   do_check_true(!!server);
 
-  server.start(-1, function () {
+  server.start(-1, function() {
     _("Started on " + server.port);
     server.stop(run_next_test);
   });
 });
 
 add_test(function test_synchronous_start() {
   _("Ensure starting using startSynchronous works.");
 
@@ -186,17 +186,17 @@ add_test(function test_basic_http() {
   server.registerUser("345", "password");
   do_check_true(server.userExists("345"));
   server.startSynchronous();
 
   _("Started on " + server.port);
   do_check_eq(server.requestCount, 0);
   let req = localRequest(server, "/2.0/storage/crypto/keys");
   _("req is " + req);
-  req.get(function (err) {
+  req.get(function(err) {
     do_check_eq(null, err);
     do_check_eq(server.requestCount, 1);
     server.stop(run_next_test);
   });
 });
 
 add_test(function test_info_collections() {
   let server = new StorageServer();
@@ -588,21 +588,21 @@ add_test(function test_x_num_records() {
   server.registerUser("123", "password");
 
   server.createContents("123", {
     crypto: {foos: {foo: "bar"},
              bars: {foo: "baz"}}
   });
   server.startSynchronous();
   let bso = localRequest(server, "/2.0/123/storage/crypto/foos");
-  bso.get(function (err) {
+  bso.get(function(err) {
     // BSO fetches don't have one.
     do_check_false("x-num-records" in this.response.headers);
     let col = localRequest(server, "/2.0/123/storage/crypto");
-    col.get(function (err) {
+    col.get(function(err) {
       // Collection fetches do.
       do_check_eq(this.response.headers["x-num-records"], "2");
       server.stop(run_next_test);
     });
   });
 });
 
 add_test(function test_put_delete_put() {
--- a/services/common/tests/unit/test_tokenauthenticatedrequest.js
+++ b/services/common/tests/unit/test_tokenauthenticatedrequest.js
@@ -19,33 +19,33 @@ add_test(function test_authenticated_req
   // TODO: We use a preset key here, but use getTokenFromBrowserIDAssertion()
   // from TokenServerClient to get a real one when possible. (Bug 745800)
   let id = "eyJleHBpcmVzIjogMTM2NTAxMDg5OC4x";
   let key = "qTZf4ZFpAMpMoeSsX3zVRjiqmNs=";
   let method = "GET";
 
   let nonce = btoa(CryptoUtils.generateRandomBytes(16));
   let ts = Math.floor(Date.now() / 1000);
-  let extra = {ts: ts, nonce: nonce};
+  let extra = {ts, nonce};
 
   let auth;
 
   let server = httpd_setup({"/foo": function(request, response) {
       do_check_true(request.hasHeader("Authorization"));
       do_check_eq(auth, request.getHeader("Authorization"));
 
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.bodyOutputStream.write(message, message.length);
     }
   });
   let uri = CommonUtils.makeURI(server.baseURI + "/foo");
   let sig = CryptoUtils.computeHTTPMACSHA1(id, key, method, uri, extra);
   auth = sig.getHeader();
 
-  let req = new TokenAuthenticatedRESTRequest(uri, {id: id, key: key}, extra);
+  let req = new TokenAuthenticatedRESTRequest(uri, {id, key}, extra);
   let cb = Async.makeSpinningCallback();
   req.get(cb);
   let result = cb.wait();
 
   do_check_eq(null, result);
   do_check_eq(message, req.response.body);
 
   server.stop(run_next_test);
--- a/services/common/tests/unit/test_tokenserverclient.js
+++ b/services/common/tests/unit/test_tokenserverclient.js
@@ -25,17 +25,17 @@ add_test(function test_working_bid_excha
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.setHeader("Content-Type", "application/json");
 
       let body = JSON.stringify({
         id:           "id",
         key:          "key",
         api_endpoint: service,
         uid:          "uid",
-        duration:     duration,
+        duration,
       });
       response.bodyOutputStream.write(body, body.length);
     }
   });
 
   let client = new TokenServerClient();
   let cb = Async.makeSpinningCallback();
   let url = server.baseURI + "/1.0/foo/1.0";
@@ -82,17 +82,17 @@ add_test(function test_conditions_requir
   let server = httpd_setup({
     "/1.0/foo/1.0": function(request, response) {
       do_check_false(request.hasHeader("x-conditions-accepted"));
 
       response.setStatusLine(request.httpVersion, 403, "Forbidden");
       response.setHeader("Content-Type", "application/json");
 
       let body = JSON.stringify({
-        errors: [{description: description, location: "body", name: ""}],
+        errors: [{description, location: "body", name: ""}],
         urls: {tos: tosURL}
       });
       response.bodyOutputStream.write(body, body.length);
     }
   });
 
   let client = new TokenServerClient();
   let url = server.baseURI + "/1.0/foo/1.0";
@@ -216,17 +216,17 @@ add_test(function test_send_extra_header
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.setHeader("Content-Type", "application/json");
 
       let body = JSON.stringify({
         id:           "id",
         key:          "key",
         api_endpoint: "http://example.com/",
         uid:          "uid",
-        duration:     duration,
+        duration,
       });
       response.bodyOutputStream.write(body, body.length);
     }
   });
 
   let client = new TokenServerClient();
   let url = server.baseURI + "/1.0/foo/1.0";
 
@@ -403,17 +403,17 @@ add_test(function test_rich_media_types(
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.setHeader("Content-Type", "application/json; foo=bar; bar=foo");
 
       let body = JSON.stringify({
         id:           "id",
         key:          "key",
         api_endpoint: "foo",
         uid:          "uid",
-        duration:     duration,
+        duration,
       });
       response.bodyOutputStream.write(body, body.length);
     }
   });
 
   let url = server.baseURI + "/foo";
   let client = new TokenServerClient();
   client.getTokenFromBrowserIDAssertion(url, "assertion", function(error, r) {
@@ -432,17 +432,17 @@ add_test(function test_exception_during_
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.setHeader("Content-Type", "application/json");
 
       let body = JSON.stringify({
         id:           "id",
         key:          "key",
         api_endpoint: "foo",
         uid:          "uid",
-        duration:     duration,
+        duration,
       });
       response.bodyOutputStream.write(body, body.length);
     }
   });
 
   let url = server.baseURI + "/foo";
   let client = new TokenServerClient();
   let cb = Async.makeSpinningCallback();
--- a/services/common/tests/unit/test_utils_convert_string.js
+++ b/services/common/tests/unit/test_utils_convert_string.js
@@ -3,31 +3,31 @@
 
 "use strict";
 
 Cu.import("resource://services-common/utils.js");
 
 // A wise line of Greek verse, and the utf-8 byte encoding.
 // N.b., Greek begins at utf-8 ce 91
 const TEST_STR = "πόλλ' οἶδ' ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα";
-const TEST_HEX = h("cf 80 cf 8c ce bb ce bb   27 20 ce bf e1 bc b6 ce"+
-                   "b4 27 20 e1 bc 80 ce bb   cf 8e cf 80 ce b7 ce be"+
-                   "2c 20 e1 bc 80 ce bb ce   bb 27 20 e1 bc 90 cf 87"+
-                   "e1 bf 96 ce bd ce bf cf   82 20 e1 bc 93 ce bd 20"+
+const TEST_HEX = h("cf 80 cf 8c ce bb ce bb   27 20 ce bf e1 bc b6 ce" +
+                   "b4 27 20 e1 bc 80 ce bb   cf 8e cf 80 ce b7 ce be" +
+                   "2c 20 e1 bc 80 ce bb ce   bb 27 20 e1 bc 90 cf 87" +
+                   "e1 bf 96 ce bd ce bf cf   82 20 e1 bc 93 ce bd 20" +
                    "ce bc ce ad ce b3 ce b1");
 // Integer byte values for the above
-const TEST_BYTES = [207,128,207,140,206,187,206,187,
-                     39, 32,206,191,225,188,182,206,
-                    180, 39, 32,225,188,128,206,187,
-                    207,142,207,128,206,183,206,190,
-                     44, 32,225,188,128,206,187,206,
-                    187, 39, 32,225,188,144,207,135,
-                    225,191,150,206,189,206,191,207,
-                    130, 32,225,188,147,206,189, 32,
-                    206,188,206,173,206,179,206,177];
+const TEST_BYTES = [207, 128, 207, 140, 206, 187, 206, 187,
+                     39, 32, 206, 191, 225, 188, 182, 206,
+                    180, 39, 32, 225, 188, 128, 206, 187,
+                    207, 142, 207, 128, 206, 183, 206, 190,
+                     44, 32, 225, 188, 128, 206, 187, 206,
+                    187, 39, 32, 225, 188, 144, 207, 135,
+                    225, 191, 150, 206, 189, 206, 191, 207,
+                    130, 32, 225, 188, 147, 206, 189, 32,
+                    206, 188, 206, 173, 206, 179, 206, 177];
 
 function run_test() {
   run_next_test();
 }
 
 add_test(function test_compress_string() {
   const INPUT = "hello";
 
--- a/services/common/tests/unit/test_utils_encodeBase64URL.js
+++ b/services/common/tests/unit/test_utils_encodeBase64URL.js
@@ -8,17 +8,17 @@ function run_test() {
 }
 
 add_test(function test_simple() {
   let expected = {
     hello: "aGVsbG8=",
     "<>?": "PD4_",
   };
 
-  for (let [k,v] of Object.entries(expected)) {
+  for (let [k, v] of Object.entries(expected)) {
     do_check_eq(CommonUtils.encodeBase64URL(k), v);
   }
 
   run_next_test();
 });
 
 add_test(function test_no_padding() {
   do_check_eq(CommonUtils.encodeBase64URL("hello", false), "aGVsbG8");
--- a/services/common/tests/unit/test_utils_json.js
+++ b/services/common/tests/unit/test_utils_json.js
@@ -22,17 +22,17 @@ add_test(function test_writeJSON_readJSO
   };
 
   function checkJSON(json) {
     do_check_eq(contents.a, json.a);
     do_check_eq(contents.b.c, json.b.c);
     do_check_eq(contents.d, json.d);
     do_check_eq(contents.e, json.e);
     run_next_test();
-  };
+  }
 
   function doRead() {
     CommonUtils.readJSON(path)
                .then(checkJSON, do_throw);
   }
 
   let path = OS.Path.join(OS.Constants.Path.profileDir, "bar.json");
   CommonUtils.writeJSON(contents, path)
--- a/services/common/tests/unit/test_utils_namedTimer.js
+++ b/services/common/tests/unit/test_utils_namedTimer.js
@@ -8,17 +8,17 @@ function run_test() {
 }
 
 add_test(function test_required_args() {
   try {
     CommonUtils.namedTimer(function callback() {
       do_throw("Shouldn't fire.");
     }, 0);
     do_throw("Should have thrown!");
-  } catch(ex) {
+  } catch (ex) {
     run_next_test();
   }
 });
 
 add_test(function test_simple() {
   _("Test basic properties of CommonUtils.namedTimer.");
 
   const delay = 200;
--- a/services/common/tokenserverclient.js
+++ b/services/common/tokenserverclient.js
@@ -94,17 +94,17 @@ TokenServerClientNetworkError.prototype.
  *
  *   general -- A general server error has occurred. Clients should
  *     interpret this as an opaque failure.
  *
  * @param message
  *        (string) Error message.
  */
 this.TokenServerClientServerError =
- function TokenServerClientServerError(message, cause="general") {
+ function TokenServerClientServerError(message, cause = "general") {
   this.now = new Date().toISOString(); // may be useful to diagnose time-skew issues.
   this.name = "TokenServerClientServerError";
   this.message = message || "Server error.";
   this.cause = cause;
   this.stack = Error().stack;
 }
 TokenServerClientServerError.prototype = new TokenServerClientError();
 TokenServerClientServerError.prototype.constructor =
@@ -239,17 +239,17 @@ TokenServerClient.prototype = {
    * @param  assertion
    *         (string) BrowserID assertion to exchange token for.
    * @param  cb
    *         (function) Callback to be invoked with result of operation.
    * @param  conditionsAccepted
    *         (bool) Whether to send acceptance to service conditions.
    */
   getTokenFromBrowserIDAssertion:
-    function getTokenFromBrowserIDAssertion(url, assertion, cb, addHeaders={}) {
+    function getTokenFromBrowserIDAssertion(url, assertion, cb, addHeaders = {}) {
     if (!url) {
       throw new TokenServerClientError("url argument is not valid.");
     }
 
     if (!assertion) {
       throw new TokenServerClientError("assertion argument is not valid.");
     }
 
@@ -431,17 +431,17 @@ TokenServerClient.prototype = {
    * allows the handler of notifications to be sure they are handling
    * notifications for the service they expect.
    *
    * If not set, no notifications will be sent.
    */
   observerPrefix: null,
 
   // Given an optional header value, notify that a backoff has been requested.
-  _maybeNotifyBackoff: function (response, headerName) {
+  _maybeNotifyBackoff(response, headerName) {
     if (!this.observerPrefix) {
       return;
     }
     let headerVal = response.headers[headerName];
     if (!headerVal) {
       return;
     }
     let backoffInterval;
@@ -451,12 +451,12 @@ TokenServerClient.prototype = {
       this._log.error("TokenServer response had invalid backoff value in '" +
                       headerName + "' header: " + headerVal);
       return;
     }
     Observers.notify(this.observerPrefix + ":backoff:interval", backoffInterval);
   },
 
   // override points for testing.
-  newRESTRequest: function(url) {
+  newRESTRequest(url) {
     return new RESTRequest(url);
   }
 };
--- a/services/common/utils.js
+++ b/services/common/utils.js
@@ -16,53 +16,53 @@ this.CommonUtils = {
   /*
    * Set manipulation methods. These should be lifted into toolkit, or added to
    * `Set` itself.
    */
 
   /**
    * Return elements of `a` or `b`.
    */
-  union: function (a, b) {
+  union(a, b) {
     let out = new Set(a);
     for (let x of b) {
       out.add(x);
     }
     return out;
   },
 
   /**
    * Return elements of `a` that are not present in `b`.
    */
-  difference: function (a, b) {
+  difference(a, b) {
     let out = new Set(a);
     for (let x of b) {
       out.delete(x);
     }
     return out;
   },
 
   /**
    * Return elements of `a` that are also in `b`.
    */
-  intersection: function (a, b) {
+  intersection(a, b) {
     let out = new Set();
     for (let x of a) {
       if (b.has(x)) {
         out.add(x);
       }
     }
     return out;
   },
 
   /**
    * Return true if `a` and `b` are the same size, and
    * every element of `a` is in `b`.
    */
-  setEqual: function (a, b) {
+  setEqual(a, b) {
     if (a.size != b.size) {
       return false;
     }
     for (let x of a) {
       if (!b.has(x)) {
         return false;
       }
     }
@@ -73,17 +73,17 @@ this.CommonUtils = {
    * Encode byte string as base64URL (RFC 4648).
    *
    * @param bytes
    *        (string) Raw byte string to encode.
    * @param pad
    *        (bool) Whether to include padding characters (=). Defaults
    *        to true for historical reasons.
    */
-  encodeBase64URL: function encodeBase64URL(bytes, pad=true) {
+  encodeBase64URL: function encodeBase64URL(bytes, pad = true) {
     let s = btoa(bytes).replace(/\+/g, "-").replace(/\//g, "_");
 
     if (!pad) {
       return s.replace(/=+$/, "");
     }
 
     return s;
   },
@@ -120,34 +120,34 @@ this.CommonUtils = {
 
   /**
    * Return a promise resolving on some later tick.
    *
    * This a wrapper around Promise.resolve() that prevents stack
    * accumulation and prevents callers from accidentally relying on
    * same-tick promise resolution.
    */
-  laterTickResolvingPromise: function (value, prototype) {
+  laterTickResolvingPromise(value, prototype) {
     let deferred = Promise.defer(prototype);
     this.nextTick(deferred.resolve.bind(deferred, value));
     return deferred.promise;
   },
 
   /**
    * Spin the event loop and return once the next tick is executed.
    *
    * This is an evil function and should not be used in production code. It
    * exists in this module for ease-of-use.
    */
   waitForNextTick: function waitForNextTick() {
     let cb = Async.makeSyncCallback();
     this.nextTick(cb);
     Async.waitForSyncCallback(cb);
 
-    return;
+
   },
 
   /**
    * Return a timer that is scheduled to call the callback after waiting the
    * provided time or as soon as possible. The timer will be set as a property
    * of the provided object with the given timer name.
    */
   namedTimer: function namedTimer(callback, wait, thisObj, name) {
@@ -375,30 +375,30 @@ this.CommonUtils = {
   },
 
   /**
    * Parses a JSON file from disk using OS.File and promises.
    *
    * @param path the file to read. Will be passed to `OS.File.read()`.
    * @return a promise that resolves to the JSON contents of the named file.
    */
-  readJSON: function(path) {
+  readJSON(path) {
     return OS.File.read(path, { encoding: "utf-8" }).then((data) => {
       return JSON.parse(data);
     });
   },
 
   /**
    * Write a JSON object to the named file using OS.File and promises.
    *
    * @param contents a JS object. Will be serialized.
    * @param path the path of the file to write.
    * @return a promise, as produced by OS.File.writeAtomic.
    */
-  writeJSON: function(contents, path) {
+  writeJSON(contents, path) {
     let data = JSON.stringify(contents);
     return OS.File.writeAtomic(path, data, {encoding: "utf-8", tmpPath: path + ".tmp"});
   },
 
 
   /**
    * Ensure that the specified value is defined in integer milliseconds since
    * UNIX epoch.
@@ -487,17 +487,17 @@ this.CommonUtils = {
    *        (Preferences) Branch from which to retrieve preference.
    * @param pref
    *        (string) The preference to read from.
    * @param def
    *        (Number) The default value to use if the preference is not defined.
    * @param log
    *        (Log.Logger) Logger to write warnings to.
    */
-  getEpochPref: function getEpochPref(branch, pref, def=0, log=null) {
+  getEpochPref: function getEpochPref(branch, pref, def = 0, log = null) {
     if (!Number.isInteger(def)) {
       throw new Error("Default value is not a number: " + def);
     }
 
     let valueStr = branch.get(pref, null);
 
     if (valueStr !== null) {
       let valueInt = parseInt(valueStr, 10);
@@ -532,18 +532,18 @@ this.CommonUtils = {
    * @param def
    *        (Number) The default value (in milliseconds) if the preference is
    *        not defined or invalid.
    * @param log
    *        (Log.Logger) Logger to write warnings to.
    * @param oldestYear
    *        (Number) Oldest year to accept in read values.
    */
-  getDatePref: function getDatePref(branch, pref, def=0, log=null,
-                                    oldestYear=2010) {
+  getDatePref: function getDatePref(branch, pref, def = 0, log = null,
+                                    oldestYear = 2010) {
 
     let valueInt = this.getEpochPref(branch, pref, def, log);
     let date = new Date(valueInt);
 
     if (valueInt == def || date.getFullYear() >= oldestYear) {
       return date;
     }
 
@@ -567,17 +567,17 @@ this.CommonUtils = {
    *        (Preference) Branch from which to read preference.
    * @param pref
    *        (string) Name of preference to write to.
    * @param date
    *        (Date) The value to save.
    * @param oldestYear
    *        (Number) The oldest year to accept for values.
    */
-  setDatePref: function setDatePref(branch, pref, date, oldestYear=2010) {
+  setDatePref: function setDatePref(branch, pref, date, oldestYear = 2010) {
     if (date.getFullYear() < oldestYear) {
       throw new Error("Trying to set " + pref + " to a very old time: " +
                       date + ". The current time is " + new Date() +
                       ". Is the system clock wrong?");
     }
 
     branch.set(pref, "" + date.getTime());
   },
--- a/services/crypto/component/tests/unit/test_jpake.js
+++ b/services/crypto/component/tests/unit/test_jpake.js
@@ -3,17 +3,17 @@ var Ci = Components.interfaces;
 
 // Ensure PSM is initialized.
 Cc["@mozilla.org/psm;1"].getService(Ci.nsISupports);
 
 function do_check_throws(func) {
   let have_error = false;
   try {
     func();
-  } catch(ex) {
+  } catch (ex) {
     dump("Was expecting an exception. Caught: " + ex + "\n");
     have_error = true;
   }
   do_check_true(have_error);
 }
 
 function test_success() {
   let a = Cc["@mozilla.org/services-crypto/sync-jpake;1"]
@@ -194,17 +194,17 @@ function test_x4_zero() {
     let b_gva = {};
     let b_ra = {};
 
     do_check_throws(function() {
         b.round2("alice", "secret", a_gx1.value, a_gv1.value, a_r1.value,
                     a_gx2.value, a_gv2.value, a_r2.value, b_A, b_gva, b_ra);
     });
   };
-  
+
   // g^x is NIST 3072's p + 1, (p + 1) mod p == 1, x == 0
   test("90066455B5CFC38F9CAA4A48B4281F292C260FEEF01FD61037E56258A7795A1C"
          + "7AD46076982CE6BB956936C6AB4DCFE05E6784586940CA544B9B2140E1EB523F"
          + "009D20A7E7880E4E5BFA690F1B9004A27811CD9904AF70420EEFD6EA11EF7DA1"
          + "29F58835FF56B89FAA637BC9AC2EFAAB903402229F491D8D3485261CD068699B"
          + "6BA58A1DDBBEF6DB51E8FE34E8A78E542D7BA351C21EA8D8F1D29F5D5D159394"
          + "87E27F4416B0CA632C59EFD1B1EB66511A5A0FBF615B766C5862D0BD8A3FE7A0"
          + "E0DA0FB2FE1FCB19E8F9996A8EA0FCCDE538175238FC8B0EE6F29AF7F642773E"
@@ -241,17 +241,17 @@ function test_x4_zero() {
          + "99EEF4816375B119824ACC9AA56D1340B6A49D05F855DE699B351012028C"
          + "CA43001F708CC61E71CA3849935BEEBABC0D268CD41B8D2B8DCA705FDFF8"
          + "1DAA772DA96EDEA0B291FD5C0C1B8EFE5318D37EBC1BFF53A9DDEC4171A6"
          + "479E341438970058E25C8F2BCDA6166C8BF1B065C174",
        "8B2BACE575179D762F6F2FFDBFF00B497C07766AB3EED9961447CF6F43D06A97");
 }
 
 function test_invalid_input_round2() {
-  let a = Cc["@mozilla.org/services-crypto/sync-jpake;1"]   
+  let a = Cc["@mozilla.org/services-crypto/sync-jpake;1"]
             .createInstance(Ci.nsISyncJPAKE);
 
   a.round1("alice", {}, {}, {}, {}, {}, {});
   do_check_throws(function() {
     a.round2("invalid", "sekrit", "some", "real", "garbage",
              "even", "more", "garbage", {}, {}, {});
   });
 }
--- a/services/crypto/modules/WeaveCrypto.js
+++ b/services/crypto/modules/WeaveCrypto.js
@@ -115,17 +115,17 @@ WeaveCrypto.prototype = {
         }
 
         let iv = this.byteCompressInts(ivStr);
         let symKey = this.importSymKey(symKeyStr, operation);
         let cryptMethod = (operation === OPERATIONS.ENCRYPT
                            ? crypto.subtle.encrypt
                            : crypto.subtle.decrypt)
                           .bind(crypto.subtle);
-        let algo = { name: CRYPT_ALGO, iv: iv };
+        let algo = { name: CRYPT_ALGO, iv };
 
 
         return Async.promiseSpinningly(
             cryptMethod(algo, symKey, data)
             .then(keyBytes => new Uint8Array(keyBytes))
         );
     },
 
@@ -240,17 +240,17 @@ WeaveCrypto.prototype = {
      */
     deriveKeyFromPassphrase(passphrase, saltStr, keyLength = 32) {
         this.log("deriveKeyFromPassphrase() called.");
         let keyData = this.makeUint8Array(passphrase, false);
         let salt = this.makeUint8Array(saltStr, true);
         let importAlgo = { name: KEY_DERIVATION_ALGO };
         let deriveAlgo = {
             name: KEY_DERIVATION_ALGO,
-            salt: salt,
+            salt,
             iterations: KEY_DERIVATION_ITERATIONS,
             hash: { name: KEY_DERIVATION_HASHING_ALGO },
         };
         let derivedKeyType = {
             name: DERIVED_KEY_ALGO,
             length: keyLength * 8,
         };
         return Async.promiseSpinningly(
--- a/services/crypto/modules/utils.js
+++ b/services/crypto/modules/utils.js
@@ -10,17 +10,17 @@ Cu.import("resource://services-common/ob
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 this.CryptoUtils = {
   xor: function xor(a, b) {
     let bytes = [];
 
     if (a.length != b.length) {
-      throw new Error("can't xor unequal length strings: "+a.length+" vs "+b.length);
+      throw new Error("can't xor unequal length strings: " + a.length + " vs " + b.length);
     }
 
     for (let i = 0; i < a.length; i++) {
       bytes[i] = a.charCodeAt(i) ^ b.charCodeAt(i);
     }
 
     return String.fromCharCode.apply(String, bytes);
   },
@@ -66,17 +66,17 @@ this.CryptoUtils = {
   },
 
   /**
    * Encode the message into UTF-8 and feed the resulting bytes into the
    * given hasher. Does not return a hash. This can be called multiple times
    * with a single hasher, but eventually you must extract the result
    * yourself.
    */
-  updateUTF8: function(message, hasher) {
+  updateUTF8(message, hasher) {
     let bytes = this._utf8Converter.convertToByteArray(message, {});
     hasher.update(bytes, bytes.length);
   },
 
   /**
    * UTF-8 encode a message and perform a SHA-1 over it.
    *
    * @param message
@@ -131,36 +131,36 @@ this.CryptoUtils = {
   },
 
   /**
    * HMAC-based Key Derivation (RFC 5869).
    */
   hkdf: function hkdf(ikm, xts, info, len) {
     const BLOCKSIZE = 256 / 8;
     if (typeof xts === undefined)
-      xts = String.fromCharCode(0, 0, 0, 0,  0, 0, 0, 0,
-                                0, 0, 0, 0,  0, 0, 0, 0,
-                                0, 0, 0, 0,  0, 0, 0, 0,
-                                0, 0, 0, 0,  0, 0, 0, 0);
+      xts = String.fromCharCode(0, 0, 0, 0, 0, 0, 0, 0,
+                                0, 0, 0, 0, 0, 0, 0, 0,
+                                0, 0, 0, 0, 0, 0, 0, 0,
+                                0, 0, 0, 0, 0, 0, 0, 0);
     let h = CryptoUtils.makeHMACHasher(Ci.nsICryptoHMAC.SHA256,
                                        CryptoUtils.makeHMACKey(xts));
     let prk = CryptoUtils.digestBytes(ikm, h);
     return CryptoUtils.hkdfExpand(prk, info, len);
   },
 
   /**
    * HMAC-based Key Derivation Step 2 according to RFC 5869.
    */
   hkdfExpand: function hkdfExpand(prk, info, len) {
     const BLOCKSIZE = 256 / 8;
     let h = CryptoUtils.makeHMACHasher(Ci.nsICryptoHMAC.SHA256,
                                        CryptoUtils.makeHMACKey(prk));
     let T = "";
     let Tn = "";
-    let iterations = Math.ceil(len/BLOCKSIZE);
+    let iterations = Math.ceil(len / BLOCKSIZE);
     for (let i = 0; i < iterations; i++) {
       Tn = CryptoUtils.digestBytes(Tn + info + String.fromCharCode(i + 1), h);
       T += Tn;
     }
     return T.slice(0, len);
   },
 
   /**
@@ -179,17 +179,17 @@ this.CryptoUtils = {
    *
    * The default value of 20 for hmacLen is appropriate for SHA1.  For SHA256,
    * hmacLen should be 32.
    *
    * The output is an octet string of length dkLen, which you
    * can encode as you wish.
    */
   pbkdf2Generate : function pbkdf2Generate(P, S, c, dkLen,
-                       hmacAlg=Ci.nsICryptoHMAC.SHA1, hmacLen=20) {
+                       hmacAlg = Ci.nsICryptoHMAC.SHA1, hmacLen = 20) {
 
     // We don't have a default in the algo itself, as NSS does.
     // Use the constant.
     if (!dkLen) {
       dkLen = SYNC_KEY_DECODED_LENGTH;
     }
 
     function F(S, c, i, h) {
@@ -242,32 +242,31 @@ this.CryptoUtils = {
                                        CryptoUtils.makeHMACKey(P));
 
     let T = [];
     for (let i = 0; i < l;) {
       T[i] = F(S, c, ++i, h);
     }
 
     let ret = "";
-    for (let i = 0; i < l-1;) {
+    for (let i = 0; i < l - 1;) {
       ret += T[i++];
     }
     ret += T[l - 1].substr(0, r);
 
     return ret;
   },
 
   deriveKeyFromPassphrase: function deriveKeyFromPassphrase(passphrase,
                                                             salt,
                                                             keyLength,
                                                             forceJS) {
     if (Svc.Crypto.deriveKeyFromPassphrase && !forceJS) {
       return Svc.Crypto.deriveKeyFromPassphrase(passphrase, salt, keyLength);
-    }
-    else {
+    } else {
       // Fall back to JS implementation.
       // 4096 is hardcoded in WeaveCrypto, so do so here.
       return CryptoUtils.pbkdf2Generate(passphrase, atob(salt), 4096,
                                         keyLength);
     }
   },
 
   /**
@@ -329,43 +328,43 @@ this.CryptoUtils = {
       port = "443";
     } else {
       throw new Error("Unsupported URI scheme: " + uri.scheme);
     }
 
     let ext = (extra && extra.ext) ? extra.ext : "";
 
     let requestString = ts.toString(10) + "\n" +
-                        nonce           + "\n" +
-                        usedMethod      + "\n" +
-                        uri.path        + "\n" +
-                        host            + "\n" +
-                        port            + "\n" +
-                        ext             + "\n";
+                        nonce + "\n" +
+                        usedMethod + "\n" +
+                        uri.path + "\n" +
+                        host + "\n" +
+                        port + "\n" +
+                        ext + "\n";
 
     let hasher = CryptoUtils.makeHMACHasher(Ci.nsICryptoHMAC.SHA1,
                                             CryptoUtils.makeHMACKey(key));
     let mac = CryptoUtils.digestBytes(requestString, hasher);
 
     function getHeader() {
       return CryptoUtils.getHTTPMACSHA1Header(this.identifier, this.ts,
                                               this.nonce, this.mac, this.ext);
     }
 
     return {
-      identifier: identifier,
-      key:        key,
+      identifier,
+      key,
       method:     usedMethod,
       hostname:   host,
-      port:       port,
-      mac:        mac,
-      nonce:      nonce,
-      ts:         ts,
-      ext:        ext,
-      getHeader:  getHeader
+      port,
+      mac,
+      nonce,
+      ts,
+      ext,
+      getHeader
     };
   },
 
 
   /**
    * Obtain the HTTP MAC Authorization header value from fields.
    *
    * @param  identifier
@@ -378,33 +377,33 @@ this.CryptoUtils = {
    *         (string) Computed HMAC digest (raw bytes).
    * @param  ext
    *         (optional) (string) Extra string content.
    * @returns
    *         (string) Value to put in Authorization header.
    */
   getHTTPMACSHA1Header: function getHTTPMACSHA1Header(identifier, ts, nonce,
                                                       mac, ext) {
-    let header ='MAC id="' + identifier + '", ' +
-                'ts="'     + ts         + '", ' +
-                'nonce="'  + nonce      + '", ' +
-                'mac="'    + btoa(mac)  + '"';
+    let header = 'MAC id="' + identifier + '", ' +
+                'ts="' + ts + '", ' +
+                'nonce="' + nonce + '", ' +
+                'mac="' + btoa(mac) + '"';
 
     if (!ext) {
       return header;
     }
 
-    return header += ', ext="' + ext +'"';
+    return header += ', ext="' + ext + '"';
   },
 
   /**
    * Given an HTTP header value, strip out any attributes.
    */
 
-  stripHeaderAttributes: function(value) {
+  stripHeaderAttributes(value) {
     value = value || "";
     let i = value.indexOf(";");
     return value.substring(0, (i >= 0) ? i : undefined).trim().toLowerCase();
   },
 
   /**
    * Compute the HAWK client values (mostly the header) for an HTTP request.
    *
@@ -453,17 +452,17 @@ this.CryptoUtils = {
    *             method - (string)
    *             resource - (string) path plus querystring
    *             host - (string)
    *             port - (number)
    *             hash - (string) payload hash (base64)
    *             ext - (string) app-specific data
    *             MAC - (string) request MAC (base64)
    */
-  computeHAWK: function(uri, method, options) {
+  computeHAWK(uri, method, options) {
     let credentials = options.credentials;
     let ts = options.ts || Math.floor(((options.now || Date.now()) +
                                        (options.localtimeOffsetMsec || 0))
                                       / 1000);
 
     let hash_algo, hmac_algo;
     if (credentials.algorithm == "sha1") {
       hash_algo = Ci.nsICryptoHash.SHA1;
@@ -482,17 +481,17 @@ this.CryptoUtils = {
       port = 80;
     } else if (uri.scheme == "https") {
       port = 443;
     } else {
       throw new Error("Unsupported URI scheme: " + uri.scheme);
     }
 
     let artifacts = {
-      ts: ts,
+      ts,
       nonce: options.nonce || btoa(CryptoUtils.generateRandomBytes(8)),
       method: method.toUpperCase(),
       resource: uri.path, // This includes both path and search/queryarg.
       host: uri.asciiHost.toLowerCase(), // This includes punycoding.
       port: port.toString(10),
       hash: options.hash,
       ext: options.ext,
     };
@@ -500,33 +499,33 @@ this.CryptoUtils = {
     let contentType = CryptoUtils.stripHeaderAttributes(options.contentType);
 
     if (!artifacts.hash && options.hasOwnProperty("payload")
         && options.payload) {
       let hasher = Cc["@mozilla.org/security/hash;1"]
                      .createInstance(Ci.nsICryptoHash);
       hasher.init(hash_algo);
       CryptoUtils.updateUTF8("hawk.1.payload\n", hasher);
-      CryptoUtils.updateUTF8(contentType+"\n", hasher);
+      CryptoUtils.updateUTF8(contentType + "\n", hasher);
       CryptoUtils.updateUTF8(options.payload, hasher);
       CryptoUtils.updateUTF8("\n", hasher);
       let hash = hasher.finish(false);
       // HAWK specifies this .hash to use +/ (not _-) and include the
       // trailing "==" padding.
       let hash_b64 = btoa(hash);
       artifacts.hash = hash_b64;
     }
 
-    let requestString = ("hawk.1.header"        + "\n" +
+    let requestString = ("hawk.1.header" + "\n" +
                          artifacts.ts.toString(10) + "\n" +
-                         artifacts.nonce        + "\n" +
-                         artifacts.method       + "\n" +
-                         artifacts.resource     + "\n" +
-                         artifacts.host         + "\n" +
-                         artifacts.port         + "\n" +
+                         artifacts.nonce + "\n" +
+                         artifacts.method + "\n" +
+                         artifacts.resource + "\n" +
+                         artifacts.host + "\n" +
+                         artifacts.port + "\n" +
                          (artifacts.hash || "") + "\n");
     if (artifacts.ext) {
       requestString += artifacts.ext.replace("\\", "\\\\").replace("\n", "\\n");
     }
     requestString += "\n";
 
     let hasher = CryptoUtils.makeHMACHasher(hmac_algo,
                                             CryptoUtils.makeHMACKey(credentials.key));
@@ -539,17 +538,17 @@ this.CryptoUtils = {
     }
     let header = ('Hawk id="' + credentials.id + '", ' +
                   'ts="' + artifacts.ts + '", ' +
                   'nonce="' + artifacts.nonce + '", ' +
                   (artifacts.hash ? ('hash="' + artifacts.hash + '", ') : "") +
                   (artifacts.ext ? ('ext="' + escape(artifacts.ext) + '", ') : "") +
                   'mac="' + artifacts.mac + '"');
     return {
-      artifacts: artifacts,
+      artifacts,
       field: header,
     };
   },
 
 };
 
 XPCOMUtils.defineLazyGetter(CryptoUtils, "_utf8Converter", function() {
   let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
--- a/services/crypto/tests/unit/head_helpers.js
+++ b/services/crypto/tests/unit/head_helpers.js
@@ -3,35 +3,34 @@ var Ci = Components.interfaces;
 var Cr = Components.results;
 var Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 try {
   // In the context of xpcshell tests, there won't be a default AppInfo
   Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
-}
-catch(ex) {
+} catch (ex) {
 
 // Make sure to provide the right OS so crypto loads the right binaries
 var OS = "XPCShell";
 if (mozinfo.os == "win")
   OS = "WINNT";
 else if (mozinfo.os == "mac")
   OS = "Darwin";
 else
   OS = "Linux";
 
 Cu.import("resource://testing-common/AppInfo.jsm", this);
 updateAppInfo({
   name: "XPCShell",
   ID: "{3e3ba16c-1675-4e88-b9c8-afef81b3d2ef}",
   version: "1",
   platformVersion: "",
-  OS: OS,
+  OS,
 });
 }
 
 // Register resource alias. Normally done in SyncComponents.manifest.
 function addResourceAlias() {
   Cu.import("resource://gre/modules/Services.jsm");
   const resProt = Services.io.getProtocolHandler("resource")
                           .QueryInterface(Ci.nsIResProtocolHandler);
--- a/services/crypto/tests/unit/test_utils_hawk.js
+++ b/services/crypto/tests/unit/test_utils_hawk.js
@@ -24,18 +24,18 @@ add_test(function test_hawk() {
   let method = "POST";
   let ts = 1353809207;
   let nonce = "Ygvqdz";
   let result;
 
   let uri_http = CommonUtils.makeURI("http://example.net/somewhere/over/the/rainbow");
   let sha1_opts = { credentials: credentials_sha1,
                     ext: "Bazinga!",
-                    ts: ts,
-                    nonce: nonce,
+                    ts,
+                    nonce,
                     payload: "something to write about",
                   };
   result = compute(uri_http, method, sha1_opts);
 
   // The HAWK spec uses non-urlsafe base64 (+/) for its output MAC string.
   do_check_eq(result.field,
               'Hawk id="123456", ts="1353809207", nonce="Ygvqdz", ' +
               'hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", ' +
@@ -55,18 +55,18 @@ add_test(function test_hawk() {
     id: "123456",
     key: "2983d45yun89q",
     algorithm: "sha256",
   };
 
   let uri_https = CommonUtils.makeURI("https://example.net/somewhere/over/the/rainbow");
   let sha256_opts = { credentials: credentials_sha256,
                       ext: "Bazinga!",
-                      ts: ts,
-                      nonce: nonce,
+                      ts,
+                      nonce,
                       payload: "something to write about",
                       contentType: "text/plain",
                     };
 
   result = compute(uri_https, method, sha256_opts);
   do_check_eq(result.field,
               'Hawk id="123456", ts="1353809207", nonce="Ygvqdz", ' +
               'hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ' +
@@ -78,18 +78,18 @@ add_test(function test_hawk() {
   do_check_eq(result.artifacts.method, method);
   do_check_eq(result.artifacts.resource, "/somewhere/over/the/rainbow");
   do_check_eq(result.artifacts.host, "example.net");
   do_check_eq(result.artifacts.port, 443);
   do_check_eq(result.artifacts.hash, "2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=");
   do_check_eq(result.artifacts.ext, "Bazinga!");
 
   let sha256_opts_noext = { credentials: credentials_sha256,
-                            ts: ts,
-                            nonce: nonce,
+                            ts,
+                            nonce,
                             payload: "something to write about",
                             contentType: "text/plain",
                           };
   result = compute(uri_https, method, sha256_opts_noext);
   do_check_eq(result.field,
               'Hawk id="123456", ts="1353809207", nonce="Ygvqdz", ' +
               'hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ' +
               'mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="'
@@ -111,18 +111,18 @@ add_test(function test_hawk() {
   result = compute(uri_https, method, { credentials: credentials_sha256 });
   let fields = result.field.split(" ");
   do_check_eq(fields[0], "Hawk");
   do_check_eq(fields[1], 'id="123456",'); // from creds.id
   do_check_true(fields[2].startsWith('ts="'));
   /* The HAWK spec calls for seconds-since-epoch, not ms-since-epoch.
    * Warning: this test will fail in the year 33658, and for time travellers
    * who journey earlier than 2001. Please plan accordingly. */
-  do_check_true(result.artifacts.ts > 1000*1000*1000);
-  do_check_true(result.artifacts.ts < 1000*1000*1000*1000);
+  do_check_true(result.artifacts.ts > 1000 * 1000 * 1000);
+  do_check_true(result.artifacts.ts < 1000 * 1000 * 1000 * 1000);
   do_check_true(fields[3].startsWith('nonce="'));
   do_check_eq(fields[3].length, ('nonce="12345678901=",').length);
   do_check_eq(result.artifacts.nonce.length, ("12345678901=").length);
 
   let result2 = compute(uri_https, method, { credentials: credentials_sha256 });
   do_check_neq(result.artifacts.nonce, result2.artifacts.nonce);
 
   /* Using an upper-case URI hostname shouldn't affect the hash. */
@@ -154,17 +154,17 @@ add_test(function test_hawk() {
 
   result = compute(uri_https, method, { credentials: credentials_sha256,
                                         now: 1378848968650,
                                       });
   do_check_eq(result.artifacts.ts, 1378848968);
 
   result = compute(uri_https, method, { credentials: credentials_sha256,
                                         now: 1378848968650,
-                                        localtimeOffsetMsec: 1000*1000,
+                                        localtimeOffsetMsec: 1000 * 1000,
                                       });
   do_check_eq(result.artifacts.ts, 1378848968 + 1000);
 
   /* Search/query-args in URIs should be included in the hash. */
   let makeURI = CommonUtils.makeURI;
   result = compute(makeURI("http://example.net/path"), method, sha256_opts);
   do_check_eq(result.artifacts.resource, "/path");
   do_check_eq(result.artifacts.mac, "WyKHJjWaeYt8aJD+H9UeCWc0Y9C+07ooTmrcrOW4MPI=");
--- a/services/crypto/tests/unit/test_utils_httpmac.js
+++ b/services/crypto/tests/unit/test_utils_httpmac.js
@@ -17,28 +17,28 @@ add_test(function test_sha1() {
   let id = "vmo1txkttblmn51u2p3zk2xiy16hgvm5ok8qiv1yyi86ffjzy9zj0ez9x6wnvbx7";
   let key = "b8u1cc5iiio5o319og7hh8faf2gi5ym4aq0zwf112cv1287an65fudu5zj7zo7dz";
   let ts = 1329181221;
   let method = "GET";
   let nonce = "wGX71";
   let uri = CommonUtils.makeURI("http://10.250.2.176/alias/");
 
   let result = CryptoUtils.computeHTTPMACSHA1(id, key, method, uri,
-                                              {ts: ts, nonce: nonce});
+                                              {ts, nonce});
 
   do_check_eq(btoa(result.mac), "jzh5chjQc2zFEvLbyHnPdX11Yck=");
 
   do_check_eq(result.getHeader(),
               'MAC id="vmo1txkttblmn51u2p3zk2xiy16hgvm5ok8qiv1yyi86ffjzy9zj0ez9x6wnvbx7", ' +
               'ts="1329181221", nonce="wGX71", mac="jzh5chjQc2zFEvLbyHnPdX11Yck="');
 
   let ext = "EXTRA DATA; foo,bar=1";
 
   result = CryptoUtils.computeHTTPMACSHA1(id, key, method, uri,
-                                              {ts: ts, nonce: nonce, ext: ext});
+                                              {ts, nonce, ext});
   do_check_eq(btoa(result.mac), "bNf4Fnt5k6DnhmyipLPkuZroH68=");
   do_check_eq(result.getHeader(),
               'MAC id="vmo1txkttblmn51u2p3zk2xiy16hgvm5ok8qiv1yyi86ffjzy9zj0ez9x6wnvbx7", ' +
               'ts="1329181221", nonce="wGX71", mac="bNf4Fnt5k6DnhmyipLPkuZroH68=", ' +
               'ext="EXTRA DATA; foo,bar=1"');
 
   run_next_test();
 });
--- a/services/crypto/tests/unit/test_utils_pbkdf2.js
+++ b/services/crypto/tests/unit/test_utils_pbkdf2.js
@@ -25,36 +25,36 @@ add_task(function test_pbkdf2() {
 // PBKDF2 HMAC-SHA1 Test Vectors
 add_task(function test_pbkdf2_hmac_sha1() {
   let pbkdf2 = CryptoUtils.pbkdf2Generate;
   let vectors = [
     {P: "password",                    // (8 octets)
      S: "salt",                        // (4 octets)
      c: 1,
      dkLen: 20,
-     DK: h("0c 60 c8 0f 96 1f 0e 71"+
-           "f3 a9 b5 24 af 60 12 06"+
+     DK: h("0c 60 c8 0f 96 1f 0e 71" +
+           "f3 a9 b5 24 af 60 12 06" +
            "2f e0 37 a6"),             // (20 octets)
     },
 
     {P: "password",                    // (8 octets)
      S: "salt",                        // (4 octets)
      c: 2,
      dkLen: 20,
-     DK: h("ea 6c 01 4d c7 2d 6f 8c"+
-           "cd 1e d9 2a ce 1d 41 f0"+
+     DK: h("ea 6c 01 4d c7 2d 6f 8c" +
+           "cd 1e d9 2a ce 1d 41 f0" +
            "d8 de 89 57"),             // (20 octets)
     },
 
     {P: "password",                    // (8 octets)
      S: "salt",                        // (4 octets)
      c: 4096,
      dkLen: 20,
-     DK: h("4b 00 79 01 b7 65 48 9a"+
-           "be ad 49 d9 26 f7 21 d0"+
+     DK: h("4b 00 79 01 b7 65 48 9a" +
+           "be ad 49 d9 26 f7 21 d0" +
            "65 a4 29 c1"),             // (20 octets)
     },
 
     // XXX Uncomment the following test after Bug 968567 lands
     //
     // XXX As it stands, I estimate that the CryptoUtils implementation will
     // take approximately 16 hours in my 2.3GHz MacBook to perform this many
     // rounds.
@@ -67,28 +67,28 @@ add_task(function test_pbkdf2_hmac_sha1(
     //        "e9 94 5b 3d 6b a2 15 8c"+
     //        "26 34 e9 84"),             // (20 octets)
     // },
 
     {P: "passwordPASSWORDpassword",    // (24 octets)
      S: "saltSALTsaltSALTsaltSALTsaltSALTsalt", // (36 octets)
      c: 4096,
      dkLen: 25,
-     DK: h("3d 2e ec 4f e4 1c 84 9b"+
-           "80 c8 d8 36 62 c0 e4 4a"+
-           "8b 29 1a 96 4c f2 f0 70"+
+     DK: h("3d 2e ec 4f e4 1c 84 9b" +
+           "80 c8 d8 36 62 c0 e4 4a" +
+           "8b 29 1a 96 4c f2 f0 70" +
            "38"),                      // (25 octets)
 
     },
 
     {P: "pass\0word",                  // (9 octets)
      S: "sa\0lt",                      // (5 octets)
      c: 4096,
      dkLen: 16,
-     DK: h("56 fa 6a a7 55 48 09 9d"+
+     DK: h("56 fa 6a a7 55 48 09 9d" +
            "cc 37 d7 f0 34 25 e0 c3"), // (16 octets)
     },
   ];
 
   for (let v of vectors) {
     do_check_eq(v.DK, b2h(pbkdf2(v.P, v.S, v.c, v.dkLen)));
   }
 });
@@ -99,58 +99,58 @@ add_task(function test_pbkdf2_hmac_sha1(
 // https://stackoverflow.com/questions/5130513/pbkdf2-hmac-sha2-test-vectors
 add_task(function test_pbkdf2_hmac_sha256() {
   let pbkdf2 = CryptoUtils.pbkdf2Generate;
   let vectors = [
     {P: "password",                    // (8 octets)
      S: "salt",                        // (4 octets)
      c: 1,
      dkLen: 32,
-     DK: h("12 0f b6 cf fc f8 b3 2c"+
-           "43 e7 22 52 56 c4 f8 37"+
-           "a8 65 48 c9 2c cc 35 48"+
+     DK: h("12 0f b6 cf fc f8 b3 2c" +
+           "43 e7 22 52 56 c4 f8 37" +
+           "a8 65 48 c9 2c cc 35 48" +
            "08 05 98 7c b7 0b e1 7b"), // (32 octets)
     },
 
     {P: "password",                    // (8 octets)
      S: "salt",                        // (4 octets)
      c: 2,
      dkLen: 32,
-     DK: h("ae 4d 0c 95 af 6b 46 d3"+
-           "2d 0a df f9 28 f0 6d d0"+
-           "2a 30 3f 8e f3 c2 51 df"+
+     DK: h("ae 4d 0c 95 af 6b 46 d3" +
+           "2d 0a df f9 28 f0 6d d0" +
+           "2a 30 3f 8e f3 c2 51 df" +
            "d6 e2 d8 5a 95 47 4c 43"), // (32 octets)
     },
 
     {P: "password",                    // (8 octets)
      S: "salt",                        // (4 octets)
      c: 4096,
      dkLen: 32,
-     DK: h("c5 e4 78 d5 92 88 c8 41"+
-           "aa 53 0d b6 84 5c 4c 8d"+
-           "96 28 93 a0 01 ce 4e 11"+
+     DK: h("c5 e4 78 d5 92 88 c8 41" +
+           "aa 53 0d b6 84 5c 4c 8d" +
+           "96 28 93 a0 01 ce 4e 11" +
            "a4 96 38 73 aa 98 13 4a"), // (32 octets)
     },
 
     {P: "passwordPASSWORDpassword",    // (24 octets)
      S: "saltSALTsaltSALTsaltSALTsaltSALTsalt", // (36 octets)
      c: 4096,
      dkLen: 40,
-     DK: h("34 8c 89 db cb d3 2b 2f"+
-           "32 d8 14 b8 11 6e 84 cf"+
-           "2b 17 34 7e bc 18 00 18"+
-           "1c 4e 2a 1f b8 dd 53 e1"+
+     DK: h("34 8c 89 db cb d3 2b 2f" +
+           "32 d8 14 b8 11 6e 84 cf" +
+           "2b 17 34 7e bc 18 00 18" +
+           "1c 4e 2a 1f b8 dd 53 e1" +
            "c6 35 51 8c 7d ac 47 e9"), // (40 octets)
     },
 
     {P: "pass\0word",                  // (9 octets)
      S: "sa\0lt",                      // (5 octets)
      c: 4096,
      dkLen: 16,
-     DK: h("89 b6 9d 05 16 f8 29 89"+
+     DK: h("89 b6 9d 05 16 f8 29 89" +
            "3c 69 62 26 65 0a 86 87"), // (16 octets)
     },
   ];
 
   for (let v of vectors) {
     do_check_eq(v.DK,
         b2h(pbkdf2(v.P, v.S, v.c, v.dkLen, Ci.nsICryptoHMAC.SHA256, 32)));
   }
--- a/services/fxaccounts/Credentials.jsm
+++ b/services/fxaccounts/Credentials.jsm
@@ -45,60 +45,60 @@ var log = Log.repository.getLogger("Iden
 log.level = LOG_LEVEL;
 log.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter()));
 
 this.Credentials = Object.freeze({
   /**
    * Make constants accessible to tests
    */
   constants: {
-    PROTOCOL_VERSION: PROTOCOL_VERSION,
-    PBKDF2_ROUNDS: PBKDF2_ROUNDS,
-    STRETCHED_PW_LENGTH_BYTES: STRETCHED_PW_LENGTH_BYTES,
-    HKDF_SALT: HKDF_SALT,
-    HKDF_LENGTH: HKDF_LENGTH,
-    HMAC_ALGORITHM: HMAC_ALGORITHM,
-    HMAC_LENGTH: HMAC_LENGTH,
+    PROTOCOL_VERSION,
+    PBKDF2_ROUNDS,
+    STRETCHED_PW_LENGTH_BYTES,
+    HKDF_SALT,
+    HKDF_LENGTH,
+    HMAC_ALGORITHM,
+    HMAC_LENGTH,
   },
 
   /**
    * KW function from https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol
    *
    * keyWord derivation for use as a salt.
    *
    *
    *   @param {String} context  String for use in generating salt
    *
    *   @return {bitArray} the salt
    *
    * Note that PROTOCOL_VERSION does not refer in any way to the version of the
    * Firefox Accounts API.
    */
-  keyWord: function(context) {
+  keyWord(context) {
     return CommonUtils.stringToBytes(PROTOCOL_VERSION + context);
   },
 
   /**
    * KWE function from https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol
    *
    * keyWord extended with a name and an email.
    *
    *   @param {String} name The name of the salt
    *   @param {String} email The email of the user.
    *
    *   @return {bitArray} the salt combination with the namespace
    *
    * Note that PROTOCOL_VERSION does not refer in any way to the version of the
    * Firefox Accounts API.
    */
-  keyWordExtended: function(name, email) {
+  keyWordExtended(name, email) {
     return CommonUtils.stringToBytes(PROTOCOL_VERSION + name + ':' + email);
   },
 
-  setup: function(emailInput, passwordInput, options={}) {
+  setup(emailInput, passwordInput, options = {}) {
     let deferred = Promise.defer();
     log.debug("setup credentials for " + emailInput);
 
     let hkdfSalt = options.hkdfSalt || HKDF_SALT;
     let hkdfLength = options.hkdfLength || HKDF_LENGTH;
     let hmacLength = options.hmacLength || HMAC_LENGTH;
     let hmacAlgorithm = options.hmacAlgorithm || HMAC_ALGORITHM;
     let stretchedPWLength = options.stretchedPassLength || STRETCHED_PW_LENGTH_BYTES;
--- a/services/fxaccounts/FxAccounts.jsm
+++ b/services/fxaccounts/FxAccounts.jsm
@@ -161,27 +161,27 @@ AccountState.prototype = {
 
   updateUserAccountData(updatedFields) {
     if (!this.isCurrent) {
       return Promise.reject(new Error("Another user has signed in"));
     }
     return this.storageManager.updateAccountData(updatedFields);
   },
 
-  resolve: function(result) {
+  resolve(result) {
     if (!this.isCurrent) {
       log.info("An accountState promise was resolved, but was actually rejected" +
                " due to a different user being signed in. Originally resolved" +
                " with", result);
       return Promise.reject(new Error("A different user signed in"));
     }
     return Promise.resolve(result);
   },
 
-  reject: function(error) {
+  reject(error) {
     // It could be argued that we should just let it reject with the original
     // error - but this runs the risk of the error being (eg) a 401, which
     // might cause the consumer to attempt some remediation and cause other
     // problems.
     if (!this.isCurrent) {
       log.info("An accountState promise was rejected, but we are ignoring that" +
                "reason and rejecting it due to a different user being signed in." +
                "Originally rejected with", error);
@@ -307,17 +307,17 @@ function copyObjectProperties(from, to, 
 
 function urlsafeBase64Encode(key) {
   return ChromeUtils.base64URLEncode(new Uint8Array(key), { pad: false });
 }
 
 /**
  * The public API's constructor.
  */
-this.FxAccounts = function (mockInternal) {
+this.FxAccounts = function(mockInternal) {
   let internal = new FxAccountsInternal();
   let external = {};
 
   // Copy all public properties to the 'external' object.
   let prototype = FxAccountsInternal.prototype;
   let options = {keys: publicProperties, bind: internal};
   copyObjectProperties(prototype, external, options);
 
@@ -329,17 +329,17 @@ this.FxAccounts = function (mockInternal
   if (mockInternal) {
     // Exposes the internal object for testing only.
     external.internal = internal;
   }
 
   if (!internal.fxaPushService) {
     // internal.fxaPushService option is used in testing.
     // Otherwise we load the service lazily.
-    XPCOMUtils.defineLazyGetter(internal, "fxaPushService", function () {
+    XPCOMUtils.defineLazyGetter(internal, "fxaPushService", function() {
       return Components.classes["@mozilla.org/fxaccounts/push;1"]
         .getService(Components.interfaces.nsISupports)
         .wrappedJSObject;
     });
   }
 
   // wait until after the mocks are setup before initializing.
   internal.initialize();
@@ -388,17 +388,17 @@ FxAccountsInternal.prototype = {
 
   // The profile object used to fetch the actual user profile.
   _profile: null,
   get profile() {
     if (!this._profile) {
       let profileServerUrl = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.profile.uri");
       this._profile = new FxAccountsProfile({
         fxa: this,
-        profileServerUrl: profileServerUrl,
+        profileServerUrl,
       });
     }
     return this._profile;
   },
 
   // A hook-point for tests who may want a mocked AccountState or mocked storage.
   newAccountState(credentials) {
     let storage = new FxAccountsStorageManager();
@@ -406,17 +406,17 @@ FxAccountsInternal.prototype = {
     return new AccountState(storage);
   },
 
   /**
    * Send a message to a set of devices in the same account
    *
    * @return Promise
    */
-  notifyDevices: function(deviceIds, payload, TTL) {
+  notifyDevices(deviceIds, payload, TTL) {
     if (!Array.isArray(deviceIds)) {
       deviceIds = [deviceIds];
     }
     return this.currentAccountState.getUserAccountData()
       .then(data => {
         if (!data) {
           throw this._error(ERROR_NO_ACCOUNT);
         }
@@ -428,21 +428,21 @@ FxAccountsInternal.prototype = {
           payload, TTL);
     });
   },
 
   /**
    * Return the current time in milliseconds as an integer.  Allows tests to
    * manipulate the date to simulate certificate expiration.
    */
-  now: function() {
+  now() {
     return this.fxAccountsClient.now();
   },
 
-  getAccountsClient: function() {
+  getAccountsClient() {
     return this.fxAccountsClient;
   },
 
   /**
    * Return clock offset in milliseconds, as reported by the fxAccountsClient.
    * This can be overridden for testing.
    *
    * The offset is the number of milliseconds that must be added to the client
@@ -709,42 +709,42 @@ FxAccountsInternal.prototype = {
     return this.currentAccountState.getUserAccountData().then(data => {
       if (!data) {
         return false;
       }
       return this.fxAccountsClient.accountStatus(data.uid);
     });
   },
 
-  checkVerificationStatus: function() {
+  checkVerificationStatus() {
     log.trace('checkVerificationStatus');
     let currentState = this.currentAccountState;
     return currentState.getUserAccountData().then(data => {
       if (!data) {
         log.trace("checkVerificationStatus - no user data");
         return null;
       }
 
       // Always check the verification status, even if the local state indicates
       // we're already verified. If the user changed their password, the check
       // will fail, and we'll enter the reauth state.
       log.trace("checkVerificationStatus - forcing verification status check");
       return this.pollEmailStatus(currentState, data.sessionToken, "push");
     });
   },
 
-  _destroyOAuthToken: function(tokenData) {
+  _destroyOAuthToken(tokenData) {
     let client = new FxAccountsOAuthGrantClient({
       serverURL: tokenData.server,
       client_id: FX_OAUTH_CLIENT_ID
     });
     return client.destroyToken(tokenData.token)
   },
 
-  _destroyAllOAuthTokens: function(tokenInfos) {
+  _destroyAllOAuthTokens(tokenInfos) {
     // let's just destroy them all in parallel...
     let promises = [];
     for (let [key, tokenInfo] of Object.entries(tokenInfos || {})) {
       promises.push(this._destroyOAuthToken(tokenInfo));
     }
     return Promise.all(promises);
   },
 
@@ -859,17 +859,17 @@ FxAccountsInternal.prototype = {
    *          uid: The user's unique id
    *          sessionToken: Session for the FxA server
    *          kA: An encryption key from the FxA server
    *          kB: An encryption key derived from the user's FxA password
    *          verified: email verification status
    *        }
    *        or null if no user is signed in
    */
-  getKeys: function() {
+  getKeys() {
     let currentState = this.currentAccountState;
     return currentState.getUserAccountData().then((userData) => {
       if (!userData) {
         throw new Error("Can't get keys; User is not signed in");
       }
       if (userData.kA && userData.kB) {
         return userData;
       }
@@ -895,17 +895,17 @@ FxAccountsInternal.prototype = {
         }
       }
       return currentState.whenKeysReadyDeferred.promise;
     }).catch(err =>
       this._handleTokenError(err)
     ).then(result => currentState.resolve(result));
    },
 
-  fetchAndUnwrapKeys: function(keyFetchToken) {
+  fetchAndUnwrapKeys(keyFetchToken) {
     if (logPII) {
       log.debug("fetchAndUnwrapKeys: token: " + keyFetchToken);
     }
     let currentState = this.currentAccountState;
     return Task.spawn(function* task() {
       // Sign out if we don't have a key fetch token.
       if (!keyFetchToken) {
         log.warn("improper fetchAndUnwrapKeys() call: token missing");
@@ -946,17 +946,17 @@ FxAccountsInternal.prototype = {
       // We are now ready for business. This should only be invoked once
       // per setSignedInUser(), regardless of whether we've rebooted since
       // setSignedInUser() was called.
       this.notifyObservers(ONVERIFIED_NOTIFICATION);
       return currentState.getUserAccountData();
     }.bind(this)).then(result => currentState.resolve(result));
   },
 
-  getAssertionFromCert: function(data, keyPair, cert, audience) {
+  getAssertionFromCert(data, keyPair, cert, audience) {
     log.debug("getAssertionFromCert");
     let payload = {};
     let d = Promise.defer();
     let options = {
       duration: ASSERTION_LIFETIME,
       localtimeOffsetMsec: this.localtimeOffsetMsec,
       now: this.now()
     };
@@ -973,17 +973,17 @@ FxAccountsInternal.prototype = {
           log.debug("getAssertionFromCert returning signed: " + signed);
         }
         d.resolve(signed);
       }
     });
     return d.promise.then(result => currentState.resolve(result));
   },
 
-  getCertificateSigned: function(sessionToken, serializedPublicKey, lifetime) {
+  getCertificateSigned(sessionToken, serializedPublicKey, lifetime) {
     log.debug("getCertificateSigned: " + !!sessionToken + " " + !!serializedPublicKey);
     if (logPII) {
       log.debug("getCertificateSigned: " + sessionToken + " " + serializedPublicKey);
     }
     return this.fxAccountsClient.signCertificate(
       sessionToken,
       JSON.parse(serializedPublicKey),
       lifetime
@@ -998,17 +998,17 @@ FxAccountsInternal.prototype = {
     // then don't use any cached key pair/certificate, i.e., generate a new
     // one and get it signed.
     // The purpose of this pref is to expedite any auth errors as the result of a
     // expired or revoked FxA session token, e.g., from resetting or changing the FxA
     // password.
     let ignoreCachedAuthCredentials = false;
     try {
       ignoreCachedAuthCredentials = Services.prefs.getBoolPref("services.sync.debug.ignoreCachedAuthCredentials");
-    } catch(e) {
+    } catch (e) {
       // Pref doesn't exist
     }
     let mustBeValidUntil = this.now() + ASSERTION_USE_PERIOD;
     let accountData = yield currentState.getUserAccountData(["cert", "keyPair", "sessionToken"]);
 
     let keyPairValid = !ignoreCachedAuthCredentials &&
                        accountData.keyPair &&
                        (accountData.keyPair.validUntil > mustBeValidUntil);
@@ -1069,46 +1069,46 @@ FxAccountsInternal.prototype = {
           rawCert: certificate,
           validUntil: certWillBeValidUntil,
         },
       };
       yield currentState.updateUserAccountData(toUpdate);
     }
     return {
       keyPair: keyPair.rawKeyPair,
-      certificate: certificate,
+      certificate,
     }
   }),
 
-  getUserAccountData: function() {
+  getUserAccountData() {
     return this.currentAccountState.getUserAccountData();
   },
 
   isUserEmailVerified: function isUserEmailVerified(data) {
     return !!(data && data.verified);
   },
 
   /**
    * Setup for and if necessary do email verification polling.
    */
-  loadAndPoll: function() {
+  loadAndPoll() {
     let currentState = this.currentAccountState;
     return currentState.getUserAccountData()
       .then(data => {
         if (data) {
           Services.telemetry.getHistogramById("FXA_CONFIGURED").add(1);
           if (!this.isUserEmailVerified(data)) {
             this.pollEmailStatus(currentState, data.sessionToken, "start");
           }
         }
         return data;
       });
   },
 
-  startVerifiedCheck: function(data) {
+  startVerifiedCheck(data) {
     log.debug("startVerifiedCheck", data && data.verified);
     if (logPII) {
       log.debug("startVerifiedCheck with user data", data);
     }
 
     // Get us to the verified state, then get the keys. This returns a promise
     // that will fire when we are completely ready.
     //
@@ -1120,32 +1120,32 @@ FxAccountsInternal.prototype = {
     // this is simply kicking off a background fetch) so we must add a rejection
     // handler to avoid runtime warnings about the rejection not being handled.
     this.whenVerified(data).then(
       () => this.getKeys(),
       err => log.info("startVerifiedCheck promise was rejected: " + err)
     );
   },
 
-  whenVerified: function(data) {
+  whenVerified(data) {
     let currentState = this.currentAccountState;
     if (data.verified) {
       log.debug("already verified");
       return currentState.resolve(data);
     }
     if (!currentState.whenVerifiedDeferred) {
       log.debug("whenVerified promise starts polling for verified email");
       this.pollEmailStatus(currentState, data.sessionToken, "start");
     }
     return currentState.whenVerifiedDeferred.promise.then(
       result => currentState.resolve(result)
     );
   },
 
-  notifyObservers: function(topic, data) {
+  notifyObservers(topic, data) {
     log.debug("Notifying observers of " + topic);
     Services.obs.notifyObservers(null, topic, data);
   },
 
   // XXX - pollEmailStatus should maybe be on the AccountState object?
   pollEmailStatus: function pollEmailStatus(currentState, sessionToken, why) {
     log.debug("entering pollEmailStatus: " + why);
     if (why == "start" || why == "push") {
@@ -1212,17 +1212,17 @@ FxAccountsInternal.prototype = {
   },
 
   _rejectWhenVerified(currentState, error) {
     currentState.whenVerifiedDeferred.reject(error);
     delete currentState.whenVerifiedDeferred;
   },
 
   // Poll email status using truncated exponential back-off.
-  pollEmailStatusAgain: function (currentState, sessionToken, timeoutMs) {
+  pollEmailStatusAgain(currentState, sessionToken, timeoutMs) {
     let ageMs = Date.now() - this.pollStartDate;
     if (ageMs >= this.POLL_SESSION) {
       if (currentState.whenVerifiedDeferred) {
         let error = new Error("User email verification timed out.");
         this._rejectWhenVerified(currentState, error);
       }
       log.debug("polling session exceeded, giving up");
       return;
@@ -1233,21 +1233,21 @@ FxAccountsInternal.prototype = {
                                      : this.VERIFICATION_POLL_TIMEOUT_SUBSEQUENT;
     }
     log.debug("polling with timeout = " + timeoutMs);
     this.currentTimer = setTimeout(() => {
       this.pollEmailStatus(currentState, sessionToken, "timer");
     }, timeoutMs);
   },
 
-  requiresHttps: function() {
+  requiresHttps() {
     let allowHttp = false;
     try {
       allowHttp = Services.prefs.getBoolPref("identity.fxaccounts.allowHttp");
-    } catch(e) {
+    } catch (e) {
       // Pref doesn't exist
     }
     return allowHttp !== true;
   },
 
   promiseAccountsSignUpURI() {
     return FxAccountsConfig.promiseAccountsSignUpURI();
   },
@@ -1275,17 +1275,17 @@ FxAccountsInternal.prototype = {
       return url + newQueryPortion;
     }).then(result => currentState.resolve(result));
   }),
 
   // Returns a promise that resolves with the URL to use to change
   // the current account's profile image.
   // if settingToEdit is set, the profile page should hightlight that setting
   // for the user to edit.
-  promiseAccountsChangeProfileURI: function(entrypoint, settingToEdit = null) {
+  promiseAccountsChangeProfileURI(entrypoint, settingToEdit = null) {
     let url = Services.urlFormatter.formatURLPref("identity.fxaccounts.settings.uri");
 
     if (settingToEdit) {
       url += (url.indexOf("?") == -1 ? "?" : "&") +
              "setting=" + encodeURIComponent(settingToEdit);
     }
 
     if (this.requiresHttps() && !/^https:/.test(url)) { // Comment to un-break emacs js-mode highlighting
@@ -1304,17 +1304,17 @@ FxAccountsInternal.prototype = {
         newQueryPortion += "&entrypoint=" + encodeURIComponent(entrypoint);
       }
       return url + newQueryPortion;
     }).then(result => currentState.resolve(result));
   },
 
   // Returns a promise that resolves with the URL to use to manage the current
   // user's FxA acct.
-  promiseAccountsManageURI: function(entrypoint) {
+  promiseAccountsManageURI(entrypoint) {
     let url = Services.urlFormatter.formatURLPref("identity.fxaccounts.settings.uri");
     if (this.requiresHttps() && !/^https:/.test(url)) { // Comment to un-break emacs js-mode highlighting
       throw new Error("Firefox Accounts server must use HTTPS");
     }
     let currentState = this.currentAccountState;
     // but we need to append the uid and email address onto a query string
     // (if the server has no matching uid it will offer to sign in with the
     // email address)
@@ -1392,17 +1392,17 @@ FxAccountsInternal.prototype = {
 
     try {
       log.debug("getOAuthToken fetching new token from", oAuthURL);
       let assertion = yield this.getAssertion(oAuthURL);
       let result = yield client.getTokenFromAssertion(assertion, scopeString);
       let token = result.access_token;
       // If we got one, cache it.
       if (token) {
-        let entry = {token: token, server: oAuthURL};
+        let entry = {token, server: oAuthURL};
         // But before we do, check the cache again - if we find one now, it
         // means someone else concurrently requested the same scope and beat
         // us to the cache write. To be nice to the server, we revoke the one
         // we just got and return the newly cached value.
         let cached = currentState.getCachedToken(scope);
         if (cached) {
           log.debug("Detected a race for this token - revoking the new one.");
           this._destroyOAuthToken(entry);
@@ -1460,31 +1460,31 @@ FxAccountsInternal.prototype = {
    *          AUTH_ERROR
    *          UNKNOWN_ERROR
    *
    * These errors will pass through:
    *          INVALID_PARAMETER
    *          NO_ACCOUNT
    *          UNVERIFIED_ACCOUNT
    */
-  _errorToErrorClass: function (aError) {
+  _errorToErrorClass(aError) {
     if (aError.errno) {
       let error = SERVER_ERRNO_TO_ERROR[aError.errno];
       return this._error(ERROR_TO_GENERAL_ERROR_CLASS[error] || ERROR_UNKNOWN, aError);
     } else if (aError.message &&
         (aError.message === "INVALID_PARAMETER" ||
         aError.message === "NO_ACCOUNT" ||
         aError.message === "UNVERIFIED_ACCOUNT" ||
         aError.message === "AUTH_ERROR")) {
       return aError;
     }
     return this._error(ERROR_UNKNOWN, aError);
   },
 
-  _error: function(aError, aDetails) {
+  _error(aError, aDetails) {
     log.error("FxA rejecting with error ${aError}, details: ${aDetails}", {aError, aDetails});
     let reason = new Error(aError);
     if (aDetails) {
       reason.details = aDetails;
     }
     return reason;
   },
 
@@ -1505,17 +1505,17 @@ FxAccountsInternal.prototype = {
    *        an error object ({error: ERROR, details: {}}) of the following:
    *          INVALID_PARAMETER
    *          NO_ACCOUNT
    *          UNVERIFIED_ACCOUNT
    *          NETWORK_ERROR
    *          AUTH_ERROR
    *          UNKNOWN_ERROR
    */
-  getSignedInUserProfile: function () {
+  getSignedInUserProfile() {
     let currentState = this.currentAccountState;
     return this.profile.getProfile().then(
       profileData => {
         let profile = Cu.cloneInto(profileData, {});
         return currentState.resolve(profile);
       },
       error => {
         log.error("Could not retrieve profile data", error);
@@ -1584,17 +1584,17 @@ FxAccountsInternal.prototype = {
     try {
       // Allow tests to skip device registration because:
       //   1. It makes remote requests to the auth server.
       //   2. _getDeviceName does not work from xpcshell.
       //   3. The B2G tests fail when attempting to import services-sync/util.js.
       if (Services.prefs.getBoolPref("identity.fxaccounts.skipDeviceRegistration")) {
         return Promise.resolve();
       }
-    } catch(ignore) {}
+    } catch (ignore) {}
 
     if (!signedInUser.sessionToken) {
       return Promise.reject(new Error(
         "_registerOrUpdateDevice called without a session token"));
     }
 
     return this.fxaPushService.registerPushEndpoint().then(subscription => {
       const deviceName = this._getDeviceName();
--- a/services/fxaccounts/FxAccountsClient.jsm
+++ b/services/fxaccounts/FxAccountsClient.jsm
@@ -50,17 +50,17 @@ this.FxAccountsClient.prototype = {
   },
 
   /*
    * Return current time in milliseconds
    *
    * Not used by this module, but made available to the FxAccounts.jsm
    * that uses this client.
    */
-  now: function() {
+  now() {
     return this.hawk.now();
   },
 
   /**
    * Common code from signIn and signUp.
    *
    * @param path
    *        Request URL path. Can be /account/create or /account/login
@@ -82,22 +82,22 @@ this.FxAccountsClient.prototype = {
    *          sessionToken: a session token (hex)
    *          uid: the user's unique ID (hex)
    *          unwrapBKey: used to unwrap kB, derived locally from the
    *                      password (not revealed to the FxA server)
    *          verified (optional): flag indicating verification status of the
    *                               email
    *        }
    */
-  _createSession: function(path, email, password, getKeys=false,
-                           retryOK=true) {
+  _createSession(path, email, password, getKeys = false,
+                 retryOK = true) {
     return Credentials.setup(email, password).then((creds) => {
       let data = {
         authPW: CommonUtils.bytesAsHex(creds.authPW),
-        email: email,
+        email,
       };
       let keys = getKeys ? "?keys=true" : "";
 
       return this._request(path + keys, "POST", null, data).then(
         // Include the canonical capitalization of the email in the response so
         // the caller can set its signed-in user state accordingly.
         result => {
           result.email = data.email;
@@ -146,17 +146,17 @@ this.FxAccountsClient.prototype = {
    *        {
    *          uid: the user's unique ID (hex)
    *          sessionToken: a session token (hex)
    *          keyFetchToken: a key fetch token (hex),
    *          unwrapBKey: used to unwrap kB, derived locally from the
    *                      password (not revealed to the FxA server)
    *        }
    */
-  signUp: function(email, password, getKeys=false) {
+  signUp(email, password, getKeys = false) {
     return this._createSession(SIGNUP, email, password, getKeys,
                                false /* no retry */);
   },
 
   /**
    * Authenticate and create a new session with the Firefox Account API server
    *
    * @param email
@@ -173,30 +173,30 @@ this.FxAccountsClient.prototype = {
    *          keyFetchToken: a key fetch token (hex)
    *          sessionToken: a session token (hex)
    *          uid: the user's unique ID (hex)
    *          unwrapBKey: used to unwrap kB, derived locally from the
    *                      password (not revealed to the FxA server)
    *          verified: flag indicating verification status of the email
    *        }
    */
-  signIn: function signIn(email, password, getKeys=false) {
+  signIn: function signIn(email, password, getKeys = false) {
     return this._createSession(SIGNIN, email, password, getKeys,
                                true /* retry */);
   },
 
   /**
    * Check the status of a session given a session token
    *
    * @param sessionTokenHex
    *        The session token encoded in hex
    * @return Promise
    *        Resolves with a boolean indicating if the session is still valid
    */
-  sessionStatus: function (sessionTokenHex) {
+  sessionStatus(sessionTokenHex) {
     return this._request("/session/status", "GET",
       deriveHawkCredentials(sessionTokenHex, "sessionToken")).then(
         () => Promise.resolve(true),
         error => {
           if (isInvalidTokenError(error)) {
             return Promise.resolve(false);
           }
           throw error;
@@ -206,50 +206,50 @@ this.FxAccountsClient.prototype = {
 
   /**
    * Destroy the current session with the Firefox Account API server
    *
    * @param sessionTokenHex
    *        The session token encoded in hex
    * @return Promise
    */
-  signOut: function (sessionTokenHex, options = {}) {
+  signOut(sessionTokenHex, options = {}) {
     let path = "/session/destroy";
     if (options.service) {
       path += "?service=" + encodeURIComponent(options.service);
     }
     return this._request(path, "POST",
       deriveHawkCredentials(sessionTokenHex, "sessionToken"));
   },
 
   /**
    * Check the verification status of the user's FxA email address
    *
    * @param sessionTokenHex
    *        The current session token encoded in hex
    * @return Promise
    */
-  recoveryEmailStatus: function (sessionTokenHex, options = {}) {
+  recoveryEmailStatus(sessionTokenHex, options = {}) {
     let path = "/recovery_email/status";
     if (options.reason) {
       path += "?reason=" + encodeURIComponent(options.reason);
     }
 
     return this._request(path, "GET",
       deriveHawkCredentials(sessionTokenHex, "sessionToken"));
   },
 
   /**
    * Resend the verification email for the user
    *
    * @param sessionTokenHex
    *        The current token encoded in hex
    * @return Promise
    */
-  resendVerificationEmail: function(sessionTokenHex) {
+  resendVerificationEmail(sessionTokenHex) {
     return this._request("/recovery_email/resend_code", "POST",
       deriveHawkCredentials(sessionTokenHex, "sessionToken"));
   },
 
   /**
    * Retrieve encryption keys
    *
    * @param keyFetchTokenHex
@@ -257,17 +257,17 @@ this.FxAccountsClient.prototype = {
    * @return Promise
    *        Returns a promise that resolves to an object:
    *        {
    *          kA: an encryption key for recevorable data (bytes)
    *          wrapKB: an encryption key that requires knowledge of the
    *                  user's password (bytes)
    *        }
    */
-  accountKeys: function (keyFetchTokenHex) {
+  accountKeys(keyFetchTokenHex) {
     let creds = deriveHawkCredentials(keyFetchTokenHex, "keyFetchToken");
     let keyRequestKey = creds.extra.slice(0, 32);
     let morecreds = CryptoUtils.hkdf(keyRequestKey, undefined,
                                      Credentials.keyWord("account/keys"), 3 * 32);
     let respHMACKey = morecreds.slice(0, 32);
     let respXORKey = morecreds.slice(32, 96);
 
     return this._request("/account/keys", "GET", creds).then(resp => {
@@ -306,17 +306,17 @@ this.FxAccountsClient.prototype = {
    *        The lifetime of the certificate
    * @return Promise
    *        Returns a promise that resolves to the signed certificate.
    *        The certificate can be used to generate a Persona assertion.
    * @throws a new Error
    *         wrapping any of these HTTP code/errno pairs:
    *           https://github.com/mozilla/fxa-auth-server/blob/master/docs/api.md#response-12
    */
-  signCertificate: function (sessionTokenHex, serializedPublicKey, lifetime) {
+  signCertificate(sessionTokenHex, serializedPublicKey, lifetime) {
     let creds = deriveHawkCredentials(sessionTokenHex, "sessionToken");
 
     let body = { publicKey: serializedPublicKey,
                  duration: lifetime };
     return Promise.resolve()
       .then(_ => this._request("/certificate/sign", "POST", creds, body))
       .then(resp => resp.cert,
             err => {
@@ -329,17 +329,17 @@ this.FxAccountsClient.prototype = {
    * Determine if an account exists
    *
    * @param email
    *        The email address to check
    * @return Promise
    *        The promise resolves to true if the account exists, or false
    *        if it doesn't. The promise is rejected on other errors.
    */
-  accountExists: function (email) {
+  accountExists(email) {
     return this.signIn(email, "").then(
       (cantHappen) => {
         throw new Error("How did I sign in with an empty password?");
       },
       (expectedError) => {
         switch (expectedError.errno) {
           case ERRNO_ACCOUNT_DOES_NOT_EXIST:
             return false;
@@ -357,18 +357,18 @@ this.FxAccountsClient.prototype = {
   },
 
   /**
    * Given the uid of an existing account (not an arbitrary email), ask
    * the server if it still exists via /account/status.
    *
    * Used for differentiating between password change and account deletion.
    */
-  accountStatus: function(uid) {
-    return this._request("/account/status?uid="+uid, "GET").then(
+  accountStatus(uid) {
+    return this._request("/account/status?uid=" + uid, "GET").then(
       (result) => {
         return result.exists;
       },
       (error) => {
         log.error("accountStatus failed with: " + error);
         return Promise.reject(error);
       }
     );
@@ -535,17 +535,17 @@ this.FxAccountsClient.prototype = {
    */
   getDeviceList(sessionTokenHex) {
     let path = "/account/devices";
     let creds = deriveHawkCredentials(sessionTokenHex, "sessionToken");
 
     return this._request(path, "GET", creds, {});
   },
 
-  _clearBackoff: function() {
+  _clearBackoff() {
       this.backoffError = null;
   },
 
   /**
    * A general method for sending raw API calls to the FxA auth server.
    * All request bodies and responses are JSON.
    *
    * @param path
--- a/services/fxaccounts/FxAccountsManager.jsm
+++ b/services/fxaccounts/FxAccountsManager.jsm
@@ -22,22 +22,22 @@ Cu.import("resource://gre/modules/Promis
 Cu.import("resource://gre/modules/FxAccountsCommon.js");
 
 XPCOMUtils.defineLazyServiceGetter(this, "permissionManager",
                                    "@mozilla.org/permissionmanager;1",
                                    "nsIPermissionManager");
 
 this.FxAccountsManager = {
 
-  init: function() {
+  init() {
     Services.obs.addObserver(this, ONLOGOUT_NOTIFICATION, false);
     Services.obs.addObserver(this, ON_FXA_UPDATE_NOTIFICATION, false);
   },
 
-  observe: function(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     // Both topics indicate our cache is invalid
     this._activeSession = null;
 
     if (aData == ONVERIFIED_NOTIFICATION) {
       log.debug("FxAccountsManager: cache cleared, broadcasting: " + aData);
       Services.obs.notifyObservers(null, aData, null);
     }
   },
@@ -62,50 +62,50 @@ this.FxAccountsManager = {
 
     return {
       email: this._activeSession.email,
       verified: this._activeSession.verified,
       profile: this._activeSession.profile,
     }
   },
 
-  _error: function(aError, aDetails) {
+  _error(aError, aDetails) {
     log.error(aError);
     let reason = {
       error: aError
     };
     if (aDetails) {
       reason.details = aDetails;
     }
     return Promise.reject(reason);
   },
 
-  _getError: function(aServerResponse) {
+  _getError(aServerResponse) {
     if (!aServerResponse || !aServerResponse.error || !aServerResponse.error.errno) {
       return;
     }
     let error = SERVER_ERRNO_TO_ERROR[aServerResponse.error.errno];
     return error;
   },
 
-  _serverError: function(aServerResponse) {
+  _serverError(aServerResponse) {
     let error = this._getError({ error: aServerResponse });
     return this._error(error ? error : ERROR_SERVER_ERROR, aServerResponse);
   },
 
   // As with _fxAccounts, we don't really need this method, but this way we
   // allow tests to mock FxAccountsClient.  By default, we want to return the
   // client used by the fxAccounts object because deep down they should have
   // access to the same hawk request object which will enable them to share
   // local clock skeq data.
-  _getFxAccountsClient: function() {
+  _getFxAccountsClient() {
     return this._fxAccounts.getAccountsClient();
   },
 
-  _signInSignUp: function(aMethod, aEmail, aPassword, aFetchKeys) {
+  _signInSignUp(aMethod, aEmail, aPassword, aFetchKeys) {
     if (Services.io.offline) {
       return this._error(ERROR_OFFLINE);
     }
 
     if (!aEmail) {
       return this._error(ERROR_INVALID_EMAIL);
     }
 
@@ -130,17 +130,17 @@ this.FxAccountsManager = {
         }
         return client[aMethod](aEmail, aPassword, aFetchKeys);
       }
     ).then(
       user => {
         let error = this._getError(user);
         if (!user || !user.uid || !user.sessionToken || error) {
           return this._error(error ? error : ERROR_INTERNAL_INVALID_USER, {
-            user: user
+            user
           });
         }
 
         // If the user object includes an email field, it may differ in
         // capitalization from what we sent down.  This is the server's
         // canonical capitalization and should be used instead.
         user.email = user.email || aEmail;
 
@@ -194,17 +194,17 @@ this.FxAccountsManager = {
    *
    * As of May 2014, the only HTTP call triggered by this._getAssertion()
    * is to /certificate/sign via:
    *   FxAccounts.getAssertion()
    *     FxAccountsInternal.getCertificateSigned()
    *       FxAccountsClient.signCertificate()
    * See the latter method for possible (error code, errno) pairs.
    */
-  _handleGetAssertionError: function(reason, aAudience, aPrincipal) {
+  _handleGetAssertionError(reason, aAudience, aPrincipal) {
     log.debug("FxAccountsManager._handleGetAssertionError()");
     let errno = (reason ? reason.errno : NaN) || NaN;
     // If the previously valid email/password pair is no longer valid ...
     if (errno == ERRNO_INVALID_AUTH_TOKEN) {
       return this._fxAccounts.accountStatus().then(
         (exists) => {
           // ... if the email still maps to an account, the password
           // must have changed, so ask the user to enter the new one ...
@@ -231,17 +231,17 @@ this.FxAccountsManager = {
             }
           );
         }
       );
     }
     return Promise.reject(reason.message ? { error: reason.message } : reason);
   },
 
-  _getAssertion: function(aAudience, aPrincipal) {
+  _getAssertion(aAudience, aPrincipal) {
     return this._fxAccounts.getAssertion(aAudience).then(
       (result) => {
         if (aPrincipal) {
           this._addPermission(aPrincipal);
         }
         return result;
       },
       (reason) => {
@@ -255,18 +255,18 @@ this.FxAccountsManager = {
    *   Interactively demonstrate knowledge of the FxA password
    *   for the currently logged-in account.
    * There are two very different scenarios:
    *   1) The password has changed on the server. Failure should log
    *      the current account OUT.
    *   2) The person typing can't prove knowledge of the password used
    *      to log in. Failure should do nothing.
    */
-  _refreshAuthentication: function(aAudience, aEmail, aPrincipal,
-                                   logoutOnFailure=false) {
+  _refreshAuthentication(aAudience, aEmail, aPrincipal,
+                         logoutOnFailure = false) {
     this._refreshing = true;
     return this._uiRequest(UI_REQUEST_REFRESH_AUTH,
                            aAudience, aPrincipal, aEmail).then(
       (assertion) => {
         this._refreshing = false;
         return assertion;
       },
       (reason) => {
@@ -278,21 +278,21 @@ this.FxAccountsManager = {
             }
           );
         }
         return this._error(reason);
       }
     );
   },
 
-  _localSignOut: function() {
+  _localSignOut() {
     return this._fxAccounts.signOut(true);
   },
 
-  _signOut: function() {
+  _signOut() {
     if (!this._activeSession) {
       return Promise.resolve();
     }
 
     // We clear the local session cache as soon as we get the onlogout
     // notification triggered within FxAccounts.signOut, so we save the
     // session token value to be able to remove the remote server session
     // in case that we have network connection.
@@ -321,17 +321,17 @@ this.FxAccountsManager = {
           reason => {
             return this._serverError(reason);
           }
         );
       }
     );
   },
 
-  _uiRequest: function(aRequest, aAudience, aPrincipal, aParams) {
+  _uiRequest(aRequest, aAudience, aPrincipal, aParams) {
     if (Services.io.offline) {
       return this._error(ERROR_OFFLINE);
     }
     let ui = Cc["@mozilla.org/fxaccounts/fxaccounts-ui-glue;1"]
                .createInstance(Ci.nsIFxAccountsUIGlue);
     if (!ui[aRequest]) {
       return this._error(ERROR_UI_REQUEST);
     }
@@ -353,65 +353,65 @@ this.FxAccountsManager = {
         });
       },
       error => {
         return this._error(ERROR_UI_ERROR, error);
       }
     );
   },
 
-  _addPermission: function(aPrincipal) {
+  _addPermission(aPrincipal) {
     // This will fail from tests cause we are running them in the child
     // process until we have chrome tests in b2g. Bug 797164.
     try {
       permissionManager.addFromPrincipal(aPrincipal, FXACCOUNTS_PERMISSION,
                                          Ci.nsIPermissionManager.ALLOW_ACTION);
     } catch (e) {
       log.warn("Could not add permission " + e);
     }
   },
 
   // -- API --
 
-  signIn: function(aEmail, aPassword, aFetchKeys) {
+  signIn(aEmail, aPassword, aFetchKeys) {
     return this._signInSignUp("signIn", aEmail, aPassword, aFetchKeys);
   },
 
-  signUp: function(aEmail, aPassword, aFetchKeys) {
+  signUp(aEmail, aPassword, aFetchKeys) {
     return this._signInSignUp("signUp", aEmail, aPassword, aFetchKeys);
   },
 
-  signOut: function() {
+  signOut() {
     if (!this._activeSession) {
       // If there is no cached active session, we try to get it from the
       // account storage.
       return this.getAccount().then(
         result => {
           if (!result) {
             return Promise.resolve();
           }
           return this._signOut();
         }
       );
     }
     return this._signOut();
   },
 
-  resendVerificationEmail: function() {
+  resendVerificationEmail() {
     return this._fxAccounts.resendVerificationEmail().then(
       (result) => {
         return result;
       },
       (error) => {
         return this._error(ERROR_SERVER_ERROR, error);
       }
     );
   },
 
-  getAccount: function() {
+  getAccount() {
     // We check first if we have session details cached.
     if (this._activeSession) {
       // If our cache says that the account is not yet verified,
       // we kick off verification before returning what we have.
       if (!this._activeSession.verified) {
         this.verificationStatus(this._activeSession);
       }
       log.debug("Account " + JSON.stringify(this._user));
@@ -447,17 +447,17 @@ this.FxAccountsManager = {
           // FxAccounts logs already inform about the error.
           log.debug("Account ", this._user);
           return Promise.resolve(this._user);
         });
       }
     );
   },
 
-  queryAccount: function(aEmail) {
+  queryAccount(aEmail) {
     log.debug("queryAccount " + aEmail);
     if (Services.io.offline) {
       return this._error(ERROR_OFFLINE);
     }
 
     let deferred = Promise.defer();
 
     if (!aEmail) {
@@ -476,17 +476,17 @@ this.FxAccountsManager = {
         return Promise.resolve({
           registered: result
         });
       },
       reason => { this._serverError(reason); }
     );
   },
 
-  verificationStatus: function() {
+  verificationStatus() {
     log.debug("verificationStatus");
     if (!this._activeSession || !this._activeSession.sessionToken) {
       this._error(ERROR_NO_TOKEN_SESSION);
     }
 
     // There is no way to unverify an already verified account, so we just
     // return the account details of a verified account
     if (this._activeSession.verified) {
@@ -540,33 +540,33 @@ this.FxAccountsManager = {
    *      trigger either the sign in or refresh flows (if our account
    *      changed on the server).
    *
    * aOptions can include:
    *   refreshAuthentication  - (bool) Force re-auth.
    *   silent                 - (bool) Prevent any UI interaction.
    *                            I.e., try to get an automatic assertion.
    */
-  getAssertion: function(aAudience, aPrincipal, aOptions) {
+  getAssertion(aAudience, aPrincipal, aOptions) {
     if (!aAudience) {
       return this._error(ERROR_INVALID_AUDIENCE);
     }
 
     let principal = aPrincipal;
     log.debug("FxAccountsManager.getAssertion() aPrincipal: ",
               principal.origin, principal.appId,
               principal.isInIsolatedMozBrowserElement);
 
     return this.getAccount().then(
       user => {
         if (user) {
           // Three have-user cases to consider. First: are we unverified?
           if (!user.verified) {
             return this._error(ERROR_UNVERIFIED_ACCOUNT, {
-              user: user
+              user
             });
           }
           // Second case: do we need to refresh?
           if (aOptions &&
               (typeof(aOptions.refreshAuthentication) != "undefined")) {
             let gracePeriod = aOptions.refreshAuthentication;
             if (typeof(gracePeriod) !== "number" || isNaN(gracePeriod)) {
               return this._error(ERROR_INVALID_REFRESH_AUTH_VALUE);
@@ -615,38 +615,38 @@ this.FxAccountsManager = {
         if (aOptions && aOptions.silent) {
           return Promise.resolve(null);
         }
         return this._uiRequest(UI_REQUEST_SIGN_IN_FLOW, aAudience, principal);
       }
     );
   },
 
-  getKeys: function() {
+  getKeys() {
     let syncEnabled = false;
     try {
       syncEnabled = Services.prefs.getBoolPref("services.sync.enabled");
-    } catch(e) {
+    } catch (e) {
       dump("Sync is disabled, so you won't get the keys. " + e + "\n");
     }
 
     if (!syncEnabled) {
       return Promise.reject(ERROR_SYNC_DISABLED);
     }
 
     return this.getAccount().then(
       user => {
         if (!user) {
           log.debug("No signed in user");
           return Promise.resolve(null);
         }
 
         if (!user.verified) {
           return this._error(ERROR_UNVERIFIED_ACCOUNT, {
-            user: user
+            user
           });
         }
 
         return this._fxAccounts.getKeys();
       }
     );
   }
 };
--- a/services/fxaccounts/FxAccountsOAuthClient.jsm
+++ b/services/fxaccounts/FxAccountsOAuthClient.jsm
@@ -111,73 +111,73 @@ this.FxAccountsOAuthClient.prototype = {
   /**
    * WebChannel origin, used to validate origin of messages.
    */
   _webChannelOrigin: null,
   /**
    * Opens a tab at "this._fxaOAuthStartUrl".
    * Registers a WebChannel listener and sets up a callback if needed.
    */
-  launchWebFlow: function () {
+  launchWebFlow() {
     if (!this._channelCallback) {
       this._registerChannel();
     }
 
     if (this._complete) {
       throw new Error("This client already completed the OAuth flow");
     } else {
       let opener = Services.wm.getMostRecentWindow("navigator:browser").gBrowser;
       opener.selectedTab = opener.addTab(this._fxaOAuthStartUrl.href);
     }
   },
 
   /**
    * Release all resources that are in use.
    */
-  tearDown: function() {
+  tearDown() {
     this.onComplete = null;
     this.onError = null;
     this._complete = true;
     this._channel.stopListening();
     this._channel = null;
   },
 
   /**
    * Configures WebChannel id and origin
    *
    * @private
    */
-  _configureChannel: function() {
+  _configureChannel() {
     this._webChannelId = "oauth_" + this.parameters.client_id;
 
     // if this.parameters.content_uri is present but not a valid URI, then this will throw an error.
     try {
       this._webChannelOrigin = Services.io.newURI(this.parameters.content_uri);
     } catch (e) {
       throw e;
     }
   },
 
   /**
    * Create a new channel with the WebChannelBroker, setup a callback listener
    * @private
    */
-  _registerChannel: function() {
+  _registerChannel() {
     /**
      * Processes messages that are called back from the FxAccountsChannel
      *
      * @param webChannelId {String}
      *        Command webChannelId
      * @param message {Object}
      *        Command message
      * @param sendingContext {Object}
      *        Channel message event sendingContext
      * @private
      */
-    let listener = function (webChannelId, message, sendingContext) {
+    let listener = function(webChannelId, message, sendingContext) {
       if (message) {
         let command = message.command;
         let data = message.data;
         let target = sendingContext && sendingContext.browser;
 
         switch (command) {
           case "oauth_complete":
             // validate the returned state and call onComplete or onError
@@ -246,17 +246,17 @@ this.FxAccountsOAuthClient.prototype = {
 
   /**
    * Validates the required FxA OAuth parameters
    *
    * @param options {Object}
    *        OAuth client options
    * @private
    */
-  _validateOptions: function (options) {
+  _validateOptions(options) {
     if (!options || !options.parameters) {
       throw new Error("Missing 'parameters' configuration option");
     }
 
     ["oauth_uri", "client_id", "content_uri", "state"].forEach(option => {
       if (!options.parameters[option]) {
         throw new Error("Missing 'parameters." + option + "' parameter");
       }
--- a/services/fxaccounts/FxAccountsOAuthGrantClient.jsm
+++ b/services/fxaccounts/FxAccountsOAuthGrantClient.jsm
@@ -54,60 +54,60 @@ this.FxAccountsOAuthGrantClient.prototyp
   /**
    * Retrieves an OAuth access token for the signed in user
    *
    * @param {Object} assertion BrowserID assertion
    * @param {String} scope OAuth scope
    * @return Promise
    *        Resolves: {Object} Object with access_token property
    */
-  getTokenFromAssertion: function (assertion, scope) {
+  getTokenFromAssertion(assertion, scope) {
     if (!assertion) {
       throw new Error("Missing 'assertion' parameter");
     }
     if (!scope) {
       throw new Error("Missing 'scope' parameter");
     }
     let params = {
-      scope: scope,
+      scope,
       client_id: this.parameters.client_id,
-      assertion: assertion,
+      assertion,
       response_type: "token"
     };
 
     return this._createRequest(AUTH_ENDPOINT, "POST", params);
   },
 
   /**
    * Destroys a previously fetched OAuth access token.
    *
    * @param {String} token The previously fetched token
    * @return Promise
    *        Resolves: {Object} with the server response, which is typically
    *        ignored.
    */
-  destroyToken: function (token) {
+  destroyToken(token) {
     if (!token) {
       throw new Error("Missing 'token' parameter");
     }
     let params = {
-      token: token,
+      token,
     };
 
     return this._createRequest(DESTROY_ENDPOINT, "POST", params);
   },
 
   /**
    * Validates the required FxA OAuth parameters
    *
    * @param options {Object}
    *        OAuth client options
    * @private
    */
-  _validateOptions: function (options) {
+  _validateOptions(options) {
     if (!options) {
       throw new Error("Missing configuration options");
     }
 
     ["serverURL", "client_id"].forEach(option => {
       if (!options[option]) {
         throw new Error("Missing '" + option + "' parameter");
       }
@@ -126,26 +126,26 @@ this.FxAccountsOAuthGrantClient.prototyp
    *        Profile server path, i.e "/profile".
    * @param {String} [method]
    *        Type of request, i.e "GET".
    * @return Promise
    *         Resolves: {Object} Successful response from the Profile server.
    *         Rejects: {FxAccountsOAuthGrantClientError} Profile client error.
    * @private
    */
-  _createRequest: function(path, method = "POST", params) {
+  _createRequest(path, method = "POST", params) {
     return new Promise((resolve, reject) => {
       let profileDataUrl = this.serverURL + path;
       let request = new this._Request(profileDataUrl);
       method = method.toUpperCase();
 
       request.setHeader("Accept", "application/json");
       request.setHeader("Content-Type", "application/json");
 
-      request.onComplete = function (error) {
+      request.onComplete = function(error) {
         if (error) {
           return reject(new FxAccountsOAuthGrantClientError({
             error: ERROR_NETWORK,
             errno: ERRNO_NETWORK,
             message: error.toString(),
           }));
         }
 
--- a/services/fxaccounts/FxAccountsProfile.jsm
+++ b/services/fxaccounts/FxAccountsProfile.jsm
@@ -66,17 +66,17 @@ function objEquiv(a, b) {
   }
   return true;
 }
 
 function hasChanged(oldData, newData) {
   return !deepEqual(oldData, newData);
 }
 
-this.FxAccountsProfile = function (options = {}) {
+this.FxAccountsProfile = function(options = {}) {
   this._cachedProfile = null;
   this._cachedAt = 0; // when we saved the cached version.
   this._currentFetchPromise = null;
   this._isNotifying = false; // are we sending a notification?
   this.fxa = options.fxa || fxAccounts;
   this.client = options.profileClient || new FxAccountsProfileClient({
     fxa: this.fxa,
     serverURL: options.profileServerUrl,
@@ -101,53 +101,53 @@ this.FxAccountsProfile.prototype = {
     // the user has just changed their profile via the web, so we want to
     // ignore our "freshness threshold"
     if (topic == ON_PROFILE_CHANGE_NOTIFICATION && !this._isNotifying) {
       log.debug("FxAccountsProfile observed profile change");
       this._cachedAt = 0;
     }
   },
 
-  tearDown: function () {
+  tearDown() {
     this.fxa = null;
     this.client = null;
     this._cachedProfile = null;
     Services.obs.removeObserver(this, ON_PROFILE_CHANGE_NOTIFICATION);
   },
 
-  _getCachedProfile: function () {
+  _getCachedProfile() {
     // The cached profile will end up back in the generic accountData
     // once bug 1157529 is fixed.
     return Promise.resolve(this._cachedProfile);
   },
 
-  _notifyProfileChange: function (uid) {
+  _notifyProfileChange(uid) {
     this._isNotifying = true;
     Services.obs.notifyObservers(null, ON_PROFILE_CHANGE_NOTIFICATION, uid);
     this._isNotifying = false;
   },
 
   // Cache fetched data if it is different from what's in the cache.
   // Send out a notification if it has changed so that UI can update.
-  _cacheProfile: function (profileData) {
+  _cacheProfile(profileData) {
     if (!hasChanged(this._cachedProfile, profileData)) {
       log.debug("fetched profile matches cached copy");
       return Promise.resolve(null); // indicates no change (but only tests care)
     }
     this._cachedProfile = profileData;
     this._cachedAt = Date.now();
     return this.fxa.getSignedInUser()
       .then(userData => {
         log.debug("notifying profile changed for user ${uid}", userData);
         this._notifyProfileChange(userData.uid);
         return profileData;
       });
   },
 
-  _fetchAndCacheProfile: function () {
+  _fetchAndCacheProfile() {
     if (!this._currentFetchPromise) {
       this._currentFetchPromise = this.client.fetchProfile().then(profile => {
         return this._cacheProfile(profile).then(() => {
           return profile;
         });
       }).then(profile => {
         this._currentFetchPromise = null;
         return profile;
@@ -157,17 +157,17 @@ this.FxAccountsProfile.prototype = {
       });
     }
     return this._currentFetchPromise
   },
 
   // Returns cached data right away if available, then fetches the latest profile
   // data in the background. After data is fetched a notification will be sent
   // out if the profile has changed.
-  getProfile: function () {
+  getProfile() {
     return this._getCachedProfile()
       .then(cachedProfile => {
         if (cachedProfile) {
           if (Date.now() > this._cachedAt + this.PROFILE_FRESHNESS_THRESHOLD) {
             // Note that _fetchAndCacheProfile isn't returned, so continues
             // in the background.
             this._fetchAndCacheProfile().catch(err => {
               log.error("Background refresh of profile failed", err);
--- a/services/fxaccounts/FxAccountsProfileClient.jsm
+++ b/services/fxaccounts/FxAccountsProfileClient.jsm
@@ -123,26 +123,26 @@ this.FxAccountsProfileClient.prototype =
    * @param {String} method
    *        Type of request, i.e "GET".
    * @param {String} token
    * @return Promise
    *         Resolves: {Object} Successful response from the Profile server.
    *         Rejects: {FxAccountsProfileClientError} Profile client error.
    * @private
    */
-  _rawRequest: function(path, method, token) {
+  _rawRequest(path, method, token) {
     return new Promise((resolve, reject) => {
       let profileDataUrl = this.serverURL + path;
       let request = new this._Request(profileDataUrl);
       method = method.toUpperCase();
 
       request.setHeader("Authorization", "Bearer " + token);
       request.setHeader("Accept", "application/json");
 
-      request.onComplete = function (error) {
+      request.onComplete = function(error) {
         if (error) {
           return reject(new FxAccountsProfileClientError({
             error: ERROR_NETWORK,
             errno: ERRNO_NETWORK,
             message: error.toString(),
           }));
         }
 
@@ -187,29 +187,29 @@ this.FxAccountsProfileClient.prototype =
 
   /**
    * Retrieve user's profile from the server
    *
    * @return Promise
    *         Resolves: {Object} Successful response from the '/profile' endpoint.
    *         Rejects: {FxAccountsProfileClientError} profile client error.
    */
-  fetchProfile: function () {
+  fetchProfile() {
     log.debug("FxAccountsProfileClient: Requested profile");
     return this._createRequest("/profile", "GET");
   },
 
   /**
    * Retrieve user's profile from the server
    *
    * @return Promise
    *         Resolves: {Object} Successful response from the '/avatar' endpoint.
    *         Rejects: {FxAccountsProfileClientError} profile client error.
    */
-  fetchProfileImage: function () {
+  fetchProfileImage() {
     log.debug("FxAccountsProfileClient: Requested avatar");
     return this._createRequest("/avatar", "GET");
   }
 };
 
 /**
  * Normalized profile client errors
  * @param {Object} [details]
--- a/services/fxaccounts/FxAccountsPush.js
+++ b/services/fxaccounts/FxAccountsPush.js
@@ -235,9 +235,9 @@ FxAccountsPushService.prototype = {
   },
 };
 
 // Service registration below registers with FxAccountsComponents.manifest
 const components = [FxAccountsPushService];
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
 
 // The following registration below helps with testing this service.
-this.EXPORTED_SYMBOLS=["FxAccountsPushService"];
+this.EXPORTED_SYMBOLS = ["FxAccountsPushService"];
--- a/services/fxaccounts/FxAccountsStorage.jsm
+++ b/services/fxaccounts/FxAccountsStorage.jsm
@@ -269,17 +269,17 @@ this.FxAccountsStorageManager.prototype 
 
      Note: _readPlainStorage is only called during initialize, so isn't
      protected via _queueStorageOperation() nor _promiseInitialized.
   */
   _readPlainStorage: Task.async(function* () {
     let got;
     try {
       got = yield this.plainStorage.get();
-    } catch(err) {
+    } catch (err) {
       // File hasn't been created yet.  That will be done
       // when write is called.
       if (!(err instanceof OS.File.Error) || !err.becauseNoSuchFile) {
         log.error("Failed to read plain storage", err);
       }
       // either way, we return null.
       got = null;
     }
@@ -439,35 +439,35 @@ this.FxAccountsStorageManager.prototype 
  *                  filename: of the file to write to
  *                  baseDir: directory where the file resides
  *                }
  * @return instance
  */
 function JSONStorage(options) {
   this.baseDir = options.baseDir;
   this.path = OS.Path.join(options.baseDir, options.filename);
-};
+}
 
 JSONStorage.prototype = {
-  set: function(contents) {
+  set(contents) {
     log.trace("starting write of json user data", contents ? Object.keys(contents.accountData) : "null");
     let start = Date.now();
     return OS.File.makeDir(this.baseDir, {ignoreExisting: true})
       .then(CommonUtils.writeJSON.bind(null, contents, this.path))
       .then(result => {
-        log.trace("finished write of json user data - took", Date.now()-start);
+        log.trace("finished write of json user data - took", Date.now() - start);
         return result;
       });
   },
 
-  get: function() {
+  get() {
     log.trace("starting fetch of json user data");
     let start = Date.now();
     return CommonUtils.readJSON(this.path).then(result => {
-      log.trace("finished fetch of json user data - took", Date.now()-start);
+      log.trace("finished fetch of json user data - took", Date.now() - start);
       return result;
     });
   },
 };
 
 function StorageLockedError() {
 }
 /**
--- a/services/fxaccounts/FxAccountsWebChannel.jsm
+++ b/services/fxaccounts/FxAccountsWebChannel.jsm
@@ -152,17 +152,17 @@ this.FxAccountsWebChannel.prototype = {
       case COMMAND_DELETE:
         this._helpers.logout(data.uid).catch(error =>
           this._sendError(error, message, sendingContext));
         break;
       case COMMAND_CAN_LINK_ACCOUNT:
         let canLinkAccount = this._helpers.shouldAllowRelink(data.email);
 
         let response = {
-          command: command,
+          command,
           messageId: message.messageId,
           data: { ok: canLinkAccount }
         };
 
         log.debug("FxAccountsWebChannel response", response);
         this._channel.send(response, sendingContext);
         break;
       case COMMAND_SYNC_PREFERENCES:
--- a/services/fxaccounts/tests/xpcshell/test_accounts.js
+++ b/services/fxaccounts/tests/xpcshell/test_accounts.js
@@ -88,31 +88,31 @@ MockStorageManager.prototype = {
 
 function MockFxAccountsClient() {
   this._email = "nobody@example.com";
   this._verified = false;
   this._deletedOnServer = false; // for testing accountStatus
 
   // mock calls up to the auth server to determine whether the
   // user account has been verified
-  this.recoveryEmailStatus = function (sessionToken) {
+  this.recoveryEmailStatus = function(sessionToken) {
     // simulate a call to /recovery_email/status
     return Promise.resolve({
       email: this._email,
       verified: this._verified
     });
   };
 
   this.accountStatus = function(uid) {
     let deferred = Promise.defer();
     deferred.resolve(!!uid && (!this._deletedOnServer));
     return deferred.promise;
   };
 
-  this.accountKeys = function (keyFetchToken) {
+  this.accountKeys = function(keyFetchToken) {
     let deferred = Promise.defer();
 
     do_timeout(50, () => {
       let response = {
         kA: expandBytes("11"),
         wrapKB: expandBytes("22")
       };
       deferred.resolve(response);
@@ -144,26 +144,26 @@ MockFxAccountsClient.prototype = {
  */
 function MockFxAccounts() {
   return new FxAccounts({
     VERIFICATION_POLL_TIMEOUT_INITIAL: 100, // 100ms
 
     _getCertificateSigned_calls: [],
     _d_signCertificate: Promise.defer(),
     _now_is: new Date(),
-    now: function () {
+    now() {
       return this._now_is;
     },
     newAccountState(credentials) {
       // we use a real accountState but mocked storage.
       let storage = new MockStorageManager();
       storage.initialize(credentials);
       return new AccountState(storage);
     },
-    getCertificateSigned: function (sessionToken, serializedPublicKey) {
+    getCertificateSigned(sessionToken, serializedPublicKey) {
       _("mock getCertificateSigned\n");
       this._getCertificateSigned_calls.push([sessionToken, serializedPublicKey]);
       return this._d_signCertificate.promise;
     },
     _registerOrUpdateDevice() {
       return Promise.resolve();
     },
     fxAccountsClient: new MockFxAccountsClient()
@@ -329,17 +329,17 @@ add_task(function* test_getCertificateOf
       do_throw("Unexpected success");
     },
     err => {
       Services.io.offline = offline;
       // ... so we have to check the error string.
       do_check_eq(err, "Error: OFFLINE");
     }
   );
-  yield fxa.signOut(/*localOnly = */true);
+  yield fxa.signOut(/* localOnly = */true);
 });
 
 add_task(function* test_getCertificateCached() {
   _("getCertificateCached()");
   let fxa = MakeFxAccounts();
   let credentials = {
     email: "foo@example.com",
     uid: "1234@lcip.org",
@@ -356,17 +356,17 @@ add_task(function* test_getCertificateCa
     },
   };
 
   yield fxa.setSignedInUser(credentials);
   let {keyPair, certificate} = yield fxa.internal.getKeypairAndCertificate(fxa.internal.currentAccountState);
   // should have the same keypair and cert.
   do_check_eq(keyPair, credentials.keyPair.rawKeyPair);
   do_check_eq(certificate, credentials.cert.rawCert);
-  yield fxa.signOut(/*localOnly = */true);
+  yield fxa.signOut(/* localOnly = */true);
 });
 
 add_task(function* test_getCertificateExpiredCert() {
   _("getCertificateExpiredCert()");
   let fxa = MakeFxAccounts({
     getCertificateSigned() {
       return "new cert";
     }
@@ -387,17 +387,17 @@ add_task(function* test_getCertificateEx
       rawCert: "expired-cert",
     },
   };
   yield fxa.setSignedInUser(credentials);
   let {keyPair, certificate} = yield fxa.internal.getKeypairAndCertificate(fxa.internal.currentAccountState);
   // should have the same keypair but a new cert.
   do_check_eq(keyPair, credentials.keyPair.rawKeyPair);
   do_check_neq(certificate, credentials.cert.rawCert);
-  yield fxa.signOut(/*localOnly = */true);
+  yield fxa.signOut(/* localOnly = */true);
 });
 
 add_task(function* test_getCertificateExpiredKeypair() {
   _("getCertificateExpiredKeypair()");
   let fxa = MakeFxAccounts({
     getCertificateSigned() {
       return "new cert";
     },
@@ -420,17 +420,17 @@ add_task(function* test_getCertificateEx
   };
 
   yield fxa.setSignedInUser(credentials);
   let {keyPair, certificate} = yield fxa.internal.getKeypairAndCertificate(fxa.internal.currentAccountState);
   // even though the cert was valid, the fact the keypair was not means we
   // should have fetched both.
   do_check_neq(keyPair, credentials.keyPair.rawKeyPair);
   do_check_neq(certificate, credentials.cert.rawCert);
-  yield fxa.signOut(/*localOnly = */true);
+  yield fxa.signOut(/* localOnly = */true);
 });
 
 // Sanity-check that our mocked client is working correctly
 add_test(function test_client_mock() {
   let fxa = new MockFxAccounts();
   let client = fxa.internal.fxAccountsClient;
   do_check_eq(client._verified, false);
   do_check_eq(typeof client.signIn, "function");
@@ -829,17 +829,17 @@ add_task(function* test_getAssertion() {
   _("----- DONE ----\n");
 });
 
 add_task(function* test_resend_email_not_signed_in() {
   let fxa = new MockFxAccounts();
 
   try {
     yield fxa.resendVerificationEmail();
-  } catch(err) {
+  } catch (err) {
     do_check_eq(err.message,
       "Cannot resend verification email; no signed-in user");
     return;
   }
   do_throw("Should not be able to resend email when nobody is signed in");
 });
 
 add_test(function test_accountStatus() {
@@ -959,21 +959,21 @@ add_task(function* test_sign_out_with_de
   do_check_true(user);
   Object.keys(credentials).forEach(key => do_check_eq(credentials[key], user[key]));
 
   const spy = {
     signOut: { count: 0 },
     signOutAndDeviceDestroy: { count: 0, args: [] }
   };
   const client = fxa.internal.fxAccountsClient;
-  client.signOut = function () {
+  client.signOut = function() {
     spy.signOut.count += 1;
     return Promise.resolve();
   };
-  client.signOutAndDestroyDevice = function () {
+  client.signOutAndDestroyDevice = function() {
     spy.signOutAndDeviceDestroy.count += 1;
     spy.signOutAndDeviceDestroy.args.push(arguments);
     return Promise.resolve();
   };
 
   const promise = new Promise(resolve => {
     makeObserver(ONLOGOUT_NOTIFICATION, () => {
       log.debug("test_sign_out_with_device observed onlogout");
@@ -1006,22 +1006,22 @@ add_task(function* test_sign_out_without
 
   const user = yield fxa.internal.getUserAccountData();
 
   const spy = {
     signOut: { count: 0, args: [] },
     signOutAndDeviceDestroy: { count: 0 }
   };
   const client = fxa.internal.fxAccountsClient;
-  client.signOut = function () {
+  client.signOut = function() {
     spy.signOut.count += 1;
     spy.signOut.args.push(arguments);
     return Promise.resolve();
   };
-  client.signOutAndDestroyDevice = function () {
+  client.signOutAndDestroyDevice = function() {
     spy.signOutAndDeviceDestroy.count += 1;
     return Promise.resolve();
   };
 
   const promise = new Promise(resolve => {
     makeObserver(ONLOGOUT_NOTIFICATION, () => {
       log.debug("test_sign_out_without_device observed onlogout");
       // user should be undefined after sign out
@@ -1074,24 +1074,24 @@ add_test(function test_getOAuthToken() {
 
   fxa.internal._d_signCertificate.resolve("cert1");
 
   // create a mock oauth client
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://example.com/v1",
     client_id: "abc123"
   });
-  client.getTokenFromAssertion = function () {
+  client.getTokenFromAssertion = function() {
     getTokenFromAssertionCalled = true;
     return Promise.resolve({ access_token: "token" });
   };
 
   fxa.setSignedInUser(alice).then(
     () => {
-      fxa.getOAuthToken({ scope: "profile", client: client }).then(
+      fxa.getOAuthToken({ scope: "profile", client }).then(
         (result) => {
            do_check_true(getTokenFromAssertionCalled);
            do_check_eq(result, "token");
            run_next_test();
         }
       )
     }
   );
@@ -1106,25 +1106,25 @@ add_test(function test_getOAuthTokenScop
 
   fxa.internal._d_signCertificate.resolve("cert1");
 
   // create a mock oauth client
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://example.com/v1",
     client_id: "abc123"
   });
-  client.getTokenFromAssertion = function (assertion, scopeString) {
+  client.getTokenFromAssertion = function(assertion, scopeString) {
     equal(scopeString, "foo bar");
     getTokenFromAssertionCalled = true;
     return Promise.resolve({ access_token: "token" });
   };
 
   fxa.setSignedInUser(alice).then(
     () => {
-      fxa.getOAuthToken({ scope: ["foo", "bar"], client: client }).then(
+      fxa.getOAuthToken({ scope: ["foo", "bar"], client }).then(
         (result) => {
            do_check_true(getTokenFromAssertionCalled);
            do_check_eq(result, "token");
            run_next_test();
         }
       )
     }
   );
@@ -1139,32 +1139,32 @@ add_task(function* test_getOAuthTokenCac
 
   fxa.internal._d_signCertificate.resolve("cert1");
 
   // create a mock oauth client
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://example.com/v1",
     client_id: "abc123"
   });
-  client.getTokenFromAssertion = function () {
+  client.getTokenFromAssertion = function() {
     numTokenFromAssertionCalls += 1;
     return Promise.resolve({ access_token: "token" });
   };
 
   yield fxa.setSignedInUser(alice);
-  let result = yield fxa.getOAuthToken({ scope: "profile", client: client, service: "test-service" });
+  let result = yield fxa.getOAuthToken({ scope: "profile", client, service: "test-service" });
   do_check_eq(numTokenFromAssertionCalls, 1);
   do_check_eq(result, "token");
 
   // requesting it again should not re-fetch the token.
-  result = yield fxa.getOAuthToken({ scope: "profile", client: client, service: "test-service" });
+  result = yield fxa.getOAuthToken({ scope: "profile", client, service: "test-service" });
   do_check_eq(numTokenFromAssertionCalls, 1);
   do_check_eq(result, "token");
   // But requesting the same service and a different scope *will* get a new one.
-  result = yield fxa.getOAuthToken({ scope: "something-else", client: client, service: "test-service" });
+  result = yield fxa.getOAuthToken({ scope: "something-else", client, service: "test-service" });
   do_check_eq(numTokenFromAssertionCalls, 2);
   do_check_eq(result, "token");
 });
 
 add_task(function* test_getOAuthTokenCachedScopeNormalization() {
   let fxa = new MockFxAccounts();
   let alice = getTestUser("alice");
   alice.verified = true;
@@ -1172,36 +1172,36 @@ add_task(function* test_getOAuthTokenCac
 
   fxa.internal._d_signCertificate.resolve("cert1");
 
   // create a mock oauth client
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://example.com/v1",
     client_id: "abc123"
   });
-  client.getTokenFromAssertion = function () {
+  client.getTokenFromAssertion = function() {
     numTokenFromAssertionCalls += 1;
     return Promise.resolve({ access_token: "token" });
   };
 
   yield fxa.setSignedInUser(alice);
-  let result = yield fxa.getOAuthToken({ scope: ["foo", "bar"], client: client, service: "test-service" });
+  let result = yield fxa.getOAuthToken({ scope: ["foo", "bar"], client, service: "test-service" });
   do_check_eq(numTokenFromAssertionCalls, 1);
   do_check_eq(result, "token");
 
   // requesting it again with the scope array in a different order not re-fetch the token.
-  result = yield fxa.getOAuthToken({ scope: ["bar", "foo"], client: client, service: "test-service" });
+  result = yield fxa.getOAuthToken({ scope: ["bar", "foo"], client, service: "test-service" });
   do_check_eq(numTokenFromAssertionCalls, 1);
   do_check_eq(result, "token");
   // requesting it again with the scope array in different case not re-fetch the token.
-  result = yield fxa.getOAuthToken({ scope: ["Bar", "Foo"], client: client, service: "test-service" });
+  result = yield fxa.getOAuthToken({ scope: ["Bar", "Foo"], client, service: "test-service" });
   do_check_eq(numTokenFromAssertionCalls, 1);
   do_check_eq(result, "token");
   // But requesting with a new entry in the array does fetch one.
-  result = yield fxa.getOAuthToken({ scope: ["foo", "bar", "etc"], client: client, service: "test-service" });
+  result = yield fxa.getOAuthToken({ scope: ["foo", "bar", "etc"], client, service: "test-service" });
   do_check_eq(numTokenFromAssertionCalls, 2);
   do_check_eq(result, "token");
 });
 
 Services.prefs.setCharPref("identity.fxaccounts.remote.oauth.uri", "https://example.com/v1");
 add_test(function test_getOAuthToken_invalid_param() {
   let fxa = new MockFxAccounts();
 
@@ -1234,17 +1234,17 @@ add_test(function test_getOAuthToken_mis
        Services.prefs.setCharPref("identity.fxaccounts.remote.oauth.uri", "https://example.com/v1");
        fxa.signOut().then(run_next_test);
     });
 });
 
 add_test(function test_getOAuthToken_no_account() {
   let fxa = new MockFxAccounts();
 
-  fxa.internal.currentAccountState.getUserAccountData = function () {
+  fxa.internal.currentAccountState.getUserAccountData = function() {
     return Promise.resolve(null);
   };
 
   fxa.getOAuthToken({ scope: "profile" })
     .then(null, err => {
        do_check_eq(err.message, "NO_ACCOUNT");
        fxa.signOut().then(run_next_test);
     });
@@ -1270,25 +1270,25 @@ add_test(function test_getOAuthToken_net
 
   fxa.internal._d_signCertificate.resolve("cert1");
 
   // create a mock oauth client
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://example.com/v1",
     client_id: "abc123"
   });
-  client.getTokenFromAssertion = function () {
+  client.getTokenFromAssertion = function() {
     return Promise.reject(new FxAccountsOAuthGrantClientError({
       error: ERROR_NETWORK,
       errno: ERRNO_NETWORK
     }));
   };
 
   fxa.setSignedInUser(alice).then(() => {
-    fxa.getOAuthToken({ scope: "profile", client: client })
+    fxa.getOAuthToken({ scope: "profile", client })
       .then(null, err => {
          do_check_eq(err.message, "NETWORK_ERROR");
          do_check_eq(err.details.errno, ERRNO_NETWORK);
          run_next_test();
       });
   });
 });
 
@@ -1299,25 +1299,25 @@ add_test(function test_getOAuthToken_aut
 
   fxa.internal._d_signCertificate.resolve("cert1");
 
   // create a mock oauth client
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://example.com/v1",
     client_id: "abc123"
   });
-  client.getTokenFromAssertion = function () {
+  client.getTokenFromAssertion = function() {
     return Promise.reject(new FxAccountsOAuthGrantClientError({
       error: ERROR_INVALID_FXA_ASSERTION,
       errno: ERRNO_INVALID_FXA_ASSERTION
     }));
   };
 
   fxa.setSignedInUser(alice).then(() => {
-    fxa.getOAuthToken({ scope: "profile", client: client })
+    fxa.getOAuthToken({ scope: "profile", client })
       .then(null, err => {
          do_check_eq(err.message, "AUTH_ERROR");
          do_check_eq(err.details.errno, ERRNO_INVALID_FXA_ASSERTION);
          run_next_test();
       });
   });
 });
 
@@ -1328,38 +1328,38 @@ add_test(function test_getOAuthToken_unk
 
   fxa.internal._d_signCertificate.resolve("cert1");
 
   // create a mock oauth client
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://example.com/v1",
     client_id: "abc123"
   });
-  client.getTokenFromAssertion = function () {
+  client.getTokenFromAssertion = function() {
     return Promise.reject("boom");
   };
 
   fxa.setSignedInUser(alice).then(() => {
-    fxa.getOAuthToken({ scope: "profile", client: client })
+    fxa.getOAuthToken({ scope: "profile", client })
       .then(null, err => {
          do_check_eq(err.message, "UNKNOWN_ERROR");
          run_next_test();
       });
   });
 });
 
 add_test(function test_getSignedInUserProfile() {
   let alice = getTestUser("alice");
   alice.verified = true;
 
   let mockProfile = {
-    getProfile: function () {
+    getProfile() {
       return Promise.resolve({ avatar: "image" });
     },
-    tearDown: function() {},
+    tearDown() {},
   };
   let fxa = new FxAccounts({
     _signOutServer() { return Promise.resolve(); },
     _registerOrUpdateDevice() { return Promise.resolve(); }
   });
 
   fxa.setSignedInUser(alice).then(() => {
     fxa.internal._profile = mockProfile;
@@ -1372,27 +1372,27 @@ add_test(function test_getSignedInUserPr
   });
 });
 
 add_test(function test_getSignedInUserProfile_error_uses_account_data() {
   let fxa = new MockFxAccounts();
   let alice = getTestUser("alice");
   alice.verified = true;
 
-  fxa.internal.getSignedInUser = function () {
+  fxa.internal.getSignedInUser = function() {
     return Promise.resolve({ email: "foo@bar.com" });
   };
 
   let teardownCalled = false;
   fxa.setSignedInUser(alice).then(() => {
     fxa.internal._profile = {
-      getProfile: function () {
+      getProfile() {
         return Promise.reject("boom");
       },
-      tearDown: function() {
+      tearDown() {
         teardownCalled = true;
       }
     };
 
     fxa.getSignedInUserProfile()
       .catch(error => {
         do_check_eq(error.message, "UNKNOWN_ERROR");
         fxa.signOut().then(() => {
@@ -1415,17 +1415,17 @@ add_test(function test_getSignedInUserPr
       });
   });
 
 });
 
 add_test(function test_getSignedInUserProfile_no_account_data() {
   let fxa = new MockFxAccounts();
 
-  fxa.internal.getSignedInUser = function () {
+  fxa.internal.getSignedInUser = function() {
     return Promise.resolve(null);
   };
 
   fxa.getSignedInUserProfile()
     .catch(error => {
        do_check_eq(error.message, "NO_ACCOUNT");
        fxa.signOut().then(run_next_test);
     });
@@ -1464,21 +1464,21 @@ add_task(function* test_checkVerificatio
  * Utility functions follow.
  */
 
 function expandHex(two_hex) {
   // Return a 64-character hex string, encoding 32 identical bytes.
   let eight_hex = two_hex + two_hex + two_hex + two_hex;
   let thirtytwo_hex = eight_hex + eight_hex + eight_hex + eight_hex;
   return thirtytwo_hex + thirtytwo_hex;
-};
+}
 
 function expandBytes(two_hex) {
   return CommonUtils.hexToBytes(expandHex(two_hex));
-};
+}
 
 function getTestUser(name) {
   return {
     email: name + "@example.com",
     uid: "1ad7f502-4cc7-4ec1-a209-071fd2fae348",
     deviceId: name + "'s device id",
     sessionToken: name + "'s session token",
     keyFetchToken: name + "'s keyfetch token",
@@ -1488,17 +1488,17 @@ function getTestUser(name) {
 }
 
 function makeObserver(aObserveTopic, aObserveFunc) {
   let observer = {
     // nsISupports provides type management in C++
     // nsIObserver is to be an observer
     QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
 
-    observe: function (aSubject, aTopic, aData) {
+    observe(aSubject, aTopic, aData) {
       log.debug("observed " + aTopic + " " + aData);
       if (aTopic == aObserveTopic) {
         removeMe();
         aObserveFunc(aSubject, aTopic, aData);
       }
     }
   };
 
@@ -1506,18 +1506,17 @@ function makeObserver(aObserveTopic, aOb
     log.debug("removing observer for " + aObserveTopic);
     Services.obs.removeObserver(observer, aObserveTopic);
   }
 
   Services.obs.addObserver(observer, aObserveTopic, false);
   return removeMe;
 }
 
-function do_check_throws(func, result, stack)
-{
+function do_check_throws(func, result, stack) {
   if (!stack)
     stack = Components.stack.caller;
 
   try {
     func();
   } catch (ex) {
     if (ex.name == result) {
       return;
--- a/services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js
+++ b/services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js
@@ -64,17 +64,17 @@ MockStorageManager.prototype = {
 
 function MockFxAccountsClient(device) {
   this._email = "nobody@example.com";
   this._verified = false;
   this._deletedOnServer = false; // for testing accountStatus
 
   // mock calls up to the auth server to determine whether the
   // user account has been verified
-  this.recoveryEmailStatus = function (sessionToken) {
+  this.recoveryEmailStatus = function(sessionToken) {
     // simulate a call to /recovery_email/status
     return Promise.resolve({
       email: this._email,
       verified: this._verified
     });
   };
 
   this.accountStatus = function(uid) {
@@ -105,17 +105,17 @@ function MockFxAccounts(device = {}) {
       return device.name || "mock device name";
     },
     fxAccountsClient: new MockFxAccountsClient(device),
     fxaPushService: {
       registerPushEndpoint() {
         return new Promise((resolve) => {
           resolve({
             endpoint: "http://mochi.test:8888",
-            getKey: function(type) {
+            getKey(type) {
               return ChromeUtils.base64URLDecode(
                 type === "auth" ? BOGUS_AUTHKEY : BOGUS_PUBLICKEY,
                 { padding: "ignore" });
             }
           });
         });
       },
     },
@@ -133,32 +133,32 @@ add_task(function* test_updateDeviceRegi
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = {
     registerDevice: { count: 0, args: [] },
     updateDevice: { count: 0, args: [] },
     getDeviceList: { count: 0, args: [] }
   };
   const client = fxa.internal.fxAccountsClient;
-  client.registerDevice = function () {
+  client.registerDevice = function() {
     spy.registerDevice.count += 1;
     spy.registerDevice.args.push(arguments);
     return Promise.resolve({
       id: "newly-generated device id",
       createdAt: Date.now(),
       name: deviceName,
       type: deviceType
     });
   };
-  client.updateDevice = function () {
+  client.updateDevice = function() {
     spy.updateDevice.count += 1;
     spy.updateDevice.args.push(arguments);
     return Promise.resolve({});
   };
-  client.getDeviceList = function () {
+  client.getDeviceList = function() {
     spy.getDeviceList.count += 1;
     spy.getDeviceList.args.push(arguments);
     return Promise.resolve([]);
   };
 
   const result = yield fxa.updateDeviceRegistration();
 
   do_check_eq(result, "newly-generated device id");
@@ -189,30 +189,30 @@ add_task(function* test_updateDeviceRegi
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = {
     registerDevice: { count: 0, args: [] },
     updateDevice: { count: 0, args: [] },
     getDeviceList: { count: 0, args: [] }
   };
   const client = fxa.internal.fxAccountsClient;
-  client.registerDevice = function () {
+  client.registerDevice = function() {
     spy.registerDevice.count += 1;
     spy.registerDevice.args.push(arguments);
     return Promise.resolve({});
   };
-  client.updateDevice = function () {
+  client.updateDevice = function() {
     spy.updateDevice.count += 1;
     spy.updateDevice.args.push(arguments);
     return Promise.resolve({
       id: credentials.deviceId,
       name: deviceName
     });
   };
-  client.getDeviceList = function () {
+  client.getDeviceList = function() {
     spy.getDeviceList.count += 1;
     spy.getDeviceList.args.push(arguments);
     return Promise.resolve([]);
   };
   const result = yield fxa.updateDeviceRegistration();
 
   do_check_eq(result, credentials.deviceId);
   do_check_eq(spy.registerDevice.count, 0);
@@ -242,35 +242,35 @@ add_task(function* test_updateDeviceRegi
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = {
     registerDevice: { count: 0, args: [] },
     updateDevice: { count: 0, args: [] },
     getDeviceList: { count: 0, args: [] }
   };
   const client = fxa.internal.fxAccountsClient;
-  client.registerDevice = function () {
+  client.registerDevice = function() {
     spy.registerDevice.count += 1;
     spy.registerDevice.args.push(arguments);
     return Promise.resolve({
       id: "a different newly-generated device id",
       createdAt: Date.now(),
       name: deviceName,
       type: deviceType
     });
   };
-  client.updateDevice = function () {
+  client.updateDevice = function() {
     spy.updateDevice.count += 1;
     spy.updateDevice.args.push(arguments);
     return Promise.reject({
       code: 400,
       errno: ERRNO_UNKNOWN_DEVICE
     });
   };
-  client.getDeviceList = function () {
+  client.getDeviceList = function() {
     spy.getDeviceList.count += 1;
     spy.getDeviceList.args.push(arguments);
     return Promise.resolve([]);
   };
 
   const result = yield fxa.updateDeviceRegistration();
 
   do_check_null(result);
@@ -302,37 +302,37 @@ add_task(function* test_updateDeviceRegi
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = {
     registerDevice: { count: 0, args: [] },
     updateDevice: { count: 0, args: [], times: [] },
     getDeviceList: { count: 0, args: [] }
   };
   const client = fxa.internal.fxAccountsClient;
-  client.registerDevice = function () {
+  client.registerDevice = function() {
     spy.registerDevice.count += 1;
     spy.registerDevice.args.push(arguments);
     return Promise.resolve({});
   };
-  client.updateDevice = function () {
+  client.updateDevice = function() {
     spy.updateDevice.count += 1;
     spy.updateDevice.args.push(arguments);
     spy.updateDevice.time = Date.now();
     if (spy.updateDevice.count === 1) {
       return Promise.reject({
         code: 400,
         errno: ERRNO_DEVICE_SESSION_CONFLICT
       });
     }
     return Promise.resolve({
       id: credentials.deviceId,
       name: deviceName
     });
   };
-  client.getDeviceList = function () {
+  client.getDeviceList = function() {
     spy.getDeviceList.count += 1;
     spy.getDeviceList.args.push(arguments);
     spy.getDeviceList.time = Date.now();
     return Promise.resolve([
       { id: "ignore", name: "ignore", type: "ignore", isCurrentDevice: false },
       { id: credentials.deviceId, name: deviceName, type: deviceType, isCurrentDevice: true }
     ]);
   };
@@ -371,30 +371,30 @@ add_task(function* test_updateDeviceRegi
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = {
     registerDevice: { count: 0, args: [] },
     updateDevice: { count: 0, args: [] },
     getDeviceList: { count: 0, args: [] }
   };
   const client = fxa.internal.fxAccountsClient;
-  client.registerDevice = function () {
+  client.registerDevice = function() {
     spy.registerDevice.count += 1;
     spy.registerDevice.args.push(arguments);
     return Promise.reject({
       code: 400,
       errno: ERRNO_TOO_MANY_CLIENT_REQUESTS
     });
   };
-  client.updateDevice = function () {
+  client.updateDevice = function() {
     spy.updateDevice.count += 1;
     spy.updateDevice.args.push(arguments);
     return Promise.resolve({});
   };
-  client.getDeviceList = function () {
+  client.getDeviceList = function() {
     spy.getDeviceList.count += 1;
     spy.getDeviceList.args.push(arguments);
     return Promise.resolve([]);
   };
 
   const result = yield fxa.updateDeviceRegistration();
 
   do_check_null(result);
@@ -415,17 +415,17 @@ add_task(function* test_getDeviceId_with
   delete credentials.deviceId;
   const fxa = new MockFxAccounts();
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = { count: 0, args: [] };
   fxa.internal.currentAccountState.getUserAccountData =
     () => Promise.resolve({ email: credentials.email,
                             deviceRegistrationVersion: DEVICE_REGISTRATION_VERSION });
-  fxa.internal._registerOrUpdateDevice = function () {
+  fxa.internal._registerOrUpdateDevice = function() {
     spy.count += 1;
     spy.args.push(arguments);
     return Promise.resolve("bar");
   };
 
   const result = yield fxa.internal.getDeviceId();
 
   do_check_eq(spy.count, 1);
@@ -439,17 +439,17 @@ add_task(function* test_getDeviceId_with
   const credentials = getTestUser("foo");
   credentials.verified = true;
   const fxa = new MockFxAccounts();
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = { count: 0, args: [] };
   fxa.internal.currentAccountState.getUserAccountData =
     () => Promise.resolve({ deviceId: credentials.deviceId, deviceRegistrationVersion: 0 });
-  fxa.internal._registerOrUpdateDevice = function () {
+  fxa.internal._registerOrUpdateDevice = function() {
     spy.count += 1;
     spy.args.push(arguments);
     return Promise.resolve("wibble");
   };
 
   const result = yield fxa.internal.getDeviceId();
 
   do_check_eq(spy.count, 1);
@@ -462,17 +462,17 @@ add_task(function* test_getDeviceId_with
   const credentials = getTestUser("foo");
   credentials.verified = true;
   const fxa = new MockFxAccounts();
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = { count: 0 };
   fxa.internal.currentAccountState.getUserAccountData =
     () => Promise.resolve({ deviceId: credentials.deviceId, deviceRegistrationVersion: DEVICE_REGISTRATION_VERSION });
-  fxa.internal._registerOrUpdateDevice = function () {
+  fxa.internal._registerOrUpdateDevice = function() {
     spy.count += 1;
     return Promise.resolve("bar");
   };
 
   const result = yield fxa.internal.getDeviceId();
 
   do_check_eq(spy.count, 0);
   do_check_eq(result, "foo's device id");
@@ -482,17 +482,17 @@ add_task(function* test_getDeviceId_with
   const credentials = getTestUser("foo");
   credentials.verified = true;
   const fxa = new MockFxAccounts();
   yield fxa.internal.setSignedInUser(credentials);
 
   const spy = { count: 0, args: [] };
   fxa.internal.currentAccountState.getUserAccountData =
     () => Promise.resolve({ deviceId: credentials.deviceId });
-  fxa.internal._registerOrUpdateDevice = function () {
+  fxa.internal._registerOrUpdateDevice = function() {
     spy.count += 1;
     spy.args.push(arguments);
     return Promise.resolve("wibble");
   };
 
   const result = yield fxa.internal.getDeviceId();
 
   do_check_eq(spy.count, 1);
@@ -501,21 +501,21 @@ add_task(function* test_getDeviceId_with
   do_check_eq(result, "wibble");
 });
 
 function expandHex(two_hex) {
   // Return a 64-character hex string, encoding 32 identical bytes.
   let eight_hex = two_hex + two_hex + two_hex + two_hex;
   let thirtytwo_hex = eight_hex + eight_hex + eight_hex + eight_hex;
   return thirtytwo_hex + thirtytwo_hex;
-};
+}
 
 function expandBytes(two_hex) {
   return CommonUtils.hexToBytes(expandHex(two_hex));
-};
+}
 
 function getTestUser(name) {
   return {
     email: name + "@example.com",
     uid: "1ad7f502-4cc7-4ec1-a209-071fd2fae348",
     deviceId: name + "'s device id",
     sessionToken: name + "'s session token",
     keyFetchToken: name + "'s keyfetch token",
--- a/services/fxaccounts/tests/xpcshell/test_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_client.js
@@ -12,30 +12,30 @@ Cu.import("resource://services-crypto/ut
 const FAKE_SESSION_TOKEN = "a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf";
 
 function run_test() {
   run_next_test();
 }
 
 // https://wiki.mozilla.org/Identity/AttachedServices/KeyServerProtocol#.2Faccount.2Fkeys
 var ACCOUNT_KEYS = {
-  keyFetch:     h("8081828384858687 88898a8b8c8d8e8f"+
+  keyFetch:     h("8081828384858687 88898a8b8c8d8e8f" +
                   "9091929394959697 98999a9b9c9d9e9f"),
 
-  response:     h("ee5c58845c7c9412 b11bbd20920c2fdd"+
-                  "d83c33c9cd2c2de2 d66b222613364636"+
-                  "c2c0f8cfbb7c6304 72c0bd88451342c6"+
-                  "c05b14ce342c5ad4 6ad89e84464c993c"+
-                  "3927d30230157d08 17a077eef4b20d97"+
+  response:     h("ee5c58845c7c9412 b11bbd20920c2fdd" +
+                  "d83c33c9cd2c2de2 d66b222613364636" +
+                  "c2c0f8cfbb7c6304 72c0bd88451342c6" +
+                  "c05b14ce342c5ad4 6ad89e84464c993c" +
+                  "3927d30230157d08 17a077eef4b20d97" +
                   "6f7a97363faf3f06 4c003ada7d01aa70"),
 
-  kA:           h("2021222324252627 28292a2b2c2d2e2f"+
+  kA:           h("2021222324252627 28292a2b2c2d2e2f" +
                   "3031323334353637 38393a3b3c3d3e3f"),
 
-  wrapKB:       h("4041424344454647 48494a4b4c4d4e4f"+
+  wrapKB:       h("4041424344454647 48494a4b4c4d4e4f" +
                   "5051525354555657 58595a5b5c5d5e5f"),
 };
 
 function deferredStop(server) {
   let deferred = Promise.defer();
   server.stop(deferred.resolve);
   return deferred.promise;
 }
@@ -233,17 +233,17 @@ add_task(function* test_signUp() {
   do_check_eq("keyFetchToken", result.keyFetchToken);
   do_check_eq(result.unwrapBKey,
               "f589225b609e56075d76eb74f771ff9ab18a4dc0e901e131ba8f984c7fb0ca8c");
 
   // Try to create an existing account.  Triggers error path.
   try {
     result = yield client.signUp(unicodeUsername, unicodePassword);
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(101, expectedError.errno);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_signIn() {
   let sessionMessage_noKey = JSON.stringify({
@@ -274,39 +274,36 @@ add_task(function* test_signIn() {
       let jsonBody = JSON.parse(body);
 
       if (jsonBody.email == unicodeUsername) {
         do_check_eq("", request._queryString);
         do_check_eq(jsonBody.authPW, "08b9d111196b8408e8ed92439da49206c8ecfbf343df0ae1ecefcd1e0174a8b6");
         response.setStatusLine(request.httpVersion, 200, "OK");
         response.bodyOutputStream.write(sessionMessage_noKey,
                                         sessionMessage_noKey.length);
-        return;
-      }
-      else if (jsonBody.email == "you@example.com") {
+
+      } else if (jsonBody.email == "you@example.com") {
         do_check_eq("keys=true", request._queryString);
         do_check_eq(jsonBody.authPW, "93d20ec50304d496d0707ec20d7e8c89459b6396ec5dd5b9e92809c5e42856c7");
         response.setStatusLine(request.httpVersion, 200, "OK");
         response.bodyOutputStream.write(sessionMessage_withKey,
                                         sessionMessage_withKey.length);
-        return;
-      }
-      else if (jsonBody.email == "You@example.com") {
+
+      } else if (jsonBody.email == "You@example.com") {
         // Error trying to sign in with a wrong capitalization
         response.setStatusLine(request.httpVersion, 400, "Bad request");
         response.bodyOutputStream.write(errorMessage_wrongCap,
                                         errorMessage_wrongCap.length);
-        return;
-      }
-      else {
+
+      } else {
         // Error trying to sign in to nonexistent account
         response.setStatusLine(request.httpVersion, 400, "Bad request");
         response.bodyOutputStream.write(errorMessage_notExistent,
                                         errorMessage_notExistent.length);
-        return;
+
       }
     },
   });
 
   // Login without retrieving optional keys
   let client = new FxAccountsClient(server.baseURI);
   let result = yield client.signIn(unicodeUsername, 'bigsecret');
   do_check_eq(FAKE_SESSION_TOKEN, result.sessionToken);
@@ -352,29 +349,29 @@ add_task(function* test_signOut() {
         response.setStatusLine(request.httpVersion, 200, "OK");
         response.bodyOutputStream.write(signoutMessage, signoutMessage.length);
         return;
       }
 
       // Error trying to sign out of nonexistent account
       response.setStatusLine(request.httpVersion, 400, "Bad request");
       response.bodyOutputStream.write(errorMessage, errorMessage.length);
-      return;
+
     },
   });
 
   let client = new FxAccountsClient(server.baseURI);
   let result = yield client.signOut("FakeSession");
   do_check_eq(typeof result, "object");
 
   // Trigger error path
   try {
     result = yield client.signOut("FakeSession");
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(102, expectedError.errno);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_recoveryEmailStatus() {
   let emailStatus = JSON.stringify({verified: true});
@@ -391,46 +388,46 @@ add_task(function* test_recoveryEmailSta
         response.setStatusLine(request.httpVersion, 200, "OK");
         response.bodyOutputStream.write(emailStatus, emailStatus.length);
         return;
       }
 
       // Second call gets an error trying to query a nonexistent account
       response.setStatusLine(request.httpVersion, 400, "Bad request");
       response.bodyOutputStream.write(errorMessage, errorMessage.length);
-      return;
+
     },
   });
 
   let client = new FxAccountsClient(server.baseURI);
   let result = yield client.recoveryEmailStatus(FAKE_SESSION_TOKEN);
   do_check_eq(result.verified, true);
 
   // Trigger error path
   try {
     result = yield client.recoveryEmailStatus("some bogus session");
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(102, expectedError.errno);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_recoveryEmailStatusWithReason() {
   let emailStatus = JSON.stringify({verified: true});
   let server = httpd_setup({
     "/recovery_email/status": function(request, response) {
       do_check_true(request.hasHeader("Authorization"));
       // if there is a query string then it will have a reason
       do_check_eq("reason=push", request._queryString);
 
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.bodyOutputStream.write(emailStatus, emailStatus.length);
-      return;
+
     },
   });
 
   let client = new FxAccountsClient(server.baseURI);
   let result = yield client.recoveryEmailStatus(FAKE_SESSION_TOKEN, {
     reason: "push",
   });
   do_check_eq(result.verified, true);
@@ -450,29 +447,29 @@ add_task(function* test_resendVerificati
         response.setStatusLine(request.httpVersion, 200, "OK");
         response.bodyOutputStream.write(emptyMessage, emptyMessage.length);
         return;
       }
 
       // Second call gets an error trying to query a nonexistent account
       response.setStatusLine(request.httpVersion, 400, "Bad request");
       response.bodyOutputStream.write(errorMessage, errorMessage.length);
-      return;
+
     },
   });
 
   let client = new FxAccountsClient(server.baseURI);
   let result = yield client.resendVerificationEmail(FAKE_SESSION_TOKEN);
   do_check_eq(JSON.stringify(result), emptyMessage);
 
   // Trigger error path
   try {
     result = yield client.resendVerificationEmail("some bogus session");
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(102, expectedError.errno);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_accountKeys() {
   // Four calls to accountKeys().  The first one should work correctly, and we
@@ -484,17 +481,17 @@ add_task(function* test_accountKeys() {
   let emptyMessage = "{}";
   let attempt = 0;
 
   let server = httpd_setup({
     "/account/keys": function(request, response) {
       do_check_true(request.hasHeader("Authorization"));
       attempt += 1;
 
-      switch(attempt) {
+      switch (attempt) {
         case 1:
           // First time succeeds
           response.setStatusLine(request.httpVersion, 200, "OK");
           response.bodyOutputStream.write(responseMessage, responseMessage.length);
           break;
 
         case 2:
           // Second time, return no bundle to trigger client error
@@ -527,33 +524,33 @@ add_task(function* test_accountKeys() {
   let result = yield client.accountKeys(ACCOUNT_KEYS.keyFetch);
   do_check_eq(CommonUtils.hexToBytes(ACCOUNT_KEYS.kA), result.kA);
   do_check_eq(CommonUtils.hexToBytes(ACCOUNT_KEYS.wrapKB), result.wrapKB);
 
   // Second try, empty bundle should trigger error
   try {
     result = yield client.accountKeys(ACCOUNT_KEYS.keyFetch);
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(expectedError.message, "failed to retrieve keys");
   }
 
   // Third try, bad bundle results in MAC error
   try {
     result = yield client.accountKeys(ACCOUNT_KEYS.keyFetch);
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(expectedError.message, "error unbundling encryption keys");
   }
 
   // Fourth try, pretend account doesn't exist
   try {
     result = yield client.accountKeys(ACCOUNT_KEYS.keyFetch);
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(102, expectedError.errno);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_signCertificate() {
   let certSignMessage = JSON.stringify({cert: {bar: "baz"}});
@@ -573,29 +570,29 @@ add_task(function* test_signCertificate(
         response.setStatusLine(request.httpVersion, 200, "OK");
         response.bodyOutputStream.write(certSignMessage, certSignMessage.length);
         return;
       }
 
       // Second attempt, trigger error
       response.setStatusLine(request.httpVersion, 400, "Bad request");
       response.bodyOutputStream.write(errorMessage, errorMessage.length);
-      return;
+
     },
   });
 
   let client = new FxAccountsClient(server.baseURI);
   let result = yield client.signCertificate(FAKE_SESSION_TOKEN, JSON.stringify({foo: "bar"}), 600);
   do_check_eq("baz", result.bar);
 
   // Account doesn't exist
   try {
     result = yield client.signCertificate("bogus", JSON.stringify({foo: "bar"}), 600);
     do_throw("Expected to catch an exception");
-  } catch(expectedError) {
+  } catch (expectedError) {
     do_check_eq(102, expectedError.errno);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_accountExists() {
   let sessionMessage = JSON.stringify({sessionToken: FAKE_SESSION_TOKEN});
@@ -646,17 +643,17 @@ add_task(function* test_accountExists() 
   do_check_true(result);
 
   result = yield client.accountExists("i.dont.exist@example.com");
   do_check_false(result);
 
   try {
     result = yield client.accountExists("i.break.things@example.com");
     do_throw("Expected to catch an exception");
-  } catch(unexpectedError) {
+  } catch (unexpectedError) {
     do_check_eq(unexpectedError.code, 500);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_registerDevice() {
   const DEVICE_ID = "device id";
@@ -697,17 +694,17 @@ add_task(function* test_registerDevice()
   do_check_eq(typeof result.createdAt, 'number');
   do_check_true(result.createdAt > 0);
   do_check_eq(result.name, DEVICE_NAME);
   do_check_eq(result.type, DEVICE_TYPE);
 
   try {
     yield client.registerDevice(FAKE_SESSION_TOKEN, ERROR_NAME, DEVICE_TYPE);
     do_throw("Expected to catch an exception");
-  } catch(unexpectedError) {
+  } catch (unexpectedError) {
     do_check_eq(unexpectedError.code, 500);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_updateDevice() {
   const DEVICE_ID = "some other id";
@@ -741,17 +738,17 @@ add_task(function* test_updateDevice() {
   do_check_true(result);
   do_check_eq(Object.keys(result).length, 2);
   do_check_eq(result.id, DEVICE_ID);
   do_check_eq(result.name, DEVICE_NAME);
 
   try {
     yield client.updateDevice(FAKE_SESSION_TOKEN, ERROR_ID, DEVICE_NAME);
     do_throw("Expected to catch an exception");
-  } catch(unexpectedError) {
+  } catch (unexpectedError) {
     do_check_eq(unexpectedError.code, 500);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_signOutAndDestroyDevice() {
   const DEVICE_ID = "device id";
@@ -780,17 +777,17 @@ add_task(function* test_signOutAndDestro
   const result = yield client.signOutAndDestroyDevice(FAKE_SESSION_TOKEN, DEVICE_ID);
 
   do_check_true(result);
   do_check_eq(Object.keys(result).length, 0);
 
   try {
     yield client.signOutAndDestroyDevice(FAKE_SESSION_TOKEN, ERROR_ID);
     do_throw("Expected to catch an exception");
-  } catch(unexpectedError) {
+  } catch (unexpectedError) {
     do_check_eq(unexpectedError.code, 500);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_getDeviceList() {
   let canReturnDevices;
@@ -813,17 +810,17 @@ add_task(function* test_getDeviceList() 
   const result = yield client.getDeviceList(FAKE_SESSION_TOKEN);
   do_check_true(Array.isArray(result));
   do_check_eq(result.length, 0);
 
   try {
     canReturnDevices = false;
     yield client.getDeviceList(FAKE_SESSION_TOKEN);
     do_throw("Expected to catch an exception");
-  } catch(unexpectedError) {
+  } catch (unexpectedError) {
     do_check_eq(unexpectedError.code, 500);
   }
 
   yield deferredStop(server);
 });
 
 add_task(function* test_client_metrics() {
   function writeResp(response, msg) {
--- a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
@@ -15,181 +15,181 @@ const CLIENT_OPTIONS = {
 const STATUS_SUCCESS = 200;
 
 /**
  * Mock request responder
  * @param {String} response
  *        Mocked raw response from the server
  * @returns {Function}
  */
-var mockResponse = function (response) {
-  return function () {
+var mockResponse = function(response) {
+  return function() {
     return {
-      setHeader: function () {},
-      post: function () {
+      setHeader() {},
+      post() {
         this.response = response;
         this.onComplete();
       }
     };
   };
 };
 
 /**
  * Mock request error responder
  * @param {Error} error
  *        Error object
  * @returns {Function}
  */
-var mockResponseError = function (error) {
-  return function () {
+var mockResponseError = function(error) {
+  return function() {
     return {
-      setHeader: function () {},
-      post: function () {
+      setHeader() {},
+      post() {
         this.onComplete(error);
       }
     };
   };
 };
 
-add_test(function missingParams () {
+add_test(function missingParams() {
   let client = new FxAccountsOAuthGrantClient(CLIENT_OPTIONS);
   try {
     client.getTokenFromAssertion()
   } catch (e) {
     do_check_eq(e.message, "Missing 'assertion' parameter");
   }
 
   try {
     client.getTokenFromAssertion("assertion")
   } catch (e) {
     do_check_eq(e.message, "Missing 'scope' parameter");
   }
 
   run_next_test();
 });
 
-add_test(function successfulResponse () {
+add_test(function successfulResponse() {
   let client = new FxAccountsOAuthGrantClient(CLIENT_OPTIONS);
   let response = {
     success: true,
     status: STATUS_SUCCESS,
     body: "{\"access_token\":\"http://example.com/image.jpeg\",\"id\":\"0d5c1a89b8c54580b8e3e8adadae864a\"}",
   };
 
   client._Request = new mockResponse(response);
   client.getTokenFromAssertion("assertion", "scope")
     .then(
-      function (result) {
+      function(result) {
         do_check_eq(result.access_token, "http://example.com/image.jpeg");
         run_next_test();
       }
     );
 });
 
-add_test(function successfulDestroy () {
+add_test(function successfulDestroy() {
   let client = new FxAccountsOAuthGrantClient(CLIENT_OPTIONS);
   let response = {
     success: true,
     status: STATUS_SUCCESS,
     body: "{}",
   };
 
   client._Request = new mockResponse(response);
   client.destroyToken("deadbeef").then(run_next_test);
 });
 
-add_test(function parseErrorResponse () {
+add_test(function parseErrorResponse() {
   let client = new FxAccountsOAuthGrantClient(CLIENT_OPTIONS);
   let response = {
     success: true,
     status: STATUS_SUCCESS,
     body: "unexpected",
   };
 
   client._Request = new mockResponse(response);
   client.getTokenFromAssertion("assertion", "scope")
     .then(
       null,
-      function (e) {
+      function(e) {
         do_check_eq(e.name, "FxAccountsOAuthGrantClientError");
         do_check_eq(e.code, STATUS_SUCCESS);
         do_check_eq(e.errno, ERRNO_PARSE);
         do_check_eq(e.error, ERROR_PARSE);
         do_check_eq(e.message, "unexpected");
         run_next_test();
       }
     );
 });
 
-add_test(function serverErrorResponse () {
+add_test(function serverErrorResponse() {
   let client = new FxAccountsOAuthGrantClient(CLIENT_OPTIONS);
   let response = {
     status: 400,
     body: "{ \"code\": 400, \"errno\": 104, \"error\": \"Bad Request\", \"message\": \"Unauthorized\", \"reason\": \"Invalid fxa assertion\" }",
   };
 
   client._Request = new mockResponse(response);
   client.getTokenFromAssertion("blah", "scope")
     .then(
     null,
-    function (e) {
+    function(e) {
       do_check_eq(e.name, "FxAccountsOAuthGrantClientError");
       do_check_eq(e.code, 400);
       do_check_eq(e.errno, ERRNO_INVALID_FXA_ASSERTION);
       do_check_eq(e.error, "Bad Request");
       do_check_eq(e.message, "Unauthorized");
       run_next_test();
     }
   );
 });
 
-add_test(function networkErrorResponse () {
+add_test(function networkErrorResponse() {
   let client = new FxAccountsOAuthGrantClient({
     serverURL: "http://",
     client_id: "abc123"
   });
   Services.prefs.setBoolPref("identity.fxaccounts.skipDeviceRegistration", true);
   client.getTokenFromAssertion("assertion", "scope")
     .then(
       null,
-      function (e) {
+      function(e) {
         do_check_eq(e.name, "FxAccountsOAuthGrantClientError");
         do_check_eq(e.code, null);
         do_check_eq(e.errno, ERRNO_NETWORK);
         do_check_eq(e.error, ERROR_NETWORK);
         run_next_test();
       }
     ).catch(() => {}).then(() =>
       Services.prefs.clearUserPref("identity.fxaccounts.skipDeviceRegistration"));
 });
 
-add_test(function unsupportedMethod () {
+add_test(function unsupportedMethod() {
   let client = new FxAccountsOAuthGrantClient(CLIENT_OPTIONS);
 
   return client._createRequest("/", "PUT")
     .then(
       null,
-      function (e) {
+      function(e) {
         do_check_eq(e.name, "FxAccountsOAuthGrantClientError");
         do_check_eq(e.code, ERROR_CODE_METHOD_NOT_ALLOWED);
         do_check_eq(e.errno, ERRNO_NETWORK);
         do_check_eq(e.error, ERROR_NETWORK);
         do_check_eq(e.message, ERROR_MSG_METHOD_NOT_ALLOWED);
         run_next_test();
       }
     );
 });
 
-add_test(function onCompleteRequestError () {
+add_test(function onCompleteRequestError() {
   let client = new FxAccountsOAuthGrantClient(CLIENT_OPTIONS);
   client._Request = new mockResponseError(new Error("onComplete error"));
   client.getTokenFromAssertion("assertion", "scope")
     .then(
       null,
-      function (e) {
+      function(e) {
         do_check_eq(e.name, "FxAccountsOAuthGrantClientError");
         do_check_eq(e.code, null);
         do_check_eq(e.errno, ERRNO_NETWORK);
         do_check_eq(e.error, ERROR_NETWORK);
         do_check_eq(e.message, "Error: onComplete error");
         run_next_test();
       }
   );
@@ -201,17 +201,17 @@ add_test(function incorrectErrno() {
     status: 400,
     body: "{ \"code\": 400, \"errno\": \"bad errno\", \"error\": \"Bad Request\", \"message\": \"Unauthorized\", \"reason\": \"Invalid fxa assertion\" }",
   };
 
   client._Request = new mockResponse(response);
   client.getTokenFromAssertion("blah", "scope")
     .then(
     null,
-    function (e) {
+    function(e) {
       do_check_eq(e.name, "FxAccountsOAuthGrantClientError");
       do_check_eq(e.code, 400);
       do_check_eq(e.errno, ERRNO_UNKNOWN_ERROR);
       do_check_eq(e.error, "Bad Request");
       do_check_eq(e.message, "Unauthorized");
       run_next_test();
     }
   );
--- a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client_server.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client_server.js
@@ -45,17 +45,17 @@ function startServer() {
 }
 
 function promiseStopServer(server) {
   return new Promise(resolve => {
     server.stop(resolve);
   });
 }
 
-add_task(function* getAndRevokeToken () {
+add_task(function* getAndRevokeToken() {
   let server = startServer();
   let clientOptions = {
     serverURL: "http://localhost:" + server.identity.primaryPort + "/v1",
     client_id: 'abc123',
   }
 
   let client = new FxAccountsOAuthGrantClient(clientOptions);
   let result = yield client.getTokenFromAssertion("assertion", "scope");
--- a/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_token_storage.js
@@ -77,17 +77,17 @@ function MockFxAccountsClient() {
 
   FxAccountsClient.apply(this);
 }
 
 MockFxAccountsClient.prototype = {
   __proto__: FxAccountsClient.prototype
 }
 
-function MockFxAccounts(device={}) {
+function MockFxAccounts(device = {}) {
   return new FxAccounts({
     fxAccountsClient: new MockFxAccountsClient(),
     newAccountState(credentials) {
       // we use a real accountState but mocked storage.
       let storage = new MockStorageManager();
       storage.initialize(credentials);
       return new AccountState(storage);
     },
--- a/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_tokens.js
@@ -84,17 +84,17 @@ function MockFxAccounts(mockGrantClient)
     fxAccountsClient: new MockFxAccountsClient(),
     getAssertion: () => Promise.resolve("assertion"),
     newAccountState(credentials) {
       // we use a real accountState but mocked storage.
       let storage = new MockStorageManager();
       storage.initialize(credentials);
       return new AccountState(storage);
     },
-    _destroyOAuthToken: function(tokenData) {
+    _destroyOAuthToken(tokenData) {
       // somewhat sad duplication of _destroyOAuthToken, but hard to avoid.
       return mockGrantClient.destroyToken(tokenData.token).then( () => {
         Services.obs.notifyObservers(null, "testhelper-fxa-revoke-complete", null);
       });
     },
     _getDeviceName() {
       return "mock device name";
     },
@@ -151,17 +151,17 @@ MockFxAccountsOAuthGrantClient.prototype
   },
   // and some stuff used only for tests.
   numTokenFetches: 0,
   activeTokens: null,
 }
 
 add_task(function* testRevoke() {
   let client = new MockFxAccountsOAuthGrantClient();
-  let tokenOptions = { scope: "test-scope", client: client };
+  let tokenOptions = { scope: "test-scope", client };
   let fxa = yield createMockFxA(client);
 
   // get our first token and check we hit the mock.
   let token1 = yield fxa.getOAuthToken(tokenOptions);
   equal(client.numTokenFetches, 1);
   equal(client.activeTokens.size, 1);
   ok(token1, "got a token");
   equal(token1, "token0");
@@ -181,23 +181,23 @@ add_task(function* testRevoke() {
   notEqual(token1, token2, "got a different token");
 });
 
 add_task(function* testSignOutDestroysTokens() {
   let client = new MockFxAccountsOAuthGrantClient();
   let fxa = yield createMockFxA(client);
 
   // get our first token and check we hit the mock.
-  let token1 = yield fxa.getOAuthToken({ scope: "test-scope", client: client });
+  let token1 = yield fxa.getOAuthToken({ scope: "test-scope", client });
   equal(client.numTokenFetches, 1);
   equal(client.activeTokens.size, 1);
   ok(token1, "got a token");
 
   // get another
-  let token2 = yield fxa.getOAuthToken({ scope: "test-scope-2", client: client });
+  let token2 = yield fxa.getOAuthToken({ scope: "test-scope-2", client });
   equal(client.numTokenFetches, 2);
   equal(client.activeTokens.size, 2);
   ok(token2, "got a token");
   notEqual(token1, token2, "got a different token");
 
   // now sign out - they should be removed.
   yield fxa.signOut();
   // FxA fires an observer when the "background" signout is complete.
@@ -217,20 +217,20 @@ add_task(function* testTokenRaces() {
 
   // We should see 2 notifications as part of this - set up the listeners
   // now (and wait on them later)
   let notifications = Promise.all([
     promiseNotification("testhelper-fxa-revoke-complete"),
     promiseNotification("testhelper-fxa-revoke-complete"),
   ]);
   let results = yield Promise.all([
-    fxa.getOAuthToken({scope: "test-scope", client: client}),
-    fxa.getOAuthToken({scope: "test-scope", client: client}),
-    fxa.getOAuthToken({scope: "test-scope-2", client: client}),
-    fxa.getOAuthToken({scope: "test-scope-2", client: client}),
+    fxa.getOAuthToken({scope: "test-scope", client}),
+    fxa.getOAuthToken({scope: "test-scope", client}),
+    fxa.getOAuthToken({scope: "test-scope-2", client}),
+    fxa.getOAuthToken({scope: "test-scope-2", client}),
   ]);
 
   equal(client.numTokenFetches, 4, "should have fetched 4 tokens.");
   // We should see 2 of the 4 revoked due to the race.
   yield notifications;
 
   // Should have 2 unique tokens
   results.sort();
--- a/services/fxaccounts/tests/xpcshell/test_profile.js
+++ b/services/fxaccounts/tests/xpcshell/test_profile.js
@@ -14,53 +14,53 @@ Services.prefs.setCharPref("identity.fxa
 const STATUS_SUCCESS = 200;
 
 /**
  * Mock request responder
  * @param {String} response
  *        Mocked raw response from the server
  * @returns {Function}
  */
-var mockResponse = function (response) {
-  let Request = function (requestUri) {
+var mockResponse = function(response) {
+  let Request = function(requestUri) {
     // Store the request uri so tests can inspect it
     Request._requestUri = requestUri;
     return {
-      setHeader: function () {},
-      head: function () {
+      setHeader() {},
+      head() {
         this.response = response;
         this.onComplete();
       }
     };
   };
 
   return Request;
 };
 
 /**
  * Mock request error responder
  * @param {Error} error
  *        Error object
  * @returns {Function}
  */
-var mockResponseError = function (error) {
-  return function () {
+var mockResponseError = function(error) {
+  return function() {
     return {
-      setHeader: function () {},
-      head: function () {
+      setHeader() {},
+      head() {
         this.onComplete(error);
       }
     };
   };
 };
 
-var mockClient = function (fxa) {
+var mockClient = function(fxa) {
   let options = {
     serverURL: "http://127.0.0.1:1111/v1",
-    fxa: fxa,
+    fxa,
   }
   return new FxAccountsProfileClient(options);
 };
 
 const ACCOUNT_DATA = {
   uid: "abc123"
 };
 
@@ -69,46 +69,46 @@ function FxaMock() {
 FxaMock.prototype = {
   currentAccountState: {
     profile: null,
     get isCurrent() {
       return true;
     }
   },
 
-  getSignedInUser: function () {
+  getSignedInUser() {
     return Promise.resolve(ACCOUNT_DATA);
   }
 };
 
 var mockFxa = function() {
   return new FxaMock();
 };
 
 function CreateFxAccountsProfile(fxa = null, client = null) {
   if (!fxa) {
     fxa = mockFxa();
   }
   let options = {
-    fxa: fxa,
+    fxa,
     profileServerUrl: "http://127.0.0.1:1111/v1"
   }
   if (client) {
     options.profileClient = client;
   }
   return new FxAccountsProfile(options);
 }
 
 add_test(function getCachedProfile() {
   let profile = CreateFxAccountsProfile();
   // a little pointless until bug 1157529 is fixed...
   profile._cachedProfile = { avatar: "myurl" };
 
   return profile._getCachedProfile()
-    .then(function (cached) {
+    .then(function(cached) {
       do_check_eq(cached.avatar, "myurl");
       run_next_test();
     });
 });
 
 add_test(function cacheProfile_change() {
   let fxa = mockFxa();
 /* Saving profile data disabled - bug 1157529
@@ -116,50 +116,50 @@ add_test(function cacheProfile_change() 
   fxa.setUserAccountData = function (data) {
     setUserAccountDataCalled = true;
     do_check_eq(data.profile.avatar, "myurl");
     return Promise.resolve();
   };
 */
   let profile = CreateFxAccountsProfile(fxa);
 
-  makeObserver(ON_PROFILE_CHANGE_NOTIFICATION, function (subject, topic, data) {
+  makeObserver(ON_PROFILE_CHANGE_NOTIFICATION, function(subject, topic, data) {
     do_check_eq(data, ACCOUNT_DATA.uid);
 //    do_check_true(setUserAccountDataCalled); - bug 1157529
     run_next_test();
   });
 
   return profile._cacheProfile({ avatar: "myurl" });
 });
 
 add_test(function cacheProfile_no_change() {
   let fxa = mockFxa();
   let profile = CreateFxAccountsProfile(fxa)
   profile._cachedProfile = { avatar: "myurl" };
 // XXX - saving is disabled (but we can leave that in for now as we are
 // just checking it is *not* called)
-  fxa.setSignedInUser = function (data) {
+  fxa.setSignedInUser = function(data) {
     throw new Error("should not update account data");
   };
 
   return profile._cacheProfile({ avatar: "myurl" })
     .then((result) => {
       do_check_false(!!result);
       run_next_test();
     });
 });
 
 add_test(function fetchAndCacheProfile_ok() {
   let client = mockClient(mockFxa());
-  client.fetchProfile = function () {
+  client.fetchProfile = function() {
     return Promise.resolve({ avatar: "myimg"});
   };
   let profile = CreateFxAccountsProfile(null, client);
 
-  profile._cacheProfile = function (toCache) {
+  profile._cacheProfile = function(toCache) {
     do_check_eq(toCache.avatar, "myimg");
     return Promise.resolve();
   };
 
   return profile._fetchAndCacheProfile()
     .then(result => {
       do_check_eq(result.avatar, "myimg");
       run_next_test();
@@ -172,17 +172,17 @@ add_task(function* fetchAndCacheProfileO
   // A promise that remains unresolved while we fire off 2 requests for
   // a profile.
   let resolveProfile;
   let promiseProfile = new Promise(resolve => {
     resolveProfile = resolve;
   });
   let numFetches = 0;
   let client = mockClient(mockFxa());
-  client.fetchProfile = function () {
+  client.fetchProfile = function() {
     numFetches += 1;
     return promiseProfile;
   };
   let profile = CreateFxAccountsProfile(null, client);
 
   let request1 = profile._fetchAndCacheProfile();
   let request2 = profile._fetchAndCacheProfile();
 
@@ -204,22 +204,22 @@ add_task(function* fetchAndCacheProfileO
 });
 
 // Check that sharing a single fetch promise works correctly when the promise
 // is rejected.
 add_task(function* fetchAndCacheProfileOnce() {
   // A promise that remains unresolved while we fire off 2 requests for
   // a profile.
   let rejectProfile;
-  let promiseProfile = new Promise((resolve,reject) => {
+  let promiseProfile = new Promise((resolve, reject) => {
     rejectProfile = reject;
   });
   let numFetches = 0;
   let client = mockClient(mockFxa());
-  client.fetchProfile = function () {
+  client.fetchProfile = function() {
     numFetches += 1;
     return promiseProfile;
   };
   let profile = CreateFxAccountsProfile(null, client);
 
   let request1 = profile._fetchAndCacheProfile();
   let request2 = profile._fetchAndCacheProfile();
 
@@ -244,30 +244,30 @@ add_task(function* fetchAndCacheProfileO
     throw new Error("should have rejected");
   } catch (ex) {
     if (ex != "oh noes") {
       throw ex;
     }
   }
 
   // but a new request should work.
-  client.fetchProfile = function () {
+  client.fetchProfile = function() {
     return Promise.resolve({ avatar: "myimg"});
   };
 
   let got = yield profile._fetchAndCacheProfile();
   do_check_eq(got.avatar, "myimg");
 });
 
 // Check that a new profile request within PROFILE_FRESHNESS_THRESHOLD of the
 // last one doesn't kick off a new request to check the cached copy is fresh.
 add_task(function* fetchAndCacheProfileAfterThreshold() {
   let numFetches = 0;
   let client = mockClient(mockFxa());
-  client.fetchProfile = function () {
+  client.fetchProfile = function() {
     numFetches += 1;
     return Promise.resolve({ avatar: "myimg"});
   };
   let profile = CreateFxAccountsProfile(null, client);
   profile.PROFILE_FRESHNESS_THRESHOLD = 1000;
 
   yield profile.getProfile();
   do_check_eq(numFetches, 1);
@@ -284,17 +284,17 @@ add_task(function* fetchAndCacheProfileA
 });
 
 // Check that a new profile request within PROFILE_FRESHNESS_THRESHOLD of the
 // last one *does* kick off a new request if ON_PROFILE_CHANGE_NOTIFICATION
 // is sent.
 add_task(function* fetchAndCacheProfileBeforeThresholdOnNotification() {
   let numFetches = 0;
   let client = mockClient(mockFxa());
-  client.fetchProfile = function () {
+  client.fetchProfile = function() {
     numFetches += 1;
     return Promise.resolve({ avatar: "myimg"});
   };
   let profile = CreateFxAccountsProfile(null, client);
   profile.PROFILE_FRESHNESS_THRESHOLD = 1000;
 
   yield profile.getProfile();
   do_check_eq(numFetches, 1);
@@ -318,66 +318,66 @@ add_test(function tearDown_ok() {
   run_next_test();
 });
 
 add_test(function getProfile_ok() {
   let cachedUrl = "myurl";
   let didFetch = false;
 
   let profile = CreateFxAccountsProfile();
-  profile._getCachedProfile = function () {
+  profile._getCachedProfile = function() {
     return Promise.resolve({ avatar: cachedUrl });
   };
 
-  profile._fetchAndCacheProfile = function () {
+  profile._fetchAndCacheProfile = function() {
     didFetch = true;
     return Promise.resolve();
   };
 
   return profile.getProfile()
     .then(result => {
       do_check_eq(result.avatar, cachedUrl);
       do_check_true(didFetch);
       run_next_test();
     });
 });
 
 add_test(function getProfile_no_cache() {
   let fetchedUrl = "newUrl";
   let profile = CreateFxAccountsProfile();
-  profile._getCachedProfile = function () {
+  profile._getCachedProfile = function() {
     return Promise.resolve();
   };
 
-  profile._fetchAndCacheProfile = function () {
+  profile._fetchAndCacheProfile = function() {
     return Promise.resolve({ avatar: fetchedUrl });
   };
 
   return profile.getProfile()
     .then(result => {
       do_check_eq(result.avatar, fetchedUrl);
       run_next_test();
     });
 });
 
 add_test(function getProfile_has_cached_fetch_deleted() {
   let cachedUrl = "myurl";
 
   let fxa = mockFxa();
   let client = mockClient(fxa);
-  client.fetchProfile = function () {
+  client.fetchProfile = function() {
     return Promise.resolve({ avatar: null });
   };
 
   let profile = CreateFxAccountsProfile(fxa, client);
   profile._cachedProfile = { avatar: cachedUrl };
 
 // instead of checking this in a mocked "save" function, just check after the
 // observer
-  makeObserver(ON_PROFILE_CHANGE_NOTIFICATION, function (subject, topic, data) {
+  makeObserver(ON_PROFILE_CHANGE_NOTIFICATION, function(subject, topic, data) {
     profile.getProfile()
       .then(profileData => {
         do_check_null(profileData.avatar);
         run_next_test();
       });
   });
 
   return profile.getProfile()
@@ -386,17 +386,17 @@ add_test(function getProfile_has_cached_
     });
 });
 
 function run_test() {
   run_next_test();
 }
 
 function makeObserver(aObserveTopic, aObserveFunc) {
-  let callback = function (aSubject, aTopic, aData) {
+  let callback = function(aSubject, aTopic, aData) {
     log.debug("observed " + aTopic + " " + aData);
     if (aTopic == aObserveTopic) {
       removeMe();
       aObserveFunc(aSubject, aTopic, aData);
     }
   };
 
   function removeMe() {
--- a/services/fxaccounts/tests/xpcshell/test_profile_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_profile_client.js
@@ -9,23 +9,23 @@ Cu.import("resource://gre/modules/FxAcco
 const STATUS_SUCCESS = 200;
 
 /**
  * Mock request responder
  * @param {String} response
  *        Mocked raw response from the server
  * @returns {Function}
  */
-var mockResponse = function (response) {
-  let Request = function (requestUri) {
+var mockResponse = function(response) {
+  let Request = function(requestUri) {
     // Store the request uri so tests can inspect it
     Request._requestUri = requestUri;
     return {
-      setHeader: function () {},
-      get: function () {
+      setHeader() {},
+      get() {
         this.response = response;
         this.onComplete();
       }
     };
   };
 
   return Request;
 };
@@ -46,95 +46,95 @@ const PROFILE_OPTIONS = {
 };
 
 /**
  * Mock request error responder
  * @param {Error} error
  *        Error object
  * @returns {Function}
  */
-var mockResponseError = function (error) {
-  return function () {
+var mockResponseError = function(error) {
+  return function() {
     return {
-      setHeader: function () {},
-      get: function () {
+      setHeader() {},
+      get() {
         this.onComplete(error);
       }
     };
   };
 };
 
-add_test(function successfulResponse () {
+add_test(function successfulResponse() {
   let client = new FxAccountsProfileClient(PROFILE_OPTIONS);
   let response = {
     success: true,
     status: STATUS_SUCCESS,
     body: "{\"email\":\"someone@restmail.net\",\"uid\":\"0d5c1a89b8c54580b8e3e8adadae864a\"}",
   };
 
   client._Request = new mockResponse(response);
   client.fetchProfile()
     .then(
-      function (result) {
+      function(result) {
         do_check_eq(client._Request._requestUri, "http://127.0.0.1:1111/v1/profile");
         do_check_eq(result.email, "someone@restmail.net");
         do_check_eq(result.uid, "0d5c1a89b8c54580b8e3e8adadae864a");
         run_next_test();
       }
     );
 });
 
-add_test(function parseErrorResponse () {
+add_test(function parseErrorResponse() {
   let client = new FxAccountsProfileClient(PROFILE_OPTIONS);
   let response = {
     success: true,
     status: STATUS_SUCCESS,
     body: "unexpected",
   };
 
   client._Request = new mockResponse(response);
   client.fetchProfile()
     .then(
       null,
-      function (e) {
+      function(e) {
         do_check_eq(e.name, "FxAccountsProfileClientError");
         do_check_eq(e.code, STATUS_SUCCESS);
         do_check_eq(e.errno, ERRNO_PARSE);
         do_check_eq(e.error, ERROR_PARSE);
         do_check_eq(e.message, "unexpected");
         run_next_test();
       }