Skip to content

Commit

Permalink
Added assert
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-van committed Oct 19, 2021
1 parent 886a838 commit 08a6d05
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/asyncGeneratorMap.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ async function * asyncGeneratorMap (asyncIterable, iteratee, queue, ordered = tr
const internalSchedule = (value, index) => {
addToWaitList(index, async () => {
const [p, cancel] = queue._execCancellableInternal(async () => {
assert(scheduledList.length >= 1, 'scheduledList can\'t be empty')
const output = scheduledList.shift()
assert(output.index === index, 'Removed invalid index from sheduled list')
/*
Expand Down

0 comments on commit 08a6d05

Please sign in to comment.