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

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

Issue 2060183002: Serialize metadata (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 4 years, 6 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/compile_time_constants.dart ('k') | pkg/compiler/lib/src/constants/values.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 234c7e17f18c0257c13e2c37efd79c06ba87af7f..94b573a422ddc5cc9fcc449ebd2af964a4cd4c8f 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1658,8 +1658,9 @@ class CompilerDiagnosticReporter extends DiagnosticReporter {
if (astElement.hasNode) {
Token from = astElement.node.getBeginToken();
Token to = astElement.node.getEndToken();
- if (astElement.metadata.isNotEmpty) {
- from = astElement.metadata.first.beginToken;
+ if (astElement.metadata.isNotEmpty &&
+ astElement.metadata.first.hasNode) {
+ from = astElement.metadata.first.node.getBeginToken();
}
return validateToken(from, to);
}
@@ -1740,8 +1741,7 @@ class CompilerDiagnosticReporter extends DiagnosticReporter {
} else if (node is Element) {
return spanFromElement(node);
} else if (node is MetadataAnnotation) {
- Uri uri = node.annotatedElement.compilationUnit.script.resourceUri;
- return spanFromTokens(node.beginToken, node.endToken, uri);
+ return node.sourcePosition;
} else if (node is Local) {
Local local = node;
return spanFromElement(local.executableContext);
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/constants/values.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698