Improve the readability of some human-consumed strings in source_maps. R=jmesserly@google.com Review URL: https://codereview.chromium.org//346983002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/source_maps@37530 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkgs/source_maps/CHANGELOG.md b/pkgs/source_maps/CHANGELOG.md index 3730a10..55d7896 100644 --- a/pkgs/source_maps/CHANGELOG.md +++ b/pkgs/source_maps/CHANGELOG.md
@@ -1,3 +1,8 @@ +## 0.9.2+1 + +* Minor readability improvements to `FixedSpan.getLocationMessage` and + `SpanException.toString`. + ## 0.9.2 * Add `SpanException` and `SpanFormatException` classes.
diff --git a/pkgs/source_maps/lib/span.dart b/pkgs/source_maps/lib/span.dart index cc48f19..91cfcd3 100644 --- a/pkgs/source_maps/lib/span.dart +++ b/pkgs/source_maps/lib/span.dart
@@ -64,7 +64,9 @@ String getLocationMessage(String message, {bool useColors: false, String color}) { - return '$formatLocation: $message'; + var source = url == null ? '' : ' of ${p.prettyUri(url)}'; + return 'line ${start.line + 1}, column ${start.column + 1}$source: ' + + message; } bool operator ==(Span other) => @@ -375,7 +377,8 @@ String toString({bool useColors: false, String color}) { if (span == null) return message; - return span.getLocationMessage(message, useColors: useColors, color: color); + return "Error on " + span.getLocationMessage(message, + useColors: useColors, color: color); } }
diff --git a/pkgs/source_maps/pubspec.yaml b/pkgs/source_maps/pubspec.yaml index 213587c..7fae470 100644 --- a/pkgs/source_maps/pubspec.yaml +++ b/pkgs/source_maps/pubspec.yaml
@@ -1,5 +1,5 @@ name: source_maps -version: 0.9.2 +version: 0.9.2+1 author: Dart Team <misc@dartlang.org> description: Library to programmatically manipulate source map files. homepage: http://www.dartlang.org