summaryrefslogtreecommitdiff
path: root/common/modules/bootstrap.jsm
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-01-13 19:32:48 -0500
committerKris Maglione <maglione.k@gmail.com>2011-01-13 19:32:48 -0500
commite2b89a6af3887ffb8ad96916ff60184307fbe89a (patch)
treef30ca5806d9b964b107116d40052ee05131f06b9 /common/modules/bootstrap.jsm
parentca4942cd7cf619bd7a846c465ca6093539ddff6f (diff)
downloadpentadactyl-e2b89a6af3887ffb8ad96916ff60184307fbe89a.tar.gz
Remove some dead code and fix :rehash.
Diffstat (limited to 'common/modules/bootstrap.jsm')
-rw-r--r--common/modules/bootstrap.jsm22
1 files changed, 13 insertions, 9 deletions
diff --git a/common/modules/bootstrap.jsm b/common/modules/bootstrap.jsm
index 00758bc0..815fc28a 100644
--- a/common/modules/bootstrap.jsm
+++ b/common/modules/bootstrap.jsm
@@ -4,11 +4,12 @@
// given in the LICENSE.txt file included with this file.
"use strict";
+let is_bootstrap = 1;
+
try {
if (!JSMLoader || JSMLoader.bump != 1)
var JSMLoader = {
- global: this,
bump: 1,
builtin: Components.utils.Sandbox(this),
canonical: {},
@@ -20,6 +21,9 @@ if (!JSMLoader || JSMLoader.bump != 1)
stale: {},
suffix: "",
getTarget: function getTarget(url) {
+ if (url.indexOf(":") === -1)
+ url = "resource://dactyl" + this.suffix + "/" + url;
+
let chan = this.io.newChannel(url, null, null);
chan.cancel(Components.results.NS_BINDING_ABORTED);
return chan.name;
@@ -29,11 +33,11 @@ if (!JSMLoader || JSMLoader.bump != 1)
if (url.indexOf(":") === -1)
url = "resource://dactyl" + this.suffix + "/" + url;
- if (url in this.stale) {
- let stale = this.stale[url];
- delete this.stale[url];
+ if (name in this.stale) {
+ let stale = this.stale[name];
+ delete this.stale[name];
- let global = this.globals[url];
+ let global = this.globals[name];
if (stale === this.getTarget(url))
this.loadSubScript(url, global.global || global);
}
@@ -41,13 +45,13 @@ if (!JSMLoader || JSMLoader.bump != 1)
try {
let global = Components.utils.import(url, target);
- if (name == "base.jsm") {
+ if (name == "base.jsm" && target.is_bootstrap) {
+ target.EXPORTED_SYMBOLS = global.EXPORTED_SYMBOLS;
global.JSMLoader = this;
- Components.utils.import(url, this.global);
- this.global.EXPORTED_SYMBOLS = global.EXPORTED_SYMBOLS;
+ target.JSMLoader = this;
}
- return this.globals[url] = global;
+ return this.globals[name] = global;
}
catch (e) {
dump("Importing " + url + ": " + e + "\n" + (e.stack || Error().stack));