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

Unified Diff: runtime/bin/builtin.dart

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup 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 | « pkg/webdriver/lib/webdriver.dart ('k') | runtime/bin/dartutils.cc » ('j') | 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 5eb32ad712903d537a899c97b6294879e40e18ba..808124a758ee062c49063c62662e9a3c65402f7e 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
library builtin;
-import 'dart:uri';
// Corelib 'print' implementation.
void _print(arg) {
@@ -58,9 +57,8 @@ String _resolveScriptUri(String cwd, String scriptName, bool isWindows) {
_logResolution("## scriptName: $scriptName");
}
var base =
- new Uri.fromComponents(
- scheme: "file",
- path: cwd.endsWith("/") ? cwd : "$cwd/");
+ new Uri(scheme: "file",
+ path: cwd.endsWith("/") ? cwd : "$cwd/");
_entrypoint = base.resolve(scriptName);
_logResolution("# Resolved script to: $_entrypoint");
@@ -84,7 +82,7 @@ String _resolveUri(String base, String userString) {
// package URI path part.
path = _filePathFromPackageUri(resolved);
}
- resolved = new Uri.fromComponents(scheme: "dart-ext", path: path);
+ resolved = new Uri(scheme: "dart-ext", path: path);
} else {
resolved = baseUri.resolve(userString);
}
@@ -127,8 +125,8 @@ String _filePathFromUri(String userUri, bool isWindows) {
}
String _filePathFromFileUri(Uri uri) {
- if (uri.domain != '') {
- throw "URIs using the 'file:' scheme may not contain a domain.";
+ if (!uri.host.isEmpty) {
+ throw "URIs using the 'file:' scheme may not contain a host.";
}
_logResolution("# Path: ${uri.path}");
@@ -136,8 +134,8 @@ String _filePathFromFileUri(Uri uri) {
}
String _filePathFromOtherUri(Uri uri) {
- if (uri.domain != '') {
- throw "URIs whose paths are used as file paths may not contain a domain.";
+ if (!uri.host.isEmpty) {
+ throw "URIs whose paths are used as file paths may not contain a host.";
}
_logResolution("# Path: ${uri.path}");
@@ -145,8 +143,8 @@ String _filePathFromOtherUri(Uri uri) {
}
String _filePathFromPackageUri(Uri uri) {
- if (uri.domain != '') {
- var path = (uri.path != '') ? '${uri.domain}${uri.path}' : uri.domain;
+ if (!uri.host.isEmpty) {
+ var path = (uri.path != '') ? '${uri.host}${uri.path}' : uri.host;
var right = 'package:$path';
var wrong = 'package://$path';
« no previous file with comments | « pkg/webdriver/lib/webdriver.dart ('k') | runtime/bin/dartutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698