Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 2974663002: Compute source spans for IR nodes and J/K-elements (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/backend_strategy.dart ('k') | pkg/compiler/lib/src/js_backend/element_strategy.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.';
}
« no previous file with comments | « pkg/compiler/lib/src/backend_strategy.dart ('k') | pkg/compiler/lib/src/js_backend/element_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698