Index: test/codegen/expect/fields.js |
diff --git a/test/codegen/expect/fields.js b/test/codegen/expect/fields.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..86fb231bb8fc9b7bf0ac010f50e86d146aa7491e |
--- /dev/null |
+++ b/test/codegen/expect/fields.js |
@@ -0,0 +1,71 @@ |
+var fields; |
+(function(exports) { |
+ 'use strict'; |
+ // Function init: (dynamic) → dynamic |
+ function init(x) { |
+ core.print(x); |
+ return x; |
+ } |
+ class Base extends core.Object { |
+ Base() { |
+ dart.initField(Base, this, 'x', init('Base.x')); |
+ } |
+ } |
+ dart.virtualField(Base, 'x'); |
+ class Mixin1 extends core.Object { |
+ Mixin1() { |
+ dart.initField(Mixin1, this, 'x', init('Mixin1.x')); |
+ } |
+ } |
+ dart.virtualField(Mixin1, 'x'); |
+ class Mixin2 extends core.Object { |
+ Mixin2() { |
+ dart.initField(Mixin2, this, 'x', init('Mixin2.x')); |
+ } |
+ } |
+ dart.virtualField(Mixin2, 'x'); |
+ class Derived extends dart.mixin(Base, Mixin1, Mixin2) { |
+ Derived() { |
+ dart.initField(Derived, this, 'x', init('Derived.x')); |
+ super.Base(); |
+ } |
+ } |
+ class _Base extends core.Object { |
+ _Base() { |
+ this.x = init('_Base.x'); |
+ } |
+ } |
+ let _x = Symbol('_x'); |
+ class _Mixin1 extends core.Object { |
+ _Mixin1() { |
+ dart.initField(_Mixin1, this, _x, init('_Mixin1.x')); |
+ } |
+ } |
+ dart.virtualField(_Mixin1, _x); |
+ class _Mixin2 extends core.Object { |
+ _Mixin2() { |
+ dart.initField(_Mixin2, this, _x, init('_Mixin2.x')); |
+ } |
+ } |
+ dart.virtualField(_Mixin2, _x); |
+ class _Derived extends dart.mixin(_Base, _Mixin1, _Mixin2) { |
+ _Derived() { |
+ this[_x] = init('_Derived.x'); |
+ super._Base(); |
+ } |
+ } |
+ // Function main: () → dynamic |
+ function main() { |
+ core.print('Creating Derived'); |
+ core.print('Derived.x == ' + dart.notNull(new Derived().x)); |
+ core.print('Creating _Derived'); |
+ core.print('_Derived.x == ' + dart.notNull(new _Derived()[_x])); |
+ } |
+ // Exports: |
+ exports.init = init; |
+ exports.Base = Base; |
+ exports.Mixin1 = Mixin1; |
+ exports.Mixin2 = Mixin2; |
+ exports.Derived = Derived; |
+ exports.main = main; |
+})(fields || (fields = {})); |