()
| 1154 | } |
| 1155 | |
| 1156 | override async next(): Promise<IteratorResult<T>> { |
| 1157 | // This sets this.lastRead to a new Promise right away, as opposed to |
| 1158 | // saying `await this.lastRead; this.lastRead = this.serialNext();` which |
| 1159 | // would not work because this.nextRead would be updated only after the |
| 1160 | // promise resolves. |
| 1161 | this.lastRead = this.lastRead.then(() => this.serialNext()); |
| 1162 | return this.lastRead; |
| 1163 | } |
| 1164 | |
| 1165 | private randomInt(max: number) { |
| 1166 | return Math.floor(this.random() * max); |
nothing calls this directly
no test coverage detected