diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-11-13 04:09:14 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-11-13 04:09:14 +0000 |
commit | 449a83920586649fa2d5d97fbf0989ef546fd133 (patch) | |
tree | 56a5ad80359766c2f9367ea1f64731932217d684 | |
parent | 3ffba43bf566c8655196df75f5ce1cc127e30af8 (diff) | |
download | prosody-449a83920586649fa2d5d97fbf0989ef546fd133.tar.gz prosody-449a83920586649fa2d5d97fbf0989ef546fd133.zip |
modulemanager: Inside plugins, have global _M as a reference to the module's environment
-rw-r--r-- | core/modulemanager.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 49ad12ac..c78c315b 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -117,6 +117,7 @@ function load(host, module_name, config) local pluginenv = setmetatable({ module = api_instance }, { __index = _G }); api_instance.environment = pluginenv; + pluginenv._M = pluginenv; setfenv(mod, pluginenv); hosts[host].modules = modulemap[host]; |