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

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

Issue 1053673008: Initial re-write of analysis context for the new task model (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months 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/lib/src/context/context.dart » ('j') | pkg/analyzer/lib/src/context/context.dart » ('J')
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 a5c5839959485e0f11e4a0001031e38d7181e6e6..67e71bc411172cfeda68b4a9388778bccb8f3fa5 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -349,6 +349,20 @@ class CacheEntry {
}
/**
+ * Return `true` if the state of the result represented by the given
+ * [descriptor] is [CacheState.INVALID].
+ */
+ bool isInvalid(ResultDescriptor descriptor) =>
+ getState(descriptor) == CacheState.INVALID;
+
+ /**
+ * Return `true` if the state of the result represented by the given
+ * [descriptor] is [CacheState.VALID].
+ */
+ bool isValid(ResultDescriptor descriptor) =>
+ getState(descriptor) == CacheState.VALID;
+
+ /**
* Set the [CacheState.ERROR] state for given [descriptors], their values to
* the corresponding default values, and remember the [exception] that caused
* this state.
@@ -763,7 +777,7 @@ class ResultData {
/**
* The value being cached, or the default value for the result if there is no
- * value (for example, when the [state] is [CacheState.INVALID].
+ * value (for example, when the [state] is [CacheState.INVALID]).
*/
Object value;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/context.dart » ('j') | pkg/analyzer/lib/src/context/context.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698