Index: pkg/analyzer/test/utils.dart |
diff --git a/pkg/analyzer/test/utils.dart b/pkg/analyzer/test/utils.dart |
index 61697c59d9e4bd0fb3b7024e956be9775ef1a316..3a2e229692c6f1d8e716c7a894b9b4a5db6c5a8e 100644 |
--- a/pkg/analyzer/test/utils.dart |
+++ b/pkg/analyzer/test/utils.dart |
@@ -14,6 +14,15 @@ import 'package:front_end/src/base/source.dart'; |
import 'package:test/test.dart'; |
/** |
+ * Search the [unit] for the [Element]s with the given [name]. |
+ */ |
+List<Element> findElementsByName(CompilationUnit unit, String name) { |
+ var finder = new _ElementsByNameFinder(name); |
+ unit.accept(finder); |
+ return finder.elements; |
+} |
+ |
+/** |
* Search the [unit] for the [LocalVariableElement] with the given [name]. |
* Fail if there is not exactly one such variable. |
*/ |