fei.wang
10 天以前 ae7b22322555448d95fd56f505bafa325c167a26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';
 
/** @type {import('.').AsyncFunctionConstructor | false} */
var cached;
 
/** @type {import('.')} */
module.exports = function getAsyncFunction() {
    if (typeof cached === 'undefined') {
        try {
            // eslint-disable-next-line no-new-func
            cached = Function('return async function () {}')().constructor;
        } catch (e) {
            cached = false;
        }
    }
    return cached;
};