diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-04-21 22:53:22 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-04-21 22:53:22 +0100 |
commit | 60b60d9c30833600635e3a695362f903c812cd36 (patch) | |
tree | a0e8f1ac2424fa263da711a4214079e748bf245f /core | |
parent | e0a85aed90d0d4a5a6bcf8220cef38f15ec3844b (diff) | |
download | prosody-60b60d9c30833600635e3a695362f903c812cd36.tar.gz prosody-60b60d9c30833600635e3a695362f903c812cd36.zip |
modulemanager: For children of shared modules, set module.environment to the empty environment for that module (useful to expose data or APIs at host.modules[module])
Diffstat (limited to 'core')
-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 f263816b..aca314c0 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -144,6 +144,7 @@ local function do_load_module(host, module_name) local ok, result, module_err = call_module_method(mod, "add_host", host_module_api); if not ok or result == false then return nil, ok and module_err or result; end local host_module = setmetatable({ module = host_module_api }, { __index = mod }); + host_module.module.environment = host_module; modulemap[host][module_name] = host_module; return host_module; end |