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

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

Issue 237123003: Support unmapped areas in source maps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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') | pkg/source_maps/lib/parser.dart » ('J')
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 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;
}
« no previous file with comments | « no previous file | pkg/source_maps/lib/parser.dart » ('j') | pkg/source_maps/lib/parser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698