Chromium Code Reviews| Index: compiler/java/com/google/dart/runner/DartRunner.java |
| diff --git a/compiler/java/com/google/dart/runner/DartRunner.java b/compiler/java/com/google/dart/runner/DartRunner.java |
| index 3ee4a259eb1576bb7f1f7f116da8d92b9deb178a..2beff762f604ca5815c755195b263e2078f27273 100644 |
| --- a/compiler/java/com/google/dart/runner/DartRunner.java |
| +++ b/compiler/java/com/google/dart/runner/DartRunner.java |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| @@ -158,7 +158,7 @@ public class DartRunner { |
| } |
| } |
| - if (!options.shouldCompileOnly()) { |
| + if (!options.shouldCompileOnly() && !options.checkOnly()) { |
| runApp(compiled, app.getName(), options, scriptArguments.toArray(new String[0]), |
| stdout, stderr); |
| } |
| @@ -242,7 +242,7 @@ public class DartRunner { |
| PrintStream stderr) |
| throws RunnerError { |
| CompilationResult compiled = compileApp( |
| - app, Collections.<LibrarySource>emptyList(), config, listener); |
| + app, Collections.<LibrarySource>emptyList(), config, listener, options); |
| runApp(compiled, app.getName(), options, dartArguments, stdout, stderr); |
| } |
| @@ -293,7 +293,7 @@ public class DartRunner { |
| return options.typeErrorsAreFatal(); |
| } |
| }; |
| - return compileApp(app, imports, config, listener); |
| + return compileApp(app, imports, config, listener, options); |
| } |
| /** |
| @@ -302,7 +302,8 @@ public class DartRunner { |
| private static CompilationResult compileApp(LibrarySource app, |
| List<LibrarySource> imports, |
| CompilerConfiguration config, |
| - DartCompilerListener listener) throws RunnerError { |
| + DartCompilerListener listener, |
| + final DartRunnerOptions options) throws RunnerError { |
|
scheglov
2012/02/06 13:09:54
Would be good to use same order or arguments as in
zundel
2012/02/06 16:01:56
Done.
|
| try { |
| final RunnerDartArtifactProvider provider = new RunnerDartArtifactProvider(); |
| String errmsg = DartCompiler.compileLib(app, imports, config, provider, listener); |
| @@ -337,10 +338,13 @@ public class DartRunner { |
| } |
| } |
| - Reader r = provider.getArtifactReader(app, "", backend.getAppExtension()); |
| - String js = CharStreams.toString(r); |
| - r.close(); |
| - return new CompilationResult(js, mapping); |
| + if (!options.checkOnly()) { |
| + Reader r = provider.getArtifactReader(app, "", backend.getAppExtension()); |
| + String js = CharStreams.toString(r); |
| + r.close(); |
| + return new CompilationResult(js, mapping); |
| + } |
| + return null; |
| } catch (IOException e) { |
| // This can't happen; it's just a StringWriter. |
| throw new AssertionError(e); |