Module:No globals: திருத்தங்களுக்கு இடையிலான வேறுபாடு

தமிழர்விக்கியிலிருந்து
Jump to navigation Jump to search
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
imported>Ged UK
சி Protected Module:No globals: High-risk Lua module ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))
rm name exception
வரிசை 1: வரிசை 1:
local mt = getmetatable(_G) or {}
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
function mt.__index (t, k)
if k ~= 'name' and k ~= 'arg' then
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
error('Tried to read nil global ' .. tostring(k), 2)
end
end

15:35, 2 மே 2014 இல் நிலவும் திருத்தம்

வார்ப்புரு:Shared Template Warning


local mt = getmetatable(_G) or {}
function mt.__index (t, k)
	if k ~= 'arg' then
		error('Tried to read nil global ' .. tostring(k), 2)
	end
	return nil
end
function mt.__newindex(t, k, v)
	if k ~= 'arg' then
		error('Tried to write global ' .. tostring(k), 2)
	end
	rawset(t, k, v)
end
setmetatable(_G, mt)
"https://tamilar.wiki/w/index.php?title=Module:No_globals&oldid=86843" இலிருந்து மீள்விக்கப்பட்டது