| 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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 * those compilation units. | 1241 * those compilation units. |
| 1242 */ | 1242 */ |
| 1243 class ConstantFinder extends RecursiveAstVisitor<Object> { | 1243 class ConstantFinder extends RecursiveAstVisitor<Object> { |
| 1244 final AnalysisContext context; | 1244 final AnalysisContext context; |
| 1245 final Source source; | 1245 final Source source; |
| 1246 final Source librarySource; | 1246 final Source librarySource; |
| 1247 | 1247 |
| 1248 /** | 1248 /** |
| 1249 * The elements and AST nodes whose constant values need to be computed. | 1249 * The elements and AST nodes whose constant values need to be computed. |
| 1250 */ | 1250 */ |
| 1251 HashSet<ConstantEvaluationTarget> constantsToCompute = | 1251 List<ConstantEvaluationTarget> constantsToCompute = |
| 1252 new HashSet<ConstantEvaluationTarget>(); | 1252 <ConstantEvaluationTarget>[]; |
| 1253 | 1253 |
| 1254 /** | 1254 /** |
| 1255 * True if instance variables marked as "final" should be treated as "const". | 1255 * True if instance variables marked as "final" should be treated as "const". |
| 1256 */ | 1256 */ |
| 1257 bool treatFinalInstanceVarAsConst = false; | 1257 bool treatFinalInstanceVarAsConst = false; |
| 1258 | 1258 |
| 1259 ConstantFinder(this.context, this.source, this.librarySource); | 1259 ConstantFinder(this.context, this.source, this.librarySource); |
| 1260 | 1260 |
| 1261 @override | 1261 @override |
| 1262 Object visitAnnotation(Annotation node) { | 1262 Object visitAnnotation(Annotation node) { |
| (...skipping 4149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5412 return BoolState.from(_element == rightElement); | 5412 return BoolState.from(_element == rightElement); |
| 5413 } else if (rightOperand is DynamicState) { | 5413 } else if (rightOperand is DynamicState) { |
| 5414 return BoolState.UNKNOWN_VALUE; | 5414 return BoolState.UNKNOWN_VALUE; |
| 5415 } | 5415 } |
| 5416 return BoolState.FALSE_STATE; | 5416 return BoolState.FALSE_STATE; |
| 5417 } | 5417 } |
| 5418 | 5418 |
| 5419 @override | 5419 @override |
| 5420 String toString() => _element == null ? "-unknown-" : _element.name; | 5420 String toString() => _element == null ? "-unknown-" : _element.name; |
| 5421 } | 5421 } |
| OLD | NEW |