| Index: compiler/java/com/google/dart/compiler/DartCompiler.java
|
| diff --git a/compiler/java/com/google/dart/compiler/DartCompiler.java b/compiler/java/com/google/dart/compiler/DartCompiler.java
|
| index 09dcbc592758934f69cc1e7929a62e33b92d0784..955ea44ec0236f057a01dcbc459c55ffbdc344a2 100644
|
| --- a/compiler/java/com/google/dart/compiler/DartCompiler.java
|
| +++ b/compiler/java/com/google/dart/compiler/DartCompiler.java
|
| @@ -1114,20 +1114,22 @@ public class DartCompiler {
|
| }
|
| }
|
|
|
| - Reader r = null;
|
| - try {
|
| - // HACK: there can be more than one backend. Since there isn't
|
| - // an obvious way to tell which one the user meant, for now
|
| - // just restrict the option to save the output if more than
|
| - // one is active.
|
| - r = provider.getArtifactReader(lib, "",
|
| - config.getBackends().get(0).getAppExtension());
|
| - String js = CharStreams.toString(r);
|
| - if (r != null) {
|
| - Files.write(js, outFile, Charset.defaultCharset());
|
| - }
|
| - } finally {
|
| - Closeables.close(r, true);
|
| + if (!config.getCompilerOptions().checkOnly()) {
|
| + Reader r = null;
|
| + try {
|
| + // HACK: there can be more than one backend. Since there isn't
|
| + // an obvious way to tell which one the user meant, for now
|
| + // just restrict the option to save the output if more than
|
| + // one is active.
|
| + r = provider.getArtifactReader(lib, "",
|
| + config.getBackends().get(0).getAppExtension());
|
| + String js = CharStreams.toString(r);
|
| + if (r != null) {
|
| + Files.write(js, outFile, Charset.defaultCharset());
|
| + }
|
| + } finally {
|
| + Closeables.close(r, true);
|
| + }
|
| }
|
| }
|
| return errorString;
|
|
|