408
409
entries(): MapIterator<[K, V]> {
410
>
const map = this;
map.ts
411
>
const state = this._state;
412
>
let current = this._head;
413
>
const iterator: MapIterator<[K, V]> = {
414
>
[Symbol.iterator]() {
415
>
return iterator;
416
>
},
417
>
[Symbol.dispose]() { /* no-op */ },
418
>
next(): IteratorResult<[K, V]> {
419
>
if (map._state !== state) {
420
throw new Error(`LinkedMap got modified during iteration.`);
421
}
423
>
const result: IteratorResult<[K, V]> = { value: [current.key, current.value], done: false };
424
>
current = current.next;
425
>
return result;
426
>
} else {
427
>
return { value: undefined, done: true };
428
>
}
429
>
}
430
>
};
431
>
return iterator;
432
>
}
433
434
[Symbol.iterator](): MapIterator<[K, V]> {