Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This work is based on changes by @BurtHarris in #26.
  • Loading branch information
sharwell committed Oct 10, 2016
1 parent 0c8122a commit bea41fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/misc/Stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ class IterableAdapter<T> implements Iterable<T>, IterableIterator<T> {
[Symbol.iterator]() { this._iterator = this.collection.iterator(); return this;}

next(): IteratorResult<T> {
if (!this._iterator.hasNext()) return { done: true, value: undefined };
return {done: false, value: this._iterator.next()}
if (!this._iterator.hasNext()) {
// A bit of a hack needed here, tracking under https://github.com/Microsoft/TypeScript/issues/11375
return { done: true, value: undefined } as any as IteratorResult<T>;
}

return { done: false, value: this._iterator.next() }
}
}

0 comments on commit bea41fd

Please sign in to comment.