Chromium Code Reviews| 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), |