| 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 b3cd932004444890e3329a7297c62e6483611274..e164f011e07d6eda46afccbe1c4f6ed71c2af3d1 100644
|
| --- a/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart
|
| +++ b/pkg/dev_compiler/lib/src/compiler/source_map_printer.dart
|
| @@ -19,6 +19,9 @@ class SourceMapPrintingContext extends JS.SimpleJavaScriptPrintingContext {
|
| /// The source_maps builder we write JavaScript code to.
|
| final sourceMap = new SourceMapBuilder();
|
|
|
| + /// The cache of URIs for paths.
|
| + final _sourceUrlCache = <String, Object>{};
|
| +
|
| CompilationUnit unit;
|
| String sourcePath;
|
| AstNode _currentTopLevelDeclaration;
|
| @@ -97,10 +100,12 @@ 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);
|
| + var sourceUrl = _sourceUrlCache.putIfAbsent(
|
| + sourcePath,
|
| + () =>
|
| + sourcePath.startsWith('dart:') || sourcePath.startsWith('package:')
|
| + ? sourcePath
|
| + : new Uri.file(sourcePath));
|
| sourceMap.addLocation(
|
| new SourceLocation(offset,
|
| sourceUrl: sourceUrl,
|
|
|