Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Unified Diff: dart/tests/compiler/dart2js/memory_compiler.dart

Issue 18029018: Check that non-abstract classes implement all methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tests/compiler/dart2js/analyze_dart2js_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/compiler/dart2js/memory_compiler.dart
diff --git a/dart/tests/compiler/dart2js/memory_compiler.dart b/dart/tests/compiler/dart2js/memory_compiler.dart
index 414e5cd1326fbdd51754adad5576850ee33e4ecc..93665658b3571409762a1f4da892fb4d9306bb54 100644
--- a/dart/tests/compiler/dart2js/memory_compiler.dart
+++ b/dart/tests/compiler/dart2js/memory_compiler.dart
@@ -74,6 +74,9 @@ DiagnosticHandler createDiagnosticHandler(DiagnosticHandler diagnosticHandler,
return handler;
}
+Expando<MemorySourceFileProvider> expando =
+ new Expando<MemorySourceFileProvider>();
+
Compiler compilerFor(Map<String,String> memorySourceFiles,
{DiagnosticHandler diagnosticHandler,
List<String> options: const [],
@@ -83,7 +86,24 @@ Compiler compilerFor(Map<String,String> memorySourceFiles,
Uri libraryRoot = script.resolve('../../../sdk/');
Uri packageRoot = script.resolve('./packages/');
- var provider = new MemorySourceFileProvider(memorySourceFiles);
+ MemorySourceFileProvider provider;
+ var readStringFromUri;
+ if (cachedCompiler == null) {
+ provider = new MemorySourceFileProvider(memorySourceFiles);
+ readStringFromUri = provider.readStringFromUri;
+ // Saving the provider in case we need it later for a cached compiler.
+ expando[readStringFromUri] = provider;
+ } else {
+ // When using a cached compiler, it has read a number of files from disk
+ // already (and will not attemp to read them again due to caching). These
+ // files must be available to the new diagnostic handler.
+ provider = expando[cachedCompiler.provider];
+ readStringFromUri = cachedCompiler.provider;
+ provider.memorySourceFiles.clear();
+ memorySourceFiles.forEach((key, value) {
+ provider.memorySourceFiles[key] = value;
+ });
+ }
var handler =
createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics);
@@ -92,7 +112,7 @@ Compiler compilerFor(Map<String,String> memorySourceFiles,
return new NullSink('$name.$extension');
}
- Compiler compiler = new Compiler(provider.readStringFromUri,
+ Compiler compiler = new Compiler(readStringFromUri,
outputProvider,
handler,
libraryRoot,
« no previous file with comments | « dart/tests/compiler/dart2js/analyze_dart2js_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698