Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: pkg/analyzer/test/utils.dart

Issue 2973093002: Stop depending on LabelElement(s) to be reported in visitChildren(). (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
*/

Powered by Google App Engine
This is Rietveld 408576698