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

Unified Diff: pkg/compiler/lib/src/js_emitter/model.dart

Issue 752553004: dart2js: Support mixins in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 6 years, 1 month 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/js_emitter/model.dart
diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
index b4b1789afc42463002e790a942415efdfc893f6b..f95e7eff739b794b2b1598154e12b991c949e1ca 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -132,21 +132,27 @@ class StaticField {
class Class {
final String name;
final Holder holder;
- Class superclass;
+ Class _superclass;
final List<Method> methods;
final List<InstanceField> fields;
final bool onlyForRti;
+ final bool isDirectlyInstantiated;
/// Whether the class must be evaluated eagerly.
bool isEager = false;
Class(this.name, this.holder, this.methods, this.fields,
- { this.onlyForRti }) {
+ {this.onlyForRti,
+ this.isDirectlyInstantiated}) {
assert(onlyForRti != null);
+ assert(isDirectlyInstantiated != null);
}
+ bool get isMixinApplication => false;
+ Class get superclass => _superclass;
+
void setSuperclass(Class superclass) {
- this.superclass = superclass;
+ this._superclass = superclass;
kasperl 2014/11/27 09:05:14 Remove this.?
floitsch 2014/11/27 12:35:16 Done.
}
String get superclassName
@@ -155,6 +161,24 @@ class Class {
=> (superclass == null) ? 0 : superclass.holder.index;
}
+class MixinApplication extends Class {
+ Class _mixinClass;
+
+ MixinApplication(String name, Holder holder,
+ {bool onlyForRti,
+ bool isDirectlyInstantiated})
+ : super(name, holder, const <Method>[], const <InstanceField>[],
+ onlyForRti: onlyForRti,
+ isDirectlyInstantiated: isDirectlyInstantiated);
+
+ bool get isMixinApplication => true;
+ Class get mixinClass => _mixinClass;
+
+ void setMixinClass(Class mixinClass) {
sigurdm 2014/11/27 09:25:54 Why not a setter?
floitsch 2014/11/27 12:35:16 Because we don't want it to feel like a field. The
+ this._mixinClass = mixinClass;
kasperl 2014/11/27 09:05:13 Remove this.?
floitsch 2014/11/27 12:35:16 Done.
+ }
+}
+
class InstanceField {
final String name;

Powered by Google App Engine
This is Rietveld 408576698