Changes

Jump to: navigation, search

Module:Arguments

492 bytes added, 19:19, 8 December 2013
return a table rather than a function, improve the comments
-- This module provides easy processing of arguments passed to Scribunto from #invoke.
-- It is intended for use by other Lua modules, and should not be called from #invoke directly.
local arguments = {} function getArgumentsarguments.getArgs(frame, options)
options = type(options) == 'table' and options or {}
-- 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 assume arguments are passed directly in.
local fargs, pargs
if frame == mw.getCurrentFrame() then
end
-- Use a user-generated functions to tidy the values if specified.
local valueFunc = options.valueFunc
if valueFunc then
end
-- Set the order of precedence of frame args and parent args.
local firstArgs, secondArgs = fargs, pargs
if options.parentFirst then
end
-- Define metatable behaviour.
metatable.__index = function (t, key)
local val = metaArgs[key]
end
return getArgumentsarguments
Anonymous user

Navigation menu