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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 19405002: Implement reflecting on static fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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: dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
index 58c23443c05a05cf1ada8e72d587754292e46156..76b16e4be3d39777100247c1f9db35e322f1491d 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
@@ -1892,6 +1892,18 @@ abstract class BaseClassElementX extends ElementX implements ClassElement {
includeSuperAndInjectedMembers: includeSuperAndInjectedMembers);
}
+ /// Similar to [forEachInstanceField] but visits static fields.
+ void forEachStaticField(void f(ClassElement enclosingClass, Element field)) {
ngeoffray 2013/07/17 07:41:11 Does the user of this function care of the enclosi
ahe 2013/07/17 08:39:15 Yes, but since it is used analogous to forEachInst
+ // Filters so that [f] is only invoked with static fields.
+ void fieldFilter(ClassElement enclosingClass, Element member) {
+ if (!member.isInstanceMember() && member.kind == ElementKind.FIELD) {
+ f(enclosingClass, member);
+ }
+ }
+
+ forEachMember(fieldFilter);
+ }
+
void forEachBackendMember(void f(Element member)) {
backendMembers.forEach(f);
}

Powered by Google App Engine
This is Rietveld 408576698