Index: dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart |
diff --git a/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart b/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart |
index a768b5038458be91960883793ce175f69e29d55d..573fc4f8dbc8a8ac8e9357c588cfbb3fb34380fc 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart |
@@ -141,7 +141,15 @@ class Token implements Spannable { |
/** |
* The number of characters parsed by this token. |
*/ |
- int get slowCharCount => slowToString().length; |
+ int get slowCharCount { |
+ if (info == BAD_INPUT_INFO) { |
+ // This is a token that wraps around an error message. Return 1 |
+ // instead of the size of the length of the error message. |
+ return 1; |
+ } else { |
+ return slowToString().length; |
+ } |
+ } |
} |
/** |