diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-02-10 23:45:39 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-02-10 23:45:39 -0500 |
commit | 43a27346bdbf318c0eefb7e02e87abe65377a076 (patch) | |
tree | 6f99ae61191a8e3287ff99f80127bc095c3b1bd2 /common/modules/contexts.jsm | |
parent | 30e29714247c58dc011bbf69a31cef9450fb8f9d (diff) | |
download | pentadactyl-43a27346bdbf318c0eefb7e02e87abe65377a076.tar.gz |
Fix bugs yay.
--HG--
branch : groups
Diffstat (limited to 'common/modules/contexts.jsm')
-rw-r--r-- | common/modules/contexts.jsm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm index 98c130fa..75f271e5 100644 --- a/common/modules/contexts.jsm +++ b/common/modules/contexts.jsm @@ -80,14 +80,16 @@ var Contexts = Module("contexts", { const contexts = this; this.modules = modules; + modules.plugins.contexts = {}; + this.groupList = []; this.groupMap = {}; this.groupsProto = {}; this.hives = {}; this.hiveProto = {}; - this.user = this.addGroup("user", "User-defined items", null, true); this.builtin = this.addGroup("builtin", "Builtin items"); + this.user = this.addGroup("user", "User-defined items", null, true); this.builtinGroups = [this.builtin, this.user]; this.builtin.modifiable = false; @@ -122,8 +124,8 @@ var Contexts = Module("contexts", { for (let hive in values(this.groupList)) util.trapErrors("destroy", hive); - for (let plugin in values(plugins.contexts)) - if (plugin.onUnload) + for (let [name, plugin] in iter(this.modules.plugins.contexts)) + if (plugin && "onUnload" in plugin) util.trapErrors("onUnload", plugin); }, @@ -360,8 +362,9 @@ var Contexts = Module("contexts", { action.macro = util.compileMacro(rhs, true); break; case "-ex": - action = function action() commands.execute(action.macro, makeParams(this, arguments), - false, null, action.context); + action = function action() this.modules.commands + .execute(action.macro, makeParams(this, arguments), + false, null, action.context); action.macro = util.compileMacro(rhs, true); action.context = this.context && update({}, this.context); break; |