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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 static _computeFindInContext(reflectee, name) | 399 static _computeFindInContext(reflectee, name) |
400 native 'ClosureMirror_find_in_context'; | 400 native 'ClosureMirror_find_in_context'; |
401 } | 401 } |
402 | 402 |
403 class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl | 403 class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl |
404 implements ClassMirror { | 404 implements ClassMirror { |
405 _LocalClassMirrorImpl(reflectee, | 405 _LocalClassMirrorImpl(reflectee, |
406 reflectedType, | 406 reflectedType, |
407 String simpleName, | 407 String simpleName, |
| 408 this._owner, |
408 this._isGeneric, | 409 this._isGeneric, |
409 this._isMixinAlias, | 410 this._isMixinAlias, |
410 this._isGenericDeclaration) | 411 this._isGenericDeclaration) |
411 : this._simpleName = _s(simpleName), | 412 : this._simpleName = _s(simpleName), |
412 this._reflectedType = reflectedType, | 413 this._reflectedType = reflectedType, |
413 this._instantiator = reflectedType, | 414 this._instantiator = reflectedType, |
414 super(reflectee); | 415 super(reflectee); |
415 | 416 |
416 final Type _reflectedType; | 417 final Type _reflectedType; |
417 final bool _isGeneric; | 418 final bool _isGeneric; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 static _ClassMirror_type_variables(reflectee) | 751 static _ClassMirror_type_variables(reflectee) |
751 native "ClassMirror_type_variables"; | 752 native "ClassMirror_type_variables"; |
752 | 753 |
753 static _computeTypeArguments(reflectee) | 754 static _computeTypeArguments(reflectee) |
754 native "ClassMirror_type_arguments"; | 755 native "ClassMirror_type_arguments"; |
755 } | 756 } |
756 | 757 |
757 class _LocalFunctionTypeMirrorImpl extends _LocalClassMirrorImpl | 758 class _LocalFunctionTypeMirrorImpl extends _LocalClassMirrorImpl |
758 implements FunctionTypeMirror { | 759 implements FunctionTypeMirror { |
759 _LocalFunctionTypeMirrorImpl(reflectee, reflectedType) | 760 _LocalFunctionTypeMirrorImpl(reflectee, reflectedType) |
760 : super(reflectee, reflectedType, null, false, false, false); | 761 : super(reflectee, reflectedType, null, null, false, false, false); |
761 | 762 |
762 bool get _isAnonymousMixinApplication => false; | 763 bool get _isAnonymousMixinApplication => false; |
763 | 764 |
764 // FunctionTypeMirrors have a simpleName generated from their signature. | 765 // FunctionTypeMirrors have a simpleName generated from their signature. |
765 Symbol _simpleName = null; | 766 Symbol _simpleName = null; |
766 Symbol get simpleName { | 767 Symbol get simpleName { |
767 if (_simpleName == null) { | 768 if (_simpleName == null) { |
768 _simpleName = _s(_makeSignatureString(returnType, parameters)); | 769 _simpleName = _s(_makeSignatureString(returnType, parameters)); |
769 } | 770 } |
770 return _simpleName; | 771 return _simpleName; |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 if (typeMirror == null) { | 1454 if (typeMirror == null) { |
1454 typeMirror = makeLocalTypeMirror(key); | 1455 typeMirror = makeLocalTypeMirror(key); |
1455 _instanitationCache[key] = typeMirror; | 1456 _instanitationCache[key] = typeMirror; |
1456 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1457 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
1457 _declarationCache[key] = typeMirror; | 1458 _declarationCache[key] = typeMirror; |
1458 } | 1459 } |
1459 } | 1460 } |
1460 return typeMirror; | 1461 return typeMirror; |
1461 } | 1462 } |
1462 } | 1463 } |
OLD | NEW |