Diff

core/modulemanager.lua @ 2585:a9e99897b2e8

modulemanager: Load plugin libraries in the same environment as the plugins.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 11 Feb 2010 05:36:03 +0500
parent 2584:5091548a3805
child 2659:ba6dd11f7259
line wrap: on
line diff
--- 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