Chromium Code Reviews| 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 664aee520ae8387c2c1a37fc22fbc7eec6eeed81..34ad40f885239e49de62a69a0566ffb2e65809b0 100644 |
| --- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
| +++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
| @@ -174,6 +174,8 @@ abstract class Compiler implements DiagnosticListener { |
| */ |
| final bool preserveComments; |
| + final api.CompilerOutputProvider outputProvider; |
| + |
| bool disableInlining = false; |
| final Tracer tracer; |
| @@ -299,9 +301,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); |
| @@ -1079,3 +1085,21 @@ bool invariant(Spannable spannable, var condition, {String message: null}) { |
| } |
| return true; |
| } |
| + |
| +/// A sink that drains into /dev/null. |
|
ngeoffray
2013/01/10 12:15:21
Really?
ahe
2013/01/25 15:50:09
For all intents and purposes. If you can observe t
|
| +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 outputProvider(String name, String extension) { |
|
ngeoffray
2013/01/10 12:15:21
Use the typedef for the return type?
ahe
2013/01/25 15:50:09
Done.
|
| + return new NullSink('$name.$extension'); |
| + } |
| +} |