Chromium Code Reviews| Index: compiler/java/com/google/dart/runner/DartRunner.java |
| =================================================================== |
| --- compiler/java/com/google/dart/runner/DartRunner.java (revision 471) |
| +++ 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()); |
|
mmendez
2011/10/17 19:34:24
This follows the existing pattern but, CharStreams
John Lenz
2011/10/17 20:06:29
Easy change. Done.
|
| + 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()); |