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 a17005964d5a09eb2c0d6d316229a648bf2d91c7..322138959091a10f851418cc8608cc8059b10d37 100644 |
--- a/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart |
+++ b/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart |
@@ -49,8 +49,14 @@ class SourceMapPrintingContext extends JS.SimpleJavaScriptPrintingContext { |
// parts. |
_currentTopLevelDeclaration = node; |
unit = node.getAncestor((n) => n is CompilationUnit); |
+ var source = resolutionMap.elementDeclaredByCompilationUnit(unit).source; |
+ // Use the uri for dart: uris instead of the path of the source file |
+ // on disk as that results in much cleaner stack traces. |
+ // Example: |
+ // source.uri = dart:core/object.dart |
+ // source.fullName = gen/patched_sdk/lib/core/object.dart |
sourcePath = |
- resolutionMap.elementDeclaredByCompilationUnit(unit).source.fullName; |
+ source.isInSystemLibrary ? source.uri.toString() : source.fullName; |
} |
Jacob
2017/04/15 02:26:49
Jenny please review this change. This switches to
Jennifer Messerly
2017/04/17 21:37:05
Nice!!!
|
// Skip MethodDeclarations - in the case of a one line function it finds the |
// declaration rather than the body and confuses devtools. |