Changes
don't bother saving old __index or __newindex
local mt = getmetatable(_G) or {}
if k ~= 'name' and k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return oldIndex(t, k)nil
end
function mt.__newindex(t, k, v)
if k ~= 'name' and k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
end
setmetatable(_G, mt)