mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 23:57:59 +01:00
[bootstrap] Fix stupid bug.
--HG-- branch : bootstrapped
This commit is contained in:
2
common/bootstrap.js
vendored
2
common/bootstrap.js
vendored
@@ -95,7 +95,7 @@ FactoryProxy.prototype = {
|
|||||||
get module() {
|
get module() {
|
||||||
Object.defineProperty(this, "module", { value: {}, enumerable: true });
|
Object.defineProperty(this, "module", { value: {}, enumerable: true });
|
||||||
JSMLoader.load(this.url, this.module);
|
JSMLoader.load(this.url, this.module);
|
||||||
JSMLoader.registerGlobal(this.url, this.module.NSGetFactory);
|
JSMLoader.registerGlobal(this.url, this.module.global);
|
||||||
return this.module;
|
return this.module;
|
||||||
},
|
},
|
||||||
createInstance: function (iids) {
|
createInstance: function (iids) {
|
||||||
|
|||||||
@@ -4,7 +4,10 @@
|
|||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var Ci = Components.interfaces, Cc = Components.classes;
|
var global = this;
|
||||||
|
var Cc = Components.classes;
|
||||||
|
var Ci = Components.interfaces;
|
||||||
|
var Cu = Components.utils;
|
||||||
|
|
||||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
|
||||||
@@ -48,6 +51,6 @@ if (XPCOMUtils.generateNSGetFactory)
|
|||||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandLineHandler]);
|
var NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandLineHandler]);
|
||||||
else
|
else
|
||||||
var NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
|
var NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
|
||||||
var EXPORTED_SYMBOLS = ["NSGetFactory"];
|
var EXPORTED_SYMBOLS = ["NSGetFactory", "global"];
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -207,6 +207,6 @@ if (XPCOMUtils.generateNSGetFactory)
|
|||||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler, ChromeData, Dactyl, Shim]);
|
var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler, ChromeData, Dactyl, Shim]);
|
||||||
else
|
else
|
||||||
var NSGetModule = XPCOMUtils.generateNSGetModule([AboutHandler, ChromeData, Dactyl, Shim]);
|
var NSGetModule = XPCOMUtils.generateNSGetModule([AboutHandler, ChromeData, Dactyl, Shim]);
|
||||||
var EXPORTED_SYMBOLS = ["NSGetFactory"];
|
var EXPORTED_SYMBOLS = ["NSGetFactory", "global"];
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
@@ -2096,6 +2096,7 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
|||||||
if (!services.commandLineHandler)
|
if (!services.commandLineHandler)
|
||||||
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=" + config.name);
|
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=" + config.name);
|
||||||
|
|
||||||
|
if (services.commandlinehandler) {
|
||||||
let commandline = services.commandLineHandler.optionValue;
|
let commandline = services.commandLineHandler.optionValue;
|
||||||
if (commandline) {
|
if (commandline) {
|
||||||
let args = dactyl.parseCommandLine(commandline);
|
let args = dactyl.parseCommandLine(commandline);
|
||||||
@@ -2105,6 +2106,7 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
|||||||
dactyl.commandLineOptions.preCommands = args["++cmd"];
|
dactyl.commandLineOptions.preCommands = args["++cmd"];
|
||||||
util.dump("Processing command-line option: " + commandline);
|
util.dump("Processing command-line option: " + commandline);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dactyl.log("Command-line options: " + util.objectToString(dactyl.commandLineOptions), 3);
|
dactyl.log("Command-line options: " + util.objectToString(dactyl.commandLineOptions), 3);
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ if (!JSMLoader)
|
|||||||
let global = this.globals[url];
|
let global = this.globals[url];
|
||||||
for each (let prop in Object.getOwnPropertyNames(global))
|
for each (let prop in Object.getOwnPropertyNames(global))
|
||||||
try {
|
try {
|
||||||
if (!set.has(this.builtin, prop) && global[prop] != this && global[prop] != set)
|
if (!set.has(this.builtin, prop) && [this, set].indexOf(global[prop]) < 0)
|
||||||
delete global[prop]
|
delete global[prop];
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ if (!JSMLoader)
|
|||||||
},
|
},
|
||||||
registerGlobal: function registerGlobal(uri, obj) {
|
registerGlobal: function registerGlobal(uri, obj) {
|
||||||
if (Cu.getGlobalForObject)
|
if (Cu.getGlobalForObject)
|
||||||
this.globals[uri] = Cu.getGlobalForObject(obj);
|
this.globals[uri.replace(/.* -> /, "")] = Cu.getGlobalForObject(obj);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user