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

Unified Diff: runtime/bin/builtin.dart

Issue 16092007: HTTP loading tests and package root support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | runtime/bin/dartutils.h » ('j') | runtime/bin/dartutils.cc » ('J')
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 bae69527f905400553e6dd8622aafff93e491f8c..ecabda40fc2f380853c7582801548240497c49e8 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -36,6 +36,12 @@ _setPackageRoot(String packageRoot) {
}
String _resolveScriptUri(String cwd, String scriptName, bool isWindows) {
+ var scriptUri = Uri.parse(scriptName);
+ if (scriptUri.scheme == 'http') {
+ _entrypoint = scriptUri;
+ _logResolution("# Resolved script to: $_entrypoint");
+ return _entrypoint.toString();
+ }
_logResolution("# Current working directory: $cwd");
_logResolution("# ScriptName: $scriptName");
if (isWindows) {
@@ -159,7 +165,11 @@ String _filePathFromPackageUri(Uri uri) {
if (_packageRoot != null) {
path = "${_packageRoot}${uri.path}";
} else {
- path = _entrypoint.resolve('packages/${uri.path}').path;
+ if (_entrypoint.scheme == 'http') {
+ path = _entrypoint.resolve('packages/${uri.path}').toString();
+ } else {
+ path = _entrypoint.resolve('packages/${uri.path}').path;
+ }
}
_logResolution("# Package: $path");
@@ -176,9 +186,9 @@ String _pathFromHttpUri(String userUri) {
return uri.path;
}
-String _domainFromHttpUri(String userUri) {
+String _hostFromHttpUri(String userUri) {
var uri = Uri.parse(userUri);
- return uri.domain;
+ return uri.host;
}
int _portFromHttpUri(String userUri) {
« no previous file with comments | « no previous file | runtime/bin/dartutils.h » ('j') | runtime/bin/dartutils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698