| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 host = authority.substring(hostStart, hostEnd); | 269 host = authority.substring(hostStart, hostEnd); |
| 270 } | 270 } |
| 271 return new Uri(scheme: scheme, userInfo: userInfo, host: DEVC$RT.cast(host, d
ynamic, String, "CastGeneral", """line 609, column 26 of dart:core/uri.dart: """
, host is String, true), port: DEVC$RT.cast(port, dynamic, int, "CastGeneral", "
""line 610, column 26 of dart:core/uri.dart: """, port is int, true), pathSegmen
ts: unencodedPath.split("/"), queryParameters: queryParameters); | 271 return new Uri(scheme: scheme, userInfo: userInfo, host: DEVC$RT.cast(host, d
ynamic, String, "CastGeneral", """line 609, column 26 of dart:core/uri.dart: """
, host is String, true), port: DEVC$RT.cast(port, dynamic, int, "CastGeneral", "
""line 610, column 26 of dart:core/uri.dart: """, port is int, true), pathSegmen
ts: unencodedPath.split("/"), queryParameters: queryParameters); |
| 272 } | 272 } |
| 273 factory Uri.file(String path, { | 273 factory Uri.file(String path, { |
| 274 bool windows} | 274 bool windows} |
| 275 ) { | 275 ) { |
| 276 windows = windows == null ? Uri._isWindows : windows; | 276 windows = windows == null ? Uri._isWindows : windows; |
| 277 return ((__x13) => DEVC$RT.cast(__x13, dynamic, Uri, "CastGeneral", """line 6
98, column 12 of dart:core/uri.dart: """, __x13 is Uri, true))(windows ? _makeWi
ndowsFileUrl(path) : _makeFileUri(path)); | 277 return ((__x12) => DEVC$RT.cast(__x12, dynamic, Uri, "CastGeneral", """line 6
98, column 12 of dart:core/uri.dart: """, __x12 is Uri, true))(windows ? _makeWi
ndowsFileUrl(path) : _makeFileUri(path)); |
| 278 } | 278 } |
| 279 external static Uri get base; | 279 external static Uri get base; |
| 280 external static bool get _isWindows; | 280 external static bool get _isWindows; |
| 281 static _checkNonWindowsPathReservedCharacters(List<String> segments, bool argum
entError) { | 281 static _checkNonWindowsPathReservedCharacters(List<String> segments, bool argum
entError) { |
| 282 segments.forEach((segment) { | 282 segments.forEach((segment) { |
| 283 if (segment.contains("/")) { | 283 if (segment.contains("/")) { |
| 284 if (argumentError) { | 284 if (argumentError) { |
| 285 throw new ArgumentError("Illegal path character $segment"); | 285 throw new ArgumentError("Illegal path character $segment"); |
| 286 } | 286 } |
| 287 else { | 287 else { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 if (userInfo != null) { | 384 if (userInfo != null) { |
| 385 userInfo = _makeUserInfo(userInfo, 0, userInfo.length); | 385 userInfo = _makeUserInfo(userInfo, 0, userInfo.length); |
| 386 } | 386 } |
| 387 else { | 387 else { |
| 388 userInfo = this.userInfo; | 388 userInfo = this.userInfo; |
| 389 } | 389 } |
| 390 if (port != null) { | 390 if (port != null) { |
| 391 port = _makePort(port, scheme); | 391 port = _makePort(port, scheme); |
| 392 } | 392 } |
| 393 else { | 393 else { |
| 394 port = ((__x14) => DEVC$RT.cast(__x14, num, int, "CastGeneral", """line 889,
column 14 of dart:core/uri.dart: """, __x14 is int, true))(this._port); | 394 port = ((__x13) => DEVC$RT.cast(__x13, num, int, "CastGeneral", """line 889,
column 14 of dart:core/uri.dart: """, __x13 is int, true))(this._port); |
| 395 if (schemeChanged) { | 395 if (schemeChanged) { |
| 396 port = _makePort(port, scheme); | 396 port = _makePort(port, scheme); |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 if (host != null) { | 399 if (host != null) { |
| 400 host = _makeHost(host, 0, host.length, false); | 400 host = _makeHost(host, 0, host.length, false); |
| 401 } | 401 } |
| 402 else if (this.hasAuthority) { | 402 else if (this.hasAuthority) { |
| 403 host = this.host; | 403 host = this.host; |
| 404 } | 404 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 425 fragment = _makeFragment(fragment, 0, fragment.length); | 425 fragment = _makeFragment(fragment, 0, fragment.length); |
| 426 } | 426 } |
| 427 else if (this.hasFragment) { | 427 else if (this.hasFragment) { |
| 428 fragment = this.fragment; | 428 fragment = this.fragment; |
| 429 } | 429 } |
| 430 return new Uri._internal(scheme, userInfo, host, port, path, query, fragment)
; | 430 return new Uri._internal(scheme, userInfo, host, port, path, query, fragment)
; |
| 431 } | 431 } |
| 432 List<String> get pathSegments { | 432 List<String> get pathSegments { |
| 433 if (_pathSegments == null) { | 433 if (_pathSegments == null) { |
| 434 var pathToSplit = !path.isEmpty && path.codeUnitAt(0) == _SLASH ? path.subst
ring(1) : path; | 434 var pathToSplit = !path.isEmpty && path.codeUnitAt(0) == _SLASH ? path.subst
ring(1) : path; |
| 435 _pathSegments = ((__x15) => DEVC$RT.cast(__x15, DEVC$RT.type((DDC$collectio
n$.UnmodifiableListView<dynamic> _) { | 435 _pathSegments = ((__x14) => DEVC$RT.cast(__x14, DEVC$RT.type((DDC$collectio
n$.UnmodifiableListView<dynamic> _) { |
| 436 } | 436 } |
| 437 ), DEVC$RT.type((List<String> _) { | 437 ), DEVC$RT.type((List<String> _) { |
| 438 } | 438 } |
| 439 ), "CastExact", """line 945, column 23 of dart:core/uri.dart: """, __x15 is
List<String>, false))(new UnmodifiableListView(pathToSplit == "" ? const <String
> [] : pathToSplit.split("/").map(Uri.decodeComponent).toList(growable: false)))
; | 439 ), "CastExact", """line 945, column 23 of dart:core/uri.dart: """, __x14 is
List<String>, false))(new UnmodifiableListView(pathToSplit == "" ? const <String
> [] : pathToSplit.split("/").map(Uri.decodeComponent).toList(growable: false)))
; |
| 440 } | 440 } |
| 441 return _pathSegments; | 441 return _pathSegments; |
| 442 } | 442 } |
| 443 Map<String, String> get queryParameters { | 443 Map<String, String> get queryParameters { |
| 444 if (_queryParameters == null) { | 444 if (_queryParameters == null) { |
| 445 _queryParameters = ((__x16) => DEVC$RT.cast(__x16, DEVC$RT.type((DDC$collect
ion$.UnmodifiableMapView<dynamic, dynamic> _) { | 445 _queryParameters = ((__x15) => DEVC$RT.cast(__x15, DEVC$RT.type((DDC$collect
ion$.UnmodifiableMapView<dynamic, dynamic> _) { |
| 446 } | 446 } |
| 447 ), DEVC$RT.type((Map<String, String> _) { | 447 ), DEVC$RT.type((Map<String, String> _) { |
| 448 } | 448 } |
| 449 ), "CastExact", """line 969, column 26 of dart:core/uri.dart: """, __x16 is
Map<String, String>, false))(new UnmodifiableMapView(splitQueryString(query))); | 449 ), "CastExact", """line 969, column 26 of dart:core/uri.dart: """, __x15 is
Map<String, String>, false))(new UnmodifiableMapView(splitQueryString(query))); |
| 450 } | 450 } |
| 451 return _queryParameters; | 451 return _queryParameters; |
| 452 } | 452 } |
| 453 static int _makePort(int port, String scheme) { | 453 static int _makePort(int port, String scheme) { |
| 454 if (port != null && port == _defaultPort(scheme)) return null; | 454 if (port != null && port == _defaultPort(scheme)) return null; |
| 455 return port; | 455 return port; |
| 456 } | 456 } |
| 457 static String _makeHost(String host, int start, int end, bool strictIPv6) { | 457 static String _makeHost(String host, int start, int end, bool strictIPv6) { |
| 458 if (host == null) return null; | 458 if (host == null) return null; |
| 459 if (start == end) return ""; | 459 if (start == end) return ""; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 } | 661 } |
| 662 static bool _isUnreservedChar(int ch) { | 662 static bool _isUnreservedChar(int ch) { |
| 663 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); | 663 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); |
| 664 } | 664 } |
| 665 static String _escapeChar(char) { | 665 static String _escapeChar(char) { |
| 666 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF"; | 666 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF"; |
| 667 List codeUnits; | 667 List codeUnits; |
| 668 if (char < 0x80) { | 668 if (char < 0x80) { |
| 669 codeUnits = new List(3); | 669 codeUnits = new List(3); |
| 670 codeUnits[0] = _PERCENT; | 670 codeUnits[0] = _PERCENT; |
| 671 codeUnits[1] = hexDigits.codeUnitAt(((__x17) => DEVC$RT.cast(__x17, dynamic
, int, "CastGeneral", """line 1248, column 43 of dart:core/uri.dart: """, __x17
is int, true))(char >> 4)); | 671 codeUnits[1] = hexDigits.codeUnitAt(((__x16) => DEVC$RT.cast(__x16, dynamic
, int, "CastGeneral", """line 1248, column 43 of dart:core/uri.dart: """, __x16
is int, true))(char >> 4)); |
| 672 codeUnits[2] = hexDigits.codeUnitAt(((__x18) => DEVC$RT.cast(__x18, dynamic
, int, "CastGeneral", """line 1249, column 43 of dart:core/uri.dart: """, __x18
is int, true))(char & 0xf)); | 672 codeUnits[2] = hexDigits.codeUnitAt(((__x17) => DEVC$RT.cast(__x17, dynamic
, int, "CastGeneral", """line 1249, column 43 of dart:core/uri.dart: """, __x17
is int, true))(char & 0xf)); |
| 673 } | 673 } |
| 674 else { | 674 else { |
| 675 int flag = 0xc0; | 675 int flag = 0xc0; |
| 676 int encodedBytes = 2; | 676 int encodedBytes = 2; |
| 677 if (char > 0x7ff) { | 677 if (char > 0x7ff) { |
| 678 flag = 0xe0; | 678 flag = 0xe0; |
| 679 encodedBytes = 3; | 679 encodedBytes = 3; |
| 680 if (char > 0xffff) { | 680 if (char > 0xffff) { |
| 681 encodedBytes = 4; | 681 encodedBytes = 4; |
| 682 flag = 0xf0; | 682 flag = 0xf0; |
| 683 } | 683 } |
| 684 } | 684 } |
| 685 codeUnits = new List(3 * encodedBytes); | 685 codeUnits = new List(3 * encodedBytes); |
| 686 int index = 0; | 686 int index = 0; |
| 687 while (--encodedBytes >= 0) { | 687 while (--encodedBytes >= 0) { |
| 688 int byte = ((__x19) => DEVC$RT.cast(__x19, dynamic, int, "CastGeneral", ""
"line 1265, column 20 of dart:core/uri.dart: """, __x19 is int, true))(((char >>
(6 * encodedBytes)) & 0x3f) | flag); | 688 int byte = ((__x18) => DEVC$RT.cast(__x18, dynamic, int, "CastGeneral", ""
"line 1265, column 20 of dart:core/uri.dart: """, __x18 is int, true))(((char >>
(6 * encodedBytes)) & 0x3f) | flag); |
| 689 codeUnits[index] = _PERCENT; | 689 codeUnits[index] = _PERCENT; |
| 690 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4); | 690 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4); |
| 691 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf); | 691 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf); |
| 692 index += 3; | 692 index += 3; |
| 693 flag = 0x80; | 693 flag = 0x80; |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 return new String.fromCharCodes(DEVC$RT.cast(codeUnits, DEVC$RT.type((List<dy
namic> _) { | 696 return new String.fromCharCodes(DEVC$RT.cast(codeUnits, DEVC$RT.type((List<dy
namic> _) { |
| 697 } | 697 } |
| 698 ), DEVC$RT.type((Iterable<int> _) { | 698 ), DEVC$RT.type((Iterable<int> _) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 } | 786 } |
| 787 return base.substring(0, baseEnd + 1) + reference.substring(refStart - 3 * ba
ckCount); | 787 return base.substring(0, baseEnd + 1) + reference.substring(refStart - 3 * ba
ckCount); |
| 788 } | 788 } |
| 789 bool _hasDotSegments(String path) { | 789 bool _hasDotSegments(String path) { |
| 790 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true; | 790 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true; |
| 791 int index = path.indexOf("/."); | 791 int index = path.indexOf("/."); |
| 792 return index != -1; | 792 return index != -1; |
| 793 } | 793 } |
| 794 String _removeDotSegments(String path) { | 794 String _removeDotSegments(String path) { |
| 795 if (!_hasDotSegments(path)) return path; | 795 if (!_hasDotSegments(path)) return path; |
| 796 List<String> output = ((__x20) => DEVC$RT.cast(__x20, DEVC$RT.type((List<dyna
mic> _) { | 796 List<String> output = ((__x19) => DEVC$RT.cast(__x19, DEVC$RT.type((List<dyna
mic> _) { |
| 797 } | 797 } |
| 798 ), DEVC$RT.type((List<String> _) { | 798 ), DEVC$RT.type((List<String> _) { |
| 799 } | 799 } |
| 800 ), "CastLiteral", """line 1402, column 27 of dart:core/uri.dart: """, __x20 is
List<String>, false))([]); | 800 ), "CastLiteral", """line 1402, column 27 of dart:core/uri.dart: """, __x19 is
List<String>, false))([]); |
| 801 bool appendSlash = false; | 801 bool appendSlash = false; |
| 802 for (String segment in path.split("/")) { | 802 for (String segment in path.split("/")) { |
| 803 appendSlash = false; | 803 appendSlash = false; |
| 804 if (segment == "..") { | 804 if (segment == "..") { |
| 805 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output
.removeLast(); | 805 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output
.removeLast(); |
| 806 appendSlash = true; | 806 appendSlash = true; |
| 807 } | 807 } |
| 808 else if ("." == segment) { | 808 else if ("." == segment) { |
| 809 appendSlash = true; | 809 appendSlash = true; |
| 810 } | 810 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 823 String targetUserInfo = ""; | 823 String targetUserInfo = ""; |
| 824 String targetHost; | 824 String targetHost; |
| 825 int targetPort; | 825 int targetPort; |
| 826 String targetPath; | 826 String targetPath; |
| 827 String targetQuery; | 827 String targetQuery; |
| 828 if (reference.scheme.isNotEmpty) { | 828 if (reference.scheme.isNotEmpty) { |
| 829 targetScheme = reference.scheme; | 829 targetScheme = reference.scheme; |
| 830 if (reference.hasAuthority) { | 830 if (reference.hasAuthority) { |
| 831 targetUserInfo = reference.userInfo; | 831 targetUserInfo = reference.userInfo; |
| 832 targetHost = reference.host; | 832 targetHost = reference.host; |
| 833 targetPort = ((__x21) => DEVC$RT.cast(__x21, dynamic, int, "CastGeneral",
"""line 1456, column 22 of dart:core/uri.dart: """, __x21 is int, true))(refere
nce.hasPort ? reference.port : null); | 833 targetPort = reference.hasPort ? reference.port : null; |
| 834 } | 834 } |
| 835 targetPath = _removeDotSegments(reference.path); | 835 targetPath = _removeDotSegments(reference.path); |
| 836 if (reference.hasQuery) { | 836 if (reference.hasQuery) { |
| 837 targetQuery = reference.query; | 837 targetQuery = reference.query; |
| 838 } | 838 } |
| 839 } | 839 } |
| 840 else { | 840 else { |
| 841 targetScheme = this.scheme; | 841 targetScheme = this.scheme; |
| 842 if (reference.hasAuthority) { | 842 if (reference.hasAuthority) { |
| 843 targetUserInfo = reference.userInfo; | 843 targetUserInfo = reference.userInfo; |
| 844 targetHost = reference.host; | 844 targetHost = reference.host; |
| 845 targetPort = _makePort(((__x22) => DEVC$RT.cast(__x22, dynamic, int, "Cas
tGeneral", """line 1467, column 32 of dart:core/uri.dart: """, __x22 is int, tru
e))(reference.hasPort ? reference.port : null), targetScheme); | 845 targetPort = _makePort(reference.hasPort ? reference.port : null, targetS
cheme); |
| 846 targetPath = _removeDotSegments(reference.path); | 846 targetPath = _removeDotSegments(reference.path); |
| 847 if (reference.hasQuery) targetQuery = reference.query; | 847 if (reference.hasQuery) targetQuery = reference.query; |
| 848 } | 848 } |
| 849 else { | 849 else { |
| 850 if (reference.path == "") { | 850 if (reference.path == "") { |
| 851 targetPath = this._path; | 851 targetPath = this._path; |
| 852 if (reference.hasQuery) { | 852 if (reference.hasQuery) { |
| 853 targetQuery = reference.query; | 853 targetQuery = reference.query; |
| 854 } | 854 } |
| 855 else { | 855 else { |
| 856 targetQuery = this._query; | 856 targetQuery = this._query; |
| 857 } | 857 } |
| 858 } | 858 } |
| 859 else { | 859 else { |
| 860 if (reference.path.startsWith("/")) { | 860 if (reference.path.startsWith("/")) { |
| 861 targetPath = _removeDotSegments(reference.path); | 861 targetPath = _removeDotSegments(reference.path); |
| 862 } | 862 } |
| 863 else { | 863 else { |
| 864 targetPath = _removeDotSegments(_merge(this._path, reference.path)); | 864 targetPath = _removeDotSegments(_merge(this._path, reference.path)); |
| 865 } | 865 } |
| 866 if (reference.hasQuery) targetQuery = reference.query; | 866 if (reference.hasQuery) targetQuery = reference.query; |
| 867 } | 867 } |
| 868 targetUserInfo = this._userInfo; | 868 targetUserInfo = this._userInfo; |
| 869 targetHost = this._host; | 869 targetHost = this._host; |
| 870 targetPort = ((__x23) => DEVC$RT.cast(__x23, num, int, "CastGeneral", """
line 1489, column 22 of dart:core/uri.dart: """, __x23 is int, true))(this._port
); | 870 targetPort = ((__x20) => DEVC$RT.cast(__x20, num, int, "CastGeneral", """
line 1489, column 22 of dart:core/uri.dart: """, __x20 is int, true))(this._port
); |
| 871 } | 871 } |
| 872 } | 872 } |
| 873 String fragment = ((__x24) => DEVC$RT.cast(__x24, dynamic, String, "CastGener
al", """line 1492, column 23 of dart:core/uri.dart: """, __x24 is String, true))
(reference.hasFragment ? reference.fragment : null); | 873 String fragment = reference.hasFragment ? reference.fragment : null; |
| 874 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort
, targetPath, targetQuery, fragment); | 874 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort
, targetPath, targetQuery, fragment); |
| 875 } | 875 } |
| 876 bool get hasAuthority => _host != null; | 876 bool get hasAuthority => _host != null; |
| 877 bool get hasPort => _port != null; | 877 bool get hasPort => _port != null; |
| 878 bool get hasQuery => _query != null; | 878 bool get hasQuery => _query != null; |
| 879 bool get hasFragment => _fragment != null; | 879 bool get hasFragment => _fragment != null; |
| 880 String get origin { | 880 String get origin { |
| 881 if (scheme == "" || _host == null || _host == "") { | 881 if (scheme == "" || _host == null || _host == "") { |
| 882 throw new StateError("Cannot use origin without a scheme: $this"); | 882 throw new StateError("Cannot use origin without a scheme: $this"); |
| 883 } | 883 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 } | 965 } |
| 966 return sb.toString(); | 966 return sb.toString(); |
| 967 } | 967 } |
| 968 bool operator ==(other) { | 968 bool operator ==(other) { |
| 969 if (other is! Uri) return false; | 969 if (other is! Uri) return false; |
| 970 Uri uri = DEVC$RT.cast(other, dynamic, Uri, "CastGeneral", """line 1698, colu
mn 15 of dart:core/uri.dart: """, other is Uri, true); | 970 Uri uri = DEVC$RT.cast(other, dynamic, Uri, "CastGeneral", """line 1698, colu
mn 15 of dart:core/uri.dart: """, other is Uri, true); |
| 971 return scheme == uri.scheme && hasAuthority == uri.hasAuthority && userInfo =
= uri.userInfo && host == uri.host && port == uri.port && path == uri.path && ha
sQuery == uri.hasQuery && query == uri.query && hasFragment == uri.hasFragment &
& fragment == uri.fragment; | 971 return scheme == uri.scheme && hasAuthority == uri.hasAuthority && userInfo =
= uri.userInfo && host == uri.host && port == uri.port && path == uri.path && ha
sQuery == uri.hasQuery && query == uri.query && hasFragment == uri.hasFragment &
& fragment == uri.fragment; |
| 972 } | 972 } |
| 973 int get hashCode { | 973 int get hashCode { |
| 974 int combine(part, current) { | 974 int combine(part, current) { |
| 975 return ((__x25) => DEVC$RT.cast(__x25, dynamic, int, "CastGeneral", """line
1714, column 14 of dart:core/uri.dart: """, __x25 is int, true))((current * 31 +
part.hashCode) & 0x3FFFFFFF); | 975 return ((__x21) => DEVC$RT.cast(__x21, dynamic, int, "CastGeneral", """line
1714, column 14 of dart:core/uri.dart: """, __x21 is int, true))((current * 31 +
part.hashCode) & 0x3FFFFFFF); |
| 976 } | 976 } |
| 977 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(
path, combine(query, combine(fragment, 1))))))); | 977 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(
path, combine(query, combine(fragment, 1))))))); |
| 978 } | 978 } |
| 979 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s
econd) { | 979 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s
econd) { |
| 980 if ("" != test) { | 980 if ("" != test) { |
| 981 sb.write(first); | 981 sb.write(first); |
| 982 sb.write(second); | 982 sb.write(second); |
| 983 } | 983 } |
| 984 } | 984 } |
| 985 static String encodeComponent(String component) { | 985 static String encodeComponent(String component) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1006 return _uriEncode(DEVC$RT.cast(_encodeFullTable, dynamic, DEVC$RT.type((List<i
nt> _) { | 1006 return _uriEncode(DEVC$RT.cast(_encodeFullTable, dynamic, DEVC$RT.type((List<i
nt> _) { |
| 1007 } | 1007 } |
| 1008 ), "CastGeneral", """line 1832, column 23 of dart:core/uri.dart: """, _encodeF
ullTable is List<int>, false), uri); | 1008 ), "CastGeneral", """line 1832, column 23 of dart:core/uri.dart: """, _encodeF
ullTable is List<int>, false), uri); |
| 1009 } | 1009 } |
| 1010 static String decodeFull(String uri) { | 1010 static String decodeFull(String uri) { |
| 1011 return _uriDecode(uri); | 1011 return _uriDecode(uri); |
| 1012 } | 1012 } |
| 1013 static Map<String, String> splitQueryString(String query, { | 1013 static Map<String, String> splitQueryString(String query, { |
| 1014 Encoding encoding : UTF8} | 1014 Encoding encoding : UTF8} |
| 1015 ) { | 1015 ) { |
| 1016 return ((__x26) => DEVC$RT.cast(__x26, dynamic, DEVC$RT.type((Map<String, Stri
ng> _) { | 1016 return ((__x22) => DEVC$RT.cast(__x22, dynamic, DEVC$RT.type((Map<String, Stri
ng> _) { |
| 1017 } | 1017 } |
| 1018 ), "CastGeneral", """line 1864, column 12 of dart:core/uri.dart: """, __x26 is
Map<String, String>, false))(query.split("&").fold({ | 1018 ), "CastGeneral", """line 1864, column 12 of dart:core/uri.dart: """, __x22 is
Map<String, String>, false))(query.split("&").fold({ |
| 1019 } | 1019 } |
| 1020 , (map, element) { | 1020 , (map, element) { |
| 1021 int index = ((__x27) => DEVC$RT.cast(__x27, dynamic, int, "CastGeneral", """
line 1865, column 19 of dart:core/uri.dart: """, __x27 is int, true))(element.in
dexOf("=")); | 1021 int index = ((__x23) => DEVC$RT.cast(__x23, dynamic, int, "CastGeneral", """
line 1865, column 19 of dart:core/uri.dart: """, __x23 is int, true))(element.in
dexOf("=")); |
| 1022 if (index == -1) { | 1022 if (index == -1) { |
| 1023 if (element != "") { | 1023 if (element != "") { |
| 1024 map[decodeQueryComponent(DEVC$RT.cast(element, dynamic, String, "CastGen
eral", """line 1868, column 36 of dart:core/uri.dart: """, element is String, tr
ue), encoding: encoding)] = ""; | 1024 map[decodeQueryComponent(DEVC$RT.cast(element, dynamic, String, "CastGen
eral", """line 1868, column 36 of dart:core/uri.dart: """, element is String, tr
ue), encoding: encoding)] = ""; |
| 1025 } | 1025 } |
| 1026 } | 1026 } |
| 1027 else if (index != 0) { | 1027 else if (index != 0) { |
| 1028 var key = element.substring(0, index); | 1028 var key = element.substring(0, index); |
| 1029 var value = element.substring(index + 1); | 1029 var value = element.substring(index + 1); |
| 1030 map[Uri.decodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "CastGene
ral", """line 1873, column 38 of dart:core/uri.dart: """, key is String, true),
encoding: encoding)] = decodeQueryComponent(DEVC$RT.cast(value, dynamic, String,
"CastGeneral", """line 1874, column 34 of dart:core/uri.dart: """, value is Str
ing, true), encoding: encoding); | 1030 map[Uri.decodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "CastGene
ral", """line 1873, column 38 of dart:core/uri.dart: """, key is String, true),
encoding: encoding)] = decodeQueryComponent(DEVC$RT.cast(value, dynamic, String,
"CastGeneral", """line 1874, column 34 of dart:core/uri.dart: """, value is Str
ing, true), encoding: encoding); |
| 1031 } | 1031 } |
| 1032 return map; | 1032 return map; |
| 1033 } | 1033 } |
| 1034 )); | 1034 )); |
| 1035 } | 1035 } |
| 1036 static List<int> parseIPv4Address(String host) { | 1036 static List<int> parseIPv4Address(String host) { |
| 1037 void error(String msg) { | 1037 void error(String msg) { |
| 1038 throw new FormatException('Illegal IPv4 address, $msg'); | 1038 throw new FormatException('Illegal IPv4 address, $msg'); |
| 1039 } | 1039 } |
| 1040 var bytes = host.split('.'); | 1040 var bytes = host.split('.'); |
| 1041 if (bytes.length != 4) { | 1041 if (bytes.length != 4) { |
| 1042 error('IPv4 address should contain exactly 4 parts'); | 1042 error('IPv4 address should contain exactly 4 parts'); |
| 1043 } | 1043 } |
| 1044 return ((__x28) => DEVC$RT.cast(__x28, DEVC$RT.type((List<dynamic> _) { | 1044 return ((__x24) => DEVC$RT.cast(__x24, DEVC$RT.type((List<dynamic> _) { |
| 1045 } | 1045 } |
| 1046 ), DEVC$RT.type((List<int> _) { | 1046 ), DEVC$RT.type((List<int> _) { |
| 1047 } | 1047 } |
| 1048 ), "CastDynamic", """line 1896, column 12 of dart:core/uri.dart: """, __x28 is
List<int>, false))(bytes.map((byteString) { | 1048 ), "CastDynamic", """line 1896, column 12 of dart:core/uri.dart: """, __x24 is
List<int>, false))(bytes.map((byteString) { |
| 1049 int byte = int.parse(DEVC$RT.cast(byteString, dynamic, String, "CastGeneral"
, """line 1898, column 32 of dart:core/uri.dart: """, byteString is String, true
)); | 1049 int byte = int.parse(DEVC$RT.cast(byteString, dynamic, String, "CastGeneral"
, """line 1898, column 32 of dart:core/uri.dart: """, byteString is String, true
)); |
| 1050 if (byte < 0 || byte > 255) { | 1050 if (byte < 0 || byte > 255) { |
| 1051 error('each part must be in the range of `0..255`'); | 1051 error('each part must be in the range of `0..255`'); |
| 1052 } | 1052 } |
| 1053 return byte; | 1053 return byte; |
| 1054 } | 1054 } |
| 1055 ).toList()); | 1055 ).toList()); |
| 1056 } | 1056 } |
| 1057 static List<int> parseIPv6Address(String host, [int start = 0, int end]) { | 1057 static List<int> parseIPv6Address(String host, [int start = 0, int end]) { |
| 1058 if (end == null) end = host.length; | 1058 if (end == null) end = host.length; |
| 1059 void error(String msg, [position]) { | 1059 void error(String msg, [position]) { |
| 1060 throw new FormatException('Illegal IPv6 address, $msg', host, DEVC$RT.cast(p
osition, dynamic, int, "CastGeneral", """line 1933, column 69 of dart:core/uri.d
art: """, position is int, true)); | 1060 throw new FormatException('Illegal IPv6 address, $msg', host, DEVC$RT.cast(p
osition, dynamic, int, "CastGeneral", """line 1933, column 69 of dart:core/uri.d
art: """, position is int, true)); |
| 1061 } | 1061 } |
| 1062 int parseHex(int start, int end) { | 1062 int parseHex(int start, int end) { |
| 1063 if (end - start > 4) { | 1063 if (end - start > 4) { |
| 1064 error('an IPv6 part can only contain a maximum of 4 hex digits', start); | 1064 error('an IPv6 part can only contain a maximum of 4 hex digits', start); |
| 1065 } | 1065 } |
| 1066 int value = int.parse(host.substring(start, end), radix: 16); | 1066 int value = int.parse(host.substring(start, end), radix: 16); |
| 1067 if (value < 0 || value > (1 << 16) - 1) { | 1067 if (value < 0 || value > (1 << 16) - 1) { |
| 1068 error('each part must be in the range of `0x0..0xFFFF`', start); | 1068 error('each part must be in the range of `0x0..0xFFFF`', start); |
| 1069 } | 1069 } |
| 1070 return value; | 1070 return value; |
| 1071 } | 1071 } |
| 1072 if (host.length < 2) error('address is too short'); | 1072 if (host.length < 2) error('address is too short'); |
| 1073 List<int> parts = ((__x29) => DEVC$RT.cast(__x29, DEVC$RT.type((List<dynamic>
_) { | 1073 List<int> parts = ((__x25) => DEVC$RT.cast(__x25, DEVC$RT.type((List<dynamic>
_) { |
| 1074 } | 1074 } |
| 1075 ), DEVC$RT.type((List<int> _) { | 1075 ), DEVC$RT.type((List<int> _) { |
| 1076 } | 1076 } |
| 1077 ), "CastLiteral", """line 1946, column 23 of dart:core/uri.dart: """, __x29 is
List<int>, false))([]); | 1077 ), "CastLiteral", """line 1946, column 23 of dart:core/uri.dart: """, __x25 is
List<int>, false))([]); |
| 1078 bool wildcardSeen = false; | 1078 bool wildcardSeen = false; |
| 1079 int partStart = start; | 1079 int partStart = start; |
| 1080 for (int i = start; i < end; i++) { | 1080 for (int i = start; i < end; i++) { |
| 1081 if (host.codeUnitAt(i) == _COLON) { | 1081 if (host.codeUnitAt(i) == _COLON) { |
| 1082 if (i == start) { | 1082 if (i == start) { |
| 1083 i++; | 1083 i++; |
| 1084 if (host.codeUnitAt(i) != _COLON) { | 1084 if (host.codeUnitAt(i) != _COLON) { |
| 1085 error('invalid start colon.', i); | 1085 error('invalid start colon.', i); |
| 1086 } | 1086 } |
| 1087 partStart = i; | 1087 partStart = i; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 static const int _RIGHT_BRACKET = 0x5D; | 1174 static const int _RIGHT_BRACKET = 0x5D; |
| 1175 static const int _LOWER_CASE_A = 0x61; | 1175 static const int _LOWER_CASE_A = 0x61; |
| 1176 static const int _LOWER_CASE_F = 0x66; | 1176 static const int _LOWER_CASE_F = 0x66; |
| 1177 static const int _LOWER_CASE_Z = 0x7A; | 1177 static const int _LOWER_CASE_Z = 0x7A; |
| 1178 static const int _BAR = 0x7C; | 1178 static const int _BAR = 0x7C; |
| 1179 static String _uriEncode(List<int> canonicalTable, String text, { | 1179 static String _uriEncode(List<int> canonicalTable, String text, { |
| 1180 Encoding encoding : UTF8, bool spaceToPlus : false} | 1180 Encoding encoding : UTF8, bool spaceToPlus : false} |
| 1181 ) { | 1181 ) { |
| 1182 byteToHex(byte, buffer) { | 1182 byteToHex(byte, buffer) { |
| 1183 const String hex = '0123456789ABCDEF'; | 1183 const String hex = '0123456789ABCDEF'; |
| 1184 buffer.writeCharCode(hex.codeUnitAt(((__x30) => DEVC$RT.cast(__x30, dynamic
, int, "CastGeneral", """line 2059, column 43 of dart:core/uri.dart: """, __x30
is int, true))(byte >> 4))); | 1184 buffer.writeCharCode(hex.codeUnitAt(((__x26) => DEVC$RT.cast(__x26, dynamic
, int, "CastGeneral", """line 2059, column 43 of dart:core/uri.dart: """, __x26
is int, true))(byte >> 4))); |
| 1185 buffer.writeCharCode(hex.codeUnitAt(((__x31) => DEVC$RT.cast(__x31, dynamic
, int, "CastGeneral", """line 2060, column 43 of dart:core/uri.dart: """, __x31
is int, true))(byte & 0x0f))); | 1185 buffer.writeCharCode(hex.codeUnitAt(((__x27) => DEVC$RT.cast(__x27, dynamic
, int, "CastGeneral", """line 2060, column 43 of dart:core/uri.dart: """, __x27
is int, true))(byte & 0x0f))); |
| 1186 } | 1186 } |
| 1187 StringBuffer result = new StringBuffer(); | 1187 StringBuffer result = new StringBuffer(); |
| 1188 var bytes = encoding.encode(text); | 1188 var bytes = encoding.encode(text); |
| 1189 for (int i = 0; i < bytes.length; i++) { | 1189 for (int i = 0; i < bytes.length; i++) { |
| 1190 int byte = bytes[i]; | 1190 int byte = bytes[i]; |
| 1191 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)
) { | 1191 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)
) { |
| 1192 result.writeCharCode(byte); | 1192 result.writeCharCode(byte); |
| 1193 } | 1193 } |
| 1194 else if (spaceToPlus && byte == _SPACE) { | 1194 else if (spaceToPlus && byte == _SPACE) { |
| 1195 result.writeCharCode(_PLUS); | 1195 result.writeCharCode(_PLUS); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 List<int> bytes; | 1231 List<int> bytes; |
| 1232 if (simple) { | 1232 if (simple) { |
| 1233 if (encoding == UTF8 || encoding == LATIN1) { | 1233 if (encoding == UTF8 || encoding == LATIN1) { |
| 1234 return text; | 1234 return text; |
| 1235 } | 1235 } |
| 1236 else { | 1236 else { |
| 1237 bytes = text.codeUnits; | 1237 bytes = text.codeUnits; |
| 1238 } | 1238 } |
| 1239 } | 1239 } |
| 1240 else { | 1240 else { |
| 1241 bytes = ((__x32) => DEVC$RT.cast(__x32, DEVC$RT.type((List<dynamic> _) { | 1241 bytes = ((__x28) => DEVC$RT.cast(__x28, DEVC$RT.type((List<dynamic> _) { |
| 1242 } | 1242 } |
| 1243 ), DEVC$RT.type((List<int> _) { | 1243 ), DEVC$RT.type((List<int> _) { |
| 1244 } | 1244 } |
| 1245 ), "CastExact", """line 2134, column 15 of dart:core/uri.dart: """, __x32 is
List<int>, false))(new List()); | 1245 ), "CastExact", """line 2134, column 15 of dart:core/uri.dart: """, __x28 is
List<int>, false))(new List()); |
| 1246 for (int i = 0; i < text.length; i++) { | 1246 for (int i = 0; i < text.length; i++) { |
| 1247 var codeUnit = text.codeUnitAt(i); | 1247 var codeUnit = text.codeUnitAt(i); |
| 1248 if (codeUnit > 127) { | 1248 if (codeUnit > 127) { |
| 1249 throw new ArgumentError("Illegal percent encoding in URI"); | 1249 throw new ArgumentError("Illegal percent encoding in URI"); |
| 1250 } | 1250 } |
| 1251 if (codeUnit == _PERCENT) { | 1251 if (codeUnit == _PERCENT) { |
| 1252 if (i + 3 > text.length) { | 1252 if (i + 3 > text.length) { |
| 1253 throw new ArgumentError('Truncated URI'); | 1253 throw new ArgumentError('Truncated URI'); |
| 1254 } | 1254 } |
| 1255 bytes.add(_hexCharPairToByte(text, i + 1)); | 1255 bytes.add(_hexCharPairToByte(text, i + 1)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1272 static const _schemeTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0xfffe, 0x07
ff, 0xfffe, 0x07ff]; | 1272 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]; | 1273 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]; | 1274 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]; | 1275 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]; | 1276 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]; | 1277 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]; | 1278 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]; | 1279 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]; | 1280 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0
x87ff, 0xfffe, 0x47ff]; |
| 1281 } | 1281 } |
| OLD | NEW |