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

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: Adressed comments. 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 | « pkg/source_maps/lib/builder.dart ('k') | pkg/source_maps/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c92a8bba0ba917699ae7ffa516f2c1740db296ef 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) {
@@ -204,8 +204,8 @@ class SingleMapping extends Mapping {
throw new StateError(
'Invalid name id: $targetUrl, $line, $srcNameId');
}
- entries.add(
- new TargetEntry(column, srcUrlId, srcLine, srcColumn, srcNameId));
+ entries.add(new TargetEntry(column, srcUrlId, srcLine, srcColumn,
+ srcNameId));
}
}
if (tokenizer.nextKind.isNewSegment) tokenizer._consumeNewSegment();
@@ -242,7 +242,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 +322,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)';
« no previous file with comments | « pkg/source_maps/lib/builder.dart ('k') | pkg/source_maps/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698