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

Unified Diff: tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart

Issue 2788373002: Add Source.getTextLine and use it to display source snippets in error messages. (Closed)
Patch Set: dartfmt Created 3 years, 8 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: tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
diff --git a/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart b/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
index 423c054085fb7047d07ba6da5fd88379c11ba42a..fae4da9bc20e2d3b31db38fe4a4a4aaa0bffa9f0 100644
--- a/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
+++ b/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
@@ -515,7 +515,7 @@ String computeDartHtmlPart(String name, SourceFileManager sourceFileManager,
line++) {
if (line >= 0) {
dartCodeBuffer.write(lineNumber(line, width: lineNoWidth));
- dartCodeBuffer.write(sourceFile.getLineText(line));
+ dartCodeBuffer.write(sourceFile.kernelSource.getTextLine(line + 1));
}
}
dartCodeBuffer.write(codeBuffer);
@@ -524,7 +524,7 @@ String computeDartHtmlPart(String name, SourceFileManager sourceFileManager,
line++) {
if (line < sourceFile.lines) {
dartCodeBuffer.write(lineNumber(line, width: lineNoWidth));
- dartCodeBuffer.write(sourceFile.getLineText(line));
+ dartCodeBuffer.write(sourceFile.kernelSource.getTextLine(line + 1));
}
}
dartCodeBuffer.write('</pre>\n');
@@ -544,10 +544,10 @@ String computeDartHtmlPart(String name, SourceFileManager sourceFileManager,
} else {
for (int line = lastLineIndex + 1; line < lineIndex; line++) {
codeBuffer.write(lineNumber(line, width: lineNoWidth));
- codeBuffer.write(sourceFile.getLineText(line));
+ codeBuffer.write(sourceFile.kernelSource.getTextLine(line + 1));
}
}
- String line = sourceFile.getLineText(lineIndex);
+ String line = sourceFile.kernelSource.getTextLine(lineIndex + 1);
locations.sort((a, b) => a.offset.compareTo(b.offset));
for (int i = 0; i < locations.length; i++) {
SourceLocation sourceLocation = locations[i];

Powered by Google App Engine
This is Rietveld 408576698