Acciones

Módulo

Diferencia entre revisiones de «No globals/doc»

De La Venciclopedia

(Página creada con «This module causes an error if any nil global is read or if any global is written to, with the exception of <var>arg</var>. To use, add <syntaxhighlight lang="lua" inline>r…»)
 
mSin resumen de edición
 
(No se muestra una edición intermedia del mismo usuario)
Línea 1: Línea 1:
This module causes an error if any nil 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.
{{module rating|release}}{{module rating|protected}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
== 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 ==
{| class=wikitable
| [[Module:No globals]] || {{#invoke:No globals/testcases|run|displayMode=short}}
|-
| [[Module:No globals/sandbox]] || {{#invoke:No globals/testcases|run||displayMode=short|module=No globals/sandbox}}
|}
* See [[Module:No globals/testcases|testcases]]
* [https://www.mediawiki.org/w/index.php?title=Special%3AComparePages&page1=Module%3ANo%20globals&page2=Module%3ANo%20globals%2Fsandbox Diff] sandbox code
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Categoría:Venciclopedia:Plantillas de ayuda|{{PAGENAME}}]]
}}</includeonly><noinclude>[[Categoría:Venciclopedia:Plantillas de uso|{{PAGENAME}}]]</noinclude>

Revisión actual - 05:59 30 sep 2020

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 Error en la secuencia de órdenes: no existe el módulo «No globals/testcases».
Module:No globals/sandbox Error en la secuencia de órdenes: no existe el módulo «No globals/testcases».