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

Unified Diff: pkg/compiler/lib/src/kernel/element_map_impl.dart

Issue 2871573007: Skip constructors from ElementEnvironment.forEachClassMember (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/kernel/element_map_impl.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index 5a0ab99bc7ed3cd42765448fb01b9cae7ebdf1a6..9b2170441b3d297402eaec147936b855f2ef4c91 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -764,19 +764,22 @@ class _KClassEnv {
_setterMap = <String, ir.Member>{};
_constructorMap = <String, ir.Member>{};
- void addMembers(ir.Class c) {
+ void addMembers(ir.Class c, {bool includeStatic}) {
for (ir.Member member in c.members) {
if (member is ir.Constructor ||
member is ir.Procedure &&
member.kind == ir.ProcedureKind.Factory) {
+ if (!includeStatic) continue;
_constructorMap[member.name.name] = member;
} else if (member is ir.Procedure) {
+ if (!includeStatic && member.isStatic) continue;
if (member.kind == ir.ProcedureKind.Setter) {
_setterMap[member.name.name] = member;
} else {
_memberMap[member.name.name] = member;
}
} else if (member is ir.Field) {
+ if (!includeStatic && member.isStatic) continue;
_memberMap[member.name.name] = member;
if (member.isMutable) {
_setterMap[member.name.name] = member;
@@ -790,9 +793,9 @@ class _KClassEnv {
}
if (cls.mixedInClass != null) {
- addMembers(cls.mixedInClass);
+ addMembers(cls.mixedInClass, includeStatic: false);
}
- addMembers(cls);
+ addMembers(cls, includeStatic: true);
}
}

Powered by Google App Engine
This is Rietveld 408576698