Permalink
Browse files

Fix broken GM_ScriptStorage reference due to module-izing.

  • Loading branch information...
1 parent 62fed40 commit ecbde9d7eb7c32e65dd53aa46e86130c73efa7b0 @arantius arantius committed Dec 8, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 modules/script.js
View
@@ -426,13 +426,13 @@ Script.prototype.updateFromNewScript = function(newScript, safeWin, chromeWin) {
if (!GM_util.getService().config.installIsUpdate(newScript)) {
// Migrate preferences.
if (this.prefroot != newScript.prefroot) {
- var storageOld = new GM_ScriptStorage(this);
- var storageNew = new GM_ScriptStorage(newScript);
+ var prefmanOld = new GM_PrefManager(this.prefroot);
+ var prefmanNew = new GM_PrefManager(newScript.prefroot);
- var names = storageOld.listValues();
+ var names = prefmanOld.listValues();
for (var i = 0, name = null; name = names[i]; i++) {
- storageNew.setValue(name, storageOld.getValue(name));
- storageOld.deleteValue(name);
+ prefmanNew.setValue(name, prefmanOld.getValue(name));
+ prefmanOld.remove(name);
}
}

0 comments on commit ecbde9d

Please sign in to comment.