From b5815f7c047221ea4a85333f7a8b6be5a2a4c737 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 10 Jun 2015 20:50:58 +0800 Subject: modify the checking verbose info --- xmake/scripts/base/utils.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'xmake/scripts/base/utils.lua') 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 -- cgit v1.3.1