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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1660713002: Create ElementAnnotation objects prior to resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix accidental comment change Created 4 years, 11 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: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 612912d70786b0d925aad98baebd7642bb87bd7f..b38144176e94c7a8e9eec8cadc8af7ace27682fd 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -7724,7 +7724,7 @@ class ResolverVisitor extends ScopedVisitor {
//
if (node.metadata != null) {
node.metadata.accept(this);
- ElementResolver.setMetadata(node.element, node);
+ ElementResolver.resolveMetadata(node);
}
//
// Continue the enum resolution.
@@ -10864,8 +10864,8 @@ class TypeResolverVisitor extends ScopedVisitor {
Object visitAnnotation(Annotation node) {
//
// Visit annotations, if the annotation is @proxy, on a class, and "proxy"
- // resolves to the proxy annotation in dart.core, then create create the
- // ElementAnnotationImpl and set it as the metadata on the enclosing class.
+ // resolves to the proxy annotation in dart.core, then resolve the
+ // ElementAnnotation.
//
// Element resolution is done in the ElementResolver, and this work will be
// done in the general case for all annotations in the ElementResolver.
@@ -10882,12 +10882,8 @@ class TypeResolverVisitor extends ScopedVisitor {
element.library.isDartCore &&
element is PropertyAccessorElement) {
// This is the @proxy from dart.core
- ClassDeclaration classDeclaration = node.parent as ClassDeclaration;
- ElementAnnotationImpl elementAnnotation =
- new ElementAnnotationImpl(element);
- node.elementAnnotation = elementAnnotation;
- (classDeclaration.element as ClassElementImpl).metadata =
- <ElementAnnotationImpl>[elementAnnotation];
+ ElementAnnotationImpl elementAnnotation = node.elementAnnotation;
+ elementAnnotation.element = element;
}
}
return null;
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698