Software /
code /
prosody
Diff
core/modulemanager.lua @ 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 |
parent | 4643:9008fc396fb1 |
child | 4662:105423f77d46 |
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