| 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('dart:uri'); | 5 #import('dart:uri'); |
| 6 #import('parser_helper.dart'); | 6 #import('parser_helper.dart'); |
| 7 #import('mock_compiler.dart'); | 7 #import('mock_compiler.dart'); |
| 8 #import("../../../lib/compiler/compiler.dart"); | 8 #import("../../../lib/compiler/compiler.dart"); |
| 9 #import("../../../lib/compiler/implementation/leg.dart", prefix:'leg'); | 9 #import("../../../lib/compiler/implementation/leg.dart", prefix:'leg'); |
| 10 #import("../../../lib/compiler/implementation/dart_backend/dart_backend.dart"); | 10 #import("../../../lib/compiler/implementation/dart_backend/dart_backend.dart"); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 interface num {} | 28 interface num {} |
| 29 interface int extends num {} | 29 interface int extends num {} |
| 30 interface double extends num {} | 30 interface double extends num {} |
| 31 interface String {} | 31 interface String {} |
| 32 interface Function {} | 32 interface Function {} |
| 33 interface List {} | 33 interface List {} |
| 34 interface Map {} | 34 interface Map {} |
| 35 interface Closure {} | 35 interface Closure {} |
| 36 interface Dynamic_ {} | 36 interface Dynamic_ {} |
| 37 interface Null {} | 37 interface Null {} |
| 38 interface TypeError {} |
| 38 class Math { | 39 class Math { |
| 39 static double parseDouble(String s) => 1.0; | 40 static double parseDouble(String s) => 1.0; |
| 40 } | 41 } |
| 41 '''; | 42 '''; |
| 42 | 43 |
| 43 const ioLib = r''' | 44 const ioLib = r''' |
| 44 #library('io'); | 45 #library('io'); |
| 45 class Platform { | 46 class Platform { |
| 46 static int operatingSystem; | 47 static int operatingSystem; |
| 47 } | 48 } |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 void foo1(a,b) { | 721 void foo1(a,b) { |
| 721 void foo2(c,d) { | 722 void foo2(c,d) { |
| 722 var E = a; | 723 var E = a; |
| 723 } | 724 } |
| 724 foo2(b, a); | 725 foo2(b, a); |
| 725 } | 726 } |
| 726 foo1(a, 8); | 727 foo1(a, 8); |
| 727 } | 728 } |
| 728 '''; | 729 '''; |
| 729 var expectedResult = | 730 var expectedResult = |
| 730 'main(){var A=7;void B(A,C){void D(E,F){var G=A;}D(C,A);}B(A,8);}'; | 731 'main(){var A=7; B(A,C){ D(E,F){var G=A;}D(C,A);}B(A,8);}'; |
| 731 testDart2Dart(src, | 732 testDart2Dart(src, |
| 732 (String result) { Expect.equals(expectedResult, result); }, minify: true); | 733 (String result) { Expect.equals(expectedResult, result); }, minify: true); |
| 733 } | 734 } |
| 734 | 735 |
| 735 testParametersMinified() { | 736 testParametersMinified() { |
| 736 var src = ''' | 737 var src = ''' |
| 737 class A { | 738 class A { |
| 738 var a; | 739 var a; |
| 739 static foo(arg1) { | 740 static foo(arg1) { |
| 740 // Should not rename arg1 to a. | 741 // Should not rename arg1 to a. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 testDoubleMains(); | 848 testDoubleMains(); |
| 848 testInterfaceDefaultAnotherLib(); | 849 testInterfaceDefaultAnotherLib(); |
| 849 testStaticAccessIoLib(); | 850 testStaticAccessIoLib(); |
| 850 testLocalFunctionPlaceholder(); | 851 testLocalFunctionPlaceholder(); |
| 851 testMinification(); | 852 testMinification(); |
| 852 testClosureLocalsMinified(); | 853 testClosureLocalsMinified(); |
| 853 testParametersMinified(); | 854 testParametersMinified(); |
| 854 testTypeVariablesInDifferentLibraries(); | 855 testTypeVariablesInDifferentLibraries(); |
| 855 testDeclarationTypePlaceholders(); | 856 testDeclarationTypePlaceholders(); |
| 856 } | 857 } |
| OLD | NEW |