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

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

Issue 1985173003: Adjust do visit in ExitDetector (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/test/generated/all_the_rest_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 777d13073d2a4a6d53a1818be85c880b01810f58..7f9657f9c18b210c6eb2e100cfe8692f8ffa8e63 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -3577,17 +3577,17 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
bool outerBreakValue = _enclosingBlockContainsBreak;
_enclosingBlockContainsBreak = false;
try {
+ if (_nodeExits(node.body)) {
+ return true;
+ }
Expression conditionExpression = node.condition;
if (_nodeExits(conditionExpression)) {
return true;
}
// TODO(jwren) Do we want to take all constant expressions into account?
if (conditionExpression is BooleanLiteral) {
- // If do {} while (true), and the body doesn't return or the body
- // doesn't have a break, then return true.
- bool blockReturns = _nodeExits(node.body);
- if (conditionExpression.value &&
- (blockReturns || !_enclosingBlockContainsBreak)) {
+ // If do {} while (true), and the body doesn't break, then return true.
+ if (conditionExpression.value && !_enclosingBlockContainsBreak) {
return true;
}
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698