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

Unified Diff: pkg/compiler/lib/src/elements/common.dart

Issue 1811173003: Support per-library serialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 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
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/common.dart
diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
index 5d5f9e673b1dded81eb95979df4008026cca1415..6c2e843b599703b441c9bd139cc7935dfc83be6e 100644
--- a/pkg/compiler/lib/src/elements/common.dart
+++ b/pkg/compiler/lib/src/elements/common.dart
@@ -510,3 +510,37 @@ abstract class FunctionSignatureCommon implements FunctionSignature {
return true;
}
}
+
+abstract class MixinApplicationElementCommon
+ implements MixinApplicationElement {
+ Link<ConstructorElement> get constructors {
+ throw new UnsupportedError('Unimplemented $this.constructors');
+ }
+
+ FunctionElement _lookupLocalConstructor(String name) {
+ for (Link<Element> link = constructors;
+ !link.isEmpty;
+ link = link.tail) {
+ if (link.head.name == name) return link.head;
+ }
+ return null;
+ }
+
+ @override
+ Element localLookup(String name) {
+ Element constructor = _lookupLocalConstructor(name);
+ if (constructor != null) return constructor;
+ if (mixin == null) return null;
+ Element mixedInElement = mixin.localLookup(name);
+ if (mixedInElement == null) return null;
+ return mixedInElement.isInstanceMember ? mixedInElement : null;
+ }
+
+ @override
+ void forEachLocalMember(void f(Element member)) {
+ constructors.forEach(f);
+ if (mixin != null) mixin.forEachLocalMember((Element mixedInElement) {
+ if (mixedInElement.isInstanceMember) f(mixedInElement);
+ });
+ }
+}
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698