()
| 383 | } |
| 384 | |
| 385 | values(): IterableIterator<V> { |
| 386 | const map = this; |
| 387 | const state = this._state; |
| 388 | let current = this._head; |
| 389 | const iterator: IterableIterator<V> = { |
| 390 | [Symbol.iterator]() { |
| 391 | return iterator; |
| 392 | }, |
| 393 | next(): IteratorResult<V> { |
| 394 | if (map._state !== state) { |
| 395 | throw new Error(`LinkedMap got modified during iteration.`); |
| 396 | } |
| 397 | if (current) { |
| 398 | const result = { value: current.value, done: false }; |
| 399 | current = current.next; |
| 400 | return result; |
| 401 | } else { |
| 402 | return { value: undefined, done: true }; |
| 403 | } |
| 404 | } |
| 405 | }; |
| 406 | return iterator; |
| 407 | } |
| 408 | |
| 409 | entries(): IterableIterator<[K, V]> { |
| 410 | const map = this; |
no outgoing calls