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

Unified Diff: dart/lib/uri/uri.dart

Issue 10850015: Changed default Uri constructor to Uri.fromComponents(), new default constructor is Uri.fromString(… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 | « dart/lib/compiler/implementation/filenames.dart ('k') | dart/runtime/bin/builtin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/uri/uri.dart
diff --git a/dart/lib/uri/uri.dart b/dart/lib/uri/uri.dart
index ad396eb74d601a970d140a396e406de93ba636b7..7c6bfdd9ee27798c5c1495a5762bbf409dea254e 100644
--- a/dart/lib/uri/uri.dart
+++ b/dart/lib/uri/uri.dart
@@ -25,18 +25,21 @@ class Uri {
Uri.fromString(String uri) : this._fromMatch(_splitRe.firstMatch(uri));
- Uri._fromMatch(Match m) : this(_emptyIfNull(m[_COMPONENT_SCHEME]),
- _emptyIfNull(m[_COMPONENT_USER_INFO]),
- _emptyIfNull(m[_COMPONENT_DOMAIN]),
- _parseIntOrZero(m[_COMPONENT_PORT]),
- _emptyIfNull(m[_COMPONENT_PATH]),
- _emptyIfNull(m[_COMPONENT_QUERY_DATA]),
- _emptyIfNull(m[_COMPONENT_FRAGMENT]));
-
- const Uri([String this.scheme = "", String this.userInfo ="",
- String this.domain = "", int this.port = 0,
- String this.path = "", String this.query = "",
- String this.fragment = ""]);
+ Uri._fromMatch(Match m) :
+ this.fromComponents(_emptyIfNull(m[_COMPONENT_SCHEME]),
+ _emptyIfNull(m[_COMPONENT_USER_INFO]),
+ _emptyIfNull(m[_COMPONENT_DOMAIN]),
+ _parseIntOrZero(m[_COMPONENT_PORT]),
+ _emptyIfNull(m[_COMPONENT_PATH]),
+ _emptyIfNull(m[_COMPONENT_QUERY_DATA]),
+ _emptyIfNull(m[_COMPONENT_FRAGMENT]));
+
+ const Uri.fromComponents([String this.scheme = "", String this.userInfo ="",
+ String this.domain = "", int this.port = 0,
+ String this.path = "", String this.query = "",
+ String this.fragment = ""]);
+
+ Uri(String uri) : this.fromString(uri);
static String _emptyIfNull(String val) => val != null ? val : '';
@@ -159,8 +162,9 @@ class Uri {
}
targetScheme = this.scheme;
}
- return new Uri(targetScheme, targetUserInfo, targetDomain, targetPort,
- targetPath, targetQuery, reference.fragment);
+ return new Uri.fromComponents(targetScheme, targetUserInfo, targetDomain,
+ targetPort, targetPath, targetQuery,
+ reference.fragment);
}
bool hasAuthority() {
« no previous file with comments | « dart/lib/compiler/implementation/filenames.dart ('k') | dart/runtime/bin/builtin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698