Chromium Code Reviews| Index: pkg/analyzer/lib/src/context/cache.dart |
| diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart |
| index a6094216f7205e4d34128077c4502b53c45a28c6..163da9a84507499edc41aec1920b3a439ba98caa 100644 |
| --- a/pkg/analyzer/lib/src/context/cache.dart |
| +++ b/pkg/analyzer/lib/src/context/cache.dart |
| @@ -509,14 +509,16 @@ class CacheEntry { |
| } |
| /** |
| - * Set the value of the result represented by the given [descriptor] to the |
| - * given [value], keep its dependency, invalidate all the dependent result. |
| + * If the result represented by the given [descriptor] is valid, set |
| + * it to the given [value], keep its dependency, and if [invalidateDependent] |
| + * invalidate all the dependent result. |
| */ |
| void setValueIncremental( |
| ResultDescriptor descriptor, dynamic value, bool invalidateDependent) { |
| ResultData data = getResultData(descriptor); |
| - data.state = CacheState.VALID; |
| - data.value = value; |
| + if (data.state == CacheState.VALID) { |
|
Brian Wilkerson
2015/11/20 19:47:47
I think we want to also set the value if the state
|
| + data.value = value; |
| + } |
| if (invalidateDependent) { |
| _invalidateDependentResults(nextInvalidateId++, data, null, 0); |
| } |