1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 03:07:58 +01:00

moar content prefs fixes.

This commit is contained in:
Kris Maglione
2014-02-16 16:51:26 -08:00
parent dee8fc3bba
commit 70a5fc23ed

View File

@@ -85,10 +85,12 @@ var Buffer = Module("Buffer", {
* @param {string} pref The name of the preference to return. * @param {string} pref The name of the preference to return.
* @returns {Promise<string>} * @returns {Promise<string>}
*/ */
get: promises.withCallbacks(function get([resolve], pref) { get: promises.withCallbacks(function get([resolve, reject], pref) {
services.contentPrefs.getByDomainAndName( services.contentPrefs.getByDomainAndName(
self.uri.spec, pref, self.loadContext, self.uri.spec, pref, self.loadContext,
resolve); { handleCompletion: () => {},
handleResult: resolve,
handleError: reject });
}), }),
/** /**
@@ -97,10 +99,12 @@ var Buffer = Module("Buffer", {
* @param {string} pref The preference to set. * @param {string} pref The preference to set.
* @param {string} value The value to store. * @param {string} value The value to store.
*/ */
set: promises.withCallbacks(function set([resolve], pref, value) { set: promises.withCallbacks(function set([resolve, reject], pref, value) {
services.contentPrefs.set( services.contentPrefs.set(
self.uri.spec, pref, value, self.loadContext, self.uri.spec, pref, value, self.loadContext,
resolve); { handleCompletion: () => {},
handleResult: resolve,
handleError: reject });
}), }),
/** /**
@@ -108,9 +112,12 @@ var Buffer = Module("Buffer", {
* *
* @param {string} pref The preference to clear. * @param {string} pref The preference to clear.
*/ */
clear: promises.withCallbacks(function clear([resolve], pref) { clear: promises.withCallbacks(function clear([resolve, reject], pref) {
services.contentPrefs.removeByDomainAndName( services.contentPrefs.removeByDomainAndName(
self.uri.spec, pref, self.loadContext, resolve); self.uri.spec, pref, self.loadContext,
{ handleCompletion: () => {},
handleResult: resolve,
handleError: reject });
}) })
})), })),