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

Unified Diff: compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java

Issue 8948001: Updates dartc to recognize 'default' keyword on interface and updated factory method syntax (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Got rid of some problems. Created 9 years 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698