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

Side by Side Diff: tests/utils/dummy_compiler_test.dart

Issue 10942028: Support class and typedef literals as expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Peter's comments. Created 8 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
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('../../lib/compiler/compiler.dart'); 7 #import('../../lib/compiler/compiler.dart');
8 #import('dart:uri'); 8 #import('dart:uri');
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 if (uri.scheme == "lib") { 15 } else if (uri.scheme == "lib") {
16 if (uri.path.endsWith("/core.dart")) { 16 if (uri.path.endsWith("/core.dart")) {
17 source = """#library('core'); 17 source = """#library('core');
18 class Object{} 18 class Object {}
19 class Type {}
19 class bool {} 20 class bool {}
20 class num {} 21 class num {}
21 class int {} 22 class int {}
22 class double{} 23 class double{}
23 class String{} 24 class String{}
24 class Function{} 25 class Function{}
25 class List {} 26 class List {}
26 class Map {} 27 class Map {}
27 class Closure {} 28 class Closure {}
28 class Dynamic_ {} 29 class Dynamic_ {}
(...skipping 26 matching lines...) Expand all
55 56
56 main() { 57 main() {
57 String code = compile(new Uri.fromComponents(scheme: 'main'), 58 String code = compile(new Uri.fromComponents(scheme: 'main'),
58 new Uri.fromComponents(scheme: 'lib'), 59 new Uri.fromComponents(scheme: 'lib'),
59 new Uri.fromComponents(scheme: 'package'), 60 new Uri.fromComponents(scheme: 'package'),
60 provider, handler).value; 61 provider, handler).value;
61 if (code === null) { 62 if (code === null) {
62 throw 'Compilation failed'; 63 throw 'Compilation failed';
63 } 64 }
64 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698