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

Unified Diff: runtime/bin/builtin.dart

Issue 538373002: Don't do Uri->String->Uri when resolving package imports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index d3acb0988914d450bc1a99485f4c45d6463f4c90..6ef1f2b2861f8d8f7d64f196e2ec7028c05fa0d0 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -176,7 +176,7 @@ String _filePathFromUri(String userUri) {
case 'file':
return uri.toFilePath();
case 'package':
- return _filePathFromPackageUri(uri);
+ return _filePathFromUri(_resolvePackageUri(uri).toString());
case 'http':
return uri.toString();
default:
@@ -190,7 +190,7 @@ String _filePathFromUri(String userUri) {
}
-String _filePathFromPackageUri(Uri uri) {
+Uri _resolvePackageUri(Uri uri) {
if (!uri.host.isEmpty) {
var path = '${uri.host}${uri.path}';
var right = 'package:$path';
@@ -203,7 +203,7 @@ String _filePathFromPackageUri(Uri uri) {
var packageRoot = _packageRoot == null ?
_entryPointScript.resolve('packages/') :
_packageRoot;
- return _filePathFromUri(packageRoot.resolve(uri.path).toString());
+ return packageRoot.resolve(uri.path);
}
@@ -303,7 +303,7 @@ Uri _createUri(String userUri) {
case 'http':
return uri;
case 'package':
- return Uri.parse(_filePathFromPackageUri(uri));
+ return _resolvePackageUri(uri);
default:
// Only handling file, http, and package URIs
// in standalone binary.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698