Module:No globals: திருத்தங்களுக்கு இடையிலான வேறுபாடு
Jump to navigation
Jump to search
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி en:Module:No_globals இலிருந்து திருத்தம் இறக்குமதி செய்யப்பட்டன |
Mediawiki>Minorax சி 7 revisions imported from meta:Module:No_globals |
||
| வரிசை 2: | வரிசை 2: | ||
function mt.__index (t, k) |
function mt.__index (t, k) |
||
if k ~= 'arg' then |
if k ~= 'arg' then |
||
-- perf optimization here and below: do not load Module:TNT unless there is an error |
|||
error('Tried to read nil global ' .. tostring(k), 2) |
|||
error(require('Module:TNT').format('I18n/No globals', 'err-read', tostring(k)), 2) |
|||
end |
end |
||
return nil |
return nil |
||
| வரிசை 8: | வரிசை 9: | ||
function mt.__newindex(t, k, v) |
function mt.__newindex(t, k, v) |
||
if k ~= 'arg' then |
if k ~= 'arg' then |
||
error(' |
error(require('Module:TNT').format('I18n/No globals', 'err-write', tostring(k)), 2) |
||
end |
end |
||
rawset(t, k, v) |
rawset(t, k, v) |
||
02:09, 1 மார்ச்சு 2020 இல் நிலவும் திருத்தம்
| This Lua module is used on many pages and changes may be widely noticed. Test changes in the module's /sandbox or /testcases subpages, or in your own module sandbox. Consider discussing changes on the talk page before implementing them. |
வார்ப்புரு:Shared Template Warning
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
-- perf optimization here and below: do not load Module:TNT unless there is an error
error(require('Module:TNT').format('I18n/No globals', 'err-read', tostring(k)), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error(require('Module:TNT').format('I18n/No globals', 'err-write', tostring(k)), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)