Skip to content

Commit e03d53f

Browse files
committed
Fix drain() function
`fill()` makes copies of the argument which is not what we want.
1 parent 0a4984d commit e03d53f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ class Sema {
5151

5252
drain () {
5353
const a = new Array(this.nrTokens)
54-
a.fill(this.v())
54+
for (let i = 0; i < this.nrTokens; i++) {
55+
a[i] = this.v()
56+
}
5557
return Promise.all(a)
5658
}
5759

0 commit comments

Comments
 (0)