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

Unified Diff: dart/lib/compiler/implementation/resolver.dart

Issue 10870010: Evaluate compile-time constants of metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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: dart/lib/compiler/implementation/resolver.dart
diff --git a/dart/lib/compiler/implementation/resolver.dart b/dart/lib/compiler/implementation/resolver.dart
index bcd63bb596299f64a75eed2676ce93086146c91e..1431ac57ca36c7e540765bd3491e69d8fd756903 100644
--- a/dart/lib/compiler/implementation/resolver.dart
+++ b/dart/lib/compiler/implementation/resolver.dart
@@ -399,6 +399,18 @@ class ResolverTask extends CompilerTask {
element);
}
+ void resolveMetadataAnnotation(MetadataAnnotation annotation) {
+ Node node = annotation.parseNode(compiler);
+ Element fakeElement = new Element(const SourceString(''),
ngeoffray 2012/08/22 14:28:56 Should we have a metadata element instead? This so
ahe 2012/08/22 17:23:02 Done.
+ ElementKind.FUNCTION,
+ annotation.enclosingElement);
Johnni Winther 2012/08/22 13:45:40 The element kind should be something else. We cann
ahe 2012/08/22 17:23:02 Done.
+ ResolverVisitor visitor = new ResolverVisitor(compiler, fakeElement);
+ node.accept(visitor);
+ annotation.value = compiler.constantHandler.compileNodeWithDefinitions(
+ node, visitor.mapping);
+ print(annotation);
Johnni Winther 2012/08/22 13:45:40 Debug output.
ahe 2012/08/22 17:23:02 Done.
+ }
+
error(Node node, MessageKind kind, [arguments = const []]) {
ResolutionError message = new ResolutionError(kind, arguments);
compiler.reportError(node, message);

Powered by Google App Engine
This is Rietveld 408576698