Module:Template invocation: Difference between revisions
use the local variables we made in p.invocation for the argument type checking
(validate the keys and values in the args table in p.invocation) |
(use the local variables we made in p.invocation for the argument type checking) |
||
Line 67: | Line 67: | ||
local typek = type(k) | local typek = type(k) | ||
local typev = type(v) | local typev = type(v) | ||
if | if typek ~= 'string' and typek ~= 'number' | ||
or | or typev ~= 'string' and typev ~= 'number' | ||
then | then | ||
error("invalid arguments table in parameter #2 of " .. | error("invalid arguments table in parameter #2 of " .. |