no Globals

This module causes an error if any nil global is read or if any global is written to, with the exception of arg.

To use, add require('Module:No globals') to the top of the module using it. The arg variable is excluded because it is necessary for Scribunto's require function to work properly. (See the Scribunto source code here.)

See also

  • Module:Log globals – adds all nil global reads/writes to the lua log

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) 

Tags:

mw:Extension:Scribunto/Lua reference manualphab:diffusion/ELUA/browse/master/engines/LuaCommon/lualib/package.lua;f768b950134a6a32c094be92c8c139a11f8880df$101

🔥 Trending searches on Wiki Simple English:

NapoleonNatick, MassachusettsNewton (unit)Bismuth(III) oxychlorideRamaSyed Ahmed KhanGreek mythologyIsraelTrans womanFritz HellwigMikhail TalSagrada FamíliaHanlon's razorLorem ipsumSoviet UnionAutumnList of Disney charactersSolar SystemAsatruSign languageParagraphMadridWindows XPAphelionProvinces and territories of CanadaAK-47Noel EdmondsClimatePeaAustraliaSardar Vallabhbhai PatelButterflyChuck NorrisRoyal Canadian Mounted PoliceBlack50 (number)Josef FritzlAbella DangerPlausible deniabilityNeil ArmstrongFijiJehovah's WitnessesLogic (rapper)GoogleLemonJuniper berryFlag of the PhilippinesLahore ResolutionPitch, yaw, and rollMoonSummerAlkeneCare BearsCarles PuigdemontGeishaDroupadi MurmuZeusSalamMunier ChoudhuryPretoriaRahul GandhiJambulItalyShivaJamshedpurThe end justifies the meansNew York CityMohs scale of mineral hardnessTikTokHugh HefnerLemmyKahoot!MovieKaabaThe Human Centipede 2 (Full Sequence)EarthquakeCentral processing unit🡆 More