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 library mirrors_dart2js; | 5 library mirrors_dart2js; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:uri'; | 8 import 'dart:uri'; |
9 | 9 |
10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; | 10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 } | 467 } |
468 | 468 |
469 abstract class Dart2JsObjectMirror extends Dart2JsElementMirror | 469 abstract class Dart2JsObjectMirror extends Dart2JsElementMirror |
470 implements ObjectMirror { | 470 implements ObjectMirror { |
471 Dart2JsObjectMirror(Dart2JsMirrorSystem system, Element element) | 471 Dart2JsObjectMirror(Dart2JsMirrorSystem system, Element element) |
472 : super(system, element); | 472 : super(system, element); |
473 } | 473 } |
474 | 474 |
475 class Dart2JsLibraryMirror extends Dart2JsObjectMirror | 475 class Dart2JsLibraryMirror extends Dart2JsObjectMirror |
476 implements LibraryMirror { | 476 implements LibraryMirror { |
477 Map<String, InterfaceMirror> _types; | 477 Map<String, ClassMirror> _types; |
478 Map<String, MemberMirror> _members; | 478 Map<String, MemberMirror> _members; |
479 | 479 |
480 Dart2JsLibraryMirror(Dart2JsMirrorSystem system, LibraryElement library) | 480 Dart2JsLibraryMirror(Dart2JsMirrorSystem system, LibraryElement library) |
481 : super(system, library); | 481 : super(system, library); |
482 | 482 |
483 LibraryElement get _library => _element; | 483 LibraryElement get _library => _element; |
484 | 484 |
485 Uri get uri => _library.uri; | 485 Uri get uri => _library.uri; |
486 | 486 |
487 LibraryMirror library() => this; | 487 LibraryMirror library() => this; |
(...skipping 16 matching lines...) Expand all Loading... |
504 // Use the file name as script name. | 504 // Use the file name as script name. |
505 String path = _library.uri.path; | 505 String path = _library.uri.path; |
506 return path.substring(path.lastIndexOf('/') + 1); | 506 return path.substring(path.lastIndexOf('/') + 1); |
507 } | 507 } |
508 } | 508 } |
509 | 509 |
510 String get qualifiedName => simpleName; | 510 String get qualifiedName => simpleName; |
511 | 511 |
512 void _ensureTypes() { | 512 void _ensureTypes() { |
513 if (_types == null) { | 513 if (_types == null) { |
514 _types = <String, InterfaceMirror>{}; | 514 _types = <String, ClassMirror>{}; |
515 _library.forEachLocalMember((Element e) { | 515 _library.forEachLocalMember((Element e) { |
516 if (e.isClass()) { | 516 if (e.isClass()) { |
517 e.ensureResolved(system.compiler); | 517 e.ensureResolved(system.compiler); |
518 var type = new Dart2JsInterfaceMirror.fromLibrary(this, e); | 518 var type = new Dart2JsClassMirror.fromLibrary(this, e); |
519 assert(invariant(_library, !_types.containsKey(type.simpleName), | 519 assert(invariant(_library, !_types.containsKey(type.simpleName), |
520 message: "Type name '${type.simpleName}' " | 520 message: "Type name '${type.simpleName}' " |
521 "is not unique in $_library.")); | 521 "is not unique in $_library.")); |
522 _types[type.simpleName] = type; | 522 _types[type.simpleName] = type; |
523 } else if (e.isTypedef()) { | 523 } else if (e.isTypedef()) { |
524 var type = new Dart2JsTypedefMirror.fromLibrary(this, | 524 var type = new Dart2JsTypedefMirror.fromLibrary(this, |
525 e.computeType(system.compiler)); | 525 e.computeType(system.compiler)); |
526 assert(invariant(_library, !_types.containsKey(type.simpleName), | 526 assert(invariant(_library, !_types.containsKey(type.simpleName), |
527 message: "Type name '${type.simpleName}' " | 527 message: "Type name '${type.simpleName}' " |
528 "is not unique in $_library.")); | 528 "is not unique in $_library.")); |
(...skipping 15 matching lines...) Expand all Loading... |
544 } | 544 } |
545 }); | 545 }); |
546 } | 546 } |
547 } | 547 } |
548 | 548 |
549 Map<String, MemberMirror> get declaredMembers { | 549 Map<String, MemberMirror> get declaredMembers { |
550 _ensureMembers(); | 550 _ensureMembers(); |
551 return new ImmutableMapWrapper<String, MemberMirror>(_members); | 551 return new ImmutableMapWrapper<String, MemberMirror>(_members); |
552 } | 552 } |
553 | 553 |
554 Map<String, InterfaceMirror> get types { | 554 Map<String, ClassMirror> get types { |
555 _ensureTypes(); | 555 _ensureTypes(); |
556 return new ImmutableMapWrapper<String, InterfaceMirror>(_types); | 556 return new ImmutableMapWrapper<String, ClassMirror>(_types); |
557 } | 557 } |
558 | 558 |
559 Location get location { | 559 Location get location { |
560 var script = _library.getCompilationUnit().script; | 560 var script = _library.getCompilationUnit().script; |
561 return new Dart2JsLocation( | 561 return new Dart2JsLocation( |
562 script, | 562 script, |
563 new SourceSpan(script.uri, 0, script.text.length)); | 563 new SourceSpan(script.uri, 0, script.text.length)); |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 | 660 |
661 bool get isInitializingFormal => true; | 661 bool get isInitializingFormal => true; |
662 | 662 |
663 FieldMirror get initializedField => new Dart2JsFieldMirror( | 663 FieldMirror get initializedField => new Dart2JsFieldMirror( |
664 _method.surroundingDeclaration, _fieldParameterElement.fieldElement); | 664 _method.surroundingDeclaration, _fieldParameterElement.fieldElement); |
665 } | 665 } |
666 | 666 |
667 //------------------------------------------------------------------------------ | 667 //------------------------------------------------------------------------------ |
668 // Declarations | 668 // Declarations |
669 //------------------------------------------------------------------------------ | 669 //------------------------------------------------------------------------------ |
670 class Dart2JsInterfaceMirror extends Dart2JsObjectMirror | 670 class Dart2JsClassMirror extends Dart2JsObjectMirror |
671 implements Dart2JsTypeMirror, InterfaceMirror { | 671 implements Dart2JsTypeMirror, ClassMirror { |
672 final Dart2JsLibraryMirror library; | 672 final Dart2JsLibraryMirror library; |
673 Map<String, Dart2JsMemberMirror> _members; | 673 Map<String, Dart2JsMemberMirror> _members; |
674 List<TypeVariableMirror> _typeVariables; | 674 List<TypeVariableMirror> _typeVariables; |
675 | 675 |
676 Dart2JsInterfaceMirror(Dart2JsMirrorSystem system, ClassElement _class) | 676 Dart2JsClassMirror(Dart2JsMirrorSystem system, ClassElement _class) |
677 : this.library = system.getLibrary(_class.getLibrary()), | 677 : this.library = system.getLibrary(_class.getLibrary()), |
678 super(system, _class); | 678 super(system, _class); |
679 | 679 |
680 ClassElement get _class => _element; | 680 ClassElement get _class => _element; |
681 | 681 |
682 Dart2JsInterfaceMirror.fromLibrary(Dart2JsLibraryMirror library, | 682 Dart2JsClassMirror.fromLibrary(Dart2JsLibraryMirror library, |
683 ClassElement _class) | 683 ClassElement _class) |
684 : this.library = library, | 684 : this.library = library, |
685 super(library.system, _class); | 685 super(library.system, _class); |
686 | 686 |
687 String get qualifiedName => '${library.qualifiedName}.${simpleName}'; | 687 String get qualifiedName => '${library.qualifiedName}.${simpleName}'; |
688 | 688 |
689 Location get location { | 689 Location get location { |
690 if (_class is PartialClassElement) { | 690 if (_class is PartialClassElement) { |
691 var node = _class.parseNode(system.compiler); | 691 var node = _class.parseNode(system.compiler); |
692 if (node !== null) { | 692 if (node !== null) { |
(...skipping 27 matching lines...) Expand all Loading... |
720 bool get isDynamic => false; | 720 bool get isDynamic => false; |
721 | 721 |
722 bool get isVoid => false; | 722 bool get isVoid => false; |
723 | 723 |
724 bool get isTypeVariable => false; | 724 bool get isTypeVariable => false; |
725 | 725 |
726 bool get isTypedef => false; | 726 bool get isTypedef => false; |
727 | 727 |
728 bool get isFunction => false; | 728 bool get isFunction => false; |
729 | 729 |
730 InterfaceMirror get declaration => this; | 730 ClassMirror get declaration => this; |
731 | 731 |
732 InterfaceMirror get superclass { | 732 ClassMirror get superclass { |
733 if (_class.supertype != null) { | 733 if (_class.supertype != null) { |
734 return new Dart2JsInterfaceTypeMirror(system, _class.supertype); | 734 return new Dart2JsInterfaceTypeMirror(system, _class.supertype); |
735 } | 735 } |
736 return null; | 736 return null; |
737 } | 737 } |
738 | 738 |
739 List<InterfaceMirror> get interfaces { | 739 List<ClassMirror> get interfaces { |
740 var list = <InterfaceMirror>[]; | 740 var list = <ClassMirror>[]; |
741 Link<DartType> link = _class.interfaces; | 741 Link<DartType> link = _class.interfaces; |
742 while (!link.isEmpty) { | 742 while (!link.isEmpty) { |
743 var type = _convertTypeToTypeMirror(system, link.head, | 743 var type = _convertTypeToTypeMirror(system, link.head, |
744 system.compiler.types.dynamicType); | 744 system.compiler.types.dynamicType); |
745 list.add(type); | 745 list.add(type); |
746 link = link.tail; | 746 link = link.tail; |
747 } | 747 } |
748 return list; | 748 return list; |
749 } | 749 } |
750 | 750 |
(...skipping 26 matching lines...) Expand all Loading... |
777 | 777 |
778 Map<String, MethodMirror> get constructors { | 778 Map<String, MethodMirror> get constructors { |
779 _ensureMembers(); | 779 _ensureMembers(); |
780 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( | 780 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( |
781 _members, (m) => m.isConstructor ? m : null); | 781 _members, (m) => m.isConstructor ? m : null); |
782 } | 782 } |
783 | 783 |
784 /** | 784 /** |
785 * Returns the default type for this interface. | 785 * Returns the default type for this interface. |
786 */ | 786 */ |
787 InterfaceMirror get defaultType { | 787 ClassMirror get defaultType { |
788 if (_class.defaultClass != null) { | 788 if (_class.defaultClass != null) { |
789 return new Dart2JsInterfaceTypeMirror(system, _class.defaultClass); | 789 return new Dart2JsInterfaceTypeMirror(system, _class.defaultClass); |
790 } | 790 } |
791 return null; | 791 return null; |
792 } | 792 } |
793 | 793 |
794 bool operator ==(Object other) { | 794 bool operator ==(Object other) { |
795 if (this === other) { | 795 if (this === other) { |
796 return true; | 796 return true; |
797 } | 797 } |
798 if (other is! InterfaceMirror) { | 798 if (other is! ClassMirror) { |
799 return false; | 799 return false; |
800 } | 800 } |
801 if (library != other.library) { | 801 if (library != other.library) { |
802 return false; | 802 return false; |
803 } | 803 } |
804 if (isDeclaration !== other.isDeclaration) { | 804 if (isDeclaration !== other.isDeclaration) { |
805 return false; | 805 return false; |
806 } | 806 } |
807 return qualifiedName == other.qualifiedName; | 807 return qualifiedName == other.qualifiedName; |
808 } | 808 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 _typedef.element.alias, | 866 _typedef.element.alias, |
867 system.compiler.types.dynamicType, | 867 system.compiler.types.dynamicType, |
868 _typedef.element.functionSignature); | 868 _typedef.element.functionSignature); |
869 } | 869 } |
870 return _definition; | 870 return _definition; |
871 } | 871 } |
872 | 872 |
873 Map<String, MemberMirror> get declaredMembers => | 873 Map<String, MemberMirror> get declaredMembers => |
874 const <String, MemberMirror>{}; | 874 const <String, MemberMirror>{}; |
875 | 875 |
876 InterfaceMirror get declaration => this; | 876 ClassMirror get declaration => this; |
877 | 877 |
878 // TODO(johnniwinther): How should a typedef respond to these? | 878 // TODO(johnniwinther): How should a typedef respond to these? |
879 InterfaceMirror get superclass => null; | 879 ClassMirror get superclass => null; |
880 | 880 |
881 List<InterfaceMirror> get interfaces => const <InterfaceMirror>[]; | 881 List<ClassMirror> get interfaces => const <ClassMirror>[]; |
882 | 882 |
883 bool get isClass => false; | 883 bool get isClass => false; |
884 | 884 |
885 bool get isInterface => false; | 885 bool get isInterface => false; |
886 | 886 |
887 bool get isPrivate => _isPrivate(simpleName); | 887 bool get isPrivate => _isPrivate(simpleName); |
888 | 888 |
889 bool get isDeclaration => true; | 889 bool get isDeclaration => true; |
890 | 890 |
891 bool get isAbstract => false; | 891 bool get isAbstract => false; |
892 | 892 |
893 Map<String, MethodMirror> get constructors => | 893 Map<String, MethodMirror> get constructors => |
894 const <String, MethodMirror>{}; | 894 const <String, MethodMirror>{}; |
895 | 895 |
896 InterfaceMirror get defaultType => null; | 896 ClassMirror get defaultType => null; |
897 } | 897 } |
898 | 898 |
899 class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror | 899 class Dart2JsTypeVariableMirror extends Dart2JsTypeElementMirror |
900 implements TypeVariableMirror { | 900 implements TypeVariableMirror { |
901 final TypeVariableType _typeVariableType; | 901 final TypeVariableType _typeVariableType; |
902 InterfaceMirror _declarer; | 902 ClassMirror _declarer; |
903 | 903 |
904 Dart2JsTypeVariableMirror(Dart2JsMirrorSystem system, | 904 Dart2JsTypeVariableMirror(Dart2JsMirrorSystem system, |
905 TypeVariableType typeVariableType) | 905 TypeVariableType typeVariableType) |
906 : this._typeVariableType = typeVariableType, | 906 : this._typeVariableType = typeVariableType, |
907 super(system, typeVariableType) { | 907 super(system, typeVariableType) { |
908 assert(_typeVariableType !== null); | 908 assert(_typeVariableType !== null); |
909 } | 909 } |
910 | 910 |
911 | 911 |
912 String get qualifiedName => '${declarer.qualifiedName}.${simpleName}'; | 912 String get qualifiedName => '${declarer.qualifiedName}.${simpleName}'; |
913 | 913 |
914 InterfaceMirror get declarer { | 914 ClassMirror get declarer { |
915 if (_declarer === null) { | 915 if (_declarer === null) { |
916 if (_typeVariableType.element.enclosingElement.isClass()) { | 916 if (_typeVariableType.element.enclosingElement.isClass()) { |
917 _declarer = new Dart2JsInterfaceMirror(system, | 917 _declarer = new Dart2JsClassMirror(system, |
918 _typeVariableType.element.enclosingElement); | 918 _typeVariableType.element.enclosingElement); |
919 } else if (_typeVariableType.element.enclosingElement.isTypedef()) { | 919 } else if (_typeVariableType.element.enclosingElement.isTypedef()) { |
920 _declarer = new Dart2JsTypedefMirror(system, | 920 _declarer = new Dart2JsTypedefMirror(system, |
921 _typeVariableType.element.enclosingElement.computeType( | 921 _typeVariableType.element.enclosingElement.computeType( |
922 system.compiler)); | 922 system.compiler)); |
923 } | 923 } |
924 } | 924 } |
925 return _declarer; | 925 return _declarer; |
926 } | 926 } |
927 | 927 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 bool get isTypeVariable => false; | 981 bool get isTypeVariable => false; |
982 | 982 |
983 bool get isTypedef => false; | 983 bool get isTypedef => false; |
984 | 984 |
985 bool get isFunction => false; | 985 bool get isFunction => false; |
986 | 986 |
987 String toString() => _type.element.toString(); | 987 String toString() => _type.element.toString(); |
988 } | 988 } |
989 | 989 |
990 class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror | 990 class Dart2JsInterfaceTypeMirror extends Dart2JsTypeElementMirror |
991 implements InterfaceMirror { | 991 implements ClassMirror { |
992 List<TypeMirror> _typeArguments; | 992 List<TypeMirror> _typeArguments; |
993 | 993 |
994 Dart2JsInterfaceTypeMirror(Dart2JsMirrorSystem system, | 994 Dart2JsInterfaceTypeMirror(Dart2JsMirrorSystem system, |
995 InterfaceType interfaceType) | 995 InterfaceType interfaceType) |
996 : super(system, interfaceType); | 996 : super(system, interfaceType); |
997 | 997 |
998 InterfaceType get _interfaceType => _type; | 998 InterfaceType get _interfaceType => _type; |
999 | 999 |
1000 String get qualifiedName => declaration.qualifiedName; | 1000 String get qualifiedName => declaration.qualifiedName; |
1001 | 1001 |
1002 // TODO(johnniwinther): Substitute type arguments for type variables. | 1002 // TODO(johnniwinther): Substitute type arguments for type variables. |
1003 Map<String, MemberMirror> get declaredMembers => declaration.declaredMembers; | 1003 Map<String, MemberMirror> get declaredMembers => declaration.declaredMembers; |
1004 | 1004 |
1005 bool get isObject => system.compiler.objectClass == _type.element; | 1005 bool get isObject => system.compiler.objectClass == _type.element; |
1006 | 1006 |
1007 bool get isDynamic => system.compiler.dynamicClass == _type.element; | 1007 bool get isDynamic => system.compiler.dynamicClass == _type.element; |
1008 | 1008 |
1009 InterfaceMirror get declaration | 1009 ClassMirror get declaration |
1010 => new Dart2JsInterfaceMirror(system, _type.element); | 1010 => new Dart2JsClassMirror(system, _type.element); |
1011 | 1011 |
1012 // TODO(johnniwinther): Substitute type arguments for type variables. | 1012 // TODO(johnniwinther): Substitute type arguments for type variables. |
1013 InterfaceMirror get superclass => declaration.superclass; | 1013 ClassMirror get superclass => declaration.superclass; |
1014 | 1014 |
1015 // TODO(johnniwinther): Substitute type arguments for type variables. | 1015 // TODO(johnniwinther): Substitute type arguments for type variables. |
1016 List<InterfaceMirror> get interfaces => declaration.interfaces; | 1016 List<ClassMirror> get interfaces => declaration.interfaces; |
1017 | 1017 |
1018 bool get isClass => declaration.isClass; | 1018 bool get isClass => declaration.isClass; |
1019 | 1019 |
1020 bool get isInterface => declaration.isInterface; | 1020 bool get isInterface => declaration.isInterface; |
1021 | 1021 |
1022 bool get isAbstract => declaration.isAbstract; | 1022 bool get isAbstract => declaration.isAbstract; |
1023 | 1023 |
1024 bool get isPrivate => declaration.isPrivate; | 1024 bool get isPrivate => declaration.isPrivate; |
1025 | 1025 |
1026 bool get isDeclaration => false; | 1026 bool get isDeclaration => false; |
(...skipping 10 matching lines...) Expand all Loading... |
1037 } | 1037 } |
1038 return _typeArguments; | 1038 return _typeArguments; |
1039 } | 1039 } |
1040 | 1040 |
1041 List<TypeVariableMirror> get typeVariables => declaration.typeVariables; | 1041 List<TypeVariableMirror> get typeVariables => declaration.typeVariables; |
1042 | 1042 |
1043 // TODO(johnniwinther): Substitute type arguments for type variables. | 1043 // TODO(johnniwinther): Substitute type arguments for type variables. |
1044 Map<String, MethodMirror> get constructors => declaration.constructors; | 1044 Map<String, MethodMirror> get constructors => declaration.constructors; |
1045 | 1045 |
1046 // TODO(johnniwinther): Substitute type arguments for type variables? | 1046 // TODO(johnniwinther): Substitute type arguments for type variables? |
1047 InterfaceMirror get defaultType => declaration.defaultType; | 1047 ClassMirror get defaultType => declaration.defaultType; |
1048 | 1048 |
1049 bool operator ==(Object other) { | 1049 bool operator ==(Object other) { |
1050 if (this === other) { | 1050 if (this === other) { |
1051 return true; | 1051 return true; |
1052 } | 1052 } |
1053 if (other is! InterfaceMirror) { | 1053 if (other is! ClassMirror) { |
1054 return false; | 1054 return false; |
1055 } | 1055 } |
1056 if (other.isDeclaration) { | 1056 if (other.isDeclaration) { |
1057 return false; | 1057 return false; |
1058 } | 1058 } |
1059 if (declaration != other.declaration) { | 1059 if (declaration != other.declaration) { |
1060 return false; | 1060 return false; |
1061 } | 1061 } |
1062 var thisTypeArguments = typeArguments.iterator(); | 1062 var thisTypeArguments = typeArguments.iterator(); |
1063 var otherTypeArguments = other.typeArguments.iterator(); | 1063 var otherTypeArguments = other.typeArguments.iterator(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 } | 1100 } |
1101 return declaration.declaredMembers; | 1101 return declaration.declaredMembers; |
1102 } | 1102 } |
1103 | 1103 |
1104 bool get isFunction => true; | 1104 bool get isFunction => true; |
1105 | 1105 |
1106 MethodMirror get callMethod => _convertElementMethodToMethodMirror( | 1106 MethodMirror get callMethod => _convertElementMethodToMethodMirror( |
1107 system.getLibrary(_functionType.element.getLibrary()), | 1107 system.getLibrary(_functionType.element.getLibrary()), |
1108 _functionType.element); | 1108 _functionType.element); |
1109 | 1109 |
1110 InterfaceMirror get declaration | 1110 ClassMirror get declaration |
1111 => new Dart2JsInterfaceMirror(system, system.compiler.functionClass); | 1111 => new Dart2JsClassMirror(system, system.compiler.functionClass); |
1112 | 1112 |
1113 // TODO(johnniwinther): Substitute type arguments for type variables. | 1113 // TODO(johnniwinther): Substitute type arguments for type variables. |
1114 InterfaceMirror get superclass => declaration.superclass; | 1114 ClassMirror get superclass => declaration.superclass; |
1115 | 1115 |
1116 // TODO(johnniwinther): Substitute type arguments for type variables. | 1116 // TODO(johnniwinther): Substitute type arguments for type variables. |
1117 List<InterfaceMirror> get interfaces => declaration.interfaces; | 1117 List<ClassMirror> get interfaces => declaration.interfaces; |
1118 | 1118 |
1119 bool get isClass => declaration.isClass; | 1119 bool get isClass => declaration.isClass; |
1120 | 1120 |
1121 bool get isInterface => declaration.isInterface; | 1121 bool get isInterface => declaration.isInterface; |
1122 | 1122 |
1123 bool get isPrivate => declaration.isPrivate; | 1123 bool get isPrivate => declaration.isPrivate; |
1124 | 1124 |
1125 bool get isDeclaration => false; | 1125 bool get isDeclaration => false; |
1126 | 1126 |
1127 bool get isAbstract => false; | 1127 bool get isAbstract => false; |
1128 | 1128 |
1129 List<TypeMirror> get typeArguments => const <TypeMirror>[]; | 1129 List<TypeMirror> get typeArguments => const <TypeMirror>[]; |
1130 | 1130 |
1131 List<TypeVariableMirror> get typeVariables => declaration.typeVariables; | 1131 List<TypeVariableMirror> get typeVariables => declaration.typeVariables; |
1132 | 1132 |
1133 Map<String, MethodMirror> get constructors => <String, MethodMirror>{}; | 1133 Map<String, MethodMirror> get constructors => <String, MethodMirror>{}; |
1134 | 1134 |
1135 InterfaceMirror get defaultType => null; | 1135 ClassMirror get defaultType => null; |
1136 | 1136 |
1137 TypeMirror get returnType { | 1137 TypeMirror get returnType { |
1138 return _convertTypeToTypeMirror(system, _functionType.returnType, | 1138 return _convertTypeToTypeMirror(system, _functionType.returnType, |
1139 system.compiler.types.dynamicType); | 1139 system.compiler.types.dynamicType); |
1140 } | 1140 } |
1141 | 1141 |
1142 List<ParameterMirror> get parameters { | 1142 List<ParameterMirror> get parameters { |
1143 if (_parameters === null) { | 1143 if (_parameters === null) { |
1144 _parameters = _parametersFromFunctionSignature(system, callMethod, | 1144 _parameters = _parametersFromFunctionSignature(system, callMethod, |
1145 _functionSignature); | 1145 _functionSignature); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1391 if (node !== null) { | 1391 if (node !== null) { |
1392 var span = system.compiler.spanFromNode(node, script.uri); | 1392 var span = system.compiler.spanFromNode(node, script.uri); |
1393 return new Dart2JsLocation(script, span); | 1393 return new Dart2JsLocation(script, span); |
1394 } else { | 1394 } else { |
1395 var span = system.compiler.spanFromElement(_variable); | 1395 var span = system.compiler.spanFromElement(_variable); |
1396 return new Dart2JsLocation(script, span); | 1396 return new Dart2JsLocation(script, span); |
1397 } | 1397 } |
1398 } | 1398 } |
1399 } | 1399 } |
1400 | 1400 |
OLD | NEW |