| OLD | NEW |
| 1 part of dart.core; | 1 part of dart.core; |
| 2 class Uri {final String _host; | 2 class Uri {final String _host; |
| 3 num _port; | 3 num _port; |
| 4 String _path; | 4 String _path; |
| 5 final String scheme; | 5 final String scheme; |
| 6 String get authority { | 6 String get authority { |
| 7 if (!hasAuthority) return ""; | 7 if (!hasAuthority) return ""; |
| 8 var sb = new StringBuffer(); | 8 var sb = new StringBuffer(); |
| 9 _writeAuthority(sb); | 9 _writeAuthority(sb); |
| 10 return sb.toString(); | 10 return sb.toString(); |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 if (codeUnit < _LOWER_CASE_A || codeUnit > _LOWER_CASE_Z) { | 562 if (codeUnit < _LOWER_CASE_A || codeUnit > _LOWER_CASE_Z) { |
| 563 allLowercase = false; | 563 allLowercase = false; |
| 564 } | 564 } |
| 565 } | 565 } |
| 566 scheme = scheme.substring(0, end); | 566 scheme = scheme.substring(0, end); |
| 567 if (!allLowercase) scheme = scheme.toLowerCase(); | 567 if (!allLowercase) scheme = scheme.toLowerCase(); |
| 568 return scheme; | 568 return scheme; |
| 569 } | 569 } |
| 570 static String _makeUserInfo(String userInfo, int start, int end) { | 570 static String _makeUserInfo(String userInfo, int start, int end) { |
| 571 if (userInfo == null) return ""; | 571 if (userInfo == null) return ""; |
| 572 return _normalize(userInfo, start, end, DEVC$RT.cast(_userinfoTable, dynamic,
DEVC$RT.type((List<int> _) { | 572 return _normalize(userInfo, start, end, DEVC$RT.cast(_userinfoTable, DEVC$RT.
type((List<dynamic> _) { |
| 573 } | 573 } |
| 574 ), "CastGeneral", """line 1126, column 45 of dart:core/uri.dart: """, _userinf
oTable is List<int>, false)); | 574 ), DEVC$RT.type((List<int> _) { |
| 575 } |
| 576 ), "CastDynamic", """line 1126, column 45 of dart:core/uri.dart: """, _userinf
oTable is List<int>, false)); |
| 575 } | 577 } |
| 576 static String _makePath(String path, int start, int end, Iterable<String> pathS
egments, bool ensureLeadingSlash, bool isFile) { | 578 static String _makePath(String path, int start, int end, Iterable<String> pathS
egments, bool ensureLeadingSlash, bool isFile) { |
| 577 if (path == null && pathSegments == null) return isFile ? "/" : ""; | 579 if (path == null && pathSegments == null) return isFile ? "/" : ""; |
| 578 if (path != null && pathSegments != null) { | 580 if (path != null && pathSegments != null) { |
| 579 throw new ArgumentError('Both path and pathSegments specified'); | 581 throw new ArgumentError('Both path and pathSegments specified'); |
| 580 } | 582 } |
| 581 var result; | 583 var result; |
| 582 if (path != null) { | 584 if (path != null) { |
| 583 result = _normalize(path, start, end, DEVC$RT.cast(_pathCharOrSlashTable, dy
namic, DEVC$RT.type((List<int> _) { | 585 result = _normalize(path, start, end, DEVC$RT.cast(_pathCharOrSlashTable, DE
VC$RT.type((List<dynamic> _) { |
| 584 } | 586 } |
| 585 ), "CastGeneral", """line 1139, column 45 of dart:core/uri.dart: """, _pathC
harOrSlashTable is List<int>, false)); | 587 ), DEVC$RT.type((List<int> _) { |
| 588 } |
| 589 ), "CastDynamic", """line 1139, column 45 of dart:core/uri.dart: """, _pathC
harOrSlashTable is List<int>, false)); |
| 586 } | 590 } |
| 587 else { | 591 else { |
| 588 result = pathSegments.map((s) => _uriEncode(DEVC$RT.cast(_pathCharTable, dyn
amic, DEVC$RT.type((List<int> _) { | 592 result = pathSegments.map((s) => _uriEncode(DEVC$RT.cast(_pathCharTable, DEV
C$RT.type((List<dynamic> _) { |
| 589 } | 593 } |
| 590 ), "CastGeneral", """line 1141, column 51 of dart:core/uri.dart: """, _pathC
harTable is List<int>, false), DEVC$RT.cast(s, dynamic, String, "CastGeneral", "
""line 1141, column 67 of dart:core/uri.dart: """, s is String, true))).join("/"
); | 594 ), DEVC$RT.type((List<int> _) { |
| 595 } |
| 596 ), "CastDynamic", """line 1141, column 51 of dart:core/uri.dart: """, _pathC
harTable is List<int>, false), DEVC$RT.cast(s, dynamic, String, "CastGeneral", "
""line 1141, column 67 of dart:core/uri.dart: """, s is String, true))).join("/"
); |
| 591 } | 597 } |
| 592 if (result.isEmpty) { | 598 if (result.isEmpty) { |
| 593 if (isFile) return "/"; | 599 if (isFile) return "/"; |
| 594 } | 600 } |
| 595 else if ((isFile || ensureLeadingSlash) && result.codeUnitAt(0) != _SLASH) { | 601 else if ((isFile || ensureLeadingSlash) && result.codeUnitAt(0) != _SLASH) { |
| 596 return "/$result"; | 602 return "/$result"; |
| 597 } | 603 } |
| 598 return DEVC$RT.cast(result, dynamic, String, "CastGeneral", """line 1149, col
umn 12 of dart:core/uri.dart: """, result is String, true); | 604 return DEVC$RT.cast(result, dynamic, String, "CastGeneral", """line 1149, col
umn 12 of dart:core/uri.dart: """, result is String, true); |
| 599 } | 605 } |
| 600 static String _makeQuery(String query, int start, int end, Map<String, String>
queryParameters) { | 606 static String _makeQuery(String query, int start, int end, Map<String, String>
queryParameters) { |
| 601 if (query == null && queryParameters == null) return null; | 607 if (query == null && queryParameters == null) return null; |
| 602 if (query != null && queryParameters != null) { | 608 if (query != null && queryParameters != null) { |
| 603 throw new ArgumentError('Both query and queryParameters specified'); | 609 throw new ArgumentError('Both query and queryParameters specified'); |
| 604 } | 610 } |
| 605 if (query != null) return _normalize(query, start, end, DEVC$RT.cast(_queryCh
arTable, dynamic, DEVC$RT.type((List<int> _) { | 611 if (query != null) return _normalize(query, start, end, DEVC$RT.cast(_queryCh
arTable, DEVC$RT.type((List<dynamic> _) { |
| 606 } | 612 } |
| 607 ), "CastGeneral", """line 1158, column 61 of dart:core/uri.dart: """, _queryCh
arTable is List<int>, false)); | 613 ), DEVC$RT.type((List<int> _) { |
| 614 } |
| 615 ), "CastDynamic", """line 1158, column 61 of dart:core/uri.dart: """, _queryCh
arTable is List<int>, false)); |
| 608 var result = new StringBuffer(); | 616 var result = new StringBuffer(); |
| 609 var first = true; | 617 var first = true; |
| 610 queryParameters.forEach((key, value) { | 618 queryParameters.forEach((key, value) { |
| 611 if (!first) { | 619 if (!first) { |
| 612 result.write("&"); | 620 result.write("&"); |
| 613 } | 621 } |
| 614 first = false; | 622 first = false; |
| 615 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "C
astGeneral", """line 1167, column 45 of dart:core/uri.dart: """, key is String,
true))); | 623 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "C
astGeneral", """line 1167, column 45 of dart:core/uri.dart: """, key is String,
true))); |
| 616 if (value != null && !value.isEmpty) { | 624 if (value != null && !value.isEmpty) { |
| 617 result.write("="); | 625 result.write("="); |
| 618 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(value, dynamic, String
, "CastGeneral", """line 1170, column 47 of dart:core/uri.dart: """, value is St
ring, true))); | 626 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(value, dynamic, String
, "CastGeneral", """line 1170, column 47 of dart:core/uri.dart: """, value is St
ring, true))); |
| 619 } | 627 } |
| 620 } | 628 } |
| 621 ); | 629 ); |
| 622 return result.toString(); | 630 return result.toString(); |
| 623 } | 631 } |
| 624 static String _makeFragment(String fragment, int start, int end) { | 632 static String _makeFragment(String fragment, int start, int end) { |
| 625 if (fragment == null) return null; | 633 if (fragment == null) return null; |
| 626 return _normalize(fragment, start, end, DEVC$RT.cast(_queryCharTable, dynamic
, DEVC$RT.type((List<int> _) { | 634 return _normalize(fragment, start, end, DEVC$RT.cast(_queryCharTable, DEVC$RT
.type((List<dynamic> _) { |
| 627 } | 635 } |
| 628 ), "CastGeneral", """line 1178, column 45 of dart:core/uri.dart: """, _queryCh
arTable is List<int>, false)); | 636 ), DEVC$RT.type((List<int> _) { |
| 637 } |
| 638 ), "CastDynamic", """line 1178, column 45 of dart:core/uri.dart: """, _queryCh
arTable is List<int>, false)); |
| 629 } | 639 } |
| 630 static int _stringOrNullLength(String s) => (s == null) ? 0 : s.length; | 640 static int _stringOrNullLength(String s) => (s == null) ? 0 : s.length; |
| 631 static bool _isHexDigit(int char) { | 641 static bool _isHexDigit(int char) { |
| 632 if (_NINE >= char) return _ZERO <= char; | 642 if (_NINE >= char) return _ZERO <= char; |
| 633 char |= 0x20; | 643 char |= 0x20; |
| 634 return _LOWER_CASE_A <= char && _LOWER_CASE_F >= char; | 644 return _LOWER_CASE_A <= char && _LOWER_CASE_F >= char; |
| 635 } | 645 } |
| 636 static int _hexValue(int char) { | 646 static int _hexValue(int char) { |
| 637 assert (_isHexDigit(char)); if (_NINE >= char) return char - _ZERO; | 647 assert (_isHexDigit(char)); if (_NINE >= char) return char - _ZERO; |
| 638 char |= 0x20; | 648 char |= 0x20; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 } | 986 } |
| 977 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(
path, combine(query, combine(fragment, 1))))))); | 987 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(
path, combine(query, combine(fragment, 1))))))); |
| 978 } | 988 } |
| 979 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s
econd) { | 989 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s
econd) { |
| 980 if ("" != test) { | 990 if ("" != test) { |
| 981 sb.write(first); | 991 sb.write(first); |
| 982 sb.write(second); | 992 sb.write(second); |
| 983 } | 993 } |
| 984 } | 994 } |
| 985 static String encodeComponent(String component) { | 995 static String encodeComponent(String component) { |
| 986 return _uriEncode(DEVC$RT.cast(_unreserved2396Table, dynamic, DEVC$RT.type((Li
st<int> _) { | 996 return _uriEncode(DEVC$RT.cast(_unreserved2396Table, DEVC$RT.type((List<dynami
c> _) { |
| 987 } | 997 } |
| 988 ), "CastGeneral", """line 1749, column 23 of dart:core/uri.dart: """, _unreser
ved2396Table is List<int>, false), component); | 998 ), DEVC$RT.type((List<int> _) { |
| 999 } |
| 1000 ), "CastDynamic", """line 1749, column 23 of dart:core/uri.dart: """, _unreser
ved2396Table is List<int>, false), component); |
| 989 } | 1001 } |
| 990 static String encodeQueryComponent(String component, { | 1002 static String encodeQueryComponent(String component, { |
| 991 Encoding encoding : UTF8} | 1003 Encoding encoding : UTF8} |
| 992 ) { | 1004 ) { |
| 993 return _uriEncode(DEVC$RT.cast(_unreservedTable, dynamic, DEVC$RT.type((List<i
nt> _) { | 1005 return _uriEncode(DEVC$RT.cast(_unreservedTable, DEVC$RT.type((List<dynamic> _
) { |
| 994 } | 1006 } |
| 995 ), "CastGeneral", """line 1788, column 9 of dart:core/uri.dart: """, _unreserv
edTable is List<int>, false), component, encoding: encoding, spaceToPlus: true); | 1007 ), DEVC$RT.type((List<int> _) { |
| 1008 } |
| 1009 ), "CastDynamic", """line 1788, column 9 of dart:core/uri.dart: """, _unreserv
edTable is List<int>, false), component, encoding: encoding, spaceToPlus: true); |
| 996 } | 1010 } |
| 997 static String decodeComponent(String encodedComponent) { | 1011 static String decodeComponent(String encodedComponent) { |
| 998 return _uriDecode(encodedComponent); | 1012 return _uriDecode(encodedComponent); |
| 999 } | 1013 } |
| 1000 static String decodeQueryComponent(String encodedComponent, { | 1014 static String decodeQueryComponent(String encodedComponent, { |
| 1001 Encoding encoding : UTF8} | 1015 Encoding encoding : UTF8} |
| 1002 ) { | 1016 ) { |
| 1003 return _uriDecode(encodedComponent, plusToSpace: true, encoding: encoding); | 1017 return _uriDecode(encodedComponent, plusToSpace: true, encoding: encoding); |
| 1004 } | 1018 } |
| 1005 static String encodeFull(String uri) { | 1019 static String encodeFull(String uri) { |
| 1006 return _uriEncode(DEVC$RT.cast(_encodeFullTable, dynamic, DEVC$RT.type((List<i
nt> _) { | 1020 return _uriEncode(DEVC$RT.cast(_encodeFullTable, DEVC$RT.type((List<dynamic> _
) { |
| 1007 } | 1021 } |
| 1008 ), "CastGeneral", """line 1832, column 23 of dart:core/uri.dart: """, _encodeF
ullTable is List<int>, false), uri); | 1022 ), DEVC$RT.type((List<int> _) { |
| 1023 } |
| 1024 ), "CastDynamic", """line 1832, column 23 of dart:core/uri.dart: """, _encodeF
ullTable is List<int>, false), uri); |
| 1009 } | 1025 } |
| 1010 static String decodeFull(String uri) { | 1026 static String decodeFull(String uri) { |
| 1011 return _uriDecode(uri); | 1027 return _uriDecode(uri); |
| 1012 } | 1028 } |
| 1013 static Map<String, String> splitQueryString(String query, { | 1029 static Map<String, String> splitQueryString(String query, { |
| 1014 Encoding encoding : UTF8} | 1030 Encoding encoding : UTF8} |
| 1015 ) { | 1031 ) { |
| 1016 return ((__x22) => DEVC$RT.cast(__x22, dynamic, DEVC$RT.type((Map<String, Stri
ng> _) { | 1032 return ((__x22) => DEVC$RT.cast(__x22, dynamic, DEVC$RT.type((Map<String, Stri
ng> _) { |
| 1017 } | 1033 } |
| 1018 ), "CastGeneral", """line 1864, column 12 of dart:core/uri.dart: """, __x22 is
Map<String, String>, false))(query.split("&").fold({ | 1034 ), "CastGeneral", """line 1864, column 12 of dart:core/uri.dart: """, __x22 is
Map<String, String>, false))(query.split("&").fold({ |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 static const _schemeTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0xfffe, 0x07
ff, 0xfffe, 0x07ff]; | 1288 static const _schemeTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0xfffe, 0x07
ff, 0xfffe, 0x07ff]; |
| 1273 static const _schemeLowerTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0x0000,
0x0000, 0xfffe, 0x07ff]; | 1289 static const _schemeLowerTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0x0000,
0x0000, 0xfffe, 0x07ff]; |
| 1274 static const _subDelimitersTable = const [0x0000, 0x0000, 0x7fd2, 0x2bff, 0xfff
e, 0x87ff, 0xfffe, 0x47ff]; | 1290 static const _subDelimitersTable = const [0x0000, 0x0000, 0x7fd2, 0x2bff, 0xfff
e, 0x87ff, 0xfffe, 0x47ff]; |
| 1275 static const _genDelimitersTable = const [0x0000, 0x0000, 0x8008, 0x8400, 0x000
1, 0x2800, 0x0000, 0x0000]; | 1291 static const _genDelimitersTable = const [0x0000, 0x0000, 0x8008, 0x8400, 0x000
1, 0x2800, 0x0000, 0x0000]; |
| 1276 static const _userinfoTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xfffe, 0x
87ff, 0xfffe, 0x47ff]; | 1292 static const _userinfoTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xfffe, 0x
87ff, 0xfffe, 0x47ff]; |
| 1277 static const _regNameTable = const [0x0000, 0x0000, 0x7ff2, 0x2bff, 0xfffe, 0x8
7ff, 0xfffe, 0x47ff]; | 1293 static const _regNameTable = const [0x0000, 0x0000, 0x7ff2, 0x2bff, 0xfffe, 0x8
7ff, 0xfffe, 0x47ff]; |
| 1278 static const _pathCharTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xffff, 0x
87ff, 0xfffe, 0x47ff]; | 1294 static const _pathCharTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xffff, 0x
87ff, 0xfffe, 0x47ff]; |
| 1279 static const _pathCharOrSlashTable = const [0x0000, 0x0000, 0xffd2, 0x2fff, 0xf
fff, 0x87ff, 0xfffe, 0x47ff]; | 1295 static const _pathCharOrSlashTable = const [0x0000, 0x0000, 0xffd2, 0x2fff, 0xf
fff, 0x87ff, 0xfffe, 0x47ff]; |
| 1280 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0
x87ff, 0xfffe, 0x47ff]; | 1296 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0
x87ff, 0xfffe, 0x47ff]; |
| 1281 } | 1297 } |
| OLD | NEW |