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

Unified Diff: pkg/fasta/lib/src/compile_platform.dart

Issue 2650733003: Use a real program when compiling platform.dill. (Closed)
Patch Set: Rebased on d90b7e967a5e328ae61fb69fcfe7469fff35218a. Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fasta/lib/src/compile_platform.dart
diff --git a/pkg/fasta/lib/src/compile_platform.dart b/pkg/fasta/lib/src/compile_platform.dart
index 6a381d75697cac286e42074bc6dc32850695a802..d6085010a141feac74cbb6a7c9de1a1da7049ff3 100644
--- a/pkg/fasta/lib/src/compile_platform.dart
+++ b/pkg/fasta/lib/src/compile_platform.dart
@@ -91,17 +91,17 @@ main(List<String> arguments) async {
dartSdk: createDartSdk(options.sdk, strongMode: options.strongMode));
Target target = getTarget(
"vm", new TargetFlags(strongMode: options.strongMode));
- Library dummyLibrary = repository.getLibraryReference(Uri.parse("dummy:"))
- ..isExternal = false;
- Program program =
- loader.loadProgram(dummyLibrary.importUri, target: target);
+ Program program = loader.loadProgram(
+ Uri.base.resolve("pkg/fasta/test/platform.dart"), target: target);
+ if (loader.errors.isNotEmpty) {
+ inputError(null, null, loader.errors.join("\n"));
+ }
+ Library mainLibrary = program.mainMethod.enclosingLibrary;
+ program.uriToSource.remove(mainLibrary.fileUri);
program = new Program(
program.libraries.where(
(Library l) => l.importUri.scheme == "dart").toList(),
program.uriToSource);
- if (loader.errors.isNotEmpty) {
- inputError(null, null, loader.errors.join("\n"));
- }
target.transformProgram(program);
for (LibraryElement analyzerLibrary in loader.libraryElements) {
Library library = loader.getLibraryReference(analyzerLibrary);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698