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

Unified Diff: pkg/analyzer/lib/src/error.dart

Issue 184893003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: pkg/analyzer/lib/src/error.dart
diff --git a/pkg/analyzer/lib/src/error.dart b/pkg/analyzer/lib/src/error.dart
index 4c9b7af2045a4c860c8893927e194589f474ef85..483c433d50963ff2924652029842f11ddb1308ec 100644
--- a/pkg/analyzer/lib/src/error.dart
+++ b/pkg/analyzer/lib/src/error.dart
@@ -44,17 +44,16 @@ class AnalyzerError implements Exception {
String toString() {
var builder = new StringBuffer();
- var receiver = new _ContentReceiver();
- error.source.getContents(receiver);
- var beforeError = receiver.result.substring(0, error.offset);
+ var content = error.source.contents.data;
+ var beforeError = content.substring(0, error.offset);
var lineNumber = "\n".allMatches(beforeError).length + 1;
builder.writeln("Error on line $lineNumber of ${error.source.fullName}: "
"${error.message}");
var errorLineIndex = beforeError.lastIndexOf("\n") + 1;
- var errorEndOfLineIndex = receiver.result.indexOf("\n", error.offset);
- if (errorEndOfLineIndex == -1) errorEndOfLineIndex = receiver.result.length;
- var errorLine = receiver.result.substring(
+ var errorEndOfLineIndex = content.indexOf("\n", error.offset);
+ if (errorEndOfLineIndex == -1) errorEndOfLineIndex = content.length;
+ var errorLine = content.substring(
errorLineIndex, errorEndOfLineIndex);
var errorColumn = error.offset - errorLineIndex;
var errorLength = error.length;

Powered by Google App Engine
This is Rietveld 408576698