From 25dc80c6861efa6269f0e80402c4651bdf61561d Mon Sep 17 00:00:00 2001 From: Tal Rofe <100444463+tal-rofe@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:18:06 +0300 Subject: [PATCH] fix: fix the "isFunction" utility to match both "asyncFunction"s and "Function"s (#927) current behavior is the utility tries to match only "Function" and therefore "AsyncFunction" will be considered bad and error will be thrown fix #926 --- src/common/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/util.js b/src/common/util.js index 8f3f1cd3..a9e59e3f 100644 --- a/src/common/util.js +++ b/src/common/util.js @@ -38,7 +38,8 @@ function isFunction (functionToCheck) { return false; } else { var getType = {}; - return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; + var functionType = getType.toString.call(functionToCheck); + return functionToCheck && (functionType === '[object Function]' || functionType === '[object AsyncFunction]'); } }