| 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 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 completer.complete(source); | 39 completer.complete(source); |
| 40 return completer.future; | 40 return completer.future; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void handler(Uri uri, int begin, int end, String message, bool fatal) { | 43 void handler(Uri uri, int begin, int end, String message, bool fatal) { |
| 44 print(message); | 44 print(message); |
| 45 } | 45 } |
| 46 | 46 |
| 47 main() { | 47 main() { |
| 48 String code = compile(new Uri(scheme: 'main'), new Uri(scheme: 'lib'), | 48 String code = compile(new Uri(scheme: 'main'), |
| 49 new Uri(scheme: 'lib'), |
| 50 new Uri(scheme: 'package'), |
| 49 provider, handler).value; | 51 provider, handler).value; |
| 50 if (code === null) { | 52 if (code === null) { |
| 51 throw 'Compilation failed'; | 53 throw 'Compilation failed'; |
| 52 } | 54 } |
| 53 } | 55 } |
| OLD | NEW |