| 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 "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
| 8 import '../mock_compiler.dart'; | 8 import '../mock_compiler.dart'; |
| 9 import '../mock_libraries.dart'; | 9 import '../mock_libraries.dart'; |
| 10 import 'package:compiler/compiler.dart'; | 10 import 'package:compiler/compiler.dart'; |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 throw 'fisk'; | 871 throw 'fisk'; |
| 872 } | 872 } |
| 873 main() { | 873 main() { |
| 874 print('corelib'); | 874 print('corelib'); |
| 875 print_A('local'); | 875 print_A('local'); |
| 876 } | 876 } |
| 877 """; | 877 """; |
| 878 testDart2Dart(src, expectedResult: expectedResult); | 878 testDart2Dart(src, expectedResult: expectedResult); |
| 879 } | 879 } |
| 880 | 880 |
| 881 testUnresolvedNamedConstructor() { | 881 testUnresolvedNamedConstructor1() { |
| 882 var src = ''' |
| 883 class A { |
| 884 } |
| 885 |
| 886 main() { |
| 887 new A.named(); |
| 888 } |
| 889 '''; |
| 890 var expectedResult = """ |
| 891 main() { |
| 892 new Unresolved(); |
| 893 } |
| 894 """; |
| 895 testDart2Dart(src, expectedResult: expectedResult); |
| 896 } |
| 897 |
| 898 testUnresolvedNamedConstructor2() { |
| 882 var src = ''' | 899 var src = ''' |
| 883 class A { | 900 class A { |
| 884 A() {} | 901 A() {} |
| 885 } | 902 } |
| 886 | 903 |
| 887 main() { | 904 main() { |
| 888 new A(); | 905 new A(); |
| 889 new A.named(); | 906 new A.named(); |
| 890 } | 907 } |
| 891 '''; | 908 '''; |
| 892 var expectedResult = """ | 909 var expectedResult = """ |
| 893 class A { | 910 class A { |
| 894 A() {} | 911 A() {} |
| 895 } | 912 } |
| 896 main() { | 913 main() { |
| 897 new A(); | 914 new A(); |
| 898 new Unresolved_A(); | 915 new Unresolved(); |
| 899 } | 916 } |
| 900 """; | 917 """; |
| 901 testDart2Dart(src, expectedResult: expectedResult); | 918 testDart2Dart(src, expectedResult: expectedResult); |
| 919 } |
| 920 |
| 921 testUnresolvedNamedConstructor3() { |
| 922 var src = ''' |
| 923 class A { |
| 924 static method() {} |
| 925 } |
| 926 |
| 927 main() { |
| 928 A.method(); |
| 929 new A.named(); |
| 930 } |
| 931 '''; |
| 932 var expectedResult = """ |
| 933 class A { |
| 934 static method() {} |
| 935 } |
| 936 main() { |
| 937 A.method(); |
| 938 new Unresolved(); |
| 939 } |
| 940 """; |
| 941 testDart2Dart(src, expectedResult: expectedResult); |
| 902 } | 942 } |
| 903 | 943 |
| 904 main() { | 944 main() { |
| 905 testSimpleFileUnparse(); | 945 testSimpleFileUnparse(); |
| 906 testTopLevelField(); | 946 testTopLevelField(); |
| 907 testSimpleTopLevelClass(); | 947 testSimpleTopLevelClass(); |
| 908 testClassWithSynthesizedConstructor(); | 948 testClassWithSynthesizedConstructor(); |
| 909 testClassWithMethod(); | 949 testClassWithMethod(); |
| 910 testExtendsImplements(); | 950 testExtendsImplements(); |
| 911 testVariableDefinitions(); | 951 testVariableDefinitions(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 922 testClassTypeArgumentBound(); | 962 testClassTypeArgumentBound(); |
| 923 testDoubleMains(); | 963 testDoubleMains(); |
| 924 testStaticAccessIoLib(); | 964 testStaticAccessIoLib(); |
| 925 testLocalFunctionPlaceholder(); | 965 testLocalFunctionPlaceholder(); |
| 926 testMinification(); | 966 testMinification(); |
| 927 testClosureLocalsMinified(); | 967 testClosureLocalsMinified(); |
| 928 testParametersMinified(); | 968 testParametersMinified(); |
| 929 testDeclarationTypePlaceholders(); | 969 testDeclarationTypePlaceholders(); |
| 930 testPlatformLibraryMemberNamesAreFixed(); | 970 testPlatformLibraryMemberNamesAreFixed(); |
| 931 testConflictsWithCoreLib(); | 971 testConflictsWithCoreLib(); |
| 932 testUnresolvedNamedConstructor(); | 972 testUnresolvedNamedConstructor1(); |
| 973 testUnresolvedNamedConstructor2(); |
| 974 testUnresolvedNamedConstructor3(); |
| 933 } | 975 } |
| OLD | NEW |