Bug 1291049 - Workaround to avoid failure when loading preferences draft
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 11 Oct 2016 22:08:25 +0200
changeset 424224 205e2aadefad
parent 424223 87dfcd071aa2
child 424225 6dd0f8b7bce0
push id32097
push userjdescottes@mozilla.com
push dateWed, 12 Oct 2016 10:38:17 +0000
bugs1291049
milestone52.0a1
Bug 1291049 - Workaround to avoid failure when loading preferences MozReview-Commit-ID: 3EstdroCPEG
devtools/client/shared/shim/Services.js
--- a/devtools/client/shared/shim/Services.js
+++ b/devtools/client/shared/shim/Services.js
@@ -241,17 +241,17 @@ PrefBranch.prototype = {
   _saveAndNotify: function () {
     let store = {
       type: this._type,
       defaultValue: this._defaultValue,
       hasUserValue: this._hasUserValue,
       userValue: this._userValue,
     };
 
-    localStorage.setItem(PREFIX + this.fullName, JSON.stringify(store));
+    localStorage.setItem(PREFIX + this._fullName, JSON.stringify(store));
     this._parent._notify(this._name);
   },
 
   /**
    * Change this preference's value without writing it back to local
    * storage.  This is used to handle changes to local storage that
    * were made externally.
    *
@@ -417,17 +417,19 @@ PrefBranch.prototype = {
       thePref._storageUpdated(type, userValue, hasUserValue, defaultValue);
     }
   },
 
   /**
    * Helper function to initialize the root PrefBranch.
    */
   _initializeRoot: function () {
-    if (localStorage.length === 0 && Services._defaultPrefsEnabled) {
+    // Only use the default prefs for now.
+    // if (localStorage.length === 0 && Services._defaultPrefsEnabled) {
+    if (Services._defaultPrefsEnabled) {
       /* eslint-disable no-eval */
       let devtools = require("raw!prefs!devtools/client/preferences/devtools");
       eval(devtools);
       let all = require("raw!prefs!modules/libpref/init/all");
       eval(all);
       /* eslint-enable no-eval */
     }