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

Unified Diff: lib/compiler/implementation/source_map_builder.dart

Issue 10911091: Add empty mapping entries for the ranges of generated JavaScript that don't map to any Dart source … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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: lib/compiler/implementation/source_map_builder.dart
diff --git a/lib/compiler/implementation/source_map_builder.dart b/lib/compiler/implementation/source_map_builder.dart
index 39798573d5c6cb6368e0df120fb57671534715fd..5fffa63c84411c122b04433ba4daf39fc6568b17 100644
--- a/lib/compiler/implementation/source_map_builder.dart
+++ b/lib/compiler/implementation/source_map_builder.dart
@@ -70,16 +70,19 @@ class SourceMapBuilder {
}
void writeEntry(_Entry entry, SourceFile targetFile, StringBuffer output) {
- SourceFile sourceFile = entry.sourceFile;
- if (sourceFile === null || entry.sourceOffset >= sourceFile.text.length) {
- return;
- }
-
int targetLine = targetFile.getLine(entry.targetOffset);
int targetColumn = targetFile.getColumn(targetLine, entry.targetOffset);
- String sourceUrl = sourceFile.filename;
- int sourceLine = sourceFile.getLine(entry.sourceOffset);
- int sourceColumn = sourceFile.getColumn(sourceLine, entry.sourceOffset);
+ String sourceUrl;
+ int sourceLine;
+ int sourceColumn;
+ SourceFile sourceFile = entry.sourceFile;
+ // TODO(podivilov): make sure enties are always associated with the right
floitsch 2012/09/05 14:22:18 entries
podivilov 2012/09/06 10:52:25 Done.
+ // source file.
+ if (sourceFile != null && entry.sourceOffset < sourceFile.text.length) {
+ sourceUrl = sourceFile.filename;
+ sourceLine = sourceFile.getLine(entry.sourceOffset);
+ sourceColumn = sourceFile.getColumn(sourceLine, entry.sourceOffset);
+ }
String sourceName = entry.sourceName;
if (targetLine > previousTargetLine) {

Powered by Google App Engine
This is Rietveld 408576698