Index: lib/prefs.js |
=================================================================== |
--- a/lib/prefs.js |
+++ b/lib/prefs.js |
@@ -62,29 +62,31 @@ |
Cu.reportError(e); |
} |
}; |
- Prefs.__defineGetter__(name, function() value); |
- Prefs.__defineSetter__(name, function(newValue) |
- { |
- if (value == newValue) |
+ Object.defineProperty(Prefs, name, { |
+ get: () => value, |
+ set: function(newValue) |
+ { |
+ if (value == newValue) |
+ return value; |
+ |
+ try |
+ { |
+ ignorePrefChanges = true; |
+ writeFunc(branch, name, newValue); |
+ value = newValue; |
+ Services.prefs.savePrefFile(null); |
+ triggerListeners(name); |
+ } |
+ catch(e) |
+ { |
+ Cu.reportError(e); |
+ } |
+ finally |
+ { |
+ ignorePrefChanges = false; |
+ } |
return value; |
- |
- try |
- { |
- ignorePrefChanges = true; |
- writeFunc(branch, name, newValue); |
- value = newValue; |
- Services.prefs.savePrefFile(null); |
- triggerListeners(name); |
} |
- catch(e) |
- { |
- Cu.reportError(e); |
- } |
- finally |
- { |
- ignorePrefChanges = false; |
- } |
- return value; |
}); |
Prefs["_update_" + name](); |
} |