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

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

Issue 1196433002: Create and test source mapping for invocations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 years, 6 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 | « pkg/js_ast/test/printer_callback_test.dart ('k') | tests/compiler/dart2js/output_collector.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 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);
+ }
}
« no previous file with comments | « pkg/js_ast/test/printer_callback_test.dart ('k') | tests/compiler/dart2js/output_collector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698