UNPKG

448 BJavaScriptView Raw
1'use strict';
2
3var 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};
10var asyncFuncs = [];
11try {
12 asyncFuncs = getAsyncs();
13} catch (e) { /**/ }
14
15module.exports = function makeAsyncFunction() {
16 return asyncFuncs[0];
17};
18module.exports.list = function makeAsyncFunctions() {
19 return asyncFuncs.slice();
20};