Module:No globals: Difference between revisions

m
1 revision imported
m (Protected Module:No globals: High-risk Lua module ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
m (1 revision imported)
 
(6 intermediate revisions by 4 users not shown)
Line 1:
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'name' and k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end