| 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 testing.abstract_context; | 5 library testing.abstract_context; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| 11 import 'package:analyzer/dart/element/visitor.dart'; | 11 import 'package:analyzer/dart/element/visitor.dart'; |
| 12 import 'package:analyzer/exception/exception.dart'; | 12 import 'package:analyzer/exception/exception.dart'; |
| 13 import 'package:analyzer/file_system/file_system.dart'; | 13 import 'package:analyzer/file_system/file_system.dart'; |
| 14 import 'package:analyzer/file_system/memory_file_system.dart'; | 14 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 15 import 'package:analyzer/source/package_map_resolver.dart'; | 15 import 'package:analyzer/source/package_map_resolver.dart'; |
| 16 import 'package:analyzer/src/dart/analysis/driver.dart'; | 16 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 17 import 'package:analyzer/src/dart/analysis/file_state.dart'; | 17 import 'package:analyzer/src/dart/analysis/file_state.dart'; |
| 18 import 'package:analyzer/src/generated/engine.dart'; | 18 import 'package:analyzer/src/generated/engine.dart'; |
| 19 import 'package:analyzer/src/generated/engine.dart' as engine; | 19 import 'package:analyzer/src/generated/engine.dart' as engine; |
| 20 import 'package:analyzer/src/generated/sdk.dart'; | 20 import 'package:analyzer/src/generated/sdk.dart'; |
| 21 import 'package:analyzer/src/generated/source_io.dart'; | 21 import 'package:analyzer/src/generated/source_io.dart'; |
| 22 import 'package:front_end/src/base/performace_logger.dart'; |
| 22 import 'package:front_end/src/incremental/byte_store.dart'; | 23 import 'package:front_end/src/incremental/byte_store.dart'; |
| 23 | 24 |
| 24 import 'mock_sdk.dart'; | 25 import 'mock_sdk.dart'; |
| 25 | 26 |
| 26 /** | 27 /** |
| 27 * Finds an [Element] with the given [name]. | 28 * Finds an [Element] with the given [name]. |
| 28 */ | 29 */ |
| 29 Element findChildElement(Element root, String name, [ElementKind kind]) { | 30 Element findChildElement(Element root, String name, [ElementKind kind]) { |
| 30 Element result = null; | 31 Element result = null; |
| 31 root.accept(new _ElementVisitorFunctionWrapper((Element element) { | 32 root.accept(new _ElementVisitorFunctionWrapper((Element element) { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 * [engine.GeneralizingElementVisitor]. | 218 * [engine.GeneralizingElementVisitor]. |
| 218 */ | 219 */ |
| 219 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { | 220 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { |
| 220 final _ElementVisitorFunction function; | 221 final _ElementVisitorFunction function; |
| 221 _ElementVisitorFunctionWrapper(this.function); | 222 _ElementVisitorFunctionWrapper(this.function); |
| 222 visitElement(Element element) { | 223 visitElement(Element element) { |
| 223 function(element); | 224 function(element); |
| 224 super.visitElement(element); | 225 super.visitElement(element); |
| 225 } | 226 } |
| 226 } | 227 } |
| OLD | NEW |