| Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| index 6e1794ced91fd8b5975feab6ac2b86581472a9ad..88595fa9de6f51fa66766351f200b75121287d04 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -3289,6 +3289,24 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| assertErrors(libraryResult.getErrors());
|
| }
|
|
|
| + /**
|
| + * Source is invalid, but should not cause {@link NullPointerException}.
|
| + * <p>
|
| + * http://code.google.com/p/dart/issues/detail?id=4354
|
| + */
|
| + public void test_switchCase_withoutExpression() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "main() {",
|
| + " switch (0) {",
|
| + " case }",
|
| + " }",
|
| + "}",
|
| + "");
|
| + // has some errors, no exception
|
| + assertTrue(libraryResult.getErrors().size() != 0);
|
| + }
|
| +
|
| private static <T extends DartNode> T findNode(
|
| AnalyzeLibraryResult libraryResult,
|
| final Class<T> clazz,
|
|
|