()
| 817 | } |
| 818 | |
| 819 | async *[Symbol.asyncIterator](): AsyncGenerator<TChange, void, void> { |
| 820 | if (this.closed) { |
| 821 | return; |
| 822 | } |
| 823 | |
| 824 | try { |
| 825 | // Change streams run indefinitely as long as errors are resumable |
| 826 | // So the only loop breaking condition is if `next()` throws |
| 827 | while (true) { |
| 828 | yield await this.next(); |
| 829 | } |
| 830 | } finally { |
| 831 | try { |
| 832 | await this.close(); |
| 833 | } catch (error) { |
| 834 | squashError(error); |
| 835 | } |
| 836 | } |
| 837 | } |
| 838 | |
| 839 | /** Is the cursor closed */ |
| 840 | public get closed(): boolean { |
nothing calls this directly
no test coverage detected