diff options
Diffstat (limited to 'toolkit/modules')
-rw-r--r-- | toolkit/modules/AppConstants.jsm | 14 | ||||
-rw-r--r-- | toolkit/modules/NewTabUtils.jsm | 20 | ||||
-rw-r--r-- | toolkit/modules/PermissionsUtils.jsm | 5 | ||||
-rw-r--r-- | toolkit/modules/UpdateUtils.jsm | 18 | ||||
-rw-r--r-- | toolkit/modules/moz.build | 7 | ||||
-rw-r--r-- | toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm | 5 | ||||
-rw-r--r-- | toolkit/modules/tests/xpcshell/test_Log.js | 6 |
7 files changed, 18 insertions, 57 deletions
diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm index 7c8a046e9..ae0eea1c4 100644 --- a/toolkit/modules/AppConstants.jsm +++ b/toolkit/modules/AppConstants.jsm @@ -102,13 +102,6 @@ MOZ_SAFE_BROWSING: false, #endif - MOZ_SERVICES_CLOUDSYNC: -#ifdef MOZ_SERVICES_CLOUDSYNC - true, -#else - false, -#endif - MOZ_UPDATER: #ifdef MOZ_UPDATER true, @@ -180,13 +173,6 @@ MOZ_SAFE_BROWSING: false, #endif - MOZ_MAINTENANCE_SERVICE: -#ifdef MOZ_MAINTENANCE_SERVICE - true, -#else - false, -#endif - DEBUG: #ifdef DEBUG true, diff --git a/toolkit/modules/NewTabUtils.jsm b/toolkit/modules/NewTabUtils.jsm index 548d87dda..35e38156f 100644 --- a/toolkit/modules/NewTabUtils.jsm +++ b/toolkit/modules/NewTabUtils.jsm @@ -119,18 +119,14 @@ LinksStorage.prototype = { get _storedVersion() { if (this.__storedVersion === undefined) { - try { - this.__storedVersion = - Services.prefs.getIntPref("browser.newtabpage.storageVersion"); - } catch (ex) { - // The storage version is unknown, so either: - // - it's a new profile - // - it's a profile where versioning information got lost - // In this case we still run through all of the valid migrations, - // starting from 1, as if it was a downgrade. As previously stated the - // migrations should already support running on an updated store. - this.__storedVersion = 1; - } + // The storage version is unknown, so either: + // - it's a new profile + // - it's a profile where versioning information got lost + // In this case we still run through all of the valid migrations, + // starting from 1, as if it was a downgrade. As previously stated the + // migrations should already support running on an updated store. + this.__storedVersion = + Services.prefs.getIntPref("browser.newtabpage.storageVersion", 1); } return this.__storedVersion; }, diff --git a/toolkit/modules/PermissionsUtils.jsm b/toolkit/modules/PermissionsUtils.jsm index dfed76f0c..4bf43a3ec 100644 --- a/toolkit/modules/PermissionsUtils.jsm +++ b/toolkit/modules/PermissionsUtils.jsm @@ -16,10 +16,7 @@ function importPrefBranch(aPrefBranch, aPermission, aAction) { let list = Services.prefs.getChildList(aPrefBranch, {}); for (let pref of list) { - let origins = ""; - try { - origins = Services.prefs.getCharPref(pref); - } catch (e) {} + let origins = Services.prefs.getCharPref(pref, ""); if (!origins) continue; diff --git a/toolkit/modules/UpdateUtils.jsm b/toolkit/modules/UpdateUtils.jsm index e92b1b797..4e796a2da 100644 --- a/toolkit/modules/UpdateUtils.jsm +++ b/toolkit/modules/UpdateUtils.jsm @@ -31,13 +31,9 @@ this.UpdateUtils = { * Whether or not to include the partner bits. Default: true. */ getUpdateChannel(aIncludePartners = true) { - let channel = AppConstants.MOZ_UPDATE_CHANNEL; let defaults = Services.prefs.getDefaultBranch(null); - try { - channel = defaults.getCharPref("app.update.channel"); - } catch (e) { - // use default value when pref not found - } + let channel = defaults.getCharPref("app.update.channel", + AppConstants.MOZ_UPDATE_CHANNEL); if (aIncludePartners) { try { @@ -93,15 +89,7 @@ this.UpdateUtils = { /* Get the distribution pref values, from defaults only */ function getDistributionPrefValue(aPrefName) { - var prefValue = "default"; - - try { - prefValue = Services.prefs.getDefaultBranch(null).getCharPref(aPrefName); - } catch (e) { - // use default when pref not found - } - - return prefValue; + return prefValue = Services.prefs.getDefaultBranch(null).getCharPref(aPrefName, "default"); } /** diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build index 948d8d2c9..8f66417c1 100644 --- a/toolkit/modules/moz.build +++ b/toolkit/modules/moz.build @@ -103,11 +103,9 @@ EXTRA_JS_MODULES.sessionstore += ['sessionstore/Utils.jsm'] EXTRA_PP_JS_MODULES += [ 'NewTabUtils.jsm', 'Troubleshoot.jsm', + 'UpdateChannel.jsm', ] -if not CONFIG['MOZ_WEBEXTENSIONS']: - EXTRA_PP_JS_MODULES += ['UpdateChannel.jsm'] - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'): DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1 @@ -153,8 +151,7 @@ for var in ('ANDROID_PACKAGE_NAME', for var in ('MOZ_TOOLKIT_SEARCH', 'MOZ_SYSTEM_NSS', 'MOZ_UPDATER', - 'MOZ_SWITCHBOARD', - 'MOZ_SERVICES_CLOUDSYNC'): + 'MOZ_SWITCHBOARD'): if CONFIG[var]: DEFINES[var] = True diff --git a/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm b/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm index cf9617ea1..4abc93ad1 100644 --- a/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm +++ b/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm @@ -186,10 +186,7 @@ var SimpleServiceDiscovery = { }, _searchFixedDevices: function _searchFixedDevices() { - let fixedDevices = null; - try { - fixedDevices = Services.prefs.getCharPref("browser.casting.fixedDevices"); - } catch (e) {} + let fixedDevices = Services.prefs.getCharPref("browser.casting.fixedDevices", ""); if (!fixedDevices) { return; diff --git a/toolkit/modules/tests/xpcshell/test_Log.js b/toolkit/modules/tests/xpcshell/test_Log.js index 429bbcc50..6aee99c93 100644 --- a/toolkit/modules/tests/xpcshell/test_Log.js +++ b/toolkit/modules/tests/xpcshell/test_Log.js @@ -381,12 +381,12 @@ add_task(function* log_message_with_params() { ob = function() {}; ob.toJSON = function() {throw "oh noes JSON"}; do_check_eq(formatMessage("Fail is ${sub}", {sub: ob}), - 'Fail is (function () {})'); + 'Fail is (function() {})'); // Fall back to .toString if both .toJSON and .toSource fail. ob.toSource = function() {throw "oh noes SOURCE"}; do_check_eq(formatMessage("Fail is ${sub}", {sub: ob}), - 'Fail is function () {}'); + 'Fail is function() {}'); // Fall back to '[object]' if .toJSON, .toSource and .toString fail. ob.toString = function() {throw "oh noes STRING"}; @@ -450,7 +450,7 @@ add_task(function* log_message_with_params() { // doesn't cause the logger to fail. let vOf = {a: 1, valueOf: function() {throw "oh noes valueOf"}}; do_check_eq(formatMessage("Broken valueOf ${}", vOf), - 'Broken valueOf ({a:1, valueOf:(function () {throw "oh noes valueOf"})})'); + 'Broken valueOf ({a:1, valueOf:(function() {throw "oh noes valueOf"})})'); // Test edge cases of bad data to formatter: // If 'params' is not an object, format it as a basic type. |