Module:No globals
- español
- 日本語
- Deutsch
- français
- 中文
- português
- Nederlands
- العربية
- аԥсшәа
- Acèh
- адыгабзэ
- Afrikaans
- алтай тил
- አማርኛ
- aragonés
- Ænglisc
- अंगिका
- الدارجة
- مصرى
- অসমীয়া
- авар
- अवधी
- Aymar aru
- azərbaycanca
- تۆرکجه
- башҡортса
- Basa Bali
- Boarisch
- Batak Toba
- Bikol Central
- беларуская
- български
- भोजपुरी
- Bislama
- Banjar
- ပအိုဝ်ႏဘာႏသာႏ
- bamanankan
- বাংলা
- བོད་ཡིག
- বিষ্ণুপ্রিয়া মণিপুরী
- brezhoneg
- bosanski
- Basa Ugi
- буряад
- català
- Chavacano de Zamboanga
- 閩東語 / Mìng-dĕ̤ng-ngṳ̄
- нохчийн
- Cebuano
- Chamoru
- کوردی
- corsu
- qırımtatarca
- čeština
- чӑвашла
- Cymraeg
- dagbanli
- Thuɔŋjäŋ
- Zazaki
- डोटेली
- ދިވެހިބަސް
- ཇོང་ཁ
- eʋegbe
- Ελληνικά
- euskara
- estremeñu
- فارسی
- Fulfulde
- suomi
- Na Vosa Vakaviti
- føroyskt
- arpetan
- Nordfriisk
- Frysk
- Gaeilge
- 贛語
- Gàidhlig
- galego
- گیلکی
- Avañe'ẽ
- गोंयची कोंकणी / Gõychi Konknni
- Bahasa Hulontalo
- ગુજરાતી
- wayuunaiki
- farefare
- gungbe
- Gaelg
- Hausa
- 客家語 / Hak-kâ-ngî
- Hawaiʻi
- עברית
- हिन्दी
- Fiji Hindi
- hrvatski
- hornjoserbsce
- Kreyòl ayisyen
- հայերեն
- Արեւմտահայերէն
- interlingua
- Bahasa Indonesia
- Igbo
- гӀалгӀай
- Ido
- Patois
- Jawa
- ქართული
- Qaraqalpaqsha
- Taqbaylit
- Kabɩyɛ
- Tyap
- Kongo
- қазақша
- ភាសាខ្មែរ
- ಕನ್ನಡ
- कॉशुर / کٲشُر
- kurdî
- kernowek
- кыргызча
- Latina
- Ladino
- Lëtzebuergesch
- лакку
- лезги
- Lingua Franca Nova
- Luganda
- Ligure
- Ladin
- lombard
- lingála
- ລາວ
- lietuvių
- latgaļu
- latviešu
- Madhurâ
- मैथिली
- Basa Banyumasan
- мокшень
- Malagasy
- Māori
- Minangkabau
- македонски
- മലയാളം
- монгол
- ꯃꯤꯇꯩ ꯂꯣꯟ
- ဘာသာမန်
- मराठी
- Bahasa Melayu
- Malti
- Mirandés
- မြန်မာဘာသာ
- эрзянь
- مازِرونی
- Nāhuatl
- Napulitano
- Plattdüütsch
- Nedersaksies
- नेपाली
- नेपाल भाषा
- Li Niha
- norsk nynorsk
- Novial
- ߒߞߏ
- Nouormand
- Sesotho sa Leboa
- Chi-Chewa
- occitan
- Oromoo
- ଓଡ଼ିଆ
- ирон
- ਪੰਜਾਬੀ
- Pangasinan
- Kapampangan
- Papiamentu
- Picard
- Naijá
- Pälzisch
- पालि
- Piemontèis
- پنجابی
- پښتو
- Runa Simi
- ikirundi
- română
- tarandíne
- русиньскый
- Ikinyarwanda
- संस्कृतम्
- саха тыла
- ᱥᱟᱱᱛᱟᱲᱤ
- sardu
- sicilianu
- Scots
- سنڌي
- davvisámegiella
- srpskohrvatski / српскохрватски
- Taclḥit
- တႆး
- සිංහල
- slovenčina
- سرائیکی
- slovenščina
- Gagana Samoa
- anarâškielâ
- chiShona
- Soomaaliga
- shqip
- српски / srpski
- Sranantongo
- SiSwati
- Sesotho
- Sunda
- svenska
- Kiswahili
- ślůnski
- Sakizaya
- தமிழ்
- Tayal
- ತುಳು
- ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
- తెలుగు
- tetun
- тоҷикӣ
- ไทย
- ትግርኛ
- Türkmençe
- Tagalog
- Setswana
- Türkçe
- Xitsonga
- татарча / tatarça
- chiTumbuka
- Twi
- reo tahiti
- тыва дыл
- удмурт
- ئۇيغۇرچە / Uyghurche
- اردو
- oʻzbekcha / ўзбекча
- vèneto
- vepsän kel’
- Volapük
- Winaray
- Wolof
- хальмг
- isiXhosa
- მარგალური
- ייִדיש
- Yorùbá
- Vahcuengh
- isiZulu
![]() | This page is shared between multiple wikis. All changes to this page will be automatically copied to all wikis listed in the left side bar. To avoid unnecessary page regeneration and server load, changes should be tested on the page's sandbox. Please help translate this 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. It is ready to mention on help pages and other resources as an option for new users to learn. 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. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
TNT | This module uses Module:TNT for localisation: |
This module is deprecated in most use cases, use strict library: require( "strict" )
.
Usage
Include this module at the top of your code. An error will be raised any time your code tries to read or write to a non-local (undeclared) variable.
Tests
Module:No globals | success: 1, error: 0, skipped: 0 |
Module:No globals/sandbox | success: 1, error: 0, skipped: 0 |
- See test cases
- Diff sandbox code
The above documentation is transcluded from Module:No globals/doc. (edit | history)
Editors can experiment in this module’s sandbox (edit | diff) and testcases (edit) pages.
Subpages of this module.
Editors can experiment in this module’s sandbox (edit | diff) and testcases (edit) pages.
Subpages of this module.
local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
-- perf optimization here and below: do not load Module:TNT unless there is an error
error(require('Module:TNT').format('I18n/No globals', 'err-read', tostring(k)), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error(require('Module:TNT').format('I18n/No globals', 'err-write', tostring(k)), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)