core/moduleapi.lua
changeset 5529 af58eea131b4
parent 5527 7e7f45f587a1
child 5530 d83482fc4a81
--- a/core/moduleapi.lua	Sat Apr 27 14:59:00 2013 +0100
+++ b/core/moduleapi.lua	Sat Apr 27 19:14:22 2013 +0200
@@ -319,7 +319,13 @@
 end
 
 function api:provides(name, item)
-	if not item then item = self.environment; end
+	-- if not item then item = setmetatable({}, { __index = function(t,k) return rawget(self.environment, k); end }); end
+	if not item then
+		item = {}
+		for k,v in pairs(self.environment) do
+			if k ~= "module" then item[k] = v; end
+		end
+	end
 	if not item.name then
 		local item_name = self.name;
 		-- Strip a provider prefix to find the item name