Chromium Code Reviews| 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..a8d2fc8cb3dce86ffcc5fb24040b6d5cd99ad10c 100644 |
| --- a/dart/lib/compiler/implementation/elements/elements.dart |
| +++ b/dart/lib/compiler/implementation/elements/elements.dart |
| @@ -123,6 +123,8 @@ class Element implements Hashable { |
| } |
| void addMetadata(MetadataAnnotation annotation) { |
| + assert(annotation.annotatedElement === null); |
| + annotation.annotatedElement = this; |
| metadata = metadata.prepend(annotation); |
| } |
| @@ -1599,6 +1601,19 @@ class MetadataAnnotation { |
| * In the mirror system, this would be an object mirror. |
| */ |
| abstract Constant get value(); |
| + Element annotatedElement; |
| + int resolutionState; |
| + |
| + MetadataAnnotation([this.resolutionState = ClassElement.STATE_NOT_STARTED]); |
|
ngeoffray
2012/08/22 21:57:54
Should these constant values be on some other plac
ahe
2012/08/23 05:43:34
Done.
|
| + |
| + 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)'; |
| } |