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

Unified Diff: compiler/java/com/google/dart/compiler/ast/ASTNodes.java

Issue 12039054: Issue 8059. Disallow mixing in classes that use 'super' from any member. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months 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
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ClassElement.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82bc8559b9fcfde6da0cc261ab0b89b8af532c03..88a322f24edf282cca9233d1734ab20c8c351159 100644
--- a/compiler/java/com/google/dart/compiler/ast/ASTNodes.java
+++ b/compiler/java/com/google/dart/compiler/ast/ASTNodes.java
@@ -29,6 +29,7 @@ import com.google.dart.compiler.type.TypeKind;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
/**
* Defines utility methods that operate on nodes in a Dart AST structure (instances of
@@ -1429,5 +1430,20 @@ public class ASTNodes {
return (DartIdentifier) constructor;
}
}
+
+ /**
+ * @return <code>true</code> if given {@link DartNode} has {@link DartSuperExpression}.
+ */
+ public static boolean hasSuperInvocation(DartNode node) {
+ final AtomicBoolean result = new AtomicBoolean();
+ node.accept(new ASTVisitor<Void>() {
+ @Override
+ public Void visitSuperExpression(DartSuperExpression node) {
+ result.set(true);
+ return null;
+ }
+ });
+ return result.get();
+ }
}
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ClassElement.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698