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

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

Issue 2788373002: Add Source.getTextLine and use it to display source snippets in error messages. (Closed)
Patch Set: Remove getLine, getColumn, and getLineText. Created 3 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: tests/compiler/dart2js/sourcemaps/diff.dart
diff --git a/tests/compiler/dart2js/sourcemaps/diff.dart b/tests/compiler/dart2js/sourcemaps/diff.dart
index 7505892879b7f86bd67e3a519048c82504685e47..c3d02b078df2b7c035d9107bcb7cafc7433226c5 100644
--- a/tests/compiler/dart2js/sourcemaps/diff.dart
+++ b/tests/compiler/dart2js/sourcemaps/diff.dart
@@ -540,8 +540,8 @@ class DiffCreator {
line.htmlParts.add(new ConstHtmlPart('</span>'));
lines.add(line);
if (codeSource.begin != null) {
- int startLine = sourceFile.getLine(codeSource.begin);
- int endLine = sourceFile.getLine(codeSource.end) + 1;
+ int startLine = sourceFile.getLocation(codeSource.begin).line - 1;
+ int endLine = sourceFile.getLocation(codeSource.end).line;
for (CodeLine codeLine in convertAnnotatedCodeToCodeLines(
sourceFile.slowText(), const <Annotation>[],
startLine: startLine, endLine: endLine)) {
@@ -592,8 +592,8 @@ class DiffCreator {
currentCodeSource = null;
for (CodeSource codeSource in codeSources) {
Interval interval = new Interval(
- sourceFile.getLine(codeSource.begin),
- sourceFile.getLine(codeSource.end) + 1);
+ sourceFile.getLocation(codeSource.begin).line - 1,
+ sourceFile.getLocation(codeSource.end).line);
if (interval.contains(dartCodeLine.lineNo)) {
currentCodeSource = codeSource;
currentLineInterval = interval;
@@ -639,7 +639,7 @@ class DiffCreator {
for (CodeLocation location in codeLineAnnotation.codeLocations) {
SourceFile sourceFile = sourceFileManager.getSourceFile(location.uri);
- int line = sourceFile.getLine(location.offset);
+ int line = sourceFile.getLocation(location.offset).line - 1;
if (currentUri != location.uri) {
restart(jsCodeLine, location, line);
} else if (interval.inWindow(line, windowSize: 2)) {

Powered by Google App Engine
This is Rietveld 408576698