Module:Error: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
m Protected Module:Error: Highly visible template or Lua module ([Edit=Block all non-admin users] (indefinite) [Move=Block all non-admin users] (indefinite))
simplify argument-grabbing code
Line 29: Line 29:
local origArgs
local origArgs
if frame == mw.getCurrentFrame() then
if frame == mw.getCurrentFrame() then
-- We're being called via #invoke. If the invoking template passed any args, use
-- We're being called via #invoke. The args are passed through to the module
-- them. Otherwise, use the args that were passed into the template.
-- from the template page, so use the args that were passed into the template.
origArgs = frame:getParent().args
origArgs = frame.args
for k, v in pairs(frame.args) do
origArgs = frame.args
break
end
else
else
-- We're being called from another module or from the debug console, so assume
-- We're being called from another module or from the debug console, so assume