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 ad80fa00093184e3bea79adb2a30cd6417d688b7..36c675905b325363b567a5550aedc2e78cf1c491 100644 |
| --- a/pkg/source_maps/lib/builder.dart |
| +++ b/pkg/source_maps/lib/builder.dart |
| @@ -74,12 +74,20 @@ class SourceMapBuilder { |
| first = false; |
| column = _append(buff, column, entry.target.column); |
| - if (entry.source == null) continue; |
| + // Encoding can be just the column offset if there is no source |
| + // information, or if two consecutive mappings share exactly the same |
| + // source infromation. |
|
dgrove
2013/07/12 22:49:20
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, |
| - _indexOf(_urls, entry.source.sourceUrl)); |
| - srcLine = _append(buff, srcLine, entry.source.line); |
| - srcColumn = _append(buff, srcColumn, entry.source.column); |
| + srcUrlId = _append(buff, srcUrlId, newUrlId); |
| + srcLine = _append(buff, srcLine, source.line); |
| + srcColumn = _append(buff, srcColumn, source.column); |
| if (entry.identifierName == null) continue; |
| srcNameId = _append(buff, srcNameId, |