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

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

Issue 10557037: Issue 1197. Support for using 'static' as method name (Closed) Base URL: https://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/language/language.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
diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
index 78510d7d6e23c8425d13c66e139320d6d280e145..e3178944b56ce491578ab822dd5c83452add188a 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
@@ -576,6 +576,24 @@ public class SyntaxTest extends AbstractParserTest {
" typedef();",
"}"));
}
+
+ /**
+ * We should be able to parse "static(abstract) => 42" top-level function.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=1197
+ */
+ public void test_staticAsFunctionName() {
+ DartUnit unit = parseUnit(
+ getName(),
+ Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "static(abstract) => 42;",
+ ""));
+ assertEquals(1, unit.getTopLevelNodes().size());
+ DartMethodDefinition method = (DartMethodDefinition) unit.getTopLevelNodes().get(0);
+ assertEquals("static", method.getName().toSource());
+ assertEquals("abstract", method.getFunction().getParameters().get(0).getName().toSource());
+ }
/**
* The token 'super' is valid by itself (not as a qualifier or assignment selector) in only some
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698