跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
维基百科
搜索
搜索
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模块:CallAssert”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
外观
移至侧栏
隐藏
←
模块:CallAssert
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local function pack(...) return {...}, select('#', ...) end local function mapArray(func, array, count) local result = {} for i = 1, count or #array do result[i] = func(array[i]) end return result end local function quote(value) if type(value) == 'string' then return (string.gsub(string.format('%q', value), '\\\n', '\\n')) -- Outer parentheses remove second value returned by gsub end local str = tostring(value) if type(value) == 'table' and str ~= 'table' then return '{' .. str .. '}' end return str end local function callAssert(func, funcName, ...) local result, resultCount = pack(func(...)) if not result[1] then local args, argsCount = pack(...) args = mapArray(quote, args, argsCount) local message = mw.ustring.format( '%s(%s) failed', funcName, table.concat(args, ', ') ) error(message, 2) end return unpack(result, 1, resultCount) end return callAssert
该页面使用的模板:
模块:CallAssert/doc
(
查看源代码
)
返回
模块:CallAssert
。
搜索
搜索
查看“︁模块:CallAssert”︁的源代码
添加话题