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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartMethodInvocation.java

Issue 9633009: Use Element instead of Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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/ast/DartMethodInvocation.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartMethodInvocation.java b/compiler/java/com/google/dart/compiler/ast/DartMethodInvocation.java
index 9bade8d32fefba7b9d49f44cc1cbad9d319535cd..4296deb5cdb04a212f347286ae219e97ffdac0ce 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartMethodInvocation.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartMethodInvocation.java
@@ -4,23 +4,32 @@
package com.google.dart.compiler.ast;
-import com.google.dart.compiler.common.Symbol;
-
import java.util.List;
/**
- * Method invocation AST node. The name of the method must not be
- * null. The receiver is an expression, super, or a classname.
+ * Method invocation AST node. The name of the method must not be null. The receiver is an
+ * expression, super, or a classname.
+ * <p>
+ * {@link DartMethodInvocation} may be created at the parsing time not only for invocation of actual
+ * method, but also for invocation of function object in some object. For example:
+ *
+ * <pre>
+ * class A {
+ * Function run;
+ * }
+ * test(A a) {
+ * a.run();
+ * }
+ * </pre>
*/
public class DartMethodInvocation extends DartInvocation {
private DartExpression target;
private DartIdentifier functionName;
- private Symbol targetSymbol;
public DartMethodInvocation(DartExpression target,
- DartIdentifier functionName,
- List<DartExpression> args) {
+ DartIdentifier functionName,
+ List<DartExpression> args) {
super(args);
functionName.getClass(); // Quick null-check.
this.target = becomeParentOf(target);
@@ -33,7 +42,7 @@ public class DartMethodInvocation extends DartInvocation {
}
public String getFunctionNameString() {
- return functionName.getTargetName();
+ return functionName.getName();
}
public DartIdentifier getFunctionName() {
@@ -46,15 +55,6 @@ public class DartMethodInvocation extends DartInvocation {
}
@Override
- public void setSymbol(Symbol symbol) {
- this.targetSymbol = symbol;
- }
-
- public Symbol getTargetSymbol() {
- return targetSymbol;
- }
-
- @Override
public void visitChildren(ASTVisitor<?> visitor) {
target.accept(visitor);
functionName.accept(visitor);

Powered by Google App Engine
This is Rietveld 408576698