summaryrefslogtreecommitdiffstats
path: root/services/sync/modules/stages/enginesync.js
diff options
context:
space:
mode:
Diffstat (limited to 'services/sync/modules/stages/enginesync.js')
-rw-r--r--services/sync/modules/stages/enginesync.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/services/sync/modules/stages/enginesync.js b/services/sync/modules/stages/enginesync.js
index ed91adddb..ce7fce94d 100644
--- a/services/sync/modules/stages/enginesync.js
+++ b/services/sync/modules/stages/enginesync.js
@@ -8,7 +8,7 @@
this.EXPORTED_SYMBOLS = ["EngineSynchronizer"];
-const {utils: Cu} = Components;
+var {utils: Cu} = Components;
Cu.import("resource://gre/modules/Log.jsm");
Cu.import("resource://services-sync/constants.js");
@@ -224,8 +224,15 @@ EngineSynchronizer.prototype = {
// If we're the only client, and no engines are marked as enabled,
// thumb our noses at the server data: it can't be right.
// Belt-and-suspenders approach to Bug 615926.
- if ((numClients <= 1) &&
- ([e for (e in meta.payload.engines) if (e != "clients")].length == 0)) {
+ let hasEnabledEngines = false;
+ for (let e in meta.payload.engines) {
+ if (e != "clients") {
+ hasEnabledEngines = true;
+ break;
+ }
+ }
+
+ if ((numClients <= 1) && !hasEnabledEngines) {
this._log.info("One client and no enabled engines: not touching local engine status.");
return;
}
@@ -289,7 +296,7 @@ EngineSynchronizer.prototype = {
}
// Any remaining engines were either enabled locally or disabled remotely.
- for each (let engineName in enabled) {
+ for (let engineName of enabled) {
let engine = engineManager.get(engineName);
if (Svc.Prefs.get("engineStatusChanged." + engine.prefName, false)) {
this._log.trace("The " + engineName + " engine was enabled locally.");