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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java

Issue 10703046: Issue 3753. Support for @deprecated annotation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Analyze for @deprecated all invocable elements Created 8 years, 6 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: compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java b/compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java
index 8f24eeaf4dce8f0df9cc967c628eec8e0cb351d2..12bac353d2e1310af850d87e6642f6e79d1b4565 100644
--- a/compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java
+++ b/compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java
@@ -10,6 +10,7 @@ import com.google.dart.compiler.ast.DartBlock;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartFunctionExpression;
import com.google.dart.compiler.ast.DartIdentifier;
+import com.google.dart.compiler.ast.DartMetadata;
import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNativeBlock;
import com.google.dart.compiler.ast.DartNode;
@@ -24,6 +25,7 @@ import java.util.List;
import java.util.Set;
class MethodElementImplementation extends AbstractNodeElement implements MethodNodeElement {
+ private final DartMetadata metadata;
private final Modifiers modifiers;
private final EnclosingElement holder;
private final ElementKind kind;
@@ -37,8 +39,9 @@ class MethodElementImplementation extends AbstractNodeElement implements MethodN
@VisibleForTesting
MethodElementImplementation(DartFunctionExpression node, String name, Modifiers modifiers) {
super(node, name);
- this.hasBody = true;
+ this.metadata = DartMetadata.EMPTY;
this.modifiers = modifiers;
+ this.hasBody = true;
this.holder = findParentEnclosingElement(node);
this.kind = ElementKind.FUNCTION_OBJECT;
if (node != null && node.getName() != null) {
@@ -52,11 +55,13 @@ class MethodElementImplementation extends AbstractNodeElement implements MethodN
EnclosingElement holder) {
super(node, name);
if (node != null) {
+ this.metadata = node.getMetadata();
this.modifiers = node.getModifiers();
this.nameLocation = node.getName().getSourceInfo();
DartBlock body = node.getFunction().getBody();
this.hasBody = body != null && !(body instanceof DartNativeBlock);
} else {
+ this.metadata = DartMetadata.EMPTY;
this.modifiers = Modifiers.NONE;
this.nameLocation = SourceInfo.UNKNOWN;
this.hasBody = false;
@@ -66,6 +71,11 @@ class MethodElementImplementation extends AbstractNodeElement implements MethodN
}
@Override
+ public DartMetadata getMetadata() {
+ return metadata;
+ }
+
+ @Override
public Modifiers getModifiers() {
return modifiers;
}

Powered by Google App Engine
This is Rietveld 408576698