Module pl.strict

Checks uses of undeclared global variables.

All global variables must be 'declared' through a regular assignment (even assigning nil will do) in a main chunk before being used anywhere or assigned to inside a function. Existing metatables __newindex and __index metamethods are respected.

You can set any table to have strict behaviour using strict.module

Functions

module (name, mod, predeclared) make an existing table strict.


Functions

module (name, mod, predeclared)
make an existing table strict.

Parameters:

  • name name of table (optional)
  • mod table - if nil then we'll return a new table
  • predeclared
    • table of variables that are to be considered predeclared.

Returns:

    the given table, or a new table
generated by LDoc 1.3