mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-19 07:25:44 +01:00
Fix live XPI update.
This commit is contained in:
@@ -68,9 +68,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
if (mod instanceof ModuleBase || mod && mod.isLocalModule) {
|
if (mod instanceof ModuleBase || mod && mod.isLocalModule) {
|
||||||
mod.stale = true;
|
mod.stale = true;
|
||||||
if ("cleanup" in mod)
|
if ("cleanup" in mod)
|
||||||
this.trapErrors(mod.cleanup, mod);
|
this.trapErrors("cleanup", mod);
|
||||||
if ("destroy" in mod)
|
if ("destroy" in mod)
|
||||||
this.trapErrors(mod.destroy, mod);
|
this.trapErrors("destroy", mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let mod in values(mods))
|
for (let mod in values(mods))
|
||||||
|
|||||||
@@ -7,18 +7,20 @@
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["JSMLoader"];
|
var EXPORTED_SYMBOLS = ["JSMLoader"];
|
||||||
var global = this;
|
|
||||||
|
|
||||||
var BOOTSTRAP_CONTRACT = "@dactyl.googlecode.com/base/bootstrap";
|
var BOOTSTRAP_CONTRACT = "@dactyl.googlecode.com/base/bootstrap";
|
||||||
var JSMLoader = BOOTSTRAP_CONTRACT in Components.classes &&
|
var JSMLoader = BOOTSTRAP_CONTRACT in Components.classes &&
|
||||||
Components.classes[BOOTSTRAP_CONTRACT].getService().wrappedJSObject.loader;
|
Components.classes[BOOTSTRAP_CONTRACT].getService().wrappedJSObject.loader;
|
||||||
|
|
||||||
if (!JSMLoader || JSMLoader.bump != 4)
|
if (JSMLoader && JSMLoader.bump === 4)
|
||||||
|
JSMLoader.global = this;
|
||||||
|
else
|
||||||
JSMLoader = {
|
JSMLoader = {
|
||||||
bump: 4,
|
bump: 4,
|
||||||
builtin: Components.utils.Sandbox(this),
|
builtin: Components.utils.Sandbox(this),
|
||||||
canonical: {},
|
canonical: {},
|
||||||
factories: [],
|
factories: [],
|
||||||
|
global: this,
|
||||||
globals: JSMLoader ? JSMLoader.globals : {},
|
globals: JSMLoader ? JSMLoader.globals : {},
|
||||||
io: Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService),
|
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),
|
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.initialized = true;
|
||||||
this.suffix = suffix || "";
|
this.suffix = suffix || "";
|
||||||
|
|
||||||
let base = this.load("base.jsm", global);
|
let base = this.load("base.jsm", this.global);
|
||||||
global.EXPORTED_SYMBOLS = base.EXPORTED_SYMBOLS;
|
this.global.EXPORTED_SYMBOLS = base.EXPORTED_SYMBOLS;
|
||||||
global.JSMLoader = this;
|
this.global.JSMLoader = this;
|
||||||
base.JSMLoader = this;
|
base.JSMLoader = this;
|
||||||
},
|
},
|
||||||
getTarget: function getTarget(url) {
|
getTarget: function getTarget(url) {
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
branch: Class.memoize(function () {
|
branch: Class.memoize(function () {
|
||||||
if (this.haveHg)
|
if (this.haveHg)
|
||||||
return io.system(this.haveHg.concat(["branch"])).output;
|
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. */
|
/** @property {string} The Dactyl version string. */
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ var Contexts = Module("contexts", {
|
|||||||
activeGroups: function (uri, doc) {
|
activeGroups: function (uri, doc) {
|
||||||
if (!uri)
|
if (!uri)
|
||||||
({ uri, doc }) = this.modules.buffer;
|
({ 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() {
|
flush: function flush() {
|
||||||
|
|||||||
Reference in New Issue
Block a user