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

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: 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..4e207f48242918c07a62d21a3bd93d46a58f9a2a 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,22 @@ 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) {
+ if (part.fileUri != null) {
ahe 2017/02/03 15:41:33 This should be == or part.fileUri ??= newFileUri.
Siggi Cherem (dart-lang) 2017/02/03 18:16:57 Not sure I follow here - what is the underlying is
ahe 2017/02/03 19:34:14 I should set the fileUri if it *is* null. Not when
ahe 2017/02/03 20:03:36 Done.
Siggi Cherem (dart-lang) 2017/02/03 20:25:26 ah - I get it now - your comment was basically a T
ahe 2017/02/03 20:35:44 Yes. As soon as I had sent the comment, I realized
+ part.fileUri = newFileUri;
+ }
+ }
+ parts.add(part);
}
void addPartOf(List<MetadataBuilder> metadata, String name) {

Powered by Google App Engine
This is Rietveld 408576698