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

Unified Diff: pkg/front_end/lib/src/fasta/source/source_library_builder.dart

Issue 2676823002: Add option --compile-sdk to fasta compile and run. (Closed)
Patch Set: Address comments. Created 3 years, 10 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: pkg/front_end/lib/src/fasta/source/source_library_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 3dbc65e3e5bba41d651ae22442d4c2e474ffd9c6..0c0599ee470627d2c138c8b0fc3e78989d97e7be 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -124,8 +124,20 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
imports.add(new Import(loader.read(resolve(uri)), prefix, combinators));
}
- void addPart(List<MetadataBuilder> metadata, String uri) {
- parts.add(loader.read(resolve(uri)));
+ void addPart(List<MetadataBuilder> metadata, String path) {
+ Uri resolvedUri;
+ Uri newFileUri;
+ if (uri.scheme == "dart") {
+ resolvedUri = new Uri(scheme: "dart", path: "${uri.path}/$path");
+ newFileUri = fileUri.resolve(path);
+ } else {
+ newFileUri = resolvedUri = resolve(path);
+ }
+ LibraryBuilder part = loader.read(resolvedUri);
+ if (part is SourceLibraryBuilder) {
+ part.fileUri ??= newFileUri;
+ }
+ parts.add(part);
}
void addPartOf(List<MetadataBuilder> metadata, String name) {
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/outline_builder.dart ('k') | pkg/front_end/lib/src/fasta/source/source_loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698