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

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

Issue 8913016: Issue 839: Bad code leading to top level methods being something other than identifier (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Nits Created 9 years 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/resolver/MethodElementImplementation.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
+ }
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/MethodElementImplementation.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698