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

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

Issue 3006483002: Remove check for scheme in source-loader. (Closed)
Patch Set: address bot failures Created 3 years, 4 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/fasta_codes_generated.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « pkg/front_end/lib/src/fasta/fasta_codes_generated.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698