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

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

Issue 1155473003: Don't schedule LIBRARY_ERRORS_READY for libraries that should not be analyzed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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/generated/engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/context/context.dart
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index ef012298a3f10a8bc4cfc5f34c99069225801e23..6eee8e967ebd9aad1a83f8353a44f38f6ff41685 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -1162,6 +1162,18 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ bool shouldErrorsBeAnalyzed(Source source, Object entry) {
+ CacheEntry entry = analysisCache.get(source);
+ if (source.isInSystemLibrary) {
+ return _options.generateSdkErrors;
+ } else if (!entry.explicitlyAdded) {
+ return _options.generateImplicitErrors;
+ } else {
+ return true;
+ }
+ }
+
+ @override
void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
DataDescriptor rowDesc, CacheState state)) {
// TODO(brianwilkerson) Figure out where this is used and adjust the call
@@ -1484,7 +1496,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
} else if (state == CacheState.ERROR) {
return;
}
- if (_shouldErrorsBeAnalyzed(source, unitEntry)) {
+ if (shouldErrorsBeAnalyzed(source, unitEntry)) {
state = unitEntry.getState(VERIFY_ERRORS);
if (state == CacheState.INVALID ||
(isPriority && state == CacheState.FLUSHED)) {
@@ -1621,20 +1633,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
/**
- * Return `true` if errors should be produced for the given [source]. The
- * [entry] associated with the source is passed in for efficiency.
- */
- bool _shouldErrorsBeAnalyzed(Source source, CacheEntry entry) {
- if (source.isInSystemLibrary) {
- return _options.generateSdkErrors;
- } else if (!entry.explicitlyAdded) {
- return _options.generateImplicitErrors;
- } else {
- return true;
- }
- }
-
- /**
* Create an entry for the newly added [source] and invalidate any sources
* that referenced the source before it existed.
*/
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698