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

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

Issue 2895983002: Read SDK and patches from a JSON file. (Closed)
Patch Set: Merged with 1333f97b9a0e3805f991578ef83b0ec4553ecf33 Created 3 years, 7 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 ed7f26b85d0d9ca0add68be9e15a7eb47d022f45..b5a21fb4651e5d11b966f64ffffd0261f606939c 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
@@ -10,6 +10,8 @@ import 'package:front_end/src/fasta/scanner/token.dart' show SymbolToken;
import 'package:kernel/ast.dart' show ProcedureKind;
+import '../../base/resolve_relative_uri.dart' show resolveRelativeUri;
+
import '../combinator.dart' show Combinator;
import '../errors.dart' show inputError, internalError;
@@ -87,6 +89,8 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
bool get isPart => partOfName != null || partOfUri != null;
+ bool get isPatch;
+
List<T> get types => libraryDeclaration.types;
T addNamedType(String name, List<T> arguments, int charOffset);
@@ -150,13 +154,13 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
Uri resolvedUri;
Uri newFileUri;
if (uri.scheme == "dart") {
- resolvedUri = new Uri(scheme: "dart", path: "${uri.path}/$path");
+ resolvedUri = resolveRelativeUri(uri, Uri.parse(path));
newFileUri = fileUri.resolve(path);
} else {
resolvedUri = uri.resolve(path);
-
- // TODO(ahe): This is wrong for package URIs.
- newFileUri = fileUri.resolve(path);
+ if (uri.scheme != "package") {
+ newFileUri = fileUri.resolve(path);
+ }
}
parts
.add(loader.read(resolvedUri, -1, fileUri: newFileUri, accessor: this));
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/outline_builder.dart ('k') | pkg/front_end/lib/src/fasta/target_implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698