| 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" show UnmodifiableListView, UnmodifiableMapView; | 7 import "dart:collection" show UnmodifiableListView, UnmodifiableMapView; |
| 8 | 8 |
| 9 final emptyList = new UnmodifiableListView([]); | 9 final emptyList = new UnmodifiableListView([]); |
| 10 final emptyMap = new UnmodifiableMapView({}); | 10 final emptyMap = new UnmodifiableMapView({}); |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 decls.addAll(_constructors); | 766 decls.addAll(_constructors); |
| 767 typeVariables.forEach((tv) => decls[tv.simpleName] = tv); | 767 typeVariables.forEach((tv) => decls[tv.simpleName] = tv); |
| 768 return _declarations = | 768 return _declarations = |
| 769 new UnmodifiableMapView<Symbol, DeclarationMirror>(decls); | 769 new UnmodifiableMapView<Symbol, DeclarationMirror>(decls); |
| 770 } | 770 } |
| 771 | 771 |
| 772 Map<Symbol, Mirror> _cachedMembers; | 772 Map<Symbol, Mirror> _cachedMembers; |
| 773 Map<Symbol, Mirror> get _members { | 773 Map<Symbol, Mirror> get _members { |
| 774 if (_cachedMembers == null) { | 774 if (_cachedMembers == null) { |
| 775 var whoseMembers = _isMixinAlias ? _trueSuperclass : this; | 775 var whoseMembers = _isMixinAlias ? _trueSuperclass : this; |
| 776 _cachedMembers = _makeMemberMap(mixin._computeMembers(whoseMembers._reflec
tee)); | 776 _cachedMembers = _makeMemberMap(mixin._computeMembers(whoseMembers.mixin._
reflectee)); |
| 777 } | 777 } |
| 778 return _cachedMembers; | 778 return _cachedMembers; |
| 779 } | 779 } |
| 780 | 780 |
| 781 Map<Symbol, MethodMirror> _cachedMethods; | 781 Map<Symbol, MethodMirror> _cachedMethods; |
| 782 Map<Symbol, MethodMirror> get _methods { | 782 Map<Symbol, MethodMirror> get _methods { |
| 783 if (_cachedMethods == null) { | 783 if (_cachedMethods == null) { |
| 784 _cachedMethods = _filterMap( | 784 _cachedMethods = _filterMap( |
| 785 _members, | 785 _members, |
| 786 (key, value) => (value is MethodMirror && value.isRegularMethod)); | 786 (key, value) => (value is MethodMirror && value.isRegularMethod)); |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1700 if (typeMirror == null) { | 1700 if (typeMirror == null) { |
| 1701 typeMirror = makeLocalTypeMirror(key); | 1701 typeMirror = makeLocalTypeMirror(key); |
| 1702 _instanitationCache[key] = typeMirror; | 1702 _instanitationCache[key] = typeMirror; |
| 1703 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1703 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1704 _declarationCache[key] = typeMirror; | 1704 _declarationCache[key] = typeMirror; |
| 1705 } | 1705 } |
| 1706 } | 1706 } |
| 1707 return typeMirror; | 1707 return typeMirror; |
| 1708 } | 1708 } |
| 1709 } | 1709 } |
| OLD | NEW |