Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 25dc80c

Browse files
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

Lines changed: 2 additions & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /