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

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

Issue 8972003: Promote class to a reserved word (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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..01dc41be873ffabb0e657fd20991a006096064f0 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());
}
+
+ public void testReservedWordClass() {
+ parseExpectErrors(Joiner.on("\n").join(
+ "class foo {}",
+ "main() {",
+ " int class = 10;",
+ " print(\"class = $class\");",
+ "}"),
+ errEx(ParserErrorCode.EXPECTED_TOKEN, 3, 7, 5),
+ errEx(ParserErrorCode.UNEXPECTED_TOKEN, 4, 19, 5));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698