查看“︁模块:CallAssert”︁的源代码
←
模块: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
此页面嵌入的页面:
模块:Arguments
(
查看源代码
)
模块:CallAssert
(
查看源代码
)
模块:CallAssert/doc
(
查看源代码
)
模块:Documentation
(
查看源代码
)(全保护)
模块:Documentation/config
(
查看源代码
)
模块:Documentation/styles.css
(
查看源代码
)
模块:Redirect
(
查看源代码
)
返回
模块:CallAssert
。
导航菜单
个人工具
登录
associated-pages
模块
讨论
English
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
分类索引
最近更改
随便看看
灵兰秘典
捐助本站
帮助
帮助
联系我们
关于本站
MediaWiki帮助
USER-SIDEBAR
GROUP-SIDEBAR
CATEGORY-SIDEBAR
工具
链入页面
相关更改
页面信息