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

Side by Side 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: Fix a long line. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import 'dart:collection' show LinkedHashMap; 7 import 'dart:collection' show LinkedHashMap;
8 8
9 import 'elements.dart'; 9 import 'elements.dart';
10 import '../../compiler.dart' as api; 10 import '../../compiler.dart' as api;
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 void fieldFilter(ClassElement enclosingClass, Element member) { 1885 void fieldFilter(ClassElement enclosingClass, Element member) {
1886 if (member.isInstanceMember() && member.kind == ElementKind.FIELD) { 1886 if (member.isInstanceMember() && member.kind == ElementKind.FIELD) {
1887 f(enclosingClass, member); 1887 f(enclosingClass, member);
1888 } 1888 }
1889 } 1889 }
1890 1890
1891 forEachMember(fieldFilter, 1891 forEachMember(fieldFilter,
1892 includeSuperAndInjectedMembers: includeSuperAndInjectedMembers); 1892 includeSuperAndInjectedMembers: includeSuperAndInjectedMembers);
1893 } 1893 }
1894 1894
1895 /// Similar to [forEachInstanceField] but visits static fields.
1896 void forEachStaticField(void f(ClassElement enclosingClass, Element field)) {
1897 // Filters so that [f] is only invoked with static fields.
1898 void fieldFilter(ClassElement enclosingClass, Element member) {
1899 if (!member.isInstanceMember() && member.kind == ElementKind.FIELD) {
1900 f(enclosingClass, member);
1901 }
1902 }
1903
1904 forEachMember(fieldFilter);
1905 }
1906
1895 void forEachBackendMember(void f(Element member)) { 1907 void forEachBackendMember(void f(Element member)) {
1896 backendMembers.forEach(f); 1908 backendMembers.forEach(f);
1897 } 1909 }
1898 1910
1899 bool implementsInterface(ClassElement intrface) { 1911 bool implementsInterface(ClassElement intrface) {
1900 for (DartType implementedInterfaceType in allSupertypes) { 1912 for (DartType implementedInterfaceType in allSupertypes) {
1901 ClassElement implementedInterface = implementedInterfaceType.element; 1913 ClassElement implementedInterface = implementedInterfaceType.element;
1902 if (identical(implementedInterface, intrface)) { 1914 if (identical(implementedInterface, intrface)) {
1903 return true; 1915 return true;
1904 } 1916 }
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 2219
2208 MetadataAnnotation ensureResolved(Compiler compiler) { 2220 MetadataAnnotation ensureResolved(Compiler compiler) {
2209 if (resolutionState == STATE_NOT_STARTED) { 2221 if (resolutionState == STATE_NOT_STARTED) {
2210 compiler.resolver.resolveMetadataAnnotation(this); 2222 compiler.resolver.resolveMetadataAnnotation(this);
2211 } 2223 }
2212 return this; 2224 return this;
2213 } 2225 }
2214 2226
2215 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 2227 String toString() => 'MetadataAnnotation($value, $resolutionState)';
2216 } 2228 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698