1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-04 03:25:47 +01:00

Dequote preference names in :set!

This commit is contained in:
Kris Maglione
2011-09-07 07:25:05 -04:00
parent 34e9e55489
commit 0064665749
4 changed files with 15 additions and 12 deletions

14
common/bootstrap.js vendored
View File

@@ -238,15 +238,13 @@ function init() {
JSMLoader.load("base.jsm", global); JSMLoader.load("base.jsm", global);
if (!(BOOTSTRAP_CONTRACT in Cc)) { if (!(BOOTSTRAP_CONTRACT in Cc)) {
let factory = { // Use Sandbox to prevent closures over this scope
classID: Components.ID("{f541c8b0-fe26-4621-a30b-e77d21721fb5}"), let sandbox = Cu.Sandbox(Cc["@mozilla.org/systemprincipal;1"].getService());
contractID: BOOTSTRAP_CONTRACT, let factory = Cu.evalInSandbox("({ createInstance: function () this })", sandbox);
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory]),
// Use Sandbox to prevent closures over this scope factory.classID = Components.ID("{f541c8b0-fe26-4621-a30b-e77d21721fb5}");
createInstance: Cu.evalInSandbox("(function () this)", factory.contractID = BOOTSTRAP_CONTRACT;
Cu.Sandbox(Cc["@mozilla.org/systemprincipal;1"].getService())) factory.QueryInterface = XPCOMUtils.generateQI([Ci.nsIFactory]);
};
factory.wrappedJSObject = factory; factory.wrappedJSObject = factory;
manager.registerFactory(factory.classID, String(factory.classID), manager.registerFactory(factory.classID, String(factory.classID),

View File

@@ -1101,6 +1101,7 @@ var Options = Module("options", {
invertBoolean = (postfix == "!"); invertBoolean = (postfix == "!");
} }
name = Option.dequote(name);
if (name == "all" && reset) if (name == "all" && reset)
modules.commandline.input(_("pref.prompt.resetAll", config.host) + " ", modules.commandline.input(_("pref.prompt.resetAll", config.host) + " ",
function (resp) { function (resp) {

View File

@@ -48,6 +48,7 @@ var Services = Module("Services", {
this.add("json", "@mozilla.org/dom/json;1", "nsIJSON", "createInstance"); this.add("json", "@mozilla.org/dom/json;1", "nsIJSON", "createInstance");
this.add("listeners", "@mozilla.org/eventlistenerservice;1", "nsIEventListenerService"); this.add("listeners", "@mozilla.org/eventlistenerservice;1", "nsIEventListenerService");
this.add("livemark", "@mozilla.org/browser/livemark-service;2", "nsILivemarkService"); this.add("livemark", "@mozilla.org/browser/livemark-service;2", "nsILivemarkService");
this.add("messages", "@mozilla.org/globalmessagemanager;1", "nsIChromeFrameMessageManager");
this.add("mime", "@mozilla.org/mime;1", "nsIMIMEService"); this.add("mime", "@mozilla.org/mime;1", "nsIMIMEService");
this.add("observer", "@mozilla.org/observer-service;1", "nsIObserverService"); this.add("observer", "@mozilla.org/observer-service;1", "nsIObserverService");
this.add("pref", "@mozilla.org/preferences-service;1", ["nsIPrefBranch2", "nsIPrefService"]); this.add("pref", "@mozilla.org/preferences-service;1", ["nsIPrefBranch2", "nsIPrefService"]);

View File

@@ -422,7 +422,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @returns [string] The resulting strings. * @returns [string] The resulting strings.
*/ */
debrace: function debrace(pattern) { debrace: function debrace(pattern) {
let res = []; var res = [];
if (isArray(pattern)) { if (isArray(pattern)) {
let rec = function rec(acc) { let rec = function rec(acc) {
@@ -1117,10 +1117,13 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
}), }),
/** /**
* Flushes the startup cache. * Flushes the startup or jar cache.
*/ */
flushCache: function flushCache() { flushCache: function flushCache(file) {
services.observer.notifyObservers(null, "startupcache-invalidate", ""); if (file)
services.observer.notifyObservers(file, "flush-cache-entry", "");
else
services.observer.notifyObservers(null, "startupcache-invalidate", "");
}, },
/** /**