1 | ;
|
2 |
|
3 | var getAsyncs = function getAsyncFunctions() {
|
4 | return [
|
5 | Function('return async (a, b) => a * b;')(),
|
6 | Function('return async () => {};')(),
|
7 | Function('return async function foo() {}')()
|
8 | ];
|
9 | };
|
10 | var asyncFuncs = [];
|
11 | try {
|
12 | asyncFuncs = getAsyncs();
|
13 | } catch (e) { /**/ }
|
14 |
|
15 | module.exports = function makeAsyncFunction() {
|
16 | return asyncFuncs[0];
|
17 | };
|
18 | module.exports.list = function makeAsyncFunctions() {
|
19 | return asyncFuncs.slice();
|
20 | };
|