mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 16: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() {
|
||||
Object.defineProperty(this, "module", { value: {}, enumerable: true });
|
||||
JSMLoader.load(this.url, this.module);
|
||||
JSMLoader.registerGlobal(this.url, this.module.NSGetFactory);
|
||||
JSMLoader.registerGlobal(this.url, this.module.global);
|
||||
return this.module;
|
||||
},
|
||||
createInstance: function (iids) {
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"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");
|
||||
|
||||
@@ -48,6 +51,6 @@ if (XPCOMUtils.generateNSGetFactory)
|
||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandLineHandler]);
|
||||
else
|
||||
var NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
|
||||
var EXPORTED_SYMBOLS = ["NSGetFactory"];
|
||||
var EXPORTED_SYMBOLS = ["NSGetFactory", "global"];
|
||||
|
||||
// vim: set fdm=marker sw=4 ts=4 et:
|
||||
|
||||
@@ -207,6 +207,6 @@ if (XPCOMUtils.generateNSGetFactory)
|
||||
var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler, ChromeData, Dactyl, Shim]);
|
||||
else
|
||||
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:
|
||||
|
||||
@@ -2096,14 +2096,16 @@ const Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
||||
if (!services.commandLineHandler)
|
||||
services.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=" + config.name);
|
||||
|
||||
let commandline = services.commandLineHandler.optionValue;
|
||||
if (commandline) {
|
||||
let args = dactyl.parseCommandLine(commandline);
|
||||
dactyl.commandLineOptions.rcFile = args["+u"];
|
||||
dactyl.commandLineOptions.noPlugins = "++noplugin" in args;
|
||||
dactyl.commandLineOptions.postCommands = args["+c"];
|
||||
dactyl.commandLineOptions.preCommands = args["++cmd"];
|
||||
util.dump("Processing command-line option: " + commandline);
|
||||
if (services.commandlinehandler) {
|
||||
let commandline = services.commandLineHandler.optionValue;
|
||||
if (commandline) {
|
||||
let args = dactyl.parseCommandLine(commandline);
|
||||
dactyl.commandLineOptions.rcFile = args["+u"];
|
||||
dactyl.commandLineOptions.noPlugins = "++noplugin" in args;
|
||||
dactyl.commandLineOptions.postCommands = args["+c"];
|
||||
dactyl.commandLineOptions.preCommands = args["++cmd"];
|
||||
util.dump("Processing command-line option: " + commandline);
|
||||
}
|
||||
}
|
||||
|
||||
dactyl.log("Command-line options: " + util.objectToString(dactyl.commandLineOptions), 3);
|
||||
|
||||
@@ -18,8 +18,8 @@ if (!JSMLoader)
|
||||
let global = this.globals[url];
|
||||
for each (let prop in Object.getOwnPropertyNames(global))
|
||||
try {
|
||||
if (!set.has(this.builtin, prop) && global[prop] != this && global[prop] != set)
|
||||
delete global[prop]
|
||||
if (!set.has(this.builtin, prop) && [this, set].indexOf(global[prop]) < 0)
|
||||
delete global[prop];
|
||||
}
|
||||
catch (e) {}
|
||||
|
||||
@@ -36,7 +36,7 @@ if (!JSMLoader)
|
||||
},
|
||||
registerGlobal: function registerGlobal(uri, obj) {
|
||||
if (Cu.getGlobalForObject)
|
||||
this.globals[uri] = Cu.getGlobalForObject(obj);
|
||||
this.globals[uri.replace(/.* -> /, "")] = Cu.getGlobalForObject(obj);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user