| Index: compiler/java/com/google/dart/compiler/ast/ASTNodes.java
|
| diff --git a/compiler/java/com/google/dart/compiler/ast/ASTNodes.java b/compiler/java/com/google/dart/compiler/ast/ASTNodes.java
|
| index 2fbc66036539133fc6882284c6c052aa856dae32..02f43d2eec3cc689ff1f6cc3e95f647043e1684b 100644
|
| --- a/compiler/java/com/google/dart/compiler/ast/ASTNodes.java
|
| +++ b/compiler/java/com/google/dart/compiler/ast/ASTNodes.java
|
| @@ -1362,4 +1362,25 @@ public class ASTNodes {
|
| return false;
|
| }
|
|
|
| + /**
|
| + * @return the {@link DartIdentifier} corresponding to the name of constructor.
|
| + */
|
| + public static DartIdentifier getConstructorNameNode(DartNewExpression node) {
|
| + DartNode constructor = node.getConstructor();
|
| + return getConstructorNameNode(constructor);
|
| + }
|
| +
|
| + /**
|
| + * @return the {@link DartIdentifier} corresponding to the name of constructor.
|
| + */
|
| + private static DartIdentifier getConstructorNameNode(DartNode constructor) {
|
| + if (constructor instanceof DartPropertyAccess) {
|
| + return ((DartPropertyAccess) constructor).getName();
|
| + } else if (constructor instanceof DartTypeNode) {
|
| + return getConstructorNameNode(((DartTypeNode) constructor).getIdentifier());
|
| + } else {
|
| + return (DartIdentifier) constructor;
|
| + }
|
| + }
|
| +
|
| }
|
|
|