| Index: tests/compiler/dart2js/memory_compiler.dart
|
| diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart
|
| index 017db0a1428b298106fc84b848977a2c40b87776..88bc8e217c5f6fd8b1ad541ed206829bdb2750db 100644
|
| --- a/tests/compiler/dart2js/memory_compiler.dart
|
| +++ b/tests/compiler/dart2js/memory_compiler.dart
|
| @@ -20,8 +20,6 @@ import 'package:compiler/src/mirrors/analyze.dart';
|
| import 'package:compiler/src/library_loader.dart'
|
| show LoadedLibraries;
|
|
|
| -export 'output_collector.dart';
|
| -
|
| class DiagnosticMessage {
|
| final Uri uri;
|
| final int begin;
|
| @@ -64,6 +62,41 @@ class DiagnosticCollector {
|
| }
|
| }
|
|
|
| +class BufferedEventSink implements EventSink<String> {
|
| + StringBuffer sb = new StringBuffer();
|
| + String text;
|
| +
|
| + void add(String event) {
|
| + sb.write(event);
|
| + }
|
| +
|
| + void addError(errorEvent, [StackTrace stackTrace]) {
|
| + // Do not support this.
|
| + }
|
| +
|
| + void close() {
|
| + text = sb.toString();
|
| + sb = null;
|
| + }
|
| +}
|
| +
|
| +class OutputCollector {
|
| + Map<String, Map<String, BufferedEventSink>> outputMap = {};
|
| +
|
| + EventSink<String> call(String name, String extension) {
|
| + Map<String, BufferedEventSink> sinkMap =
|
| + outputMap.putIfAbsent(extension, () => {});
|
| + return sinkMap.putIfAbsent(name, () => new BufferedEventSink());
|
| + }
|
| +
|
| + String getOutput(String name, String extension) {
|
| + Map<String, BufferedEventSink> sinkMap = outputMap[extension];
|
| + if (sinkMap == null) return null;
|
| + BufferedEventSink sink = sinkMap[name];
|
| + return sink != null ? sink.text : null;
|
| + }
|
| +}
|
| +
|
| DiagnosticHandler createDiagnosticHandler(DiagnosticHandler diagnosticHandler,
|
| SourceFileProvider provider,
|
| bool showDiagnostics) {
|
| @@ -208,7 +241,7 @@ class MemoryLoadedLibraries implements LoadedLibraries {
|
| bool containsLibrary(Uri uri) => copiedLibraries.containsKey(uri);
|
|
|
| @override
|
| - void forEachImportChain(f, {callback}) {}
|
| + void forEachImportChain(f) {}
|
|
|
| @override
|
| void forEachLibrary(f) {}
|
|
|