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

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

Issue 2054323002: Fix exit detection for try statements. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add tests without a "finally" clause Created 4 years, 6 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 d74e92556dc052cd46a05a82d54d74cd78e05994..48aeaaffb8735dad8acfb9961065ad7f0ca37082 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -3790,14 +3790,18 @@ class ExitDetector extends GeneralizingAstVisitor<bool> {
@override
bool visitTryStatement(TryStatement node) {
- if (_nodeExits(node.body)) {
+ if (_nodeExits(node.finallyBlock)) {
return true;
}
- Block finallyBlock = node.finallyBlock;
- if (_nodeExits(finallyBlock)) {
- return true;
+ if (!_nodeExits(node.body)) {
+ return false;
}
- return false;
+ for (CatchClause c in node.catchClauses) {
+ if (!_nodeExits(c.body)) {
+ return false;
+ }
+ }
+ return true;
}
@override
« 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