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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 return super.visitArgumentList(node); | 129 return super.visitArgumentList(node); |
130 } | 130 } |
131 | 131 |
132 @override | 132 @override |
133 Object visitAsExpression(AsExpression node) { | 133 Object visitAsExpression(AsExpression node) { |
134 _checkForUnnecessaryCast(node); | 134 _checkForUnnecessaryCast(node); |
135 return super.visitAsExpression(node); | 135 return super.visitAsExpression(node); |
136 } | 136 } |
137 | 137 |
138 @override | 138 @override |
| 139 Object visitAssertInitializer(AssertInitializer node) { |
| 140 _checkForPossibleNullCondition(node.condition); |
| 141 return super.visitAssertInitializer(node); |
| 142 } |
| 143 |
| 144 @override |
139 Object visitAssertStatement(AssertStatement node) { | 145 Object visitAssertStatement(AssertStatement node) { |
140 _checkForPossibleNullCondition(node.condition); | 146 _checkForPossibleNullCondition(node.condition); |
141 return super.visitAssertStatement(node); | 147 return super.visitAssertStatement(node); |
142 } | 148 } |
143 | 149 |
144 @override | 150 @override |
145 Object visitAssignmentExpression(AssignmentExpression node) { | 151 Object visitAssignmentExpression(AssignmentExpression node) { |
146 TokenType operatorType = node.operator.type; | 152 TokenType operatorType = node.operator.type; |
147 if (operatorType == TokenType.EQ) { | 153 if (operatorType == TokenType.EQ) { |
148 _checkForUseOfVoidResult(node.rightHandSide); | 154 _checkForUseOfVoidResult(node.rightHandSide); |
(...skipping 2643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2792 Set<AstNode> _enclosingBlockBreaksLabel = new Set<AstNode>(); | 2798 Set<AstNode> _enclosingBlockBreaksLabel = new Set<AstNode>(); |
2793 | 2799 |
2794 @override | 2800 @override |
2795 bool visitArgumentList(ArgumentList node) => | 2801 bool visitArgumentList(ArgumentList node) => |
2796 _visitExpressions(node.arguments); | 2802 _visitExpressions(node.arguments); |
2797 | 2803 |
2798 @override | 2804 @override |
2799 bool visitAsExpression(AsExpression node) => _nodeExits(node.expression); | 2805 bool visitAsExpression(AsExpression node) => _nodeExits(node.expression); |
2800 | 2806 |
2801 @override | 2807 @override |
| 2808 bool visitAssertInitializer(AssertInitializer node) => false; |
| 2809 |
| 2810 @override |
2802 bool visitAssertStatement(AssertStatement node) => false; | 2811 bool visitAssertStatement(AssertStatement node) => false; |
2803 | 2812 |
2804 @override | 2813 @override |
2805 bool visitAssignmentExpression(AssignmentExpression node) { | 2814 bool visitAssignmentExpression(AssignmentExpression node) { |
2806 Expression leftHandSide = node.leftHandSide; | 2815 Expression leftHandSide = node.leftHandSide; |
2807 if (_nodeExits(leftHandSide)) { | 2816 if (_nodeExits(leftHandSide)) { |
2808 return true; | 2817 return true; |
2809 } | 2818 } |
2810 TokenType operatorType = node.operator.type; | 2819 TokenType operatorType = node.operator.type; |
2811 if (operatorType == TokenType.AMPERSAND_AMPERSAND_EQ || | 2820 if (operatorType == TokenType.AMPERSAND_AMPERSAND_EQ || |
(...skipping 7927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10739 return null; | 10748 return null; |
10740 } | 10749 } |
10741 if (identical(node.staticElement, variable)) { | 10750 if (identical(node.staticElement, variable)) { |
10742 if (node.inSetterContext()) { | 10751 if (node.inSetterContext()) { |
10743 result = true; | 10752 result = true; |
10744 } | 10753 } |
10745 } | 10754 } |
10746 return null; | 10755 return null; |
10747 } | 10756 } |
10748 } | 10757 } |
OLD | NEW |