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

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

Issue 12047041: Testable patch parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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
Index: dart/tests/compiler/dart2js/mock_compiler.dart
diff --git a/dart/tests/compiler/dart2js/mock_compiler.dart b/dart/tests/compiler/dart2js/mock_compiler.dart
index bb71b40f9e2dfc19d526b4642cf0d9a6a569a37d..4642f23d4ba2790a8a73a37b5c605393b6746035 100644
--- a/dart/tests/compiler/dart2js/mock_compiler.dart
+++ b/dart/tests/compiler/dart2js/mock_compiler.dart
@@ -171,14 +171,18 @@ class MockCompiler extends Compiler {
* is fixed to export its top-level declarations.
*/
LibraryElement createLibrary(String name, String source) {
- Uri uri = new Uri.fromComponents(scheme: "source", path: name);
- var script = new Script(uri, new MockFile(source));
- var library = new LibraryElementX(script);
+ var library = createUnparsedLibrary(name, source);
parseScript(source, library);
library.setExports(library.localScope.values.toList());
return library;
}
+ LibraryElement createUnparsedLibrary(String name, String source) {
+ Uri uri = new Uri.fromComponents(scheme: "source", path: name);
+ var script = new Script(uri, new MockFile(source));
+ return new LibraryElementX(script);
+ }
+
void reportWarning(Node node, var message) {
warnings.add(new WarningMessage(node, message.message));
}
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/patch_parser.dart ('k') | dart/tests/compiler/dart2js/patch2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698