Index: pkg/compiler/lib/src/compiler.dart |
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
index 536c51a5176f50968489ddc30eca3229151e864e..9885f5d8801b3aa7ac9e0b9d671d0292093c1e0a 100644 |
--- a/pkg/compiler/lib/src/compiler.dart |
+++ b/pkg/compiler/lib/src/compiler.dart |
@@ -1140,8 +1140,14 @@ class CompilerDiagnosticReporter extends DiagnosticReporter { |
/// Using [frontendStrategy] to compute a [SourceSpan] from spannable using |
/// the [currentElement] as context. |
SourceSpan _spanFromStrategy(Spannable spannable) { |
- SourceSpan span = |
- compiler.frontendStrategy.spanFromSpannable(spannable, currentElement); |
+ SourceSpan span; |
+ if (compiler.phase == Compiler.PHASE_COMPILING) { |
+ span = |
+ compiler.backendStrategy.spanFromSpannable(spannable, currentElement); |
+ } else { |
+ span = compiler.frontendStrategy |
+ .spanFromSpannable(spannable, currentElement); |
+ } |
if (span != null) return span; |
throw 'No error location.'; |
} |