Chromium Code Reviews| Index: compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java |
| diff --git a/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java b/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java |
| index 1e4f541773ff8b5463842ad60bc52e1f79b1fd73..20c9129d250d304a5e959b93a5a68545afbda69e 100644 |
| --- a/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java |
| +++ b/compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java |
| @@ -4,6 +4,8 @@ |
| package com.google.dart.compiler; |
| +import java.net.URI; |
| + |
| import com.google.dart.compiler.ast.DartClass; |
| import com.google.dart.compiler.ast.DartField; |
| import com.google.dart.compiler.ast.DartIdentifier; |
| @@ -13,6 +15,7 @@ import com.google.dart.compiler.ast.DartNodeTraverser; |
| import com.google.dart.compiler.ast.DartPropertyAccess; |
| import com.google.dart.compiler.ast.DartTypeNode; |
| import com.google.dart.compiler.ast.DartUnit; |
| +import com.google.dart.compiler.resolver.ClassElement; |
| import com.google.dart.compiler.resolver.Element; |
| import com.google.dart.compiler.resolver.ElementKind; |
| import com.google.dart.compiler.resolver.EnclosingElement; |
| @@ -20,8 +23,6 @@ import com.google.dart.compiler.type.InterfaceType; |
| import com.google.dart.compiler.type.Type; |
| import com.google.dart.compiler.type.TypeKind; |
| -import java.net.URI; |
| - |
| /** |
| * A visitor that fills in {@link LibraryDeps} for a compilation unit. |
| */ |
| @@ -58,13 +59,14 @@ public class LibraryDepsVisitor extends DartNodeTraverser<Void> { |
| // explanation). |
| switch (kind) { |
| case FIELD: |
| - case METHOD: |
| + case METHOD: { |
| EnclosingElement enclosing = target.getEnclosingElement(); |
| addHoleIfSuper(node, enclosing); |
| if (enclosing.getKind().equals(ElementKind.LIBRARY)) { |
| addElementDependency(target); |
| } |
| break; |
| + } |
| } |
| // Add dependency on the computed type of identifiers. |
| @@ -109,6 +111,10 @@ public class LibraryDepsVisitor extends DartNodeTraverser<Void> { |
| currentClass = node; |
| node.visitChildren(this); |
| currentClass = null; |
| + if(node.isInterface() && node.getDefaultClass() != null) { |
|
mmendez
2011/12/15 22:04:12
visitChildren should cause the defaultClass to be
|
| + ClassElement interfaceElement = node.getSymbol(); |
| + addElementDependency(interfaceElement.getDefaultClass().getElement()); |
| + } |
| return null; |
| } |