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

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

Issue 2070493003: Revert "Remove Registry from registerMetadataConstant" and "Serialize metadata" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 94b573a422ddc5cc9fcc449ebd2af964a4cd4c8f..234c7e17f18c0257c13e2c37efd79c06ba87af7f 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -1658,9 +1658,8 @@ class CompilerDiagnosticReporter extends DiagnosticReporter {
if (astElement.hasNode) {
Token from = astElement.node.getBeginToken();
Token to = astElement.node.getEndToken();
- if (astElement.metadata.isNotEmpty &&
- astElement.metadata.first.hasNode) {
- from = astElement.metadata.first.node.getBeginToken();
+ if (astElement.metadata.isNotEmpty) {
+ from = astElement.metadata.first.beginToken;
}
return validateToken(from, to);
}
@@ -1741,7 +1740,8 @@ class CompilerDiagnosticReporter extends DiagnosticReporter {
} else if (node is Element) {
return spanFromElement(node);
} else if (node is MetadataAnnotation) {
- return node.sourcePosition;
+ Uri uri = node.annotatedElement.compilationUnit.script.resourceUri;
+ return spanFromTokens(node.beginToken, node.endToken, uri);
} 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