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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java

Issue 10533127: Fix for issue 3526 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java (revision 8609)
+++ compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java (working copy)
@@ -20,12 +20,14 @@
import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartPropertyAccess;
+import com.google.dart.compiler.ast.DartReturnStatement;
import com.google.dart.compiler.ast.DartStatement;
import com.google.dart.compiler.ast.DartStringInterpolation;
import com.google.dart.compiler.ast.DartStringLiteral;
import com.google.dart.compiler.ast.DartTryStatement;
import com.google.dart.compiler.ast.DartTypeExpression;
import com.google.dart.compiler.ast.DartTypeNode;
+import com.google.dart.compiler.ast.DartUnaryExpression;
import com.google.dart.compiler.ast.DartUnit;
import com.google.dart.compiler.ast.DartVariableStatement;
@@ -436,6 +438,24 @@
assertEquals("[]=", ((DartIdentifier)F_access_assign.getName()).getName());
}
+ public void test_super_operator() {
+ DartUnit unit = parseUnit("phony_super.dart", Joiner.on("\n").join(
+ "class A {",
+ " void m() {",
+ " --super;",
+ " }",
+ "}"));
+ List<DartNode> nodes = unit.getTopLevelNodes();
+ assertEquals(1, nodes.size());
+ DartClass A = (DartClass) nodes.get(0);
+ DartMethodDefinition m = (DartMethodDefinition) A.getMembers().get(0);
+ DartExprStmt statement = (DartExprStmt) m.getFunction().getBody().getStatements().get(0);
+ DartUnaryExpression value = (DartUnaryExpression) statement.getExpression();
+ assertEquals(Token.SUB, value.getOperator());
+ DartUnaryExpression inner = (DartUnaryExpression) value.getArg();
+ assertEquals(Token.SUB, inner.getOperator());
+ }
+
/**
* Typedef and interface are top level keywords that are also valid as identifiers.
*
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698