Index: tests/compiler/dart2js/parser_helper.dart |
diff --git a/tests/compiler/dart2js/parser_helper.dart b/tests/compiler/dart2js/parser_helper.dart |
index ec96f0e6b09346f981f0296c87ede4720935d245..3ba38e91c6a4c8134fe6b60481bd6dd4fadf1190 100644 |
--- a/tests/compiler/dart2js/parser_helper.dart |
+++ b/tests/compiler/dart2js/parser_helper.dart |
@@ -78,10 +78,17 @@ class MockFile extends SourceFile { |
: super('<string>', text); |
} |
+var sourceCounter = 0; |
+ |
Link<Element> parseUnit(String text, Compiler compiler, |
- LibraryElement library) { |
+ LibraryElement library, |
+ [void registerSource(Uri uri, String source)]) { |
Token tokens = scan(text); |
- Uri uri = new Uri.fromComponents(scheme: "source"); |
+ Uri uri = |
+ new Uri.fromComponents(scheme: "source", path: '${++sourceCounter}'); |
+ if (registerSource != null) { |
+ registerSource(uri, text); |
+ } |
var script = new Script(uri, new MockFile(text)); |
var unit = new CompilationUnitElementX(script, library); |
int id = 0; |