Skip to content

Commit dc929a5

Browse files
committed
[Refactor] skip getProto call when AsyncFunction does not exist
1 parent 981ab90 commit dc929a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ module.exports = function isAsyncFunction(fn) {
4343
// eslint-disable-next-line no-extra-parens
4444
AsyncFunction = asyncFunc ? /** @type {import('.').AsyncFunction} */ (getProto(asyncFunc)) : false;
4545
}
46-
return getProto(fn) === AsyncFunction;
46+
return AsyncFunction && getProto(fn) === AsyncFunction;
4747
};

0 commit comments

Comments
 (0)