| 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.constant; | 5 library analyzer.src.generated.constant; |
| 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/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * An [AstCloner] that copies the necessary information from the AST to allow | 155 * An [AstCloner] that copies the necessary information from the AST to allow |
| 156 * constants to be evaluated. | 156 * constants to be evaluated. |
| 157 */ | 157 */ |
| 158 class ConstantAstCloner extends AstCloner { | 158 class ConstantAstCloner extends AstCloner { |
| 159 ConstantAstCloner() : super(true); | 159 ConstantAstCloner() : super(true); |
| 160 | 160 |
| 161 @override | 161 @override |
| 162 ConstructorName visitConstructorName(ConstructorName node) { |
| 163 ConstructorName name = super.visitConstructorName(node); |
| 164 name.staticElement = node.staticElement; |
| 165 return name; |
| 166 } |
| 167 |
| 168 @override |
| 162 InstanceCreationExpression visitInstanceCreationExpression( | 169 InstanceCreationExpression visitInstanceCreationExpression( |
| 163 InstanceCreationExpression node) { | 170 InstanceCreationExpression node) { |
| 164 InstanceCreationExpression expression = | 171 InstanceCreationExpression expression = |
| 165 super.visitInstanceCreationExpression(node); | 172 super.visitInstanceCreationExpression(node); |
| 166 expression.staticElement = node.staticElement; | 173 expression.staticElement = node.staticElement; |
| 167 return expression; | 174 return expression; |
| 168 } | 175 } |
| 169 | 176 |
| 170 @override | 177 @override |
| 171 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( | 178 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( |
| (...skipping 5296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5468 return BoolState.from(_element == rightElement); | 5475 return BoolState.from(_element == rightElement); |
| 5469 } else if (rightOperand is DynamicState) { | 5476 } else if (rightOperand is DynamicState) { |
| 5470 return BoolState.UNKNOWN_VALUE; | 5477 return BoolState.UNKNOWN_VALUE; |
| 5471 } | 5478 } |
| 5472 return BoolState.FALSE_STATE; | 5479 return BoolState.FALSE_STATE; |
| 5473 } | 5480 } |
| 5474 | 5481 |
| 5475 @override | 5482 @override |
| 5476 String toString() => _element == null ? "-unknown-" : _element.name; | 5483 String toString() => _element == null ? "-unknown-" : _element.name; |
| 5477 } | 5484 } |
| OLD | NEW |