| 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 '../../../sdk/lib/_internal/compiler/compiler.dart'; | 9 import '../../../sdk/lib/_internal/compiler/compiler.dart'; |
| 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' as l
eg; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 testSimpleTopLevelClass() { | 167 testSimpleTopLevelClass() { |
| 168 testDart2Dart('main(){new A();}class A{A(){}}'); | 168 testDart2Dart('main(){new A();}class A{A(){}}'); |
| 169 } | 169 } |
| 170 | 170 |
| 171 testClassWithSynthesizedConstructor() { | 171 testClassWithSynthesizedConstructor() { |
| 172 testDart2Dart('main(){new A();}class A{}'); | 172 testDart2Dart('main(){new A();}class A{}'); |
| 173 } | 173 } |
| 174 | 174 |
| 175 testClassWithMethod() { | 175 testClassWithMethod() { |
| 176 testDart2Dart('main(){var a=new A();a.foo();}class A{void foo(){}}'); | 176 String src = r'main(){var a=new A();a.foo();}class A{void foo(){}}'; |
| 177 String expected = r'main(){new A().foo();}class A{void foo(){}}'; |
| 178 testDart2Dart(src, continuation: (result) => Expect.equals(expected, result)); |
| 177 } | 179 } |
| 178 | 180 |
| 179 testExtendsImplements() { | 181 testExtendsImplements() { |
| 180 testDart2Dart('main(){new B<Object>();}' | 182 testDart2Dart('main(){new B<Object>();}' |
| 181 'class A<T>{}class B<T> extends A<T>{}'); | 183 'class A<T>{}class B<T> extends A<T>{}'); |
| 182 } | 184 } |
| 183 | 185 |
| 184 testVariableDefinitions() { | 186 testVariableDefinitions() { |
| 185 testDart2Dart('main(){var x,y;final String s=null;}', | 187 testDart2Dart('main(){var x,y;final String s=null;}', |
| 186 continuation: (String s) { Expect.equals('main(){}', s); }); | 188 continuation: (String s) { Expect.equals('main(){}', s); }); |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 const String globalconstfield; | 653 const String globalconstfield; |
| 652 | 654 |
| 653 void foo(String arg) {} | 655 void foo(String arg) {} |
| 654 | 656 |
| 655 main() { | 657 main() { |
| 656 String localvar; | 658 String localvar; |
| 657 foo("5"); | 659 foo("5"); |
| 658 } | 660 } |
| 659 '''; | 661 '''; |
| 660 var expectedResult = | 662 var expectedResult = |
| 661 ' foo( arg){}main(){var localvar;foo("5");}'; | 663 ' foo( arg){}main(){foo("5");}'; |
| 662 testDart2Dart(src, | 664 testDart2Dart(src, |
| 663 continuation: (String result) { Expect.equals(expectedResult, result); }, | 665 continuation: (String result) { Expect.equals(expectedResult, result); }, |
| 664 stripTypes: true); | 666 stripTypes: true); |
| 665 } | 667 } |
| 666 | 668 |
| 667 testPlatformLibraryMemberNamesAreFixed() { | 669 testPlatformLibraryMemberNamesAreFixed() { |
| 668 var src = ''' | 670 var src = ''' |
| 669 import 'dart:html'; | 671 import 'dart:html'; |
| 670 | 672 |
| 671 class A { | 673 class A { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 testStaticAccessIoLib(); | 741 testStaticAccessIoLib(); |
| 740 testLocalFunctionPlaceholder(); | 742 testLocalFunctionPlaceholder(); |
| 741 testMinification(); | 743 testMinification(); |
| 742 testClosureLocalsMinified(); | 744 testClosureLocalsMinified(); |
| 743 testParametersMinified(); | 745 testParametersMinified(); |
| 744 testDeclarationTypePlaceholders(); | 746 testDeclarationTypePlaceholders(); |
| 745 testPlatformLibraryMemberNamesAreFixed(); | 747 testPlatformLibraryMemberNamesAreFixed(); |
| 746 testConflictsWithCoreLib(); | 748 testConflictsWithCoreLib(); |
| 747 testUnresolvedNamedConstructor(); | 749 testUnresolvedNamedConstructor(); |
| 748 } | 750 } |
| OLD | NEW |