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

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

Issue 10833012: Fix for issue 3783 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 9892)
+++ compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java (working copy)
@@ -87,6 +87,24 @@
assertTrue(expression instanceof DartFunctionExpression);
}
+ public void test_functionExpression_inIsExpression() {
+ DartUnit unit = parseUnit("function.dart", Joiner.on("\n").join(
+ "main() {",
+ " (p) {} is String;",
+ "}"
+ ));
+ assertNotNull(unit);
+ assertEquals(1, unit.getTopLevelNodes().size());
+ DartMethodDefinition function = (DartMethodDefinition) unit.getTopLevelNodes().get(0);
+ assertNotNull(function);
+ DartStatement statement = function.getFunction().getBody().getStatements().get(0);
+ assertTrue(statement instanceof DartExprStmt);
+ DartExpression expression = ((DartExprStmt) statement).getExpression();
+ assertTrue(expression instanceof DartBinaryExpression);
+ DartExpression lhs = ((DartBinaryExpression) expression).getArg1();
+ assertTrue(lhs instanceof DartFunctionExpression);
+ }
+
public void test_const() {
DartUnit unit = parseUnit(getName() + ".dart", makeCode(
"// filler filler filler filler filler filler filler filler filler filler",
« 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