Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java

Issue 8287001: Add a command-line option for generating source maps. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java
===================================================================
--- compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java (revision 471)
+++ compiler/java/com/google/dart/compiler/backend/js/AbstractJsBackend.java (working copy)
@@ -63,6 +63,8 @@
private static final String STATICS_PART_NAME = "$statics$";
private static final String SEPARATOR_PART_NAME = "$seperator$";
+ protected final DartMangler mangler = new DollarMangler();
+
protected static class Part {
final LibraryUnit lib;
final DartUnit unit;
@@ -313,8 +315,6 @@
}
}
- protected final DartMangler mangler = new DollarMangler();
-
protected Map<String, JsProgram> translateToJS(DartUnit unit, DartCompilerContext context,
CoreTypeProvider typeProvider) {
TraceEvent logEvent =
@@ -529,7 +529,7 @@
* Currently, out of date checks require that we write a JS file even if it is empty.
* However, we should not write a map file if it is.
*/
- if (!globalBlock.getStatements().isEmpty()) {
+ if (!globalBlock.getStatements().isEmpty() && generateSourceMap(context)) {
TraceEvent sourcemapEvent =
Tracer.canTrace() ? Tracer.start(DartEventType.WRITE_SOURCE_MAP, "src", srcName,
"name", name) : null;
@@ -555,4 +555,8 @@
protected boolean generateClosureCompatibleCode() {
return false;
}
+
+ protected boolean generateSourceMap(DartCompilerContext context) {
+ return context.getCompilerConfiguration().getCompilerOptions().generateSourceMaps();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698