OLD | NEW |
(Empty) | |
| 1 var fields; |
| 2 (function(exports) { |
| 3 'use strict'; |
| 4 // Function init: (dynamic) → dynamic |
| 5 function init(x) { |
| 6 core.print(x); |
| 7 return x; |
| 8 } |
| 9 class Base extends core.Object { |
| 10 Base() { |
| 11 dart.initField(Base, this, 'x', init('Base.x')); |
| 12 } |
| 13 } |
| 14 dart.virtualField(Base, 'x'); |
| 15 class Mixin1 extends core.Object { |
| 16 Mixin1() { |
| 17 dart.initField(Mixin1, this, 'x', init('Mixin1.x')); |
| 18 } |
| 19 } |
| 20 dart.virtualField(Mixin1, 'x'); |
| 21 class Mixin2 extends core.Object { |
| 22 Mixin2() { |
| 23 dart.initField(Mixin2, this, 'x', init('Mixin2.x')); |
| 24 } |
| 25 } |
| 26 dart.virtualField(Mixin2, 'x'); |
| 27 class Derived extends dart.mixin(Base, Mixin1, Mixin2) { |
| 28 Derived() { |
| 29 dart.initField(Derived, this, 'x', init('Derived.x')); |
| 30 super.Base(); |
| 31 } |
| 32 } |
| 33 class _Base extends core.Object { |
| 34 _Base() { |
| 35 this.x = init('_Base.x'); |
| 36 } |
| 37 } |
| 38 let _x = Symbol('_x'); |
| 39 class _Mixin1 extends core.Object { |
| 40 _Mixin1() { |
| 41 dart.initField(_Mixin1, this, _x, init('_Mixin1.x')); |
| 42 } |
| 43 } |
| 44 dart.virtualField(_Mixin1, _x); |
| 45 class _Mixin2 extends core.Object { |
| 46 _Mixin2() { |
| 47 dart.initField(_Mixin2, this, _x, init('_Mixin2.x')); |
| 48 } |
| 49 } |
| 50 dart.virtualField(_Mixin2, _x); |
| 51 class _Derived extends dart.mixin(_Base, _Mixin1, _Mixin2) { |
| 52 _Derived() { |
| 53 this[_x] = init('_Derived.x'); |
| 54 super._Base(); |
| 55 } |
| 56 } |
| 57 // Function main: () → dynamic |
| 58 function main() { |
| 59 core.print('Creating Derived'); |
| 60 core.print('Derived.x == ' + dart.notNull(new Derived().x)); |
| 61 core.print('Creating _Derived'); |
| 62 core.print('_Derived.x == ' + dart.notNull(new _Derived()[_x])); |
| 63 } |
| 64 // Exports: |
| 65 exports.init = init; |
| 66 exports.Base = Base; |
| 67 exports.Mixin1 = Mixin1; |
| 68 exports.Mixin2 = Mixin2; |
| 69 exports.Derived = Derived; |
| 70 exports.main = main; |
| 71 })(fields || (fields = {})); |
OLD | NEW |