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

Unified Diff: lib/src/resolve.dart

Issue 2666013004: Address a number of open issues. (Closed)
Patch Set: Close the parenthesis. Created 3 years, 11 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 | « lib/src/io_io.dart ('k') | lib/src/resource_loader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/resolve.dart
diff --git a/lib/src/resolve.dart b/lib/src/resolve.dart
index 7a54520a84c6e9149b78cf3df5d88ea3db8e5edd..053899a4e5985856fd88a80cd9bc83662c90482c 100644
--- a/lib/src/resolve.dart
+++ b/lib/src/resolve.dart
@@ -6,9 +6,14 @@ import "dart:async" show Future;
import "dart:isolate" show Isolate;
/// Helper function for resolving to a non-relative, non-package URI.
-Future<Uri> resolveUri(Uri uri) async {
+Future<Uri> resolveUri(Uri uri) {
if (uri.scheme == "package") {
- return Isolate.resolvePackageUri(uri);
+ return Isolate.resolvePackageUri(uri).then((resolvedUri) {
+ if (resolvedUri == null) {
+ throw new ArgumentError.value(uri, "uri", "Unknown package");
+ }
+ return resolvedUri;
+ });
}
- return Uri.base.resolveUri(uri);
+ return new Future<Uri>.value(Uri.base.resolveUri(uri));
}
« no previous file with comments | « lib/src/io_io.dart ('k') | lib/src/resource_loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698