summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-02-23 20:40:09 -0500
committerKris Maglione <maglione.k@gmail.com>2011-02-23 20:40:09 -0500
commitd9fe3a736e34cae9dd47396505e2b2f2c8ab7f56 (patch)
tree10c391489121a54ea81da47dce6d2fc8e896c74b
parent80ca9194ec2659e86661107ca81459c1e33c748a (diff)
downloadpentadactyl-d9fe3a736e34cae9dd47396505e2b2f2c8ab7f56.tar.gz
Fix live XPI update.
-rw-r--r--common/content/dactyl.js4
-rw-r--r--common/modules/bootstrap.jsm12
-rw-r--r--common/modules/config.jsm2
-rw-r--r--common/modules/contexts.jsm2
4 files changed, 11 insertions, 9 deletions
diff --git a/common/content/dactyl.js b/common/content/dactyl.js
index 3eccba53..9e17bbf9 100644
--- a/common/content/dactyl.js
+++ b/common/content/dactyl.js
@@ -68,9 +68,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
if (mod instanceof ModuleBase || mod && mod.isLocalModule) {
mod.stale = true;
if ("cleanup" in mod)
- this.trapErrors(mod.cleanup, mod);
+ this.trapErrors("cleanup", mod);
if ("destroy" in mod)
- this.trapErrors(mod.destroy, mod);
+ this.trapErrors("destroy", mod);
}
for (let mod in values(mods))
diff --git a/common/modules/bootstrap.jsm b/common/modules/bootstrap.jsm
index 4b5b531a..833927fa 100644
--- a/common/modules/bootstrap.jsm
+++ b/common/modules/bootstrap.jsm
@@ -7,18 +7,20 @@
try {
var EXPORTED_SYMBOLS = ["JSMLoader"];
-var global = this;
var BOOTSTRAP_CONTRACT = "@dactyl.googlecode.com/base/bootstrap";
var JSMLoader = BOOTSTRAP_CONTRACT in Components.classes &&
Components.classes[BOOTSTRAP_CONTRACT].getService().wrappedJSObject.loader;
-if (!JSMLoader || JSMLoader.bump != 4)
+if (JSMLoader && JSMLoader.bump === 4)
+ JSMLoader.global = this;
+else
JSMLoader = {
bump: 4,
builtin: Components.utils.Sandbox(this),
canonical: {},
factories: [],
+ global: this,
globals: JSMLoader ? JSMLoader.globals : {},
io: Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService),
loader: Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader),
@@ -29,9 +31,9 @@ if (!JSMLoader || JSMLoader.bump != 4)
this.initialized = true;
this.suffix = suffix || "";
- let base = this.load("base.jsm", global);
- global.EXPORTED_SYMBOLS = base.EXPORTED_SYMBOLS;
- global.JSMLoader = this;
+ let base = this.load("base.jsm", this.global);
+ this.global.EXPORTED_SYMBOLS = base.EXPORTED_SYMBOLS;
+ this.global.JSMLoader = this;
base.JSMLoader = this;
},
getTarget: function getTarget(url) {
diff --git a/common/modules/config.jsm b/common/modules/config.jsm
index 9743df7c..d1680f73 100644
--- a/common/modules/config.jsm
+++ b/common/modules/config.jsm
@@ -130,7 +130,7 @@ var ConfigBase = Class("ConfigBase", {
branch: Class.memoize(function () {
if (this.haveHg)
return io.system(this.haveHg.concat(["branch"])).output;
- return (/pre-hg\d+-(.*)$/.exec(this.version) || [])[1];
+ return (/pre-hg\d+-(\S*)$/.exec(this.version) || [])[1];
}),
/** @property {string} The Dactyl version string. */
diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm
index 1dafd148..97700acf 100644
--- a/common/modules/contexts.jsm
+++ b/common/modules/contexts.jsm
@@ -270,7 +270,7 @@ var Contexts = Module("contexts", {
activeGroups: function (uri, doc) {
if (!uri)
({ uri, doc }) = this.modules.buffer;
- return this.initializedGroups().filter(function (g) g.filter(uri, doc));
+ return this.initializedGroups().filter(function (g) uri && g.filter(uri, doc));
},
flush: function flush() {