Index: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java |
diff --git a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java |
index 4f2eb83b2ad441c02ffbea50a378041469479120..747677b651a365394309ea06e0265326088c34fd 100644 |
--- a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java |
+++ b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java |
@@ -302,4 +302,15 @@ public class NegativeParserTest extends CompilerTestCase { |
"}"), |
dartUnit.toDietSource().trim()); |
} |
+ |
+ /** |
+ * Function signatures require the name to be an identifier; especially true at the top level. |
+ * <p> |
+ * http://code.google.com/p/dart/issues/detail?id=839 |
+ */ |
+ public void testTopLevelFunctionNotIdentifier() { |
+ parseExpectErrors( |
+ "foo.baz() {}", |
+ errEx(ParserErrorCode.FUNCTION_NAME_EXPECTED_IDENTIFIER, 1, 1, 7)); |
+ } |
} |