Chromium Code Reviews| Index: lib/compiler/implementation/dart_backend/backend.dart |
| diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart |
| index a896995c3fefa1892d43c17421cce5ac131b485d..4569ff89aaa8ec21d39cfdb3bf551438a4d882fa 100644 |
| --- a/lib/compiler/implementation/dart_backend/backend.dart |
| +++ b/lib/compiler/implementation/dart_backend/backend.dart |
| @@ -141,6 +141,12 @@ class ReferencedElementCollector extends AbstractVisitor { |
| this.element, this.treeElements, |
| this.typedefs, this.classes); |
| + void collectElement(Element element) { |
|
Anton Muhin
2012/08/13 08:15:30
nit: please, do not shadow the field.
Roman
2012/08/13 08:23:08
Renamed field to rootElement.
|
| + new ReferencedElementCollector( |
| + compiler, element, new TreeElementMapping(), typedefs, classes) |
| + .collect(); |
| + } |
| + |
| visitNode(Node node) { node.visitChildren(this); } |
| visitTypeAnnotation(TypeAnnotation typeAnnotation) { |
| @@ -148,11 +154,12 @@ class ReferencedElementCollector extends AbstractVisitor { |
| Element typeElement = type.element; |
| if (typeElement.isTypedef() && !typedefs.contains(typeElement)) { |
| typedefs.add(typeElement); |
| - new ReferencedElementCollector( |
| - compiler, typeElement, new TreeElementMapping(), typedefs, classes) |
| - .collect(); |
| + collectElement(typeElement); |
| + } |
| + if (typeElement.isClass() && !classes.contains(typeElement)) { |
| + classes.add(typeElement); |
| + collectElement(typeElement); |
| } |
| - if (typeElement.isClass()) classes.add(typeElement); |
| typeAnnotation.visitChildren(this); |
| } |