Change "FormatException.position" to be named "offset". Address comments on SpanFormatException changes. R=nweiz@google.com Review URL: https://codereview.chromium.org//396603003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/source_maps@38373 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/pkgs/source_maps/CHANGELOG.md b/pkgs/source_maps/CHANGELOG.md index 7767fc1..c52d585 100644 --- a/pkgs/source_maps/CHANGELOG.md +++ b/pkgs/source_maps/CHANGELOG.md
@@ -1,3 +1,7 @@ +## 0.9.4 + +* Update `SpanFormatException` with `source` and `offset`. + ## 0.9.3 * Support writing SingleMapping objects to source map version 3 format.
diff --git a/pkgs/source_maps/lib/span.dart b/pkgs/source_maps/lib/span.dart index 771e9e0..7b513e6 100644 --- a/pkgs/source_maps/lib/span.dart +++ b/pkgs/source_maps/lib/span.dart
@@ -385,9 +385,10 @@ /// A [SpanException] that's also a [FormatException]. class SpanFormatException extends SpanException implements FormatException { - SpanFormatException(String message, Span span) + final source; + + SpanFormatException(String message, Span span, [this.source]) : super(message, span); - get source => null; - int get position => null; + int get position => span == null ? null : span.start.offset; }
diff --git a/pkgs/source_maps/pubspec.yaml b/pkgs/source_maps/pubspec.yaml index ae0323d..c5029e2 100644 --- a/pkgs/source_maps/pubspec.yaml +++ b/pkgs/source_maps/pubspec.yaml
@@ -7,7 +7,7 @@ # # When the minor version is upgraded, you *must* update that version constraint # in pub to stay in sync with this. -version: 0.9.3 +version: 0.9.4 author: Dart Team <misc@dartlang.org> description: Library to programmatically manipulate source map files. homepage: http://www.dartlang.org