Comparison

core/moduleapi.lua @ 4660:96b40b5e8ea8

moduleapi: module:provides(): Fix usage of wrong table
author Matthew Wild <mwild1@gmail.com>
date Mon, 23 Apr 2012 14:09:35 +0100
parent 4651:d1739d72100a
child 4661:76db5d0a2104
comparison
equal deleted inserted replaced
4659:d53142e90cd0 4660:96b40b5e8ea8
296 end 296 end
297 297
298 function api:provides(name, item) 298 function api:provides(name, item)
299 if not item then item = self.environment; end 299 if not item then item = self.environment; end
300 if not item.name then 300 if not item.name then
301 local item_name = module.name; 301 local item_name = self.name;
302 -- Strip a provider prefix to find the item name 302 -- Strip a provider prefix to find the item name
303 -- (e.g. "auth_foo" -> "foo" for an auth provider) 303 -- (e.g. "auth_foo" -> "foo" for an auth provider)
304 if item_name:find(name.."_", 1, true) == 1 then 304 if item_name:find(name.."_", 1, true) == 1 then
305 item_name = item_name:sub(#name+2); 305 item_name = item_name:sub(#name+2);
306 end 306 end