| 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 // 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) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 void handler(Uri uri, int begin, int end, String message, Diagnostic kind) { | 43 void handler(Uri uri, int begin, int end, String message, Diagnostic kind) { |
| 44 if (uri === null) { | 44 if (uri === null) { |
| 45 print('$kind: $message'); | 45 print('$kind: $message'); |
| 46 } else { | 46 } else { |
| 47 print('$uri:$begin:$end: $kind: $message'); | 47 print('$uri:$begin:$end: $kind: $message'); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 main() { | 51 main() { |
| 52 String code = compile(new Uri(scheme: 'main'), | 52 String code = compile(new Uri.fromComponents(scheme: 'main'), |
| 53 new Uri(scheme: 'lib'), | 53 new Uri.fromComponents(scheme: 'lib'), |
| 54 new Uri(scheme: 'package'), | 54 new Uri.fromComponents(scheme: 'package'), |
| 55 provider, handler).value; | 55 provider, handler).value; |
| 56 if (code === null) { | 56 if (code === null) { |
| 57 throw 'Compilation failed'; | 57 throw 'Compilation failed'; |
| 58 } | 58 } |
| 59 } | 59 } |
| OLD | NEW |