Index: compiler/java/com/google/dart/compiler/ast/LibraryUnit.java |
diff --git a/compiler/java/com/google/dart/compiler/ast/LibraryUnit.java b/compiler/java/com/google/dart/compiler/ast/LibraryUnit.java |
index a5f4e33fb21d120314cafd5efe08bef2b6071310..00c24c92ae583852c8b12e97491072aecc76d115 100644 |
--- a/compiler/java/com/google/dart/compiler/ast/LibraryUnit.java |
+++ b/compiler/java/com/google/dart/compiler/ast/LibraryUnit.java |
@@ -308,8 +308,13 @@ public class LibraryUnit { |
public Void visitMethodDefinition(DartMethodDefinition node) { |
// Method names are always identifiers, except for factories, which cannot appear |
// in this context. |
- DartIdentifier name = (DartIdentifier) node.getName(); |
- topLevelNodes.put(name.getTargetName(), node); |
+ DartExpression name = node.getName(); |
+ if(name instanceof DartIdentifier) { |
+ topLevelNodes.put(((DartIdentifier) name).getTargetName(), node); |
+ } else { |
+ // Visit the unknown node to generate a string for our use. |
+ topLevelNodes.put(node.getName().toSource(), node); |
+ } |
return null; |
} |