Index: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
index 66cf22a69de2bb74e33ef1b021dba5cd603277b5..7220da51fd2b54feb3a45bd04803f4e93cb71b69 100644 |
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
@@ -1547,7 +1547,10 @@ if (typeof $printHelperName === "function") { |
void outputSourceMap(String code, String name) { |
if (!generateSourceMap) return; |
- SourceFile compiledFile = new SourceFile(null, compiler.assembledCode); |
+ // Create a source file for the compilation output. This allows using |
+ // [:getLine:] to transform offsets to line numbers in [SourceMapBuilder]. |
+ SourceFile compiledFile = |
+ new StringSourceFile(null, compiler.assembledCode); |
String sourceMap = buildSourceMap(mainBuffer, compiledFile); |
compiler.outputProvider(name, 'js.map') |
..add(sourceMap) |