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

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

Issue 2804613003: Make lines and columns one-based in SourceLocation. (Closed)
Patch Set: 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
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fae4da9bc20e2d3b31db38fe4a4a4aaa0bffa9f0..6a39556ed71fef39d26e86b869698edbdb567ca6 100644
--- a/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
+++ b/tests/compiler/dart2js/sourcemaps/sourcemap_html_helper.dart
@@ -487,7 +487,7 @@ String computeDartHtmlPart(String name, SourceFileManager sourceFileManager,
Map<int, List<SourceLocation>> uriMap =
sourceLocationMap.putIfAbsent(sourceLocation.sourceUri, () => {});
List<SourceLocation> lineList =
- uriMap.putIfAbsent(sourceLocation.line, () => []);
+ uriMap.putIfAbsent(sourceLocation.line - 1, () => []);
lineList.add(sourceLocation);
});
sourceLocationMap.forEach((Uri uri, Map<int, List<SourceLocation>> uriMap) {
@@ -552,10 +552,10 @@ String computeDartHtmlPart(String name, SourceFileManager sourceFileManager,
for (int i = 0; i < locations.length; i++) {
SourceLocation sourceLocation = locations[i];
int index = collection.getIndex(sourceLocation);
- int start = sourceLocation.column;
+ int start = sourceLocation.column - 1;
int end = line.length;
if (i + 1 < locations.length) {
- end = locations[i + 1].column;
+ end = locations[i + 1].column - 1;
}
if (i == 0) {
codeBuffer.write(lineNumber(lineIndex, width: lineNoWidth));
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698