From b2f0fcf3c4cd47d68837272243b870410eeb9a25 Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Mon, 30 May 2022 15:19:38 +0000 Subject: [PATCH] Bug 1610653 - Part 8: Do not use global this property assignment to define global variable in services/sync. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D144115 --- services/sync/modules/SyncDisconnect.jsm | 6 +++--- services/sync/modules/engines/prefs.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/sync/modules/SyncDisconnect.jsm b/services/sync/modules/SyncDisconnect.jsm index 9ac237f771fa..02da5be0557b 100644 --- a/services/sync/modules/SyncDisconnect.jsm +++ b/services/sync/modules/SyncDisconnect.jsm @@ -23,9 +23,9 @@ XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function() { return ChromeUtils.import("resource://gre/modules/FxAccountsCommon.js"); }); -this.EXPORTED_SYMBOLS = ["SyncDisconnectInternal", "SyncDisconnect"]; +const EXPORTED_SYMBOLS = ["SyncDisconnectInternal", "SyncDisconnect"]; -this.SyncDisconnectInternal = { +const SyncDisconnectInternal = { lockRetryInterval: 1000, // wait 1 seconds before trying for the lock again. lockRetryCount: 120, // Try 120 times (==2 mins) before giving up in disgust. promiseDisconnectFinished: null, // If we are sanitizing, a promise for completion. @@ -226,7 +226,7 @@ this.SyncDisconnectInternal = { }, }; -this.SyncDisconnect = { +const SyncDisconnect = { get promiseDisconnectFinished() { return SyncDisconnectInternal.promiseDisconnectFinished; }, diff --git a/services/sync/modules/engines/prefs.js b/services/sync/modules/engines/prefs.js index 24b488d15a4b..46be11f92019 100644 --- a/services/sync/modules/engines/prefs.js +++ b/services/sync/modules/engines/prefs.js @@ -62,7 +62,7 @@ XPCOMUtils.defineLazyGetter(this, "PREFS_DOC_URL", () => ); // Check for a local control pref or PREF_SYNC_PREFS_ARBITRARY -this.isAllowedPrefName = function(prefName) { +function isAllowedPrefName(prefName) { if (prefName == PREF_SYNC_PREFS_ARBITRARY) { return false; // never allow this. } @@ -80,7 +80,7 @@ this.isAllowedPrefName = function(prefName) { } catch (_) { return false; } -}; +} function PrefRec(collection, id) { CryptoWrapper.call(this, collection, id);