modulemanager: Load plugin libraries in the same environment as the plugins.

Thu, 11 Feb 2010 05:36:03 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Thu, 11 Feb 2010 05:36:03 +0500
changeset 2585
a9e99897b2e8
parent 2584
5091548a3805
child 2586
26ead5e16cd3

modulemanager: Load plugin libraries in the same environment as the plugins.

core/modulemanager.lua file | annotate | diff | comparison | revisions
--- a/core/modulemanager.lua	Thu Feb 11 05:34:53 2010 +0500
+++ b/core/modulemanager.lua	Thu Feb 11 05:36:03 2010 +0500
@@ -398,7 +398,7 @@
 		f, n = pluginloader.load_code(lib, lib..".lib.lua");
 	end
 	if not f then error("Failed to load plugin library '"..lib.."', error: "..n); end -- FIXME better error message
-	setfenv(f, setmetatable({ module = self }, { __index = _G }));
+	setfenv(f, self.environment);
 	return f();
 end
 

mercurial