| 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 // These values are allowed to be passed directly over the wire. | 9 // These values are allowed to be passed directly over the wire. |
| 10 bool _isSimpleValue(var value) { | 10 bool _isSimpleValue(var value) { |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 Type get reflectedType { | 453 Type get reflectedType { |
| 454 if (!hasReflectedType) { | 454 if (!hasReflectedType) { |
| 455 throw new UnsupportedError( | 455 throw new UnsupportedError( |
| 456 "Declarations of generics have no reflected type"); | 456 "Declarations of generics have no reflected type"); |
| 457 } | 457 } |
| 458 return _reflectedType; | 458 return _reflectedType; |
| 459 } | 459 } |
| 460 | 460 |
| 461 Symbol _simpleName; | 461 Symbol _simpleName; |
| 462 Symbol get simpleName { | 462 Symbol get simpleName { |
| 463 // dynamic, void and the function types have their names set eagerly in the | 463 // All but anonymous mixin applications have their name set at construction. |
| 464 // constructor. | |
| 465 if(_simpleName == null) { | 464 if(_simpleName == null) { |
| 466 var simpleString = _name(_reflectee); | 465 _simpleName = this._mixinApplicationName; |
| 467 if (simpleString.contains('&')) { | |
| 468 _simpleName = this._mixinApplicationName; | |
| 469 } else { | |
| 470 _simpleName = _s(simpleString); | |
| 471 } | |
| 472 } | 466 } |
| 473 return _simpleName; | 467 return _simpleName; |
| 474 } | 468 } |
| 475 | 469 |
| 476 Symbol _qualifiedName = null; | 470 Symbol _qualifiedName = null; |
| 477 Symbol get qualifiedName { | 471 Symbol get qualifiedName { |
| 478 if (_qualifiedName == null) { | 472 if (_qualifiedName == null) { |
| 479 _qualifiedName = _computeQualifiedName(owner, simpleName); | 473 _qualifiedName = _computeQualifiedName(owner, simpleName); |
| 480 } | 474 } |
| 481 return _qualifiedName; | 475 return _qualifiedName; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 } | 705 } |
| 712 | 706 |
| 713 bool operator ==(other) { | 707 bool operator ==(other) { |
| 714 return this.runtimeType == other.runtimeType && | 708 return this.runtimeType == other.runtimeType && |
| 715 this._reflectee == other._reflectee && | 709 this._reflectee == other._reflectee && |
| 716 this._reflectedType == other._reflectedType; | 710 this._reflectedType == other._reflectedType; |
| 717 } | 711 } |
| 718 | 712 |
| 719 int get hashCode => simpleName.hashCode; | 713 int get hashCode => simpleName.hashCode; |
| 720 | 714 |
| 721 static _name(reflectee) | |
| 722 native "ClassMirror_name"; | |
| 723 | |
| 724 static _library(reflectee) | 715 static _library(reflectee) |
| 725 native "ClassMirror_library"; | 716 native "ClassMirror_library"; |
| 726 | 717 |
| 727 static _supertype(reflectee) | 718 static _supertype(reflectee) |
| 728 native "ClassMirror_supertype"; | 719 native "ClassMirror_supertype"; |
| 729 | 720 |
| 730 static _interfaces(reflectee) | 721 static _interfaces(reflectee) |
| 731 native "ClassMirror_interfaces"; | 722 native "ClassMirror_interfaces"; |
| 732 | 723 |
| 733 static _computeMixin(reflectee) | 724 static _computeMixin(reflectee) |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 if (typeMirror == null) { | 1372 if (typeMirror == null) { |
| 1382 typeMirror = makeLocalTypeMirror(key); | 1373 typeMirror = makeLocalTypeMirror(key); |
| 1383 _instanitationCache[key] = typeMirror; | 1374 _instanitationCache[key] = typeMirror; |
| 1384 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { | 1375 if (typeMirror is ClassMirror && !typeMirror._isGeneric) { |
| 1385 _declarationCache[key] = typeMirror; | 1376 _declarationCache[key] = typeMirror; |
| 1386 } | 1377 } |
| 1387 } | 1378 } |
| 1388 return typeMirror; | 1379 return typeMirror; |
| 1389 } | 1380 } |
| 1390 } | 1381 } |
| OLD | NEW |