Chromium Code Reviews| Index: pkg/source_maps/lib/builder.dart |
| diff --git a/pkg/source_maps/lib/builder.dart b/pkg/source_maps/lib/builder.dart |
| index 12587cd84bf1ee2d235987e1310e36760b0016dc..d063bf5dab2e0389514c7f922f8c7f47b52203f0 100644 |
| --- a/pkg/source_maps/lib/builder.dart |
| +++ b/pkg/source_maps/lib/builder.dart |
| @@ -51,10 +51,10 @@ class SourceMapBuilder { |
| var buff = new StringBuffer(); |
| var line = 0; |
| var column = 0; |
| - var srcLine = 0; |
| - var srcColumn = 0; |
| - var srcUrlId = 0; |
| - var srcNameId = 0; |
| + var srcLine = null; |
| + var srcColumn = null; |
| + var srcUrlId = null; |
| + var srcNameId = null; |
| var first = true; |
| // The encoding needs to be sorted by the target offsets. |
| @@ -75,15 +75,10 @@ class SourceMapBuilder { |
| column = _append(buff, column, entry.target.column); |
| // Encoding can be just the column offset if there is no source |
| - // information, or if two consecutive mappings share exactly the same |
| - // source information. |
| + // information. |
| var source = entry.source; |
| if (source == null) continue; |
| var newUrlId = _indexOf(_urls, source.sourceUrl); |
| - if (newUrlId == srcUrlId && source.line == srcLine |
| - && source.column == srcColumn && entry.identifierName == null) { |
| - continue; |
| - } |
| srcUrlId = _append(buff, srcUrlId, newUrlId); |
| srcLine = _append(buff, srcLine, source.line); |
| @@ -122,6 +117,9 @@ class SourceMapBuilder { |
| /// Appends to [buff] a VLQ encoding of [newValue] using the difference |
| /// between [oldValue] and [newValue] |
| static int _append(StringBuffer buff, int oldValue, int newValue) { |
| + if (oldValue == null) { |
|
Siggi Cherem (dart-lang)
2014/04/18 02:00:31
I might be missing something, could we simply reve
zarah
2014/04/23 07:52:12
I don't think you are :-), Done.
|
| + oldValue = 0; |
| + } |
| buff.writeAll(encodeVlq(newValue - oldValue)); |
| return newValue; |
| } |