summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/utils.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-10 20:50:58 +0800
committerruki <[email protected]>2015-06-10 20:50:58 +0800
commitb5815f7c047221ea4a85333f7a8b6be5a2a4c737 (patch)
treef53349989af5e057d77233d333ef5efc46d03ed3 /xmake/scripts/base/utils.lua
parent62f8e7581602d698a341db16257bd3d9304fa30d (diff)
modify the checking verbose info
Diffstat (limited to 'xmake/scripts/base/utils.lua')
-rw-r--r--xmake/scripts/base/utils.lua13
1 files changed, 5 insertions, 8 deletions
diff --git a/xmake/scripts/base/utils.lua b/xmake/scripts/base/utils.lua
index bbbc802ac..58ec6ba60 100644
--- a/xmake/scripts/base/utils.lua
+++ b/xmake/scripts/base/utils.lua
@@ -208,19 +208,15 @@ function utils.unique(array)
end
-- call functions
-function utils.call(self, funcs, pred, ...)
+function utils.call(funcs, pred, ...)
-- check
- assert(self and funcs and type(funcs) == "table")
+ assert(funcs)
-- call all
- for _, name in ipairs(funcs) do
+ for _, func in ipairs(utils.wrap(funcs)) do
-- check
- assert(type(name) == "string")
-
- -- get function
- local func = self[name]
assert(type(func) == "function")
-- call it
@@ -229,7 +225,8 @@ function utils.call(self, funcs, pred, ...)
-- exists predicate?
if pred and type(pred) == "function" then
if not pred(name, result) then break end
- end
+ -- failed?
+ elseif not result then break end
end
end