Skip to content

Commit 25dc80c

Browse files
authored
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
1 parent fc283fb commit 25dc80c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/util.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function isFunction (functionToCheck) {
3838
return false;
3939
} else {
4040
var getType = {};
41-
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
41+
var functionType = getType.toString.call(functionToCheck);
42+
return functionToCheck && (functionType === '[object Function]' || functionType === '[object AsyncFunction]');
4243
}
4344
}
4445

0 commit comments

Comments
 (0)