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..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)'; |
| } |