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

Unified Diff: pkg/source_maps/lib/parser.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
Index: pkg/source_maps/lib/parser.dart
diff --git a/pkg/source_maps/lib/parser.dart b/pkg/source_maps/lib/parser.dart
index 6b8bf378089dc55f89822db1b10c72deb62bd6b3..114209ced880d0715ccd60c3021603ea6abce725 100644
--- a/pkg/source_maps/lib/parser.dart
+++ b/pkg/source_maps/lib/parser.dart
@@ -185,7 +185,7 @@ class SingleMapping extends Mapping {
if (tokenizer.nextKind.isNewSegment) throw _segmentError(0, line);
column += tokenizer._consumeValue();
if (!tokenizer.nextKind.isValue) {
- entries.add(new TargetEntry(column, srcUrlId, srcLine, srcColumn));
+ entries.add(new TargetEntry(column));
} else {
srcUrlId += tokenizer._consumeValue();
if (srcUrlId >= urls.length) {
@@ -197,7 +197,10 @@ class SingleMapping extends Mapping {
if (!tokenizer.nextKind.isValue) throw _segmentError(3, line);
srcColumn += tokenizer._consumeValue();
if (!tokenizer.nextKind.isValue) {
- entries.add(new TargetEntry(column, srcUrlId, srcLine, srcColumn));
+ entries.add(new TargetEntry(column,
+ sourceUrlId: srcUrlId,
Siggi Cherem (dart-lang) 2014/04/18 02:00:31 nit: just to match the style we use in this packag
Siggi Cherem (dart-lang) 2014/04/22 18:12:44 Thinking more about it, let's switch back to posit
zarah 2014/04/23 07:52:12 Done.
zarah 2014/04/23 07:52:12 Updated to 0.9.1-dev .
+ sourceLine: srcLine,
+ sourceColumn: srcColumn));
} else {
srcNameId += tokenizer._consumeValue();
if (srcNameId >= names.length) {
@@ -205,7 +208,11 @@ class SingleMapping extends Mapping {
'Invalid name id: $targetUrl, $line, $srcNameId');
}
entries.add(
- new TargetEntry(column, srcUrlId, srcLine, srcColumn, srcNameId));
+ new TargetEntry(column,
Siggi Cherem (dart-lang) 2014/04/18 02:00:31 similarly here. We can also move this 'new ..." to
zarah 2014/04/23 07:52:12 Done.
+ sourceUrlId: srcUrlId,
+ sourceLine: srcLine,
+ sourceColumn: srcColumn,
+ sourceNameId: srcNameId));
}
}
if (tokenizer.nextKind.isNewSegment) tokenizer._consumeNewSegment();
@@ -242,7 +249,7 @@ class SingleMapping extends Mapping {
Span spanFor(int line, int column, {Map<String, SourceFile> files}) {
var entry = _findColumn(line, column, _findLine(line));
- if (entry == null) return null;
+ if (entry == null || entry.sourceUrlId == null) return null;
var url = urls[entry.sourceUrlId];
if (files != null && files[url] != null) {
var file = files[url];
@@ -322,8 +329,8 @@ class TargetEntry {
final int sourceColumn;
final int sourceNameId;
- TargetEntry(this.column, this.sourceUrlId, this.sourceLine,
- this.sourceColumn, [this.sourceNameId]);
+ TargetEntry(this.column, {this.sourceUrlId, this.sourceLine,
+ this.sourceColumn, this.sourceNameId});
String toString() => '$runtimeType: '
'($column, $sourceUrlId, $sourceLine, $sourceColumn, $sourceNameId)';

Powered by Google App Engine
This is Rietveld 408576698