Index: pkg/compiler/lib/src/io/position_information.dart |
diff --git a/pkg/compiler/lib/src/io/position_information.dart b/pkg/compiler/lib/src/io/position_information.dart |
index e64d1448e115ac232b3e3d489d4a78ee7dbe065f..38df2215a7153fff167a3b3e4e9c5f53920c5d50 100644 |
--- a/pkg/compiler/lib/src/io/position_information.dart |
+++ b/pkg/compiler/lib/src/io/position_information.dart |
@@ -8,7 +8,7 @@ |
library dart2js.source_information.position; |
import '../common.dart'; |
-import '../elements/elements.dart' show AstElement, FieldElement; |
+import '../elements/elements.dart' show AstElement, FieldElement, ResolvedAst, ResolvedAstKind; |
import '../js/js.dart' as js; |
import '../js/js_debug.dart'; |
import '../js/js_source_mapping.dart'; |
@@ -147,16 +147,17 @@ class PositionSourceInformationBuilder implements SourceInformationBuilder { |
sourceFile = element.implementation.compilationUnit.script.file, |
name = computeElementNameForSourceMaps(element); |
- SourceInformation buildDeclaration(AstElement element) { |
- if (element.isSynthesized) { |
+ SourceInformation buildDeclaration(ResolvedAst resolvedAst) { |
+ if (resolvedAst.kind != ResolvedAstKind.PARSED) { |
+ SourceSpan span = resolvedAst.element.sourcePosition; |
return new PositionSourceInformation(new OffsetSourceLocation( |
- sourceFile, element.position.charOffset, name)); |
+ sourceFile, span.begin, name)); |
} else { |
return new PositionSourceInformation( |
new OffsetSourceLocation(sourceFile, |
- element.resolvedAst.node.getBeginToken().charOffset, name), |
+ resolvedAst.node.getBeginToken().charOffset, name), |
new OffsetSourceLocation(sourceFile, |
- element.resolvedAst.node.getEndToken().charOffset, name)); |
+ resolvedAst.node.getEndToken().charOffset, name)); |
} |
} |