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

Unified Diff: pkg/compiler/lib/src/library_loader.dart

Issue 1131593006: Report malformed URIs in library dependencies (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update copyright in test Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 3e5ddde094dd997f8b3c01f3725d8b95a6e8afd4..ab501b0133708b5c4f9a6afb348b16b6a8d1941e 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -505,7 +505,15 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
LibraryElement library,
LibraryDependency tag) {
Uri base = library.canonicalUri;
- Uri resolvedUri = base.resolve(tag.uri.dartString.slowToString());
+ String tagUriString = tag.uri.dartString.slowToString();
+ Uri resolvedUri;
+ try {
+ resolvedUri = base.resolve(tagUriString);
+ } on FormatException {
+ compiler.reportError(
+ tag, MessageKind.INVALID_URI, {'uri': tagUriString});
+ return new Future.value();
floitsch 2015/05/06 21:19:00 This return feels fishy. Is the convention that th
+ }
return createLibrary(handler, library, resolvedUri, tag.uri)
.then((LibraryElement loadedLibrary) {
if (loadedLibrary == null) return;
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698