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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 2002353003: Don't short circuit visiting else (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 unified diff | Download patch
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 3672 matching lines...) Expand 10 before | Expand all | Expand 10 after
3683 // if(true) ... 3683 // if(true) ...
3684 return _nodeExits(thenStatement); 3684 return _nodeExits(thenStatement);
3685 } else if (elseStatement != null) { 3685 } else if (elseStatement != null) {
3686 // if (false) ... 3686 // if (false) ...
3687 return _nodeExits(elseStatement); 3687 return _nodeExits(elseStatement);
3688 } 3688 }
3689 } 3689 }
3690 if (thenStatement == null || elseStatement == null) { 3690 if (thenStatement == null || elseStatement == null) {
3691 return false; 3691 return false;
3692 } 3692 }
3693 return _nodeExits(thenStatement) && _nodeExits(elseStatement); 3693 bool thenExits = _nodeExits(thenStatement);
3694 bool elseExits = _nodeExits(elseStatement);
3695 return thenExits && elseExits;
3694 } 3696 }
3695 3697
3696 @override 3698 @override
3697 bool visitIndexExpression(IndexExpression node) { 3699 bool visitIndexExpression(IndexExpression node) {
3698 Expression target = node.realTarget; 3700 Expression target = node.realTarget;
3699 if (_nodeExits(target)) { 3701 if (_nodeExits(target)) {
3700 return true; 3702 return true;
3701 } 3703 }
3702 if (_nodeExits(node.index)) { 3704 if (_nodeExits(node.index)) {
3703 return true; 3705 return true;
(...skipping 7275 matching lines...) Expand 10 before | Expand all | Expand 10 after
10979 return null; 10981 return null;
10980 } 10982 }
10981 if (identical(node.staticElement, variable)) { 10983 if (identical(node.staticElement, variable)) {
10982 if (node.inSetterContext()) { 10984 if (node.inSetterContext()) {
10983 result = true; 10985 result = true;
10984 } 10986 }
10985 } 10987 }
10986 return null; 10988 return null;
10987 } 10989 }
10988 } 10990 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698