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

Unified Diff: frog/leg/tree/nodes.dart

Issue 9327001: Implement super initializers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 10 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
Index: frog/leg/tree/nodes.dart
diff --git a/frog/leg/tree/nodes.dart b/frog/leg/tree/nodes.dart
index 890094ab5a9fad587619fa57daec3be3c7292828..17cda56cf231e343734dd54789215fc761c3f7d2 100644
--- a/frog/leg/tree/nodes.dart
+++ b/frog/leg/tree/nodes.dart
@@ -1442,3 +1442,25 @@ class CatchBlock extends Node {
Token getEndToken() => block.getEndToken();
}
+
+class Initializers {
+ static bool isSuperConstructorCall(Send node) {
+ return (node.receiver === null &&
+ node.selector.asIdentifier() !== null &&
+ node.selector.asIdentifier().isSuper()) ||
+ (node.receiver !== null &&
+ node.receiver.asIdentifier() !== null &&
+ node.receiver.asIdentifier().isSuper() &&
+ node.selector.asIdentifier() !== null);
+ }
+
+ static bool isConstructorRedirect(Send node) {
+ return (node.receiver === null &&
+ node.selector.asIdentifier() !== null &&
+ node.selector.asIdentifier().isThis()) ||
+ (node.receiver !== null &&
+ node.receiver.asIdentifier() !== null &&
+ node.receiver.asIdentifier().isThis() &&
+ node.selector.asIdentifier() !== null);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698