| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.test.src.dart.constant.utilities_test; | 5 library analyzer.test.src.dart.constant.utilities_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/dart/ast/token.dart'; | 10 import 'package:analyzer/src/dart/ast/token.dart'; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 if (target is ElementAnnotationImpl) { | 176 if (target is ElementAnnotationImpl) { |
| 177 expect(target.context, same(_context)); | 177 expect(target.context, same(_context)); |
| 178 expect(target.source, same(_source)); | 178 expect(target.source, same(_source)); |
| 179 annotations.add(target.annotationAst); | 179 annotations.add(target.annotationAst); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 return new List<Annotation>.from(annotations); | 182 return new List<Annotation>.from(annotations); |
| 183 } | 183 } |
| 184 | 184 |
| 185 List<ConstantEvaluationTarget> _findConstants() { | 185 List<ConstantEvaluationTarget> _findConstants() { |
| 186 ConstantFinder finder = new ConstantFinder(_context, _source, _source); | 186 ConstantFinder finder = new ConstantFinder(); |
| 187 _node.accept(finder); | 187 _node.accept(finder); |
| 188 List<ConstantEvaluationTarget> constants = finder.constantsToCompute; | 188 List<ConstantEvaluationTarget> constants = finder.constantsToCompute; |
| 189 expect(constants, isNotNull); | 189 expect(constants, isNotNull); |
| 190 return constants; | 190 return constants; |
| 191 } | 191 } |
| 192 | 192 |
| 193 ConstructorElement _setupConstructorDeclaration(String name, bool isConst) { | 193 ConstructorElement _setupConstructorDeclaration(String name, bool isConst) { |
| 194 Keyword constKeyword = isConst ? Keyword.CONST : null; | 194 Keyword constKeyword = isConst ? Keyword.CONST : null; |
| 195 ConstructorDeclaration constructorDeclaration = | 195 ConstructorDeclaration constructorDeclaration = |
| 196 AstFactory.constructorDeclaration2( | 196 AstFactory.constructorDeclaration2( |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 void _visitNode(AstNode node) { | 355 void _visitNode(AstNode node) { |
| 356 node.accept(_createReferenceFinder(_head)); | 356 node.accept(_createReferenceFinder(_head)); |
| 357 } | 357 } |
| 358 } | 358 } |
| 359 | 359 |
| 360 class _TestAnalysisContext extends TestAnalysisContext { | 360 class _TestAnalysisContext extends TestAnalysisContext { |
| 361 @override | 361 @override |
| 362 InternalAnalysisContext getContextFor(Source source) => this; | 362 InternalAnalysisContext getContextFor(Source source) => this; |
| 363 } | 363 } |
| OLD | NEW |