summaryrefslogtreecommitdiff
path: root/common/content/modules.js
diff options
context:
space:
mode:
authorKris Maglione <kris@vimperator.org>2009-11-09 03:12:27 -0500
committerKris Maglione <kris@vimperator.org>2009-11-09 03:12:27 -0500
commita72068c9f792be065c84998d28227527f2d1dd45 (patch)
treeefda9a51f58edc285130ea45e8571fd7105445b1 /common/content/modules.js
parent4d88ccb0368b3697cca433de508cd23ecf15e481 (diff)
downloadpentadactyl-a72068c9f792be065c84998d28227527f2d1dd45.tar.gz
Refactor modules.config.
Diffstat (limited to 'common/content/modules.js')
-rw-r--r--common/content/modules.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/content/modules.js b/common/content/modules.js
index 7e1a0b1b..c7501c52 100644
--- a/common/content/modules.js
+++ b/common/content/modules.js
@@ -1,7 +1,10 @@
const ModuleBase = Class("ModuleBase", { requires: [] });
function Module(name, inst, clas, moduleInit) {
- const module = Class(name, ModuleBase, inst, clas);
+ var base = ModuleBase;
+ if (callable(inst))
+ base = Array.splice(arguments, 1, 1)[0]
+ const module = Class(name, base, inst, clas);
module.INIT = moduleInit || {};
module.requires = inst.requires || [];
Module.list.push(module);
@@ -12,7 +15,7 @@ Module.list = [];
Module.constructors = {};
window.addEventListener("load", function () {
- function dump(str) window.dump(String.replace(str, /\n?$/, "\n").replace(/^/m, config.name.toLowerCase() + ": "));
+ function dump(str) window.dump(String.replace(str, /\n?$/, "\n").replace(/^/m, Config.prototype.name.toLowerCase() + ": "));
const start = Date.now();
const deferredInit = { load: [] };
const seen = set();