OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.context.context; | 5 library analyzer.src.context.context; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1510 } | 1510 } |
1511 } | 1511 } |
1512 return entries; | 1512 return entries; |
1513 } | 1513 } |
1514 | 1514 |
1515 void _evaluatePendingFutures() { | 1515 void _evaluatePendingFutures() { |
1516 for (AnalysisTarget target in _pendingFutureTargets.keys) { | 1516 for (AnalysisTarget target in _pendingFutureTargets.keys) { |
1517 CacheEntry cacheEntry = _cache.get(target); | 1517 CacheEntry cacheEntry = _cache.get(target); |
1518 List<PendingFuture> pendingFutures = _pendingFutureTargets[target]; | 1518 List<PendingFuture> pendingFutures = _pendingFutureTargets[target]; |
1519 for (int i = 0; i < pendingFutures.length;) { | 1519 for (int i = 0; i < pendingFutures.length;) { |
1520 if (pendingFutures[i].evaluate(cacheEntry)) { | 1520 if (cacheEntry == null) { |
1521 pendingFutures[i].forciblyComplete(); | |
Paul Berry
2015/10/21 17:57:34
After this line, add:
pendingFutures.removeAt(i);
Brian Wilkerson
2015/10/21 18:05:01
Good catch! Done.
Leaf
2015/10/21 18:15:47
This is the same location that I was generally see
| |
1522 } else if (pendingFutures[i].evaluate(cacheEntry)) { | |
1521 pendingFutures.removeAt(i); | 1523 pendingFutures.removeAt(i); |
1522 } else { | 1524 } else { |
1523 i++; | 1525 i++; |
1524 } | 1526 } |
1525 } | 1527 } |
1526 } | 1528 } |
1527 } | 1529 } |
1528 | 1530 |
1529 /** | 1531 /** |
1530 * Return a list containing all of the change notices that are waiting to be | 1532 * Return a list containing all of the change notices that are waiting to be |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2113 new PendingFuture<T>(_context, target, computeValue); | 2115 new PendingFuture<T>(_context, target, computeValue); |
2114 if (!pendingFuture.evaluate(entry)) { | 2116 if (!pendingFuture.evaluate(entry)) { |
2115 _context._pendingFutureTargets | 2117 _context._pendingFutureTargets |
2116 .putIfAbsent(target, () => <PendingFuture>[]) | 2118 .putIfAbsent(target, () => <PendingFuture>[]) |
2117 .add(pendingFuture); | 2119 .add(pendingFuture); |
2118 scheduleComputation(); | 2120 scheduleComputation(); |
2119 } | 2121 } |
2120 return pendingFuture.future; | 2122 return pendingFuture.future; |
2121 } | 2123 } |
2122 } | 2124 } |
OLD | NEW |