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

Unified Diff: lib/uri/uri.dart

Issue 10919239: Change Uri.fromComponents to take named optional arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | tests/utils/uri_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/uri/uri.dart
diff --git a/lib/uri/uri.dart b/lib/uri/uri.dart
index 074043e448c05150b9493c3312e75791fcdcb6af..c29ebe25838a249eabc898656498d4499620be5c 100644
--- a/lib/uri/uri.dart
+++ b/lib/uri/uri.dart
@@ -27,18 +27,21 @@ class Uri {
Uri.fromString(String uri) : this._fromMatch(_splitRe.firstMatch(uri));
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 = ""]);
+ this.fromComponents(scheme: _emptyIfNull(m[_COMPONENT_SCHEME]),
+ userInfo: _emptyIfNull(m[_COMPONENT_USER_INFO]),
+ domain: _emptyIfNull(m[_COMPONENT_DOMAIN]),
+ port: _parseIntOrZero(m[_COMPONENT_PORT]),
+ path: _emptyIfNull(m[_COMPONENT_PATH]),
+ query: _emptyIfNull(m[_COMPONENT_QUERY_DATA]),
+ fragment: _emptyIfNull(m[_COMPONENT_FRAGMENT]));
+
+ const Uri.fromComponents({this.scheme: "",
+ this.userInfo: "",
+ this.domain: "",
+ this.port: 0,
+ this.path: "",
+ this.query: "",
+ this.fragment: ""});
Uri(String uri) : this.fromString(uri);
@@ -163,9 +166,13 @@ class Uri {
}
targetScheme = this.scheme;
}
- return new Uri.fromComponents(targetScheme, targetUserInfo, targetDomain,
- targetPort, targetPath, targetQuery,
- reference.fragment);
+ return new Uri.fromComponents(scheme: targetScheme,
+ userInfo: targetUserInfo,
+ domain: targetDomain,
+ port: targetPort,
+ path: targetPath,
+ query: targetQuery,
+ fragment: reference.fragment);
}
bool hasAuthority() {
« no previous file with comments | « no previous file | tests/utils/uri_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698