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

Unified Diff: lib/src/resolve.dart

Issue 2666013004: Address a number of open issues. (Closed)
Patch Set: Swap imports in resource_loader.dart. Addresses #16. 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..1c0c09cfbda585016110c79c94b84d83267b69be 100644
--- a/lib/src/resolve.dart
+++ b/lib/src/resolve.dart
@@ -6,9 +6,10 @@ 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) =>
+ resolvedUri ?? new ArgumentError.value(uri, "uri", "Unknown package"));
floitsch 2017/02/01 12:17:59 That looks wrong. I'm guessing you wanted to throw
Lasse Reichstein Nielsen 2017/02/01 12:44:36 True, should have had a throw. Rewriting to the fu
}
- 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