| 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/src/cancelable_future.dart'; | 10 import 'package:analyzer/src/cancelable_future.dart'; |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 /** | 1404 /** |
| 1405 * Return a list containing all of the change notices that are waiting to be | 1405 * Return a list containing all of the change notices that are waiting to be |
| 1406 * returned. If there are no notices, then return either `null` or an empty | 1406 * returned. If there are no notices, then return either `null` or an empty |
| 1407 * list, depending on the value of [nullIfEmpty]. | 1407 * list, depending on the value of [nullIfEmpty]. |
| 1408 */ | 1408 */ |
| 1409 List<ChangeNotice> _getChangeNotices(bool nullIfEmpty) { | 1409 List<ChangeNotice> _getChangeNotices(bool nullIfEmpty) { |
| 1410 if (_pendingNotices.isEmpty) { | 1410 if (_pendingNotices.isEmpty) { |
| 1411 if (nullIfEmpty) { | 1411 if (nullIfEmpty) { |
| 1412 return null; | 1412 return null; |
| 1413 } | 1413 } |
| 1414 return ChangeNoticeImpl.EMPTY_ARRAY; | 1414 return ChangeNoticeImpl.EMPTY_LIST; |
| 1415 } | 1415 } |
| 1416 List<ChangeNotice> notices = new List.from(_pendingNotices.values); | 1416 List<ChangeNotice> notices = new List.from(_pendingNotices.values); |
| 1417 _pendingNotices.clear(); | 1417 _pendingNotices.clear(); |
| 1418 return notices; | 1418 return notices; |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 /** | 1421 /** |
| 1422 * Return a change notice for the given [source], creating one if one does not | 1422 * Return a change notice for the given [source], creating one if one does not |
| 1423 * already exist. | 1423 * already exist. |
| 1424 */ | 1424 */ |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 PendingFuture pendingFuture = | 2141 PendingFuture pendingFuture = |
| 2142 new PendingFuture<T>(_context, target, computeValue); | 2142 new PendingFuture<T>(_context, target, computeValue); |
| 2143 if (!pendingFuture.evaluate(entry)) { | 2143 if (!pendingFuture.evaluate(entry)) { |
| 2144 _context._pendingFutureTargets | 2144 _context._pendingFutureTargets |
| 2145 .putIfAbsent(target, () => <PendingFuture>[]) | 2145 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2146 .add(pendingFuture); | 2146 .add(pendingFuture); |
| 2147 } | 2147 } |
| 2148 return pendingFuture.future; | 2148 return pendingFuture.future; |
| 2149 } | 2149 } |
| 2150 } | 2150 } |
| OLD | NEW |