From 18473f1844a8230130e1fc23d7ebf7d33183316f Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 6 Oct 2018 07:09:02 +0200 Subject: Update sync client for JS changes. --- services/sync/modules/util.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'services/sync/modules/util.js') diff --git a/services/sync/modules/util.js b/services/sync/modules/util.js index 67cc3f063..b063a29ac 100644 --- a/services/sync/modules/util.js +++ b/services/sync/modules/util.js @@ -4,7 +4,7 @@ this.EXPORTED_SYMBOLS = ["XPCOMUtils", "Services", "Utils", "Async", "Svc", "Str"]; -const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; +var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; Cu.import("resource://gre/modules/Log.jsm"); Cu.import("resource://services-common/observers.js"); @@ -338,12 +338,14 @@ this.Utils = { try { json = yield CommonUtils.readJSON(path); - } catch (e if e instanceof OS.File.Error && e.becauseNoSuchFile) { - // Ignore non-existent files. } catch (e) { - if (that._log) { - that._log.debug("Failed to load json: " + - CommonUtils.exceptionStr(e)); + if (e instanceof OS.File.Error && e.becauseNoSuchFile) { + // Ignore non-existent files, but explicitly return null. + json = null; + } else { + if (that._log) { + that._log.debug("Failed to load json", e); + } } } @@ -690,7 +692,7 @@ Svc.Prefs = new Preferences(PREFS_BRANCH); Svc.DefaultPrefs = new Preferences({branch: PREFS_BRANCH, defaultBranch: true}); Svc.Obs = Observers; -let _sessionCID = Services.appinfo.ID == SEAMONKEY_ID ? +var _sessionCID = Services.appinfo.ID == SEAMONKEY_ID ? "@mozilla.org/suite/sessionstore;1" : "@mozilla.org/browser/sessionstore;1"; -- cgit v1.2.3