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

Side by Side Diff: tests/compiler/dart2js/unparser_test.dart

Issue 10692073: Start emitting top-level functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months 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 | « lib/compiler/implementation/dart_backend/backend.dart ('k') | no next file » | 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) 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("../../../lib/compiler/compiler.dart"); 7 #import("../../../lib/compiler/compiler.dart");
8 #import("../../../lib/compiler/implementation/tree/tree.dart"); 8 #import("../../../lib/compiler/implementation/tree/tree.dart");
9 9
10 testUnparse(String statement) { 10 testUnparse(String statement) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 testUnparseMember('operator[](int i)=> null;'); 82 testUnparseMember('operator[](int i)=> null;');
83 } 83 }
84 84
85 testNativeMethods() { 85 testNativeMethods() {
86 testUnparseMember('foo()native;'); 86 testUnparseMember('foo()native;');
87 testUnparseMember('foo()native "bar";'); 87 testUnparseMember('foo()native "bar";');
88 testUnparseMember('foo()native "this.x = 41";'); 88 testUnparseMember('foo()native "this.x = 41";');
89 } 89 }
90 90
91 testSimpleFileUnparse() { 91 testSimpleFileUnparse() {
92 testDart2Dart('main() {}', (String s) { 92 final src = '''
93 Expect.equals( 93 should_be_dropped() {
94 '''main() {
95 final bailout_reason = "I can do nothing right now.";
96 } 94 }
97 ''', s); 95
96 should_be_kept() {
97 }
98
99 main() {
100 should_be_kept();
101 }
102 ''';
103 testDart2Dart(src, (String s) {
104 Expect.equals('should_be_kept(){}main(){should_be_kept();}', s);
98 }); 105 });
99 } 106 }
100 107
101 main() { 108 main() {
102 testGenericTypes(); 109 testGenericTypes();
103 testForLoop(); 110 testForLoop();
104 testEmptyList(); 111 testEmptyList();
105 testClosure(); 112 testClosure();
106 testIndexedOperatorDecl(); 113 testIndexedOperatorDecl();
107 testNativeMethods(); 114 testNativeMethods();
108 testSimpleFileUnparse(); 115 testSimpleFileUnparse();
109 } 116 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/dart_backend/backend.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698