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 4efb8ad4466abe0c4d9e1746d5d2ce00c2e1da7c..0a0428bee0af1eb8919af660278f135a7439f8ba 100644 |
--- a/tests/compiler/dart2js/memory_source_file_helper.dart |
+++ b/tests/compiler/dart2js/memory_source_file_helper.dart |
@@ -14,7 +14,7 @@ export 'package:compiler/src/filenames.dart' |
show currentDirectory; |
import 'package:compiler/src/io/source_file.dart' |
- show StringSourceFile; |
+ show StringSourceFile, SourceFile; |
import 'package:compiler/src/source_file_provider.dart' |
show SourceFileProvider; |
@@ -41,4 +41,15 @@ class MemorySourceFileProvider extends SourceFileProvider { |
} |
Future<String> call(Uri resourceUri) => readStringFromUri(resourceUri); |
+ |
+ SourceFile getSourceFile(Uri resourceUri) { |
+ if (resourceUri.scheme != 'memory') { |
+ return super.getSourceFile(resourceUri); |
+ } |
+ String source = memorySourceFiles[resourceUri.path]; |
+ if (source == null) { |
+ throw new Exception('No such file $resourceUri'); |
+ } |
+ return new StringSourceFile.fromUri(resourceUri, source); |
+ } |
} |