Module:Template invocation: Difference between revisions

    (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 type(k) ~= 'string' and type(k) ~= 'number'
    if typek ~= 'string' and typek ~= 'number'
    or type(v) ~= 'string' and type(v) ~= 'number'
    or typev ~= 'string' and typev ~= 'number'
    then
    then
    error("invalid arguments table in parameter #2 of " ..
    error("invalid arguments table in parameter #2 of " ..