diff --git a/src/governor.ts b/src/governor.ts index fd6f561..2021919 100644 --- a/src/governor.ts +++ b/src/governor.ts @@ -18,11 +18,10 @@ export abstract class Governor { } wrapIterator(iter: Iterator | AsyncIterator): AsyncIterator { - const _this = this; return { - next: async function(n) { - return await _this.wrap(iter.next as Iterator['next']).call(iter, n); - }, + next: async (n) => + await this.wrap(iter.next as Iterator['next']).call(iter, n) + , return: async () => typeof iter.return === "function" ? iter.return()