Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 1463833003: Don't update incrementally invalid results. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698