Index: tests/compiler/dart2js/output_collector.dart |
diff --git a/tests/compiler/dart2js/output_collector.dart b/tests/compiler/dart2js/output_collector.dart |
index c6bc101a7f8b22f99ba065704aec89a46b69ff7a..d2d3af4fc04f6e598432653ae654d929121863d3 100644 |
--- a/tests/compiler/dart2js/output_collector.dart |
+++ b/tests/compiler/dart2js/output_collector.dart |
@@ -26,6 +26,29 @@ class BufferedEventSink implements EventSink<String> { |
} |
} |
+class CloningEventSink implements EventSink<String> { |
+ final List<EventSink<String>> sinks; |
+ |
+ CloningEventSink(this.sinks); |
+ |
+ @override |
+ void add(String event) { |
+ sinks.forEach((EventSink<String> sink) => sink.add(event)); |
+ } |
+ |
+ @override |
+ void addError(errorEvent, [StackTrace stackTrace]) { |
+ sinks.forEach((EventSink<String> sink) { |
+ sink.addError(errorEvent, stackTrace); |
+ }); |
+ } |
+ |
+ @override |
+ void close() { |
+ sinks.forEach((EventSink<String> sink) => sink.close()); |
+ } |
+} |
+ |
class OutputCollector { |
Map<String, Map<String, BufferedEventSink>> outputMap = {}; |