Index: lib/prefs.js |
diff --git a/lib/prefs.js b/lib/prefs.js |
index e1aa3f751c5feb430e5dfb83ada7917bd777bd9f..9770373dde089e346532fae7f706f8d8f660ee7b 100644 |
--- a/lib/prefs.js |
+++ b/lib/prefs.js |
@@ -188,7 +188,7 @@ let Prefs = exports.Prefs = { |
* @param {string} preference |
* @param {function} callback |
*/ |
- on: function(preference, callback) |
+ on: (preference, callback) => |
{ |
eventEmitter.on(preference, callback); |
}, |
@@ -199,7 +199,7 @@ let Prefs = exports.Prefs = { |
* @param {string} preference |
* @param {function} callback |
*/ |
- off: function(preference, callback) |
+ off: (preference, callback) => |
{ |
eventEmitter.off(preference, callback); |
}, |
@@ -230,11 +230,8 @@ function prefToKey(pref) |
function addPreference(pref) |
{ |
Object.defineProperty(Prefs, pref, { |
- get: function() |
- { |
- return (pref in overrides ? overrides : defaults)[pref]; |
- }, |
- set: function(value) |
+ get: () => (pref in overrides ? overrides : defaults)[pref], |
+ set: value => |
{ |
let defaultValue = defaults[pref]; |
@@ -262,7 +259,7 @@ function init() |
prefs.forEach(addPreference); |
let localLoaded = new Promise(resolve => { |
- ext.storage.get(prefs.map(prefToKey), function(items) |
+ ext.storage.get(prefs.map(prefToKey), items => |
{ |
for (let key in items) |
overrides[keyToPref(key)] = items[key]; |
@@ -274,7 +271,7 @@ function init() |
let managedLoaded = new Promise(resolve => { |
if (require("info").platform == "chromium" && "managed" in chrome.storage) |
{ |
- chrome.storage.managed.get(null, function(items) |
+ chrome.storage.managed.get(null, items => |
{ |
// Opera doesn't support chrome.storage.managed, but instead simply |
// removing the API, Opera sets chrome.runtime.lastError when using it. |
@@ -296,7 +293,7 @@ function init() |
function onLoaded() |
{ |
- ext.storage.onChanged.addListener(function(changes) |
+ ext.storage.onChanged.addListener(changes => |
{ |
for (let key in changes) |
{ |