Index: dart/compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java |
diff --git a/dart/compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java b/dart/compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java |
index badebcef8641525af7e5aa18f9aa1b31cda1f562..4cc2a1db926c6b551225d42a25bf94ca12d8d3a7 100644 |
--- a/dart/compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java |
+++ b/dart/compiler/java/com/google/dart/compiler/backend/js/JavascriptBackend.java |
@@ -13,11 +13,8 @@ import com.google.dart.compiler.LibrarySource; |
import com.google.dart.compiler.ast.LibraryNode; |
import com.google.dart.compiler.ast.LibraryUnit; |
import com.google.dart.compiler.backend.js.analysis.TreeShaker; |
-import com.google.dart.compiler.common.GenerateSourceMap; |
import com.google.dart.compiler.metrics.CompilerMetrics; |
import com.google.dart.compiler.resolver.CoreTypeProvider; |
-import com.google.debugging.sourcemap.FilePosition; |
-import com.google.debugging.sourcemap.SourceMapSection; |
import java.io.IOException; |
import java.io.Reader; |
@@ -41,10 +38,6 @@ public class JavascriptBackend extends AbstractJsBackend { |
private int column = 0; |
private Appendable out; |
private long charCount = 0; |
- |
- FilePosition getOffset() { |
- return new FilePosition(line, column); |
- } |
CountingAppendable(Appendable out) { |
this.out = out; |
@@ -89,14 +82,11 @@ public class JavascriptBackend extends AbstractJsBackend { |
private static class DepsWritingCallback implements DepsCallback { |
private final DartCompilerContext context; |
private CountingAppendable out; |
- private final List<SourceMapSection> appSections; |
DepsWritingCallback( |
DartCompilerContext context, |
- CountingAppendable out, |
- List<SourceMapSection> appSections) { |
+ CountingAppendable out) { |
this.out = out; |
this.context = context; |
- this.appSections = appSections; |
} |
@Override |
@@ -115,8 +105,6 @@ public class JavascriptBackend extends AbstractJsBackend { |
if (r == null) { |
return; |
} |
- FilePosition offset = out.getOffset(); |
- assert(src != null); |
long partSize = 0; |
boolean failed = true; |
@@ -126,13 +114,6 @@ public class JavascriptBackend extends AbstractJsBackend { |
} finally { |
Closeables.close(r, failed); |
} |
- |
- if (partSize > 0) { |
- String mapUrl = context.getArtifactUri(src, part.part, EXTENSION_JS_SRC_MAP).toString(); |
- SourceMapSection sourceMapSection = |
- SourceMapSection.forURL(mapUrl, offset.getLine(), offset.getColumn()); |
- appSections.add(sourceMapSection); |
- } |
} |
public long getCharsWritten() { |
@@ -141,11 +122,10 @@ public class JavascriptBackend extends AbstractJsBackend { |
} |
private static long packageLibs(Writer w, |
- List<SourceMapSection> appSections, |
DartCompilerContext context) throws IOException { |
final CountingAppendable out = new CountingAppendable(w); |
- DepsWritingCallback callback = new DepsWritingCallback(context, out, appSections); |
+ DepsWritingCallback callback = new DepsWritingCallback(context, out); |
DependencyBuilder.build(context.getAppLibraryUnit(), callback); |
return callback.getCharsWritten(); |
} |
@@ -160,7 +140,6 @@ public class JavascriptBackend extends AbstractJsBackend { |
LibraryUnit appLibraryUnit = context.getAppLibraryUnit(); |
boolean hasEntryPoint = appLibraryUnit.getElement().getEntryPoint() != null; |
- List<SourceMapSection> appSections = Lists.newArrayList(); |
String completeArtifactName = EXTENSION_APP_JS; |
if (hasEntryPoint) { |
// Apps with entry points will be reduced so we write into a different file name |
@@ -172,7 +151,7 @@ public class JavascriptBackend extends AbstractJsBackend { |
boolean failed = true; |
try { |
// Emit the concatenated Javascript sources in dependency order. |
- outputFileSize = packageLibs(out, appSections, context); |
+ outputFileSize = packageLibs(out, context); |
outputFileSize += writeEntryPointCall(getMangledEntryPoint(context), out); |
failed = false; |
} finally { |
@@ -195,32 +174,10 @@ public class JavascriptBackend extends AbstractJsBackend { |
if (compilerMetrics != null) { |
compilerMetrics.packagedJsApplication(outputFileSize, -1); |
} |
- |
- Writer srcMapOut = context.getArtifactWriter(app, "", EXTENSION_APP_JS_SRC_MAP); |
- failed = true; |
- try { |
- // TODO(johnlenz): settle how we want to get a reference to the app |
- // output. Do we want this to be a filename, a URL, both? |
- new GenerateSourceMap().appendIndexMapTo(srcMapOut, app.getName() + "." |
- + EXTENSION_JS, appSections); |
- failed = false; |
- } finally { |
- Closeables.close(srcMapOut, failed); |
- } |
} |
@Override |
public String getAppExtension() { |
return EXTENSION_APP_JS; |
} |
- |
- @Override |
- public String getSourceMapExtension() { |
- return EXTENSION_APP_JS_SRC_MAP; |
- } |
- |
- @Override |
- protected boolean shouldOptimize() { |
- return false; |
- } |
} |