Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: pkg/analyzer2dart/test/end2end_data.dart

Issue 701123002: Support local functions in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer2dart/lib/src/modely.dart ('k') | pkg/analyzer2dart/test/sexpr_data.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /// Test data for the end2end test. 5 /// Test data for the end2end test.
6 library test.end2end.data; 6 library test.end2end.data;
7 7
8 import 'test_helper.dart' show Group; 8 import 'test_helper.dart' show Group;
9 import 'test_helper.dart' as base show TestSpec; 9 import 'test_helper.dart' as base show TestSpec;
10 10
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 ''', ''' 729 ''', '''
730 main(a) { 730 main(a) {
731 var i, v0 = a.iterator; 731 var i, v0 = a.iterator;
732 while (v0.moveNext()) { 732 while (v0.moveNext()) {
733 i = v0.current; 733 i = v0.current;
734 print(i); 734 print(i);
735 } 735 }
736 } 736 }
737 '''), 737 '''),
738 ]), 738 ]),
739
740 const Group('Local functions', const <TestSpec>[
741 const TestSpec('''
742 main(a) {
743 local() {}
744 return local();
745 }
746 ''', '''
747 main(a) {
748 return (() {})();
749 }
750 '''),
751
752 const TestSpec('''
753 main(a) {
754 local() {}
755 var l = local;
756 return l();
757 }
758 ''', '''
759 main(a) {
760 return (() {})();
761 }
762 '''),
763
764 const TestSpec('''
765 main(a) {
766 return () {}();
767 }
768 ''', '''
769 main(a) {
770 return (() {})();
771 }
772 '''),
773
774 const TestSpec('''
775 main(a) {
776 var c = a ? () { return 0; } : () { return 1; }
777 return c();
778 }
779 ''', '''
780 main(a) {
781 return (a ? () {
782 return 0;
783 } : () {
784 return 1;
785 })();
786 }
787 '''),
788 ]),
739 ]; 789 ];
OLDNEW
« no previous file with comments | « pkg/analyzer2dart/lib/src/modely.dart ('k') | pkg/analyzer2dart/test/sexpr_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698