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

Unified Diff: compiler/javatests/com/google/dart/compiler/CompilerTestCase.java

Issue 9950045: Implements error recovery for cases where 'var' or 'final' prefix a method def'n (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adds additional unit test Created 8 years, 9 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/CompilerTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
index 00107ff0821cf23330c7ef444d42bc46e188543c..2ad25036ce06f5ac07732dcc86a5953f7c08add2 100644
--- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
@@ -240,13 +240,17 @@ public abstract class CompilerTestCase extends TestCase {
/**
* Parse a single compilation unit for the name and source.
*/
- protected DartUnit parseUnit(String srcName, String sourceCode) {
+ protected DartUnit parseUnit(String srcName, String sourceCode, Object... errors) {
// TODO(jgw): We'll need to fill in the library parameter when testing multiple units.
DartSourceTest src = new DartSourceTest(srcName, sourceCode, null);
- ParserContext context = makeParserContext(src, sourceCode, DartCompilerListener.EMPTY);
- return makeParser(context).parseUnit(src);
+ DartCompilerListenerTest listener = new DartCompilerListenerTest(srcName, errors);
+ ParserContext context = makeParserContext(src, sourceCode, listener);
+ DartUnit unit = makeParser(context).parseUnit(src);
+ listener.checkAllErrorsReported();
+ return unit;
}
+
/**
* Parse a single compilation unit with given name and source, and check for a set of expected errors.
*

Powered by Google App Engine
This is Rietveld 408576698