Add async function detection to _.isFunction.

This commit is contained in:
John-David Dalton
2016-10-27 10:05:22 -07:00
parent a9fd17950a
commit 7d4c3ed404
2 changed files with 20 additions and 6 deletions

View File

@@ -86,6 +86,7 @@
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
asyncTag = '[object AsyncFunction]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
domExcTag = '[object DOMException]',
@@ -11627,7 +11628,7 @@
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == proxyTag;
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
/**