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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 10702054: Issue 3931. Visit children nodes safely. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
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 4dd715c30878698c4f9469dc93574d0006b2c359..76e1dc1c1c1ee133864968b5b3155f5c2e94dd4b 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -27,6 +27,7 @@ import com.google.dart.compiler.ast.DartForInStatement;
import com.google.dart.compiler.ast.DartFunctionExpression;
import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartInvocation;
+import com.google.dart.compiler.ast.DartMapLiteralEntry;
import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNewExpression;
import com.google.dart.compiler.ast.DartNode;
@@ -3030,6 +3031,22 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
+ /**
+ * Missing value in {@link DartMapLiteralEntry} is parsing error, but should not cause exception.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=3931
+ */
+ public void test_mapLiteralEntry_noValue() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main() {",
+ " var v = {'key' : /*no value*/};",
+ "}",
+ "");
+ // has some errors
+ assertTrue(libraryResult.getErrors().size() != 0);
+ }
+
private static <T extends DartNode> T findNode(
AnalyzeLibraryResult libraryResult,
final Class<T> clazz,

Powered by Google App Engine
This is Rietveld 408576698