sindresorhus / p-limit

Run multiple promise-returning & async functions with limited concurrency
MIT License
1.84k stars 99 forks source link

syntax error #58

Closed yuyeqianxun closed 2 years ago

yuyeqianxun commented 2 years ago

here is syntax error in code

const run = async (fn, resolve, args) => {
    activeCount++;

    const result = (async () => fn(...args))();

    resolve(result);

    try {
        await result;
    } catch {}

    next();
};

it will case something wrong;

try catch from mdn https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Statements/try...catch