| 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 'parser_helper.dart'; | 7 import 'parser_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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 testParametersMinified() { | 605 testParametersMinified() { |
| 606 var src = ''' | 606 var src = ''' |
| 607 class A { | 607 class A { |
| 608 var a; | 608 var a; |
| 609 static foo(arg1) { | 609 static foo(arg1) { |
| 610 // Should not rename arg1 to a. | 610 // Should not rename arg1 to a. |
| 611 arg1 = 5; | 611 arg1 = 5; |
| 612 } | 612 } |
| 613 } | 613 } |
| 614 | 614 |
| 615 fooglobal(arg,[optionalarg = 7]) { | 615 fooglobal(arg,{optionalarg: 7}) { |
| 616 arg = 6; | 616 arg = 6; |
| 617 } | 617 } |
| 618 | 618 |
| 619 main() { | 619 main() { |
| 620 new A().a; | 620 new A().a; |
| 621 A.foo(8); | 621 A.foo(8); |
| 622 fooglobal(8); | 622 fooglobal(8); |
| 623 } | 623 } |
| 624 '''; | 624 '''; |
| 625 var expectedResult = | 625 var expectedResult = |
| 626 'class B{var E;static C(A){A=5;}}D(A,[optionalarg=7]){A=6;}' | 626 'class B{var E;static C(A){A=5;}}D(A,{optionalarg: 7}){A=6;}' |
| 627 'main(){new B().E;B.C(8);D(8);}'; | 627 'main(){new B().E;B.C(8);D(8);}'; |
| 628 testDart2Dart(src, continuation: | 628 testDart2Dart(src, continuation: |
| 629 (String result) { Expect.equals(expectedResult, result); }, minify: true); | 629 (String result) { Expect.equals(expectedResult, result); }, minify: true); |
| 630 } | 630 } |
| 631 | 631 |
| 632 testDeclarationTypePlaceholders() { | 632 testDeclarationTypePlaceholders() { |
| 633 var src = ''' | 633 var src = ''' |
| 634 String globalfield; | 634 String globalfield; |
| 635 const String globalconstfield; | 635 const String globalconstfield; |
| 636 | 636 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 testStaticAccessIoLib(); | 723 testStaticAccessIoLib(); |
| 724 testLocalFunctionPlaceholder(); | 724 testLocalFunctionPlaceholder(); |
| 725 testMinification(); | 725 testMinification(); |
| 726 testClosureLocalsMinified(); | 726 testClosureLocalsMinified(); |
| 727 testParametersMinified(); | 727 testParametersMinified(); |
| 728 testDeclarationTypePlaceholders(); | 728 testDeclarationTypePlaceholders(); |
| 729 testPlatformLibraryMemberNamesAreFixed(); | 729 testPlatformLibraryMemberNamesAreFixed(); |
| 730 testConflictsWithCoreLib(); | 730 testConflictsWithCoreLib(); |
| 731 testUnresolvedNamedConstructor(); | 731 testUnresolvedNamedConstructor(); |
| 732 } | 732 } |
| OLD | NEW |