Index: pkg/front_end/lib/src/fasta/source/source_loader.dart |
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart |
index 638598d4494f17fb86f20b74a180dbf487d1cbcd..3734675ef92012e66997a2229242408605f06d7a 100644 |
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart |
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart |
@@ -34,6 +34,8 @@ import '../compiler_context.dart' show CompilerContext; |
import '../deprecated_problems.dart' show deprecated_inputError; |
+import '../problems.dart' show internalProblem; |
+ |
import '../export.dart' show Export; |
import '../fasta_codes.dart' |
@@ -45,6 +47,7 @@ import '../fasta_codes.dart' |
templateIllegalMixin, |
templateIllegalMixinDueToConstructors, |
templateIllegalMixinDueToConstructorsCause, |
+ templateInternalProblemUriMissingScheme, |
templateUnspecified; |
import '../kernel/kernel_shadow_ast.dart' show KernelTypeInferenceEngine; |
@@ -96,11 +99,14 @@ class SourceLoader<L> extends Loader<L> { |
Future<Token> tokenize(SourceLibraryBuilder library, |
{bool suppressLexicalErrors: false}) async { |
Uri uri = library.fileUri; |
- // TODO(sigmund): source-loader shouldn't check schemes, but defer to the |
- // underlying file system to decide whether it is supported. |
- if (uri == null || uri.scheme != "file" && uri.scheme != "multi-root") { |
+ if (uri == null) { |
return deprecated_inputError( |
library.uri, -1, "Not found: ${library.uri}."); |
+ } else if (!uri.hasScheme) { |
+ return internalProblem( |
ahe
2017/08/28 12:54:39
I'm not sure these checks belong here anymore. Let
|
+ templateInternalProblemUriMissingScheme.withArguments(uri), |
+ -1, |
+ library.uri); |
} |
// Get the library text from the cache, or read from the file system. |