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

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

Issue 17759007: First pass at asynchronous input loading in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 years, 3 months 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 | « tests/compiler/dart2js/memory_compiler.dart ('k') | tests/compiler/dart2js/message_kind_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/memory_source_file_helper.dart
diff --git a/tests/compiler/dart2js/memory_source_file_helper.dart b/tests/compiler/dart2js/memory_source_file_helper.dart
index f8ecb277a63f4881951fcfebef8b8eedb58f4d6d..8ebdf7d6763223ad1d2c4e5f63cbb651b049349b 100644
--- a/tests/compiler/dart2js/memory_source_file_helper.dart
+++ b/tests/compiler/dart2js/memory_source_file_helper.dart
@@ -24,14 +24,17 @@ export '../../../sdk/lib/_internal/compiler/implementation/source_file_provider.
show SourceFileProvider, FormattingDiagnosticHandler;
class MemorySourceFileProvider extends SourceFileProvider {
- static Map MEMORY_SOURCE_FILES;
+ final Map<String, String> memorySourceFiles;
+
+ MemorySourceFileProvider(Map<String, String> this.memorySourceFiles);
+
Future<String> readStringFromUri(Uri resourceUri) {
if (resourceUri.scheme != 'memory') {
return super.readStringFromUri(resourceUri);
}
- String source = MEMORY_SOURCE_FILES[resourceUri.path];
+ String source = memorySourceFiles[resourceUri.path];
// TODO(ahe): Return new Future.error(...) ?
- if (source == null) throw 'No such file $resourceUri';
+ if (source == null) return new Future.error('No such file $resourceUri');
String resourceName = '$resourceUri';
this.sourceFiles[resourceName] = new SourceFile(resourceName, source);
return new Future.value(source);
« no previous file with comments | « tests/compiler/dart2js/memory_compiler.dart ('k') | tests/compiler/dart2js/message_kind_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698