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

Side by Side Diff: pkg/compiler/lib/src/common_elements.dart

Issue 2882523003: Add forEachLibraryMember and forEachConstructor to ElementEnvironment (Closed)
Patch Set: Updated cf. comments. Created 3 years, 7 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // TODO(sigmund): rename and move to common/elements.dart 5 // TODO(sigmund): rename and move to common/elements.dart
6 library dart2js.type_system; 6 library dart2js.type_system;
7 7
8 import 'common/names.dart' show Identifiers, Uris; 8 import 'common/names.dart' show Identifiers, Uris;
9 import 'constants/values.dart'; 9 import 'constants/values.dart';
10 import 'elements/entities.dart'; 10 import 'elements/entities.dart';
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 LibraryEntity lookupLibrary(Uri uri, {bool required: false}); 1170 LibraryEntity lookupLibrary(Uri uri, {bool required: false});
1171 1171
1172 /// Calls [f] for every class declared in [library]. 1172 /// Calls [f] for every class declared in [library].
1173 void forEachClass(LibraryEntity library, void f(ClassEntity cls)); 1173 void forEachClass(LibraryEntity library, void f(ClassEntity cls));
1174 1174
1175 /// Lookup the class [name] in [library], fail if the class is missing and 1175 /// Lookup the class [name] in [library], fail if the class is missing and
1176 /// [required]. 1176 /// [required].
1177 ClassEntity lookupClass(LibraryEntity library, String name, 1177 ClassEntity lookupClass(LibraryEntity library, String name,
1178 {bool required: false}); 1178 {bool required: false});
1179 1179
1180 /// Calls [f] for every top level member in [library].
1181 void forEachLibraryMember(LibraryEntity library, void f(MemberEntity member));
1182
1180 /// Lookup the member [name] in [library], fail if the class is missing and 1183 /// Lookup the member [name] in [library], fail if the class is missing and
1181 /// [required]. 1184 /// [required].
1182 MemberEntity lookupLibraryMember(LibraryEntity library, String name, 1185 MemberEntity lookupLibraryMember(LibraryEntity library, String name,
1183 {bool setter: false, bool required: false}); 1186 {bool setter: false, bool required: false});
1184 1187
1185 /// Lookup the member [name] in [cls], fail if the class is missing and 1188 /// Lookup the member [name] in [cls], fail if the class is missing and
1186 /// [required]. 1189 /// [required].
1187 MemberEntity lookupClassMember(ClassEntity cls, String name, 1190 MemberEntity lookupClassMember(ClassEntity cls, String name,
1188 {bool setter: false, bool required: false}); 1191 {bool setter: false, bool required: false});
1189 1192
1190 /// Lookup the constructor [name] in [cls], fail if the class is missing and 1193 /// Lookup the constructor [name] in [cls], fail if the class is missing and
1191 /// [required]. 1194 /// [required].
1192 ConstructorEntity lookupConstructor(ClassEntity cls, String name, 1195 ConstructorEntity lookupConstructor(ClassEntity cls, String name,
1193 {bool required: false}); 1196 {bool required: false});
1194 1197
1195 /// Calls [f] for each class member declared or inherited in [cls] together 1198 /// Calls [f] for each class member declared or inherited in [cls] together
1196 /// with the class that declared the member. 1199 /// with the class that declared the member.
1197 /// 1200 ///
1198 /// TODO(johnniwinther): This should not include static members of 1201 /// TODO(johnniwinther): This should not include static members of
1199 /// superclasses. 1202 /// superclasses.
1200 void forEachClassMember( 1203 void forEachClassMember(
1201 ClassEntity cls, void f(ClassEntity declarer, MemberEntity member)); 1204 ClassEntity cls, void f(ClassEntity declarer, MemberEntity member));
1202 1205
1206 /// Calls [f] for every constructor declared in [cls].
1207 void forEachConstructor(
1208 ClassEntity cls, void f(ConstructorEntity constructor));
1209
1203 /// Returns the superclass of [cls]. 1210 /// Returns the superclass of [cls].
1204 /// 1211 ///
1205 /// If [skipUnnamedMixinApplications] is `true`, unnamed mixin applications 1212 /// If [skipUnnamedMixinApplications] is `true`, unnamed mixin applications
1206 /// are excluded, for instance for these classes 1213 /// are excluded, for instance for these classes
1207 /// 1214 ///
1208 /// class S {} 1215 /// class S {}
1209 /// class M {} 1216 /// class M {}
1210 /// class C extends S with M {} 1217 /// class C extends S with M {}
1211 /// 1218 ///
1212 /// the result of `getSuperClass(C)` is the unnamed mixin application 1219 /// the result of `getSuperClass(C)` is the unnamed mixin application
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 /// arguments, both required and optional. 1269 /// arguments, both required and optional.
1263 CallStructure getCallStructure(FunctionEntity entity); 1270 CallStructure getCallStructure(FunctionEntity entity);
1264 1271
1265 /// Returns `true` if [member] a the synthetic getter `loadLibrary` injected 1272 /// Returns `true` if [member] a the synthetic getter `loadLibrary` injected
1266 /// on deferred libraries. 1273 /// on deferred libraries.
1267 bool isDeferredLoadLibraryGetter(MemberEntity member); 1274 bool isDeferredLoadLibraryGetter(MemberEntity member);
1268 1275
1269 /// Returns the metadata constants declared on [member]. 1276 /// Returns the metadata constants declared on [member].
1270 Iterable<ConstantValue> getMemberMetadata(MemberEntity member); 1277 Iterable<ConstantValue> getMemberMetadata(MemberEntity member);
1271 } 1278 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698