Chromium Code Reviews| Index: sdk/lib/core/uri.dart |
| diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart |
| index b31b04a6349d224747b89502d438f5e14927f93e..8529de9347eb662170169fc81209a4a3f1387779 100644 |
| --- a/sdk/lib/core/uri.dart |
| +++ b/sdk/lib/core/uri.dart |
| @@ -488,6 +488,9 @@ class Uri { |
| * and joined using equal and ampersand characters. The |
| * percent-encoding of the keys and values encodes all characters |
| * except for the unreserved characters. |
| + * If `query` is the empty string, it is equivalent to omitting it. |
| + * To have an actual empty query part, |
| + * use an empty list for `queryParameters`. |
| * If both `query` and `queryParameters` are omitted or `null`, the |
| * URI will have no query part. |
| * |
| @@ -508,6 +511,8 @@ class Uri { |
| scheme = _makeScheme(scheme, _stringOrNullLength(scheme)); |
| userInfo = _makeUserInfo(userInfo, 0, _stringOrNullLength(userInfo)); |
| host = _makeHost(host, 0, _stringOrNullLength(host), false); |
| + // Special case this constructor for backwards compatibility. |
|
Anders Johnsen
2014/06/26 11:04:32
TODO for deprecating this behavior in 2.0?
Lasse Reichstein Nielsen
2014/06/26 11:14:04
I'll put it on my list, but we are not putting 2.0
|
| + if (query == "") query = null; |
| query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters); |
| fragment = _makeFragment(fragment, 0, _stringOrNullLength(fragment)); |
| port = _makePort(port, scheme); |