From cb31648d3933774707d0dd0d963c7bdcb75f4be4 Mon Sep 17 00:00:00 2001 From: porschemx <63641528+surfaceyu@users.noreply.github.com> Date: Wed, 23 Jun 2021 17:58:15 +0800 Subject: [PATCH] fixed async functions --- lib/util/utils.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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;