diff --git a/lib/util/utils.js b/lib/util/utils.js index 325a968..d3ef2fd 100644 --- a/lib/util/utils.js +++ b/lib/util/utils.js @@ -98,7 +98,10 @@ Utils.checkNumber = Utils.isType("Number"); * @return {Boolean} true|false * @api public */ -Utils.checkFunction = Utils.isType("Function"); +// fixed async functions +Utils.checkFunction = function(obj) { + return Utils.isType("Function")(obj) || Utils.isType("AsyncFunction")(obj); +}; /** * Utils check object * @@ -448,4 +451,4 @@ Utils.checkCocos2dJsb = function() { return false; } -module.exports = Utils; \ No newline at end of file +module.exports = Utils;