From 449a83920586649fa2d5d97fbf0989ef546fd133 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 13 Nov 2010 04:09:14 +0000 Subject: modulemanager: Inside plugins, have global _M as a reference to the module's environment --- core/modulemanager.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'core') diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 49ad12ac..c78c315b 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -117,6 +117,7 @@ function load(host, module_name, config) local pluginenv = setmetatable({ module = api_instance }, { __index = _G }); api_instance.environment = pluginenv; + pluginenv._M = pluginenv; setfenv(mod, pluginenv); hosts[host].modules = modulemap[host]; -- cgit v1.2.3