| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package com.google.dart.runner; | 5 package com.google.dart.runner; |
| 6 | 6 |
| 7 import com.google.common.base.Joiner; | 7 import com.google.common.base.Joiner; |
| 8 import com.google.common.collect.Lists; | 8 import com.google.common.collect.Lists; |
| 9 import com.google.common.io.CharStreams; | 9 import com.google.common.io.CharStreams; |
| 10 import com.google.common.io.Files; | 10 import com.google.common.io.Files; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 public CompilationResult(String js, SourceMapping mapping) { | 330 public CompilationResult(String js, SourceMapping mapping) { |
| 331 this.mapping = mapping; | 331 this.mapping = mapping; |
| 332 this.js = js; | 332 this.js = js; |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 | 335 |
| 336 private static CompilationResult compileApp (LibrarySource app, List<LibrarySo
urce> imports, | 336 private static CompilationResult compileApp (LibrarySource app, List<LibrarySo
urce> imports, |
| 337 final DartRunnerOptions options, DartCompilerListener listener) throws Run
nerError { | 337 final DartRunnerOptions options, DartCompilerListener listener) throws Run
nerError { |
| 338 Backend backend; | 338 Backend backend; |
| 339 if (options.shouldOptimize()) { | 339 if (options.shouldOptimize()) { |
| 340 backend = new ClosureJsBackend(options.generateHumanReadableOutput()); | 340 backend = new ClosureJsBackend( |
| 341 options.developerModeChecks(), |
| 342 options.generateHumanReadableOutput()); |
| 341 } else { | 343 } else { |
| 342 backend = new JavascriptBackend(); | 344 backend = new JavascriptBackend(); |
| 343 } | 345 } |
| 344 CompilerConfiguration config = new DefaultCompilerConfiguration(backend, opt
ions) { | 346 CompilerConfiguration config = new DefaultCompilerConfiguration(backend, opt
ions) { |
| 345 @Override | 347 @Override |
| 346 public boolean expectEntryPoint() { | 348 public boolean expectEntryPoint() { |
| 347 return true; | 349 return true; |
| 348 } | 350 } |
| 349 | 351 |
| 350 @Override | 352 @Override |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 Reader r = provider.getArtifactReader(app, "", backend.getAppExtension()); | 398 Reader r = provider.getArtifactReader(app, "", backend.getAppExtension()); |
| 397 String js = CharStreams.toString(r); | 399 String js = CharStreams.toString(r); |
| 398 r.close(); | 400 r.close(); |
| 399 return new CompilationResult(js, mapping); | 401 return new CompilationResult(js, mapping); |
| 400 } catch (IOException e) { | 402 } catch (IOException e) { |
| 401 // This can't happen; it's just a StringWriter. | 403 // This can't happen; it's just a StringWriter. |
| 402 throw new AssertionError(e); | 404 throw new AssertionError(e); |
| 403 } | 405 } |
| 404 } | 406 } |
| 405 } | 407 } |
| OLD | NEW |