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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 16101007: Implement LibraryMirror.metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix issues found during testing. Created 7 years, 7 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/sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index d02064d6252e77c08100c4ee7e86488631b6c1a0..9ee95100a829b07ae2403be5f28a0bf92e0dae97 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -962,8 +962,12 @@ class ResolverTask extends CompilerTask {
annotation.resolutionState = STATE_STARTED;
Node node = annotation.parseNode(compiler);
- ResolverVisitor visitor =
- visitorFor(annotation.annotatedElement.enclosingElement);
+ Element annotatedElement = annotation.annotatedElement;
+ Element context = annotatedElement.enclosingElement;
+ if (context == null) {
+ context = annotatedElement;
+ }
+ ResolverVisitor visitor = visitorFor(context);
node.accept(visitor);
annotation.value = compiler.metadataHandler.compileNodeWithDefinitions(
node, visitor.mapping, isConst: true);

Powered by Google App Engine
This is Rietveld 408576698