358
359
keys(): MapIterator<K> {
360
>
const map = this;
map.ts
361
>
const state = this._state;
362
>
let current = this._head;
363
>
const iterator: MapIterator<K> = {
364
>
[Symbol.iterator]() {
365
>
return iterator;
366
>
},
367
>
[Symbol.dispose]() { /* no-op */ },
368
>
next(): IteratorResult<K> {
369
>
if (map._state !== state) {
370
throw new Error(`LinkedMap got modified during iteration.`);
371
}
373
const result = { value: current.key, done: false };
374
current = current.next;
375
return result;
377
>
return { value: undefined, done: true };
378
>
}
379
>
}
380
>
};
381
>
return iterator;
382
>
}
383
384
values(): MapIterator<V> {