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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 3772 matching lines...) Expand 10 before | Expand all | Expand 10 after
3783 } 3783 }
3784 3784
3785 @override 3785 @override
3786 bool visitThisExpression(ThisExpression node) => false; 3786 bool visitThisExpression(ThisExpression node) => false;
3787 3787
3788 @override 3788 @override
3789 bool visitThrowExpression(ThrowExpression node) => true; 3789 bool visitThrowExpression(ThrowExpression node) => true;
3790 3790
3791 @override 3791 @override
3792 bool visitTryStatement(TryStatement node) { 3792 bool visitTryStatement(TryStatement node) {
3793 if (_nodeExits(node.body)) { 3793 if (_nodeExits(node.finallyBlock)) {
3794 return true; 3794 return true;
3795 } 3795 }
3796 Block finallyBlock = node.finallyBlock; 3796 if (!_nodeExits(node.body)) {
3797 if (_nodeExits(finallyBlock)) { 3797 return false;
3798 return true;
3799 } 3798 }
3800 return false; 3799 for (CatchClause c in node.catchClauses) {
3800 if (!_nodeExits(c.body)) {
3801 return false;
3802 }
3803 }
3804 return true;
3801 } 3805 }
3802 3806
3803 @override 3807 @override
3804 bool visitTypeName(TypeName node) => false; 3808 bool visitTypeName(TypeName node) => false;
3805 3809
3806 @override 3810 @override
3807 bool visitVariableDeclaration(VariableDeclaration node) { 3811 bool visitVariableDeclaration(VariableDeclaration node) {
3808 Expression initializer = node.initializer; 3812 Expression initializer = node.initializer;
3809 if (initializer != null) { 3813 if (initializer != null) {
3810 return initializer.accept(this); 3814 return initializer.accept(this);
(...skipping 7119 matching lines...) Expand 10 before | Expand all | Expand 10 after
10930 return null; 10934 return null;
10931 } 10935 }
10932 if (identical(node.staticElement, variable)) { 10936 if (identical(node.staticElement, variable)) {
10933 if (node.inSetterContext()) { 10937 if (node.inSetterContext()) {
10934 result = true; 10938 result = true;
10935 } 10939 }
10936 } 10940 }
10937 return null; 10941 return null;
10938 } 10942 }
10939 } 10943 }
OLDNEW
« 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