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

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

Issue 8788001: Trying to unbreak dart editor build - new use of rollback messes up code completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to fix unit test 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
« 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/ParserEventsTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/ParserEventsTest.java b/compiler/javatests/com/google/dart/compiler/parser/ParserEventsTest.java
index 7623f85b4cc97127e9fc7059cad208373b6fdf94..99c7fa46ce4cc6f508b918777cb81e9208b461e6 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/ParserEventsTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/ParserEventsTest.java
@@ -68,6 +68,7 @@ import static com.google.dart.compiler.parser.ParserEventsTest.Mark.VariableDecl
import static com.google.dart.compiler.parser.ParserEventsTest.Mark.WhileStatement;
import java.util.HashSet;
+import java.util.LinkedHashSet;
public class ParserEventsTest extends AbstractParserTest {
@@ -172,11 +173,23 @@ public class ParserEventsTest extends AbstractParserTest {
}
private static class ParserEventRecorder extends DartParser {
- private HashSet<Mark> marks;
+ private LinkedHashSet<Mark> marks;
+
+ @Override
+ protected void rollback() {
+ super.rollback();
+ Mark lastMark = null;
+ for (Mark mark: marks) {
+ lastMark = mark;
+ }
+ if (lastMark != null) {
+ marks.remove(lastMark);
+ }
+ }
public ParserEventRecorder(ParserContext ctx) {
super(ctx);
- marks = new HashSet<Mark>();
+ marks = new LinkedHashSet<Mark>();
}
@SuppressWarnings({"unchecked", "rawtypes"})
« 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