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 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart'
; | 5 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart'
; |
6 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.
dart'; | 6 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.
dart'; |
7 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirro
r.dart'; | 7 import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirro
r.dart'; |
8 | 8 |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 "Unexpected mirror type returned"); | 103 "Unexpected mirror type returned"); |
104 Expect.stringEquals("Foo", fooClass.simpleName, | 104 Expect.stringEquals("Foo", fooClass.simpleName, |
105 "Unexpected type simple name"); | 105 "Unexpected type simple name"); |
106 Expect.stringEquals("mirrors_helper.Foo", fooClass.qualifiedName, | 106 Expect.stringEquals("mirrors_helper.Foo", fooClass.qualifiedName, |
107 "Unexpected type qualified name"); | 107 "Unexpected type qualified name"); |
108 | 108 |
109 Expect.equals(helperLibrary, fooClass.library, | 109 Expect.equals(helperLibrary, fooClass.library, |
110 "Unexpected library returned from type"); | 110 "Unexpected library returned from type"); |
111 | 111 |
112 Expect.isFalse(fooClass.isObject, "Class is Object"); | 112 Expect.isFalse(fooClass.isObject, "Class is Object"); |
113 Expect.isFalse(fooClass.isDynamic, "Class is Dynamic"); | 113 Expect.isFalse(fooClass.isDynamic, "Class is dynamic"); |
114 Expect.isFalse(fooClass.isVoid, "Class is void"); | 114 Expect.isFalse(fooClass.isVoid, "Class is void"); |
115 Expect.isFalse(fooClass.isTypeVariable, "Class is a type variable"); | 115 Expect.isFalse(fooClass.isTypeVariable, "Class is a type variable"); |
116 Expect.isFalse(fooClass.isTypedef, "Class is a typedef"); | 116 Expect.isFalse(fooClass.isTypedef, "Class is a typedef"); |
117 Expect.isFalse(fooClass.isFunction, "Class is a function"); | 117 Expect.isFalse(fooClass.isFunction, "Class is a function"); |
118 | 118 |
119 Expect.isTrue(fooClass.isOriginalDeclaration); | 119 Expect.isTrue(fooClass.isOriginalDeclaration); |
120 Expect.equals(fooClass, fooClass.originalDeclaration); | 120 Expect.equals(fooClass, fooClass.originalDeclaration); |
121 | 121 |
122 Expect.isTrue(fooClass.isClass, "Class is not class"); | 122 Expect.isTrue(fooClass.isClass, "Class is not class"); |
123 Expect.isFalse(fooClass.isAbstract); | 123 Expect.isFalse(fooClass.isAbstract); |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 "Unexpected mirror type returned"); | 430 "Unexpected mirror type returned"); |
431 Expect.stringEquals("Bar", barClass.simpleName, | 431 Expect.stringEquals("Bar", barClass.simpleName, |
432 "Unexpected type simple name"); | 432 "Unexpected type simple name"); |
433 Expect.stringEquals("mirrors_helper.Bar", barClass.qualifiedName, | 433 Expect.stringEquals("mirrors_helper.Bar", barClass.qualifiedName, |
434 "Unexpected type qualified name"); | 434 "Unexpected type qualified name"); |
435 | 435 |
436 Expect.equals(helperLibrary, barClass.library, | 436 Expect.equals(helperLibrary, barClass.library, |
437 "Unexpected library returned from type"); | 437 "Unexpected library returned from type"); |
438 | 438 |
439 Expect.isFalse(barClass.isObject, "Interface is Object"); | 439 Expect.isFalse(barClass.isObject, "Interface is Object"); |
440 Expect.isFalse(barClass.isDynamic, "Interface is Dynamic"); | 440 Expect.isFalse(barClass.isDynamic, "Interface is dynamic"); |
441 Expect.isFalse(barClass.isVoid, "Interface is void"); | 441 Expect.isFalse(barClass.isVoid, "Interface is void"); |
442 Expect.isFalse(barClass.isTypeVariable, "Interface is a type variable"); | 442 Expect.isFalse(barClass.isTypeVariable, "Interface is a type variable"); |
443 Expect.isFalse(barClass.isTypedef, "Interface is a typedef"); | 443 Expect.isFalse(barClass.isTypedef, "Interface is a typedef"); |
444 Expect.isFalse(barClass.isFunction, "Interface is a function"); | 444 Expect.isFalse(barClass.isFunction, "Interface is a function"); |
445 | 445 |
446 Expect.isTrue(barClass.isOriginalDeclaration); | 446 Expect.isTrue(barClass.isOriginalDeclaration); |
447 Expect.equals(barClass, barClass.originalDeclaration); | 447 Expect.equals(barClass, barClass.originalDeclaration); |
448 | 448 |
449 Expect.isTrue(barClass.isClass); | 449 Expect.isTrue(barClass.isClass); |
450 Expect.isTrue(barClass.isAbstract); | 450 Expect.isTrue(barClass.isAbstract); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 "Unexpected mirror type returned"); | 524 "Unexpected mirror type returned"); |
525 Expect.stringEquals("Baz", bazClass.simpleName, | 525 Expect.stringEquals("Baz", bazClass.simpleName, |
526 "Unexpected type simple name"); | 526 "Unexpected type simple name"); |
527 Expect.stringEquals("mirrors_helper.Baz", bazClass.qualifiedName, | 527 Expect.stringEquals("mirrors_helper.Baz", bazClass.qualifiedName, |
528 "Unexpected type qualified name"); | 528 "Unexpected type qualified name"); |
529 | 529 |
530 Expect.equals(helperLibrary, bazClass.library, | 530 Expect.equals(helperLibrary, bazClass.library, |
531 "Unexpected library returned from type"); | 531 "Unexpected library returned from type"); |
532 | 532 |
533 Expect.isFalse(bazClass.isObject, "Class is Object"); | 533 Expect.isFalse(bazClass.isObject, "Class is Object"); |
534 Expect.isFalse(bazClass.isDynamic, "Class is Dynamic"); | 534 Expect.isFalse(bazClass.isDynamic, "Class is dynamic"); |
535 Expect.isFalse(bazClass.isVoid, "Class is void"); | 535 Expect.isFalse(bazClass.isVoid, "Class is void"); |
536 Expect.isFalse(bazClass.isTypeVariable, "Class is a type variable"); | 536 Expect.isFalse(bazClass.isTypeVariable, "Class is a type variable"); |
537 Expect.isFalse(bazClass.isTypedef, "Class is a typedef"); | 537 Expect.isFalse(bazClass.isTypedef, "Class is a typedef"); |
538 Expect.isFalse(bazClass.isFunction, "Class is a function"); | 538 Expect.isFalse(bazClass.isFunction, "Class is a function"); |
539 | 539 |
540 Expect.isTrue(bazClass.isOriginalDeclaration); | 540 Expect.isTrue(bazClass.isOriginalDeclaration); |
541 Expect.equals(bazClass, bazClass.originalDeclaration); | 541 Expect.equals(bazClass, bazClass.originalDeclaration); |
542 | 542 |
543 Expect.isTrue(bazClass.isClass, "Class is not class"); | 543 Expect.isTrue(bazClass.isClass, "Class is not class"); |
544 Expect.isFalse(bazClass.isAbstract); | 544 Expect.isFalse(bazClass.isAbstract); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 Expect.isFalse(method1.isRedirectingConstructor); | 635 Expect.isFalse(method1.isRedirectingConstructor); |
636 Expect.isFalse(method1.isFactoryConstructor); | 636 Expect.isFalse(method1.isFactoryConstructor); |
637 Expect.isNull(method1.constructorName); | 637 Expect.isNull(method1.constructorName); |
638 Expect.isFalse(method1.isGetter); | 638 Expect.isFalse(method1.isGetter); |
639 Expect.isFalse(method1.isSetter); | 639 Expect.isFalse(method1.isSetter); |
640 Expect.isFalse(method1.isOperator); | 640 Expect.isFalse(method1.isOperator); |
641 Expect.isNull(method1.operatorName); | 641 Expect.isNull(method1.operatorName); |
642 | 642 |
643 var dynamicType = method1.returnType; | 643 var dynamicType = method1.returnType; |
644 Expect.isNotNull(dynamicType, "Return type was null"); | 644 Expect.isNotNull(dynamicType, "Return type was null"); |
645 Expect.isFalse(dynamicType.isObject, "Dynamic is Object"); | 645 Expect.isFalse(dynamicType.isObject, "dynamic is Object"); |
646 Expect.isTrue(dynamicType.isDynamic, "Dynamic is not Dynamic"); | 646 Expect.isTrue(dynamicType.isDynamic, "dynamic is not dynamic"); |
647 Expect.isFalse(dynamicType.isVoid, "Dynamic is void"); | 647 Expect.isFalse(dynamicType.isVoid, "dynamic is void"); |
648 Expect.isFalse(dynamicType.isTypeVariable, "Dynamic is a type variable"); | 648 Expect.isFalse(dynamicType.isTypeVariable, "dynamic is a type variable"); |
649 Expect.isFalse(dynamicType.isTypedef, "Dynamic is a typedef"); | 649 Expect.isFalse(dynamicType.isTypedef, "dynamic is a typedef"); |
650 Expect.isFalse(dynamicType.isFunction, "Dynamic is a function"); | 650 Expect.isFalse(dynamicType.isFunction, "dynamic is a function"); |
651 | 651 |
652 var method1Parameters = method1.parameters; | 652 var method1Parameters = method1.parameters; |
653 Expect.isNotNull(method1Parameters, "Method parameters is null"); | 653 Expect.isNotNull(method1Parameters, "Method parameters is null"); |
654 Expect.equals(1, method1Parameters.length, "Unexpected parameter count"); | 654 Expect.equals(1, method1Parameters.length, "Unexpected parameter count"); |
655 var method1Parameter1 = method1Parameters[0]; | 655 var method1Parameter1 = method1Parameters[0]; |
656 Expect.isNotNull(method1Parameter1, "Parameter is null"); | 656 Expect.isNotNull(method1Parameter1, "Parameter is null"); |
657 Expect.equals(dynamicType, method1Parameter1.type); | 657 Expect.equals(dynamicType, method1Parameter1.type); |
658 Expect.stringEquals("e", method1Parameter1.simpleName, | 658 Expect.stringEquals("e", method1Parameter1.simpleName, |
659 "Unexpected parameter simpleName"); | 659 "Unexpected parameter simpleName"); |
660 Expect.stringEquals("mirrors_helper.Baz.method1#e", | 660 Expect.stringEquals("mirrors_helper.Baz.method1#e", |
(...skipping 29 matching lines...) Expand all Loading... |
690 Expect.isFalse(method2.isFactoryConstructor); | 690 Expect.isFalse(method2.isFactoryConstructor); |
691 Expect.isNull(method2.constructorName); | 691 Expect.isNull(method2.constructorName); |
692 Expect.isFalse(method2.isGetter); | 692 Expect.isFalse(method2.isGetter); |
693 Expect.isFalse(method2.isSetter); | 693 Expect.isFalse(method2.isSetter); |
694 Expect.isFalse(method2.isOperator); | 694 Expect.isFalse(method2.isOperator); |
695 Expect.isNull(method2.operatorName); | 695 Expect.isNull(method2.operatorName); |
696 | 696 |
697 var voidType = method2.returnType; | 697 var voidType = method2.returnType; |
698 Expect.isNotNull(voidType, "Return type was null"); | 698 Expect.isNotNull(voidType, "Return type was null"); |
699 Expect.isFalse(voidType.isObject, "void is Object"); | 699 Expect.isFalse(voidType.isObject, "void is Object"); |
700 Expect.isFalse(voidType.isDynamic, "void is Dynamic"); | 700 Expect.isFalse(voidType.isDynamic, "void is dynamic"); |
701 Expect.isTrue(voidType.isVoid, "void is not void"); | 701 Expect.isTrue(voidType.isVoid, "void is not void"); |
702 Expect.isFalse(voidType.isTypeVariable, "void is a type variable"); | 702 Expect.isFalse(voidType.isTypeVariable, "void is a type variable"); |
703 Expect.isFalse(voidType.isTypedef, "void is a typedef"); | 703 Expect.isFalse(voidType.isTypedef, "void is a typedef"); |
704 Expect.isFalse(voidType.isFunction, "void is a function"); | 704 Expect.isFalse(voidType.isFunction, "void is a function"); |
705 | 705 |
706 var method2Parameters = method2.parameters; | 706 var method2Parameters = method2.parameters; |
707 Expect.isNotNull(method2Parameters, "Method parameters is null"); | 707 Expect.isNotNull(method2Parameters, "Method parameters is null"); |
708 Expect.equals(2, method2Parameters.length, "Unexpected parameter count"); | 708 Expect.equals(2, method2Parameters.length, "Unexpected parameter count"); |
709 var method2Parameter1 = method2Parameters[0]; | 709 var method2Parameter1 = method2Parameters[0]; |
710 Expect.isNotNull(method2Parameter1, "Parameter is null"); | 710 Expect.isNotNull(method2Parameter1, "Parameter is null"); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 804 |
805 var method3Parameter2 = method3Parameters[1]; | 805 var method3Parameter2 = method3Parameters[1]; |
806 Expect.isNotNull(method3Parameter2, "Parameter is null"); | 806 Expect.isNotNull(method3Parameter2, "Parameter is null"); |
807 var funcTypedef = method3Parameter2.type; | 807 var funcTypedef = method3Parameter2.type; |
808 Expect.isNotNull(funcTypedef, "Parameter type is null"); | 808 Expect.isNotNull(funcTypedef, "Parameter type is null"); |
809 Expect.stringEquals("Func", funcTypedef.simpleName, | 809 Expect.stringEquals("Func", funcTypedef.simpleName, |
810 "Unexpected simpleName"); | 810 "Unexpected simpleName"); |
811 Expect.stringEquals("mirrors_helper.Func", funcTypedef.qualifiedName, | 811 Expect.stringEquals("mirrors_helper.Func", funcTypedef.qualifiedName, |
812 "Unexpected simpleName"); | 812 "Unexpected simpleName"); |
813 Expect.isFalse(funcTypedef.isObject, "Typedef is Object"); | 813 Expect.isFalse(funcTypedef.isObject, "Typedef is Object"); |
814 Expect.isFalse(funcTypedef.isDynamic, "Typedef is Dynamic"); | 814 Expect.isFalse(funcTypedef.isDynamic, "Typedef is dynamic"); |
815 Expect.isFalse(funcTypedef.isVoid, "Typedef is void"); | 815 Expect.isFalse(funcTypedef.isVoid, "Typedef is void"); |
816 Expect.isFalse(funcTypedef.isTypeVariable, "Typedef is a type variable"); | 816 Expect.isFalse(funcTypedef.isTypeVariable, "Typedef is a type variable"); |
817 Expect.isTrue(funcTypedef.isTypedef, "Typedef is not a typedef"); | 817 Expect.isTrue(funcTypedef.isTypedef, "Typedef is not a typedef"); |
818 Expect.isFalse(funcTypedef.isFunction, "Typedef is a function"); | 818 Expect.isFalse(funcTypedef.isFunction, "Typedef is a function"); |
819 | 819 |
820 Expect.equals(helperLibrary, funcTypedef.library, | 820 Expect.equals(helperLibrary, funcTypedef.library, |
821 "Unexpected typedef library"); | 821 "Unexpected typedef library"); |
822 Expect.isNull(funcTypedef.superclass, "Non-null superclass on typedef"); | 822 Expect.isNull(funcTypedef.superclass, "Non-null superclass on typedef"); |
823 Expect.isNotNull(funcTypedef.superinterfaces); | 823 Expect.isNotNull(funcTypedef.superinterfaces); |
824 Expect.isTrue(funcTypedef.superinterfaces.isEmpty); | 824 Expect.isTrue(funcTypedef.superinterfaces.isEmpty); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 Expect.isTrue(privateFactoryConstructor.isPrivate); | 1046 Expect.isTrue(privateFactoryConstructor.isPrivate); |
1047 Expect.isFalse(privateFactoryConstructor.isConstConstructor); | 1047 Expect.isFalse(privateFactoryConstructor.isConstConstructor); |
1048 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); | 1048 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); |
1049 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); | 1049 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); |
1050 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); | 1050 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); |
1051 | 1051 |
1052 var metadata = privateClass.metadata; | 1052 var metadata = privateClass.metadata; |
1053 Expect.isNotNull(metadata); | 1053 Expect.isNotNull(metadata); |
1054 Expect.equals(0, metadata.length); | 1054 Expect.equals(0, metadata.length); |
1055 } | 1055 } |
OLD | NEW |