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

Unified Diff: compiler/java/com/google/dart/runner/DartRunner.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/runner/DartRunner.java
===================================================================
--- compiler/java/com/google/dart/runner/DartRunner.java (revision 409)
+++ compiler/java/com/google/dart/runner/DartRunner.java (working copy)
@@ -373,26 +373,28 @@
Backend backend = config.getBackends().get(0);
SourceMapping mapping = null;
- Reader mr = provider.getArtifactReader(app, "", backend.getSourceMapExtension());
- if (mr != null) {
- String mapContents = CharStreams.toString(mr);
- try {
- mapping = SourceMapConsumerFactory.parse(mapContents, new SourceMapSupplier() {
+ if (config.getCompilerOptions().generateSourceMaps()) {
+ Reader mr = provider.getArtifactReader(app, "", backend.getSourceMapExtension());
+ if (mr != null) {
+ String mapContents = CharStreams.toString(mr);
+ try {
+ mapping = SourceMapConsumerFactory.parse(mapContents, new SourceMapSupplier() {
- @Override
- public String getSourceMap(String url) {
- String contents = provider.getGeneratedFileContents(url);
- if (contents == null || contents.isEmpty()) {
- return null;
+ @Override
+ public String getSourceMap(String url) {
+ String contents = provider.getGeneratedFileContents(url);
+ if (contents == null || contents.isEmpty()) {
+ return null;
+ }
+ return contents;
}
- return contents;
- }
- });
- } catch (SourceMapParseException e) {
- throw new AssertionError(e);
+ });
+ } catch (SourceMapParseException e) {
+ throw new AssertionError(e);
+ }
+ mr.close();
}
- mr.close();
}
Reader r = provider.getArtifactReader(app, "", backend.getAppExtension());

Powered by Google App Engine
This is Rietveld 408576698