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 | 6202ef36ecb18cfcf2aee207ccbccec24899513e (patch) | |
tree | a0e8f1ac2424fa263da711a4214079e748bf245f | |
parent | 2d053569057683dbba3f960522d760cee3a1aae3 (diff) | |
download | prosody-6202ef36ecb18cfcf2aee207ccbccec24899513e.tar.gz prosody-6202ef36ecb18cfcf2aee207ccbccec24899513e.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])
-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 |