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

Unified Diff: dart/site/try/src/interaction_manager.dart

Issue 212823002: Don't loop forever on scanner errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix long line that Kasper missed :-) Created 6 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: dart/site/try/src/interaction_manager.dart
diff --git a/dart/site/try/src/interaction_manager.dart b/dart/site/try/src/interaction_manager.dart
index 431dbe870008e1b58207872d569c92fc99d773a0..0f0a18c7da5b36c0a3c74d9f8818065703fb1035 100644
--- a/dart/site/try/src/interaction_manager.dart
+++ b/dart/site/try/src/interaction_manager.dart
@@ -260,6 +260,7 @@ class InitialState extends InteractionState {
selectionOffset = selection.anchorOffset;
}
int splitPoint = token.charOffset - offset;
+ if (splitPoint < 0) continue; // Happens for scanner errors.
Text str = node.splitText(splitPoint);
Text after = str.splitText(token.charCount);
offset += splitPoint + token.charCount;
« no previous file with comments | « no previous file | dart/tests/try/paste_content_rewriting_test.dart » ('j') | dart/tests/try/paste_content_rewriting_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698