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

Side by Side Diff: tests/utils/src/DummyCompilerTest.dart

Issue 9873021: Move frog/leg to lib/compiler/implementation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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/tools/mini_parser.dart ('k') | utils/compiler/build_helper.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) 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 // Smoke test of the dart2js compiler API. 5 // Smoke test of the dart2js compiler API.
6 6
7 #import('../../../frog/leg/api.dart'); 7 #import('../../../lib/compiler/compiler.dart');
8 #import('../../../lib/uri/uri.dart'); 8 #import('../../../lib/uri/uri.dart');
9 9
10 Future<String> provider(Uri uri) { 10 Future<String> provider(Uri uri) {
11 Completer<String> completer = new Completer<String>(); 11 Completer<String> completer = new Completer<String>();
12 String source; 12 String source;
13 if (uri.scheme == "main") { 13 if (uri.scheme == "main") {
14 source = "main() {}"; 14 source = "main() {}";
15 } else { 15 } else {
16 source = "#library('lib');"; 16 source = "#library('lib');";
17 } 17 }
18 completer.complete(source); 18 completer.complete(source);
19 return completer.future; 19 return completer.future;
20 } 20 }
21 21
22 void handler(Uri uri, int begin, int end, String message, bool fatal) { 22 void handler(Uri uri, int begin, int end, String message, bool fatal) {
23 print(message); 23 print(message);
24 } 24 }
25 25
26 main() { 26 main() {
27 String code = compile(new Uri(scheme: 'main'), new Uri(scheme: 'lib'), 27 String code = compile(new Uri(scheme: 'main'), new Uri(scheme: 'lib'),
28 provider, handler).value; 28 provider, handler).value;
29 if (code === null) { 29 if (code === null) {
30 throw 'Compilation failed'; 30 throw 'Compilation failed';
31 } 31 }
32 } 32 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/tools/mini_parser.dart ('k') | utils/compiler/build_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698