Module std.strict
Checks uses of undeclared global variables.
All global variables must be 'declared' through a regular
assignment (even assigning nil
will do) in a top-level
chunk before being used anywhere or assigned to inside a function.
To use this module, just require it near the start of your program.
From Lua distribution (etc/strict.lua
).
Functions
__index (t, n) | Detect dereference of undeclared global. |
__newindex (t, n, v) | Detect assignment to undeclared global. |