| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/dart/element/visitor.dart'; | 9 import 'package:analyzer/dart/element/visitor.dart'; |
| 10 import 'package:analyzer/exception/exception.dart'; | 10 import 'package:analyzer/exception/exception.dart'; |
| 11 import 'package:analyzer/file_system/file_system.dart'; | 11 import 'package:analyzer/file_system/file_system.dart'; |
| 12 import 'package:analyzer/file_system/memory_file_system.dart'; | 12 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 13 import 'package:analyzer/source/package_map_resolver.dart'; | 13 import 'package:analyzer/source/package_map_resolver.dart'; |
| 14 import 'package:analyzer/src/dart/analysis/driver.dart'; | 14 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 15 import 'package:analyzer/src/dart/analysis/file_state.dart'; | 15 import 'package:analyzer/src/dart/analysis/file_state.dart'; |
| 16 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
| 17 import 'package:analyzer/src/generated/engine.dart' as engine; | 17 import 'package:analyzer/src/generated/engine.dart' as engine; |
| 18 import 'package:analyzer/src/generated/sdk.dart'; | 18 import 'package:analyzer/src/generated/sdk.dart'; |
| 19 import 'package:analyzer/src/generated/source_io.dart'; | 19 import 'package:analyzer/src/generated/source_io.dart'; |
| 20 import 'package:front_end/src/base/performace_logger.dart'; | 20 import 'package:front_end/src/base/performace_logger.dart'; |
| 21 import 'package:front_end/src/incremental/byte_store.dart'; | 21 import 'package:front_end/src/byte_store/byte_store.dart'; |
| 22 | 22 |
| 23 import 'mock_sdk.dart'; | 23 import 'mock_sdk.dart'; |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * Finds an [Element] with the given [name]. | 26 * Finds an [Element] with the given [name]. |
| 27 */ | 27 */ |
| 28 Element findChildElement(Element root, String name, [ElementKind kind]) { | 28 Element findChildElement(Element root, String name, [ElementKind kind]) { |
| 29 Element result = null; | 29 Element result = null; |
| 30 root.accept(new _ElementVisitorFunctionWrapper((Element element) { | 30 root.accept(new _ElementVisitorFunctionWrapper((Element element) { |
| 31 if (element.name != name) { | 31 if (element.name != name) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 * [engine.GeneralizingElementVisitor]. | 163 * [engine.GeneralizingElementVisitor]. |
| 164 */ | 164 */ |
| 165 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { | 165 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { |
| 166 final _ElementVisitorFunction function; | 166 final _ElementVisitorFunction function; |
| 167 _ElementVisitorFunctionWrapper(this.function); | 167 _ElementVisitorFunctionWrapper(this.function); |
| 168 visitElement(Element element) { | 168 visitElement(Element element) { |
| 169 function(element); | 169 function(element); |
| 170 super.visitElement(element); | 170 super.visitElement(element); |
| 171 } | 171 } |
| 172 } | 172 } |
| OLD | NEW |