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

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

Issue 9166010: Implement super calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 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
Index: frog/leg/tree/nodes.dart
diff --git a/frog/leg/tree/nodes.dart b/frog/leg/tree/nodes.dart
index f0c8c111c4308b5667c2d6e9bc4295be62dfbccc..f8596a3d9492b6da9e555c3030507907bf1ad527 100644
--- a/frog/leg/tree/nodes.dart
+++ b/frog/leg/tree/nodes.dart
@@ -220,6 +220,11 @@ class Send extends Expression {
int argumentCount() => argumentsNode.length();
+ bool get isSuperCall() {
+ return receiver !== null &&
+ receiver.asIdentifier() !== null &&
+ receiver.asIdentifier().isSuper();
+ }
bool get isOperator() => selector is Operator;
bool get isPropertyAccess() => argumentsNode === null;
bool get isFunctionObjectInvocation() => selector === null;
@@ -656,6 +661,8 @@ class Identifier extends Expression {
bool isThis() => source.stringValue == 'this';
+ bool isSuper() => source.stringValue == 'super';
+
Identifier asIdentifier() => this;
accept(Visitor visitor) => visitor.visitIdentifier(this);
« frog/leg/resolver.dart ('K') | « frog/leg/ssa/tracer.dart ('k') | frog/leg/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698