| Index: sdk/lib/_internal/compiler/compiler.dart
|
| diff --git a/sdk/lib/_internal/compiler/compiler.dart b/sdk/lib/_internal/compiler/compiler.dart
|
| index abeb36c459404f519ed5149807260d41ed4d8db8..215f248749e373a981a4d90e49b64be5ed20baaa 100644
|
| --- a/sdk/lib/_internal/compiler/compiler.dart
|
| +++ b/sdk/lib/_internal/compiler/compiler.dart
|
| @@ -92,19 +92,21 @@ 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';
|
| + // TODO(ahe): Use the value of the future (which signals success or failure).
|
| + return compiler.run(script).then((_) {
|
| + 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;
|
| + });
|
| }
|
|
|
| /**
|
|
|