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)); |