Chromium Code Reviews| Index: pkg/source_maps/lib/span.dart |
| diff --git a/pkg/source_maps/lib/span.dart b/pkg/source_maps/lib/span.dart |
| index 1d2152da70c4e59c7ff0a1b58d9dcac0f8c28af6..e5057fcebd717785f9c1330b877d9045c1250d61 100644 |
| --- a/pkg/source_maps/lib/span.dart |
| +++ b/pkg/source_maps/lib/span.dart |
| @@ -69,7 +69,7 @@ abstract class Span implements Comparable { |
| bool operator ==(Span other) => |
| sourceUrl == other.sourceUrl && start == other.start && end == other.end; |
| - int get hashCode => sourceUrl.hashCode + start + (31 * (end - start)); |
| + int get hashCode => sourceUrl.hashCode + start.offset + (31 * length); |
|
justinfagnani
2013/07/26 00:44:22
length includes information from start.offset alre
Siggi Cherem (dart-lang)
2013/07/26 00:50:12
I could argue the opposite: end.offset is always >
|
| String toString() => '<$runtimeType: $start $end $formatLocation $text>'; |
| } |
| @@ -99,6 +99,11 @@ abstract class Location implements Comparable { |
| return offset - other.offset; |
| } |
| + bool operator ==(Location other) => |
| + sourceUrl == other.sourceUrl && offset == other.offset; |
| + |
| + int get hashCode => sourceUrl.hashCode + offset; |
| + |
| String toString() => '(Location $offset)'; |
| String get formatString => '$sourceUrl:${line + 1}:${column + 1}'; |
| } |