| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // VM-specific implementation of the dart:mirrors library. | 5 // VM-specific implementation of the dart:mirrors library. |
| 6 | 6 |
| 7 import "dart:collection"; | 7 import "dart:collection"; |
| 8 | 8 |
| 9 final emptyList = new UnmodifiableListView([]); | 9 final emptyList = new UnmodifiableListView([]); |
| 10 final emptyMap = new _UnmodifiableMapView({}); | 10 final emptyMap = new _UnmodifiableMapView({}); |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 return _s( | 567 return _s( |
| 568 _n(klass.qualifiedName) | 568 _n(klass.qualifiedName) |
| 569 + ' with ' | 569 + ' with ' |
| 570 + mixins.reversed.map((m)=>_n(m.qualifiedName)).join(', ')); | 570 + mixins.reversed.map((m)=>_n(m.qualifiedName)).join(', ')); |
| 571 } | 571 } |
| 572 | 572 |
| 573 var _mixin; | 573 var _mixin; |
| 574 ClassMirror get mixin { | 574 ClassMirror get mixin { |
| 575 if (_mixin == null) { | 575 if (_mixin == null) { |
| 576 if (_isMixinTypedef) { | 576 if (_isMixinTypedef) { |
| 577 Type mixinType = isOriginalDeclaration | 577 Type mixinType = _nativeMixinInstantiated(_trueSuperclass._reflectedType
, |
| 578 ? _nativeMixin(_trueSuperclass._reflectedType) | 578 _instantiator); |
| 579 : _nativeMixinInstantiated(_trueSuperclass._reflectedType, _instanti
ator); | |
| 580 _mixin = reflectType(mixinType); | 579 _mixin = reflectType(mixinType); |
| 581 } else { | 580 } else { |
| 582 Type mixinType = isOriginalDeclaration | 581 Type mixinType = _nativeMixinInstantiated(_reflectedType, _instantiator)
; |
| 583 ? _nativeMixin(_reflectedType) | |
| 584 : _nativeMixinInstantiated(_reflectedType, _instantiator); | |
| 585 if (mixinType == null) { | 582 if (mixinType == null) { |
| 586 // The reflectee is not a mixin application. | 583 // The reflectee is not a mixin application. |
| 587 _mixin = this; | 584 _mixin = this; |
| 588 } else { | 585 } else { |
| 589 _mixin = reflectType(mixinType); | 586 _mixin = reflectType(mixinType); |
| 590 } | 587 } |
| 591 } | 588 } |
| 592 } | 589 } |
| 593 return _mixin; | 590 return _mixin; |
| 594 } | 591 } |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 if (typeMirror == null) { | 1526 if (typeMirror == null) { |
| 1530 typeMirror = makeLocalTypeMirror(key); | 1527 typeMirror = makeLocalTypeMirror(key); |
| 1531 _instanitationCache[key] = typeMirror; | 1528 _instanitationCache[key] = typeMirror; |
| 1532 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1529 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1533 _declarationCache[key] = typeMirror; | 1530 _declarationCache[key] = typeMirror; |
| 1534 } | 1531 } |
| 1535 } | 1532 } |
| 1536 return typeMirror; | 1533 return typeMirror; |
| 1537 } | 1534 } |
| 1538 } | 1535 } |
| OLD | NEW |