Module:Arguments and Module:Arguments/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
m (1 revision imported)
 
m (1 revision imported: forgot this existed...)
 
Line 166: Line 166:
if tidyVal then
if tidyVal then
if type(tidyVal) ~= 'function' then
if type(tidyVal) ~= 'function' then
error(
error(require('Module:TNT').format('I18n/Module:Arguments', 'err-bad-val', type(tidyVal)), 2)
"bad value assigned to option 'valueFunc'"
.. '(function expected, got '
.. type(tidyVal)
.. ')',
2
)
end
end
elseif options.trim ~= false then
elseif options.trim ~= false then
Line 269: Line 263:
end
end
if options.readOnly then
if options.readOnly then
error(
error(require('Module:TNT').format('I18n/Module:Arguments', 'err-table-ro', tostring(key)), 2)
'could not write to argument table key "'
.. tostring(key)
.. '"; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
elseif options.noOverwrite and args[key] ~= nil then
error(
error(require('Module:TNT').format('I18n/Module:Arguments', 'err-key-exists', tostring(key)), 2)
'could not write to argument table key "'
.. tostring(key)
.. '"; overwriting existing arguments is not permitted',
2
)
elseif val == nil then
elseif val == nil then
--[[
--[[