| Index: tests/compiler/dart2js/memory_compiler.dart
|
| diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart
|
| index 3712603dbc70da3142ad4e9f22c091e098a30ed8..fa69df7a99c519025c85fcc028ef31d73b1898ca 100644
|
| --- a/tests/compiler/dart2js/memory_compiler.dart
|
| +++ b/tests/compiler/dart2js/memory_compiler.dart
|
| @@ -16,6 +16,8 @@ import 'package:compiler/compiler_new.dart' show
|
| PackagesDiscoveryProvider;
|
| import 'package:compiler/src/diagnostics/messages.dart' show
|
| Message;
|
| +import 'package:compiler/src/mirrors/source_mirrors.dart';
|
| +import 'package:compiler/src/mirrors/analyze.dart';
|
| import 'package:compiler/src/null_compiler_output.dart' show
|
| NullCompilerOutput;
|
| import 'package:compiler/src/library_loader.dart' show
|
| @@ -257,3 +259,23 @@ DiagnosticHandler createDiagnosticHandler(DiagnosticHandler diagnosticHandler,
|
| }
|
| return handler;
|
| }
|
| +
|
| +Future<MirrorSystem> mirrorSystemFor(Map<String,String> memorySourceFiles,
|
| + {DiagnosticHandler diagnosticHandler,
|
| + List<String> options: const [],
|
| + bool showDiagnostics: true}) {
|
| + Uri libraryRoot = Uri.base.resolve('sdk/');
|
| + Uri packageRoot = Uri.base.resolve(Platform.packageRoot);
|
| +
|
| + var provider = new MemorySourceFileProvider(memorySourceFiles);
|
| + var handler =
|
| + createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics);
|
| +
|
| + List<Uri> libraries = <Uri>[];
|
| + memorySourceFiles.forEach((String path, _) {
|
| + libraries.add(new Uri(scheme: 'memory', path: path));
|
| + });
|
| +
|
| + return analyze(libraries, libraryRoot, packageRoot,
|
| + provider, handler, options);
|
| +}
|
|
|