Check against edge-case that doResolve adds back to our resolution queue.
@@ -179,13 +179,13 @@ public final class JSTypeResolver {
this.state = State.CLOSING;
- // resolutionQueue scales with the size of the application, so it needs to be GC-able.
- ArrayDeque<JSType> queue = this.resolutionQueue;
- this.resolutionQueue = new ArrayDeque<>();
- while (!queue.isEmpty()) {
- this.doResolve(queue.removeFirst());
+ while (!this.resolutionQueue.isEmpty()) {
+ this.doResolve(this.resolutionQueue.removeFirst());
}
+ // resolutionQueue scales with the size of the application, so it needs to be GC'd.
+ this.resolutionQueue = new ArrayDeque<>();
+
this.state = State.CLOSED;
// TODO(sdh): Stop doing this here. It's obviously the wrong place.
