src/async/makeAsyncFunc.js
function makeFuncWithArity(fn, arity) {
    // Need to handle each arity individually, but the body never changes.
    switch (arity) {
        case 0: return function f0() { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 1: return function f1(a) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 2: return function f2(a, b) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 3: return function f3(a, b, c) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 4: return function f4(a, b, c, d) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 5: return function f5(a, b, c, d, e) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 6: return function f6(a, b, c, d, e, f) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 7: return function f7(a, b, c, d, e, f, g) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 8: return function f8(a, b, c, d, e, f, g, h) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 9: return function f9(a, b, c, d, e, f, g, h, _i) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        default: return fn; // Bail out if arity is crazy high.
    }
}
function makeFuncWithArity(fn, arity) {
    // Need to handle each arity individually, but the body never changes.
    switch (arity) {
        case 0: return function f0() { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 1: return function f1(a) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 2: return function f2(a, b) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 3: return function f3(a, b, c) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 4: return function f4(a, b, c, d) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 5: return function f5(a, b, c, d, e) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 6: return function f6(a, b, c, d, e, f) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 7: return function f7(a, b, c, d, e, f, g) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 8: return function f8(a, b, c, d, e, f, g, h) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        case 9: return function f9(a, b, c, d, e, f, g, h, _i) { var i, l = arguments.length, r = new Array(l); for (i = 0; i < l; ++i)
            r[i] = arguments[i]; return fn.apply(this, r); };
        default: return fn; // Bail out if arity is crazy high.
    }
}
Returns a function that directly proxies the given function, whilst reporting the given arity.