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

Unified Diff: pkg/dev_compiler/lib/src/compiler/source_map_printer.dart

Issue 2833633002: Various DDC fixes for windows (Closed)
Patch Set: Fix formatting Created 3 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/dev_compiler/lib/src/compiler/compiler.dart ('k') | pkg/dev_compiler/test/codegen_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/source_map_printer.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart b/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart
index 322138959091a10f851418cc8608cc8059b10d37..b3cd932004444890e3329a7297c62e6483611274 100644
--- a/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart
+++ b/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart
@@ -66,7 +66,9 @@ class SourceMapPrintingContext extends JS.SimpleJavaScriptPrintingContext {
void exitNode(JS.Node jsNode) {
AstNode node = jsNode.sourceInformation;
- if (unit == null || node == null || node.offset == -1) return;
+ if (unit == null || node == null || node.offset == -1 || node.isSynthetic) {
+ return;
+ }
// TODO(jmesserly): in many cases marking the end will be unnecessary.
// Skip MethodDeclarations - in the case of a one line function it finds the
@@ -95,9 +97,13 @@ class SourceMapPrintingContext extends JS.SimpleJavaScriptPrintingContext {
if (next.lineNumber == loc.lineNumber + 1) {
loc = next;
}
+ var sourceUrl =
+ sourcePath.startsWith('dart:') || sourcePath.startsWith('package:')
+ ? sourcePath
+ : new Uri.file(sourcePath);
sourceMap.addLocation(
new SourceLocation(offset,
- sourceUrl: sourcePath,
+ sourceUrl: sourceUrl,
line: loc.lineNumber - 1,
column: loc.columnNumber - 1),
new SourceLocation(buffer.length, line: _line, column: _column),
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/compiler.dart ('k') | pkg/dev_compiler/test/codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698