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

Unified Diff: pkg/compiler/lib/src/io/source_map_builder.dart

Issue 2654023003: Add no-info mappings at start of out.js and after mapped functions (Closed)
Patch Set: fixes Created 3 years, 11 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/compiler/lib/src/io/source_information.dart ('k') | tests/compiler/dart2js/sourcemaps/js_tracer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/io/source_map_builder.dart
diff --git a/pkg/compiler/lib/src/io/source_map_builder.dart b/pkg/compiler/lib/src/io/source_map_builder.dart
index c3e6f5f76afd693e42d242513757e1909a335018..e7c12aae1c8caeb624e7a9dd04146a3249b1e436 100644
--- a/pkg/compiler/lib/src/io/source_map_builder.dart
+++ b/pkg/compiler/lib/src/io/source_map_builder.dart
@@ -52,10 +52,13 @@ class SourceMapBuilder {
SourceLocation location = sourceMapEntry.sourceLocation;
if (location != null) {
- LineColumnMap<SourceMapEntry> sourceLineColumnMap =
- sourceLocationMap.putIfAbsent(
- location.sourceUri, () => new LineColumnMap<SourceMapEntry>());
- sourceLineColumnMap.add(location.line, location.column, sourceMapEntry);
+ if (location.sourceUri != null) {
+ LineColumnMap<SourceMapEntry> sourceLineColumnMap =
+ sourceLocationMap.putIfAbsent(location.sourceUri,
+ () => new LineColumnMap<SourceMapEntry>());
+ sourceLineColumnMap.add(
+ location.line, location.column, sourceMapEntry);
+ }
}
});
@@ -69,9 +72,11 @@ class SourceMapBuilder {
lineColumnMap.forEachElement((SourceMapEntry entry) {
SourceLocation sourceLocation = entry.sourceLocation;
if (sourceLocation != null) {
- uriMap.register(sourceLocation.sourceUri);
- if (sourceLocation.sourceName != null) {
- nameMap.register(sourceLocation.sourceName);
+ if (sourceLocation.sourceUri != null) {
+ uriMap.register(sourceLocation.sourceUri);
+ if (sourceLocation.sourceName != null) {
+ nameMap.register(sourceLocation.sourceName);
+ }
}
}
});
@@ -143,9 +148,11 @@ class SourceMapBuilder {
}
Uri sourceUri = sourceLocation.sourceUri;
- sourceUriIndexEncoder.encode(output, uriMap[sourceUri]);
- sourceLineEncoder.encode(output, sourceLocation.line);
- sourceColumnEncoder.encode(output, sourceLocation.column);
+ if (sourceUri != null) {
+ sourceUriIndexEncoder.encode(output, uriMap[sourceUri]);
+ sourceLineEncoder.encode(output, sourceLocation.line);
+ sourceColumnEncoder.encode(output, sourceLocation.column);
+ }
String sourceName = sourceLocation.sourceName;
if (sourceName != null) {
« no previous file with comments | « pkg/compiler/lib/src/io/source_information.dart ('k') | tests/compiler/dart2js/sourcemaps/js_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698