diff --git a/lib/es9.js b/lib/es9.js index f81c9d0..f336637 100644 --- a/lib/es9.js +++ b/lib/es9.js @@ -1,10 +1,7 @@ async function* asyncPool(concurrency, iterable, iteratorFn) { - let done; - const ret = []; const executing = new Set(); for (const item of iterable) { const promise = Promise.resolve().then(() => iteratorFn(item, iterable)); - ret.push(promise); executing.add(promise); const clean = () => executing.delete(promise); promise.then(clean).catch(clean);