OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |