Difference between revisions of "Module:No globals/doc"

From "PTTLink Wiki"
Jump to navigation Jump to search
(Created page with " Editing Module:No globals/doc Jump to navigation Jump to search You are editing a source translation page. Please make sure that you are familiar with the following document...")
 
m (1 revision imported)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{used in system}}
 +
{{module rating|protected}}
 +
<!-- Template categories go at the bottom of this page. -->
  
Editing Module:No globals/doc
+
This module causes an error if any nil [[global variable|global]] is read or if any global is written to, with the exception of <var>arg</var>. To use, add <syntaxhighlight lang="lua" inline>require('Module:No globals')</syntaxhighlight> to the top of the module using it. The <var>arg</var> variable is excluded because it is necessary for Scribunto's [[mw:Extension:Scribunto/Lua reference manual#require|require]] function to work properly. (See the Scribunto source code [[phab:diffusion/ELUA/browse/master/includes/engines/LuaCommon/lualib/package.lua;1fad4da13706f4dbdd0477a834675b9d09757bf6|here]].)
Jump to navigation
 
Jump to search
 
  
You are editing a source translation page. Please make sure that you are familiar with the following documentation:
+
== See also ==
 +
* [[Module:Log globals]] – adds all nil global reads/writes to the Lua log
  
    Changing the source text
 
    Example of markup to use
 
 
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
 
Advanced
 
Special characters
 
Help
 
<noinclude><!--
 
-->{{#ifeq:{{SUBPAGENAME}}|doc||{{Documentation subpage}}}}<!--
 
--><languages /><!--
 
--></noinclude>{{#switch:<translate></translate>
 
| =
 
<includeonly>{{Languages|Module:No globals/doc}}</includeonly>
 
{{Shared Template Warning|Module:No globals|No globals}}
 
{{Module rating|release}}
 
{{Module rating|protected}}
 
<translate>
 
== Usage == <!--T:1-->
 
</translate>
 
<translate><!--T:2--> Include this module at the top of your code.</translate>
 
<translate><!--T:3--> An error will be raised any time your code tries to read or write to a non-local (undeclared) variable.</translate>
 
 
<translate>
 
== Tests == <!--T:4-->
 
</translate>
 
{{ModuleQuality}}
 
 
<includeonly>{{Sandbox other||
 
<includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata -->
+
<!-- Template categories go here. -->
[[Category:Modules{{#translation:}}]]
+
[[Category:Lua metamodules]]
}}</includeonly><noinclude>
+
}}</includeonly>
[[Category:Module documentation pages{{#translation:}}]]
 
</noinclude>
 
| #default=
 
  {{#invoke:Template translation|renderTranslatedTemplate|template=Module:No globals/doc|noshift=1|uselang={{int:lang}}}}
 
}}
 
Summary (?):
 
 
 
By saving changes, you agree to the Terms of Use, and you irrevocably agree to release your contribution under the CC BY-SA 3.0 License and the GFDL. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
 
Preview page with this template
 
 
 
  · · · · · · ·
 
    · · · ·  · · · · · · · · · ·
 
 
 
Templates used on this page:
 
Navigation menu
 
 
 
    English
 
    Not logged in
 
    Talk
 
    Contributions
 
    Create account
 
    Log in
 
 
 
    Module
 
    Discussion
 
 
 
    Read
 
    Edit source
 
    View history
 
 
 
Search
 
 
 
    Main page
 
    Get MediaWiki
 
    Get extensions
 
    Tech blog
 
    Contribute
 
 
 
Support
 
 
 
    User help
 
    FAQ
 
    Technical manual
 
    Support desk
 
    Communication
 
 
 
Development
 
 
 
    Bug tracker
 
    Code docs
 
    Code repository
 
    Statistics
 
 
 
MediaWiki.org
 
 
 
    Community portal
 
    Recent changes
 
    Translate content
 
    Random page
 
    Village pump
 
    Sandbox
 
 
 
Tools
 
 
 
    What links here
 
    Related changes
 
    Upload file
 
    Special pages
 
    Page information
 
 
 
    Privacy policy
 
    About MediaWiki.org
 
    Disclaimers
 
    Code of Conduct
 
    Mobile view
 
    Developers
 
    Statistics
 
    Cookie statement
 
 
 
    Wikimedia Foundation
 
    Powered by MediaWiki
 
 
 
Welcome to MediaWiki
 
Anyone can edit, and every improvement helps.
 
Thank you for helping the world discover more!
 

Latest revision as of 17:52, 20 January 2022


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