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..54317535b43a6f3d257cccad415a7706dd12a60c 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 new StateError('Failed to create mirror system.'); |
+ } |
+ }); |
} |
//------------------------------------------------------------------------------ |
@@ -382,7 +383,7 @@ abstract class Dart2JsElementMirror extends Dart2JsDeclarationMirror { |
// Lookup [: prefix.id :]. |
String prefix = name.substring(0, index); |
String id = name.substring(index+1); |
- result = scope.lookup(new SourceString(prefix)); |
+ result = scope.lookup(new SourceString(prefix)); |
if (result != null && result.isPrefix()) { |
PrefixElement prefix = result; |
result = prefix.lookupLocalMember(new SourceString(id)); |