| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 430 |
| 431 static _computeFindInContext(reflectee, name) | 431 static _computeFindInContext(reflectee, name) |
| 432 native 'ClosureMirror_find_in_context'; | 432 native 'ClosureMirror_find_in_context'; |
| 433 } | 433 } |
| 434 | 434 |
| 435 class _LocalClassMirror extends _LocalObjectMirror | 435 class _LocalClassMirror extends _LocalObjectMirror |
| 436 implements ClassMirror { | 436 implements ClassMirror { |
| 437 final Type _reflectedType; | 437 final Type _reflectedType; |
| 438 Symbol _simpleName; | 438 Symbol _simpleName; |
| 439 DeclarationMirror _owner; | 439 DeclarationMirror _owner; |
| 440 final bool isAbstract; |
| 440 final bool _isGeneric; | 441 final bool _isGeneric; |
| 441 final bool _isMixinAlias; | 442 final bool _isMixinAlias; |
| 442 final bool _isGenericDeclaration; | 443 final bool _isGenericDeclaration; |
| 443 Type _instantiator; | 444 Type _instantiator; |
| 444 | 445 |
| 445 _LocalClassMirror(reflectee, | 446 _LocalClassMirror(reflectee, |
| 446 reflectedType, | 447 reflectedType, |
| 447 String simpleName, | 448 String simpleName, |
| 448 this._owner, | 449 this._owner, |
| 450 this.isAbstract, |
| 449 this._isGeneric, | 451 this._isGeneric, |
| 450 this._isMixinAlias, | 452 this._isMixinAlias, |
| 451 this._isGenericDeclaration) | 453 this._isGenericDeclaration) |
| 452 : this._simpleName = _s(simpleName), | 454 : this._simpleName = _s(simpleName), |
| 453 this._reflectedType = reflectedType, | 455 this._reflectedType = reflectedType, |
| 454 this._instantiator = reflectedType, | 456 this._instantiator = reflectedType, |
| 455 super(reflectee); | 457 super(reflectee); |
| 456 | 458 |
| 457 | 459 |
| 458 bool get hasReflectedType => !_isGenericDeclaration; | 460 bool get hasReflectedType => !_isGenericDeclaration; |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 static _ClassMirror_type_variables(reflectee) | 799 static _ClassMirror_type_variables(reflectee) |
| 798 native "ClassMirror_type_variables"; | 800 native "ClassMirror_type_variables"; |
| 799 | 801 |
| 800 static _computeTypeArguments(reflectee) | 802 static _computeTypeArguments(reflectee) |
| 801 native "ClassMirror_type_arguments"; | 803 native "ClassMirror_type_arguments"; |
| 802 } | 804 } |
| 803 | 805 |
| 804 class _LocalFunctionTypeMirror extends _LocalClassMirror | 806 class _LocalFunctionTypeMirror extends _LocalClassMirror |
| 805 implements FunctionTypeMirror { | 807 implements FunctionTypeMirror { |
| 806 _LocalFunctionTypeMirror(reflectee, reflectedType) | 808 _LocalFunctionTypeMirror(reflectee, reflectedType) |
| 807 : super(reflectee, reflectedType, null, null, false, false, false); | 809 : super(reflectee, reflectedType, null, null, false, false, false, false); |
| 808 | 810 |
| 809 bool get _isAnonymousMixinApplication => false; | 811 bool get _isAnonymousMixinApplication => false; |
| 810 | 812 |
| 811 // FunctionTypeMirrors have a simpleName generated from their signature. | 813 // FunctionTypeMirrors have a simpleName generated from their signature. |
| 812 Symbol _simpleName = null; | 814 Symbol _simpleName = null; |
| 813 Symbol get simpleName { | 815 Symbol get simpleName { |
| 814 if (_simpleName == null) { | 816 if (_simpleName == null) { |
| 815 _simpleName = _s(_makeSignatureString(returnType, parameters)); | 817 _simpleName = _s(_makeSignatureString(returnType, parameters)); |
| 816 } | 818 } |
| 817 return _simpleName; | 819 return _simpleName; |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1486 if (typeMirror == null) { | 1488 if (typeMirror == null) { |
| 1487 typeMirror = makeLocalTypeMirror(key); | 1489 typeMirror = makeLocalTypeMirror(key); |
| 1488 _instanitationCache[key] = typeMirror; | 1490 _instanitationCache[key] = typeMirror; |
| 1489 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1491 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1490 _declarationCache[key] = typeMirror; | 1492 _declarationCache[key] = typeMirror; |
| 1491 } | 1493 } |
| 1492 } | 1494 } |
| 1493 return typeMirror; | 1495 return typeMirror; |
| 1494 } | 1496 } |
| 1495 } | 1497 } |
| OLD | NEW |