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

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

Issue 2492633002: Create AST structure for asserts in constructor initializers (Closed)
Patch Set: Created 4 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 | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/test/generated/parser_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/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index a009cde3fe705736e4d5f691fb2a8546948df3d2..f0ffbdc5f38c7f4e1a0917d300aaae0d76c53b96 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -136,6 +136,12 @@ class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
}
@override
+ Object visitAssertInitializer(AssertInitializer node) {
+ _checkForPossibleNullCondition(node.condition);
+ return super.visitAssertInitializer(node);
+ }
+
+ @override
Object visitAssertStatement(AssertStatement node) {
_checkForPossibleNullCondition(node.condition);
return super.visitAssertStatement(node);
@@ -2799,6 +2805,9 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
bool visitAsExpression(AsExpression node) => _nodeExits(node.expression);
@override
+ bool visitAssertInitializer(AssertInitializer node) => false;
+
+ @override
bool visitAssertStatement(AssertStatement node) => false;
@override
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698