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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FunctionDeclaration.java

Issue 11787017: Initial implementation of MemoryIndexStoreImpl and IndexContributor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update for review comments Created 7 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: 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();

Powered by Google App Engine
This is Rietveld 408576698