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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 983733002: No errors in third-party packages (issue 22170) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « pkg/analyzer/lib/src/analyzer_impl.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index c5e99c1081ef764c4ff0ebd4885d9f95fdd84e8e..402664789e347f3d0030ac2b1c53f7f17c511b40 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -959,8 +959,14 @@ class AnalysisContextImpl implements InternalAnalysisContext {
AnalysisOptionsImpl _options = new AnalysisOptionsImpl();
/**
- * A flag indicating whether errors related to sources in the SDK should be generated and
- * reported.
+ * A flag indicating whether errors related to implicitly analyzed sources
+ * should be generated and reported.
+ */
+ bool _generateImplicitErrors = true;
+
+ /**
+ * A flag indicating whether errors related to sources in the SDK should be
+ * generated and reported.
*/
bool _generateSdkErrors = true;
@@ -1115,6 +1121,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
void set analysisOptions(AnalysisOptions options) {
bool needsRecompute = this._options.analyzeFunctionBodiesPredicate !=
options.analyzeFunctionBodiesPredicate ||
+ this._options.generateImplicitErrors != options.generateImplicitErrors ||
this._options.generateSdkErrors != options.generateSdkErrors ||
this._options.dart2jsHint != options.dart2jsHint ||
(this._options.hint && !options.hint) ||
@@ -1140,6 +1147,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
this._options.analyzeFunctionBodiesPredicate =
options.analyzeFunctionBodiesPredicate;
+ this._options.generateImplicitErrors = options.generateImplicitErrors;
this._options.generateSdkErrors = options.generateSdkErrors;
this._options.dart2jsHint = options.dart2jsHint;
this._options.hint = options.hint;
@@ -1148,6 +1156,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
this._options.incrementalValidation = options.incrementalValidation;
this._options.lint = options.lint;
this._options.preserveComments = options.preserveComments;
+ _generateImplicitErrors = options.generateImplicitErrors;
_generateSdkErrors = options.generateSdkErrors;
if (needsRecompute) {
_invalidateAllLocalResolutionInformation(false);
@@ -2584,6 +2593,12 @@ class AnalysisContextImpl implements InternalAnalysisContext {
// These values are not currently being computed, so their state
// is not interesting.
continue;
+ } else if (!sourceEntry.explicitlyAdded &&
+ !_generateImplicitErrors &&
+ (descriptor == DartEntry.VERIFICATION_ERRORS ||
+ descriptor == DartEntry.HINTS ||
+ descriptor == DartEntry.LINTS)) {
+ continue;
scheglov 2015/03/05 18:54:04 Can this code be moved outside of the libraries cy
Brian Wilkerson 2015/03/05 19:47:58 I don't think so, although it would be nice. The p
} else if (source.isInSystemLibrary &&
!_generateSdkErrors &&
(descriptor == DartEntry.VERIFICATION_ERRORS ||
@@ -3846,7 +3861,8 @@ class AnalysisContextImpl implements InternalAnalysisContext {
return new AnalysisContextImpl_TaskData(
new ResolveDartLibraryTask(this, source, librarySource), false);
}
- if (_generateSdkErrors || !source.isInSystemLibrary) {
+ if ((!source.isInSystemLibrary || _generateSdkErrors)
Paul Berry 2015/03/05 19:16:53 I had to write out a truth table to determine if t
Brian Wilkerson 2015/03/05 19:55:41 Done
+ && (dartEntry.explicitlyAdded || _generateImplicitErrors)) {
CacheState verificationErrorsState = dartEntry.getStateInLibrary(
DartEntry.VERIFICATION_ERRORS, librarySource);
if (verificationErrorsState == CacheState.INVALID ||
@@ -4062,7 +4078,8 @@ class AnalysisContextImpl implements InternalAnalysisContext {
return;
}
}
- if (_generateSdkErrors || !source.isInSystemLibrary) {
+ if ((!source.isInSystemLibrary || _generateSdkErrors)
+ && (dartEntry.explicitlyAdded || _generateImplicitErrors)) {
CacheState verificationErrorsState = dartEntry.getStateInLibrary(
DartEntry.VERIFICATION_ERRORS, librarySource);
if (verificationErrorsState == CacheState.INVALID ||
@@ -6295,8 +6312,8 @@ abstract class AnalysisListener {
class AnalysisNotScheduledError implements Exception {}
/**
- * The interface `AnalysisOptions` defines the behavior of objects that provide access to a
- * set of analysis options used to control the behavior of an analysis context.
+ * A set of analysis options used to control the behavior of an analysis
+ * context.
*/
abstract class AnalysisOptions {
/**
@@ -6308,7 +6325,7 @@ abstract class AnalysisOptions {
* This getter is deprecated; consider using [analyzeFunctionBodiesPredicate]
* instead.
*/
- @deprecated
+ @deprecated // Use this.analyzeFunctionBodiesPredicate
bool get analyzeFunctionBodies;
/**
@@ -6318,61 +6335,54 @@ abstract class AnalysisOptions {
AnalyzeFunctionBodiesPredicate get analyzeFunctionBodiesPredicate;
/**
- * Return the maximum number of sources for which AST structures should be kept in the cache.
- *
- * @return the maximum number of sources for which AST structures should be kept in the cache
+ * Return the maximum number of sources for which AST structures should be
+ * kept in the cache.
*/
int get cacheSize;
/**
* Return `true` if analysis is to generate dart2js related hint results.
- *
- * @return `true` if analysis is to generate dart2js related hint results
*/
bool get dart2jsHint;
/**
* Return `true` if analysis is to include the new async support.
*/
- @deprecated
+ @deprecated // Always true
bool get enableAsync;
/**
* Return `true` if analysis is to include the new deferred loading support.
- *
- * @return `true` if analysis is to include the new deferred loading support
*/
- @deprecated
+ @deprecated // Always true
bool get enableDeferredLoading;
/**
* Return `true` if analysis is to include the new enum support.
- *
- * @return `true` if analysis is to include the new enum support
*/
- @deprecated
+ @deprecated // Always true
bool get enableEnum;
/**
- * Return `true` if errors, warnings and hints should be generated for sources in the SDK.
- * The default value is `false`.
- *
- * @return `true` if errors, warnings and hints should be generated for the SDK
+ * Return `true` if errors, warnings and hints should be generated for sources
+ * that are implicitly being analyzed. The default value is `true`.
+ */
+ bool get generateImplicitErrors;
+
+ /**
+ * Return `true` if errors, warnings and hints should be generated for sources
+ * in the SDK. The default value is `false`.
*/
bool get generateSdkErrors;
/**
- * Return `true` if analysis is to generate hint results (e.g. type inference based
- * information and pub best practices).
- *
- * @return `true` if analysis is to generate hint results
+ * Return `true` if analysis is to generate hint results (e.g. type inference
+ * based information and pub best practices).
*/
bool get hint;
/**
* Return `true` if incremental analysis should be used.
- *
- * @return `true` if incremental analysis should be used
*/
bool get incremental;
@@ -6390,22 +6400,18 @@ abstract class AnalysisOptions {
/**
* Return `true` if analysis is to generate lint warnings.
- *
- * @return `true` if analysis is to generate lint warnings
*/
bool get lint;
/**
* Return `true` if analysis is to parse comments.
- *
- * @return `true` if analysis is to parse comments
*/
bool get preserveComments;
}
/**
- * Instances of the class `AnalysisOptions` represent a set of analysis options used to
- * control the behavior of an analysis context.
+ * A set of analysis options used to control the behavior of an analysis
+ * context.
*/
class AnalysisOptionsImpl implements AnalysisOptions {
/**
@@ -6433,24 +6439,32 @@ class AnalysisOptionsImpl implements AnalysisOptions {
_analyzeAllFunctionBodies;
/**
- * The maximum number of sources for which AST structures should be kept in the cache.
+ * The maximum number of sources for which AST structures should be kept in
+ * the cache.
*/
int cacheSize = DEFAULT_CACHE_SIZE;
/**
- * A flag indicating whether analysis is to generate dart2js related hint results.
+ * A flag indicating whether analysis is to generate dart2js related hint
+ * results.
*/
bool dart2jsHint = true;
/**
- * A flag indicating whether errors, warnings and hints should be generated for sources in the
- * SDK.
+ * A flag indicating whether errors, warnings and hints should be generated
+ * for sources that are implicitly being analyzed.
+ */
+ bool generateImplicitErrors = true;
+
+ /**
+ * A flag indicating whether errors, warnings and hints should be generated
+ * for sources in the SDK.
*/
- bool _generateSdkErrors = false;
+ bool generateSdkErrors = false;
/**
- * A flag indicating whether analysis is to generate hint results (e.g. type inference based
- * information and pub best practices).
+ * A flag indicating whether analysis is to generate hint results (e.g. type
+ * inference based information and pub best practices).
*/
bool hint = true;
@@ -6482,21 +6496,21 @@ class AnalysisOptionsImpl implements AnalysisOptions {
bool preserveComments = true;
/**
- * Initialize a newly created set of analysis options to have their default values.
+ * Initialize a newly created set of analysis options to have their default
+ * values.
*/
AnalysisOptionsImpl();
/**
- * Initialize a newly created set of analysis options to have the same values as those in the
- * given set of analysis options.
- *
- * @param options the analysis options whose values are being copied
+ * Initialize a newly created set of analysis options to have the same values
+ * as those in the given set of analysis [options].
*/
AnalysisOptionsImpl.con1(AnalysisOptions options) {
analyzeFunctionBodiesPredicate = options.analyzeFunctionBodiesPredicate;
cacheSize = options.cacheSize;
dart2jsHint = options.dart2jsHint;
- _generateSdkErrors = options.generateSdkErrors;
+ generateImplicitErrors = options.generateImplicitErrors;
+ generateSdkErrors = options.generateSdkErrors;
hint = options.hint;
incremental = options.incremental;
incrementalApi = options.incrementalApi;
@@ -6562,20 +6576,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
// Enum support cannot be disabled
}
- @override
- bool get generateSdkErrors => _generateSdkErrors;
-
- /**
- * Set whether errors, warnings and hints should be generated for sources in the SDK to match the
- * given value.
- *
- * @param generate `true` if errors, warnings and hints should be generated for sources in
- * the SDK
- */
- void set generateSdkErrors(bool generate) {
- _generateSdkErrors = generate;
- }
-
/**
* Predicate used for [analyzeFunctionBodiesPredicate] when
* [analyzeFunctionBodies] is set to `true`.
« no previous file with comments | « pkg/analyzer/lib/src/analyzer_impl.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698