உள்ளடக்கத்துக்குச் செல்

Module:No globals

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.
Jackmcbarn (பேச்சு | பங்களிப்புகள்) பயனரால் செய்யப்பட்ட 20:38, 23 ஏப்ரல் 2014 அன்றிருந்தவாரான திருத்தம் (Created page with 'local mt = getmetatable(_G) or {} local oldIndex = mt.__index or function() return nil end mt.__index = function(t, k) if k ~= 'name' and k ~= 'arg' then erro...')
warning எச்சரிக்கைDo not edit. This page is maintained by an automated tool. All edits should be done at mediawiki.org. (translate this warning)
Please help translate this page.

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