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

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

Issue 1162603006: Element model cleanup + prepare for easier reimplementation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 65d269cb85c32d5bfd6c39cf2e3f5805f38b99a4..a81be046d9dcd216349423a59870c8643ee5ba82 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1927,11 +1927,14 @@ abstract class Compiler implements DiagnosticListener {
}
SourceSpan spanFromElement(Element element) {
+ if (element != null && element.sourcePosition != null) {
+ return element.sourcePosition;
+ }
while (element != null && element.isSynthesized) {
element = element.enclosingElement;
}
if (element != null &&
- element.position == null &&
+ element.sourcePosition == null &&
!element.isLibrary &&
!element.isCompilationUnit) {
// Sometimes, the backend fakes up elements that have no
@@ -1945,6 +1948,9 @@ abstract class Compiler implements DiagnosticListener {
if (element == null) {
element = currentElement;
}
+ if (element.sourcePosition != null) {
+ return element.sourcePosition;
+ }
Token position = element.position;
Uri uri = element.compilationUnit.script.readableUri;
return (position == null)
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698