Jump to content

ᥛᥨᥝᥱ ᥓᥧᥰ:No globals

ᥘᥧᥐ ᥖᥤ ᥝᥤᥱ ᥑᥤᥱ ᥚᥤᥱ ᥖᥤᥱ ᥕᥣᥱ ᥛᥣᥰ
Sotiale (ᥖᥩᥢᥲ ᥟᥧᥙᥱ | ᥑᥝᥲ ᥞᥨᥛ) (1 revision imported: [TEST] importing tddwiki via a tool) ᥐᥨᥝᥳ ᥑᥨᥢᥳ ᥑᥭ ᥛᥫ 12:53, 15 ᥟᥩᥐᥱ ᥗᥨᥝᥱ ᥙᥣᥱ 2024
(ᥙᥦᥐᥱ ᥙᥫᥒ) ← ᥘᥩᥒ ᥑᥨᥢᥳ ᥑᥭ ᥟᥢ ᥐᥝᥱ | ᥐᥣᥢ ᥑᥨᥢᥳ ᥑᥭ ᥐᥛᥰ ᥘᥪᥢᥰ ᥔᥧᥖᥴ (ᥙᥦᥐᥱ ᥙᥫᥒ) | ᥐᥣᥢ ᥑᥨᥢᥳ ᥚᥖᥴ ᥟᥢ ᥛᥬᥱ → (ᥙᥦᥐᥱ ᥙᥫᥒ)

Documentation for this module may be created at ᥛᥨᥝᥱ ᥓᥧᥰ:No globals/doc

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)