fixed ListIterator.reachedEnd edge case
This commit is contained in:
parent
2a33507c00
commit
d314c3e1a6
@ -169,7 +169,12 @@ export class ListIterator {
|
|||||||
throw lengthExceeded
|
throw lengthExceeded
|
||||||
}
|
}
|
||||||
this.index -= len
|
this.index -= len
|
||||||
if (this.rel > len) {
|
if (this.reachedEnd) {
|
||||||
|
const nextItem = /** @type {Item} */ (this.nextItem)
|
||||||
|
this.rel = nextItem.countable && !nextItem.deleted ? nextItem.length : 0
|
||||||
|
this.reachedEnd = false
|
||||||
|
}
|
||||||
|
if (this.rel >= len) {
|
||||||
this.rel -= len
|
this.rel -= len
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user