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

Unified Diff: pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart

Issue 1814453002: Remove more calls to safelyVisit methods (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/dart/element/element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
diff --git a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
index e978eb42af41c57d1da8ca2e52fe1109d7c3a3c4..7a7a870e9b8096ed1f5d0557b1dbfe2f8f21dbd9 100644
--- a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
+++ b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
@@ -127,21 +127,21 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor {
}
computer._addRegionForNode(node.constructorName, element);
// arguments
- _safelyVisit(node.arguments);
+ node.arguments?.accept(this);
}
@override
visitAssignmentExpression(AssignmentExpression node) {
- _safelyVisit(node.leftHandSide);
+ node.leftHandSide?.accept(this);
computer._addRegionForToken(node.operator, node.bestElement);
- _safelyVisit(node.rightHandSide);
+ node.rightHandSide?.accept(this);
}
@override
visitBinaryExpression(BinaryExpression node) {
- _safelyVisit(node.leftOperand);
+ node.leftOperand?.accept(this);
computer._addRegionForToken(node.operator, node.bestElement);
- _safelyVisit(node.rightOperand);
+ node.rightOperand?.accept(this);
}
@override
@@ -255,7 +255,7 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor {
computer._addRegionForToken(node.thisKeyword, element);
computer._addRegionForNode(node.constructorName, element);
// process arguments
- _safelyVisit(node.argumentList);
+ node.argumentList?.accept(this);
}
@override
@@ -277,7 +277,7 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor {
computer._addRegionForToken(node.superKeyword, element);
computer._addRegionForNode(node.constructorName, element);
// process arguments
- _safelyVisit(node.argumentList);
+ node.argumentList?.accept(this);
}
void _addConstructorName(AstNode parent, ConstructorName node) {
@@ -324,10 +324,4 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor {
}
}
}
-
- void _safelyVisit(AstNode node) {
- if (node != null) {
- node.accept(this);
- }
- }
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/element/element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698