aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index bf1e1924..5a97e5bf 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -142,10 +142,10 @@ local function do_load_module(host, module_name)
},{
__index = modulemap["*"][module_name].module;
});
+ local host_module = setmetatable({ module = host_module_api }, { __index = mod });
+ host_module_api.environment = host_module;
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