Software /
code /
prosody
Changeset
4652:9d24bc503621
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])
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 21 Apr 2012 22:53:22 +0100 |
parents | 4651:d1739d72100a |
children | 4653:0b055b588f75 |
files | core/modulemanager.lua |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/core/modulemanager.lua Sat Apr 21 22:52:15 2012 +0100 +++ b/core/modulemanager.lua Sat Apr 21 22:53:22 2012 +0100 @@ -144,6 +144,7 @@ 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