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

Unified Diff: dart/lib/compiler/implementation/elements/elements.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/elements/elements.dart
diff --git a/dart/lib/compiler/implementation/elements/elements.dart b/dart/lib/compiler/implementation/elements/elements.dart
index 2cfa90d06652a110c01bd578db777c881f3c13b1..ae26a43cd157fbe6124c4fe1a7d04f87ac6f8016 100644
--- a/dart/lib/compiler/implementation/elements/elements.dart
+++ b/dart/lib/compiler/implementation/elements/elements.dart
@@ -1599,6 +1599,20 @@ class MetadataAnnotation {
* In the mirror system, this would be an object mirror.
*/
abstract Constant get value();
+ final Element enclosingElement;
Johnni Winther 2012/08/22 13:45:40 enclosingElement is a bad name if it is always the
ahe 2012/08/22 14:01:54 It isn't supposed to always be a compilation unit.
ahe 2012/08/22 17:23:02 You convinced me offline that it should be annotat
+ int resolutionState;
+
+ MetadataAnnotation(this.enclosingElement,
+ [this.resolutionState = ClassElement.STATE_NOT_STARTED]);
Johnni Winther 2012/08/22 13:45:40 Why allow for another initial resolutionState?
ahe 2012/08/22 14:01:54 I need that for PatchMetadataAnnotation.
+
+ abstract Node parseNode(DiagnosticListener listener);
+
+ MetadataAnnotation ensureResolved(Compiler compiler) {
+ if (resolutionState == ClassElement.STATE_NOT_STARTED) {
+ compiler.resolver.resolveMetadataAnnotation(this);
+ }
+ return this;
+ }
- // TODO(ahe): Add more functionality as needed.
+ String toString() => 'MetadataAnnotation($value, $resolutionState)';
}
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/resolver.dart » ('j') | dart/lib/compiler/implementation/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698