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

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

Issue 2833633002: Various DDC fixes for windows (Closed)
Patch Set: 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
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..a486f1a5f9a4c08d2cb0638d22434d157d806ca4 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,8 @@ 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;
Jennifer Messerly 2017/04/20 18:22:39 I think this needs to be { ... } per style guide
vsm 2017/04/20 18:29:05 Done
// 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 +96,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),

Powered by Google App Engine
This is Rietveld 408576698