Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FunctionDeclaration.java |
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FunctionDeclaration.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FunctionDeclaration.java |
index 6d3867d0fd666dda9b88cbec083cb704267d6df4..8edc047f1880eb38c69ee6cd0f3f63dbde3d6f92 100644 |
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FunctionDeclaration.java |
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FunctionDeclaration.java |
@@ -13,6 +13,7 @@ |
*/ |
package com.google.dart.engine.ast; |
+import com.google.dart.engine.element.FunctionElement; |
import com.google.dart.engine.scanner.Token; |
import java.util.List; |
@@ -85,6 +86,16 @@ public class FunctionDeclaration extends CompilationUnitMember { |
return visitor.visitFunctionDeclaration(this); |
} |
+ /** |
+ * Return the {@link FunctionElement} associated with this function, or {@code null} if the AST |
+ * structure has not been resolved. |
+ * |
+ * @return the {@link FunctionElement} associated with this function |
+ */ |
+ public FunctionElement getElement() { |
+ return name != null ? (FunctionElement) name.getElement() : null; |
+ } |
+ |
@Override |
public Token getEndToken() { |
return functionExpression.getEndToken(); |