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

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

Issue 1424793008: Remove unused support for disabling error messages (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/generated/error.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index b24c069216cf49a3ffcd8e9c1384651df57e523c..91f49200bb8ba8c9299b6b07be71c78df2ecfde6 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -9746,13 +9746,6 @@ class PartialResolverVisitor extends ResolverVisitor {
final List<VariableElement> variablesAndFields = <VariableElement>[];
/**
- * A flag indicating whether we should discard errors while resolving the
- * initializer for variable declarations. We do this for top-level variables
- * and fields because their initializer will be re-resolved at a later time.
- */
- bool discardErrorsInInitializer = false;
-
- /**
* Initialize a newly created visitor to resolve the nodes in an AST node.
*
* The [definingLibrary] is the element for the library containing the node
@@ -9775,8 +9768,7 @@ class PartialResolverVisitor extends ResolverVisitor {
InheritanceManager inheritanceManager,
StaticTypeAnalyzerFactory typeAnalyzerFactory})
: strongMode = definingLibrary.context.analysisOptions.strongMode,
- super(definingLibrary, source, typeProvider,
- new DisablableErrorListener(errorListener));
+ super(definingLibrary, source, typeProvider, errorListener);
@override
Object visitBlockFunctionBody(BlockFunctionBody node) {
@@ -9798,26 +9790,12 @@ class PartialResolverVisitor extends ResolverVisitor {
Object visitFieldDeclaration(FieldDeclaration node) {
if (strongMode && node.isStatic) {
_addVariables(node.fields.variables);
- bool wasDiscarding = discardErrorsInInitializer;
- discardErrorsInInitializer = true;
- try {
- return super.visitFieldDeclaration(node);
- } finally {
- discardErrorsInInitializer = wasDiscarding;
- }
}
return super.visitFieldDeclaration(node);
}
@override
Object visitNode(AstNode node) {
- if (discardErrorsInInitializer) {
- AstNode parent = node.parent;
- if (parent is VariableDeclaration && parent.initializer == node) {
- DisablableErrorListener listener = errorListener;
- return listener.disableWhile(() => super.visitNode(node));
- }
- }
return super.visitNode(node);
}
@@ -9825,13 +9803,6 @@ class PartialResolverVisitor extends ResolverVisitor {
Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
if (strongMode) {
_addVariables(node.variables.variables);
- bool wasDiscarding = discardErrorsInInitializer;
- discardErrorsInInitializer = true;
- try {
- return super.visitTopLevelVariableDeclaration(node);
- } finally {
- discardErrorsInInitializer = wasDiscarding;
- }
}
return super.visitTopLevelVariableDeclaration(node);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698