From 6202ef36ecb18cfcf2aee207ccbccec24899513e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 21 Apr 2012 22:53:22 +0100 Subject: 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]) --- core/modulemanager.lua | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3