Index: sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart |
index 74b6e563cecf2cd92e920fee162354ec0622522d..2ebc1e54b87813106c3ed33bfb7af7b0d9542e59 100644 |
--- a/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart |
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart |
@@ -227,12 +227,13 @@ Future<MirrorSystem> analyze(List<Uri> libraries, |
internalDiagnosticHandler, |
libraryRoot, packageRoot, options); |
compiler.librariesToAnalyzeWhenRun = libraries; |
- bool success = compiler.run(null); |
- if (success && !compilationFailed) { |
- return new Future<MirrorSystem>.value(new Dart2JsMirrorSystem(compiler)); |
- } else { |
- return new Future<MirrorSystem>.error('Failed to create mirror system.'); |
- } |
+ return compiler.run(null).then((bool success) { |
+ if (success && !compilationFailed) { |
+ return new Dart2JsMirrorSystem(compiler); |
+ } else { |
+ throw 'Failed to create mirror system.'; |
ahe
2013/09/02 13:43:24
throw new StateError or something.
Johnni Winther
2013/09/03 07:51:39
Done.
|
+ } |
+ }); |
} |
//------------------------------------------------------------------------------ |