Module:Arguments: Difference between revisions
Jump to navigation
Jump to search
(Fixed) |
(check) |
||
Line 55: | Line 55: | ||
--[[ | --[[ | ||
-- Get the | -- Get the arguments from the frame object if available. If the frame object | ||
-- is not available, we are being called from another Lua module or from the | |||
-- debug console, so assign the args to a new variable so we can | |||
-- | -- differentiate them. | ||
-- | |||
-- | |||
--]] | --]] | ||
local fargs, pargs, luaArgs | local fargs, pargs, luaArgs | ||
if type(frame.args) == 'table' and type(frame.getParent) == 'function' then | if type(frame.args) == 'table' and type(frame.getParent) == 'function' then | ||
if | if not options.parentOnly then | ||
fargs = frame.args | |||
end | |||
if not options.frameOnly then | |||
pargs = frame:getParent().args | |||
end | |||
if options.parentFirst then | |||
fargs, pargs = pargs, fargs | |||
end | end | ||
else | else | ||
Line 252: | Line 212: | ||
--]] | --]] | ||
metaArgs[key] = nil | metaArgs[key] = nil | ||
nilArgs[key] = true | nilArgs[key] = true -- Memoize nils. | ||
else | else | ||
metaArgs[key] = val | metaArgs[key] = val |