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

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 9346021: Turn off code generation in dartc by default, soon to be static analysis only (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Feedback from scheglov Created 8 years, 10 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/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;

Powered by Google App Engine
This is Rietveld 408576698