Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: pkg/source_maps/lib/builder.dart

Issue 19019006: Fix bug in source-maps parsing: parser failed when most information could be (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/source_maps/lib/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | pkg/source_maps/lib/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698