Chromium Code Reviews| Index: sdk/lib/_internal/compiler/compiler.dart |
| diff --git a/sdk/lib/_internal/compiler/compiler.dart b/sdk/lib/_internal/compiler/compiler.dart |
| index e0be2393bc5f6291533d9166f4c0c8f3841cae7e..bdbbd34fcd1ceb9f54943e0ad3320bf7f97cbe10 100644 |
| --- a/sdk/lib/_internal/compiler/compiler.dart |
| +++ b/sdk/lib/_internal/compiler/compiler.dart |
| @@ -92,19 +92,20 @@ Future<String> compile(Uri script, |
| libraryRoot, |
| packageRoot, |
| options); |
| - compiler.run(script); |
| - String code = compiler.assembledCode; |
| - if (code != null && outputProvider != null) { |
| - String outputType = 'js'; |
| - if (options.contains('--output-type=dart')) { |
| - outputType = 'dart'; |
| + return compiler.run(script).then((_) { |
|
ahe
2013/06/26 07:02:00
Could you add something like:
// TODO(ahe): Use t
Bob Nystrom
2013/06/27 00:38:18
Done.
|
| + String code = compiler.assembledCode; |
| + if (code != null && outputProvider != null) { |
| + String outputType = 'js'; |
| + if (options.contains('--output-type=dart')) { |
| + outputType = 'dart'; |
| + } |
| + outputProvider('', outputType) |
| + ..add(code) |
| + ..close(); |
| + code = ''; // Non-null signals success. |
| } |
| - outputProvider('', outputType) |
| - ..add(code) |
| - ..close(); |
| - code = ''; // Non-null signals success. |
| - } |
| - return new Future.value(code); |
| + return code; |
| + }); |
| } |
| /** |