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

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

Issue 12035007: Issue 7999: DartEditor analyser goes into infinite loop, caused by class definition inside switch st (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add test Created 7 years, 11 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') | 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/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 3a72c7a692ec9ddd0720744ec81e17065fff2a6d..3e070aa1f30df48360a0addc9deefed8d78b7d1e 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
@@ -193,6 +193,27 @@ public class SyntaxTest extends AbstractParserTest {
}
/**
+ * There was bug that class instead of case in switch caused infinite parsing loop.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=7999
+ */
+ public void test_switch_class_inCase() {
+ DartParserRunner runner = parseSource(Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "void main() {",
+ " print((e) {",
+ " switch (e) {",
+ " case 'Up': cursor.(); break;",
+ " class LoopClass { var myData; }",
+ " case 'Down':",
+ " }",
+ " }); ",
+ "}",
+ ""));
+ assertTrue(runner.getErrorCount() > 0);
+ }
+
+ /**
* There was bug that handling missing identifier (method name) after "cursor." in switch caused
* infinite parsing loop.
* <p>
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698