| Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| index 0137e2f2dcf8766f0aa96b2e569ce73b52d4b5f7..854e0bc0832c61a5de86446c38f431ecc718cc22 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| @@ -203,6 +203,8 @@ abstract class Compiler implements DiagnosticListener {
|
| */
|
| final bool preserveComments;
|
|
|
| + final api.CompilerOutputProvider outputProvider;
|
| +
|
| bool disableInlining = false;
|
|
|
| List<Uri> librariesToAnalyzeWhenRun;
|
| @@ -331,9 +333,13 @@ abstract class Compiler implements DiagnosticListener {
|
| this.rejectDeprecatedFeatures: false,
|
| this.checkDeprecationInSdk: false,
|
| this.preserveComments: false,
|
| + outputProvider,
|
| List<String> strips: const []})
|
| : libraries = new Map<String, LibraryElement>(),
|
| - progress = new Stopwatch() {
|
| + progress = new Stopwatch(),
|
| + this.outputProvider =
|
| + (outputProvider == null) ? NullSink.outputProvider : outputProvider
|
| + {
|
| progress.start();
|
| world = new World(this);
|
|
|
| @@ -1087,3 +1093,21 @@ bool invariant(Spannable spannable, var condition, {String message: null}) {
|
| }
|
| return true;
|
| }
|
| +
|
| +/// A sink that drains into /dev/null.
|
| +class NullSink extends Sink<String> {
|
| + final String name;
|
| +
|
| + NullSink(this.name);
|
| +
|
| + add(String value) {}
|
| +
|
| + void close() {}
|
| +
|
| + toString() => name;
|
| +
|
| + /// Convenience method for getting an [api.CompilerOutputProvider].
|
| + static NullSink outputProvider(String name, String extension) {
|
| + return new NullSink('$name.$extension');
|
| + }
|
| +}
|
|
|