Module:No globals: Difference between revisions
From Wikimedia Commons, the free media repository
Revision as of 15:06, 6 February 2015 (view source)
~Pyb (talk | contribs)
m (5 revisions imported from w:en:Module:No_globals​)
← Older edit
Revision as of 00:16, 15 May 2015 (view source)
Krenair (talk | contribs)
(scribunto content model)
Newer edit →
Revision as of 00:16, 15 May 2015
Lua
Code​Discussion​Edit​History​Links​Link count Subpages:​Documentation​Tests​Results​Sandbox​Live code All modules
Note: This module is used on a lot of pages. In order not to put too much load on the servers, edits should be kept to a bare minimum. Please discuss proposed changes on the talk page first.
  • Editing a module causes all pages that use the module to be re-rendered. If the module is used often, this can put a lot of load on the servers since it fills up the job queue.
  • Keep in mind that displays produced by modules used on file description pages also show up on other wikis.
  • This module has been protected from editing to prevent vandalism. Only administrators can edit it. Get their attention by placing {{Edit protected}} at the talk page.
This module is rated as ready for general use. It has reached a mature form and is thought to be bug-free and ready for use wherever appropriate. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing.
This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.
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.)
Code
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)
Categories: Heavily used modulesModules for general useModules subject to page protection
Search
This page was last edited on 15 May 2015, at 00:16.
Files are available under licenses specified on their description page. All structured data from the file namespace is available under the Creative Commons CC0 License; all unstructured text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and the Privacy Policy.
Privacy policy
About Wikimedia Commons
Disclaimers
Mobile view
Developers
Statistics
Cookie statement

TalkContributionsCreate accountLog in
ModuleDiscussion
ViewView sourceHistory
Visit the main pageMain pageWelcomeCommunity portalVillage pumpHelp centerUpload fileRecent changesLatest filesRandom fileContact usWhat links hereRelated changesSpecial pagesPermanent linkPage informationWikidata itemMediaWikiMeta-WikiMultilingual WikisourceWikispeciesWikibooksWikidataWikimaniaWikipediaWikiquoteWikisourceWikiversityWikivoyageWiktionaryAcèhАдыгабзэAfrikaansAlemannischАлтай тилአማርኛAragonésالعربيةالدارجةمصرىঅসমীয়াAsturianuAymar aruAzərbaycancaتۆرکجهБашҡортсаBasa BaliBoarischŽemaitėškaBikol CentralБеларускаяБеларуская (тарашкевіца)БългарскиभोजपुरीBislamaBanjarBamanankanবাংলাবিষ্ণুপ্রিয়া মণিপুরীBrezhonegBosanskiБуряадCatalàChavacano de ZamboangaMìng-dĕ̤ng-ngṳ̄НохчийнCebuanoChamoruکوردیCorsuČeštinaЧӑвашлаCymraegDanskDeutschThuɔŋjäŋZazakiडोटेलीދިވެހިބަސްEʋegbeΕλληνικάEnglishEsperantoEspañolEestiEuskaraEstremeñuفارسیFulfuldeSuomiNa Vosa VakavitiFøroysktFrançaisArpetanNordfriiskFryskGaeilge贛語GàidhligGalegoAvañe'ẽगोंयची कोंकणी / Gõychi KonknniBahasa HulontaloગુજરાતીHausa客家語/Hak-kâ-ngîHawaiʻiעבריתहिन्दीFiji HindiHrvatskiMagyarՀայերենԱրեւմտահայերէնInterlinguaBahasa IndonesiaIgboIlokanoГӀалгӀайIdoItaliano日本語JawaქართულიTaqbaylitKabɩyɛKongoҚазақшаភាសាខ្មែរಕನ್ನಡ한국어कॉशुर / کٲشُرKurdîKernowekКыргызчаLadinoLëtzebuergeschЛаккуЛезгиLingua Franca NovaLugandaLigureLadinLombardLingálaລາວLietuviųLatgaļuLatviešuMadhurâमैथिलीBasa BanyumasanМокшеньMalagasyМакедонскиമലയാളംМонголဘာသာ မန်मराठीBahasa MelayuMirandésမြန်မာဘာသာمازِرونیNāhuatlNapulitanoPlattdüütschNedersaksiesनेपालीनेपाल भाषाNederlandsNorsk nynorskNorskNovialߒߞߏNouormandଓଡ଼ିଆИронਪੰਜਾਬੀPangasinanKapampanganPapiamentuPälzischपालिNorfuk / PitkernPolskiPiemontèisپنجابیپښتوPortuguêsIkirundiRomânăTarandíneРусскийIkinyarwandaसंस्कृतम्Саха тылаᱥᱟᱱᱛᱟᱲᱤSarduSicilianuScotsسنڌيSrpskohrvatski / српскохрватскиTaclḥitၽႃႇသႃႇတႆး සිංහලSimple EnglishSlovenčinaSlovenščinaGagana SamoaChiShonaSoomaaligaShqipСрпски / srpskiSranantongoSiSwatiSundaSvenskaKiswahiliSakizayaதமிழ்ತುಳುతెలుగుTetunТоҷикӣไทยትግርኛTürkmençeTagalogSetswanaTürkçeXitsongaТатарча/tatarçaТыва дылئۇيغۇرچە / UyghurcheУкраїнськаاردوOʻzbekcha/ўзбекчаVènetoTiếng ViệtVolapükWinaray吴语ХальмгIsiXhosaმარგალურიייִדישYorùbáVahcuengh中文文言Bân-lâm-gú粵語Edit links