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

Side by Side Diff: test/dart_codegen/expect/core/uri.dart

Issue 959003003: Typecheck constructor initializers properly (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 } 276 }
277 host = authority.substring(hostStart, hostEnd); 277 host = authority.substring(hostStart, hostEnd);
278 } 278 }
279 return new Uri(scheme: scheme, userInfo: userInfo, host: host, port: port, pa thSegments: unencodedPath.split("/"), queryParameters: queryParameters); 279 return new Uri(scheme: scheme, userInfo: userInfo, host: host, port: port, pa thSegments: unencodedPath.split("/"), queryParameters: queryParameters);
280 } 280 }
281 factory Uri.file(String path, { 281 factory Uri.file(String path, {
282 bool windows} 282 bool windows}
283 ) { 283 ) {
284 windows = windows == null ? Uri._isWindows : windows; 284 windows = windows == null ? Uri._isWindows : windows;
285 return ((__x10) => DDC$RT.cast(__x10, dynamic, Uri, "CastGeneral", """line 69 8, column 12 of dart:core/uri.dart: """, __x10 is Uri, true))(windows ? _makeWin dowsFileUrl(path) : _makeFileUri(path)); 285 return ((__x14) => DDC$RT.cast(__x14, dynamic, Uri, "CastGeneral", """line 69 8, column 12 of dart:core/uri.dart: """, __x14 is Uri, true))(windows ? _makeWin dowsFileUrl(path) : _makeFileUri(path));
286 } 286 }
287 external static Uri get base; 287 external static Uri get base;
288 external static bool get _isWindows; 288 external static bool get _isWindows;
289 static _checkNonWindowsPathReservedCharacters(List<String> segments, bool argum entError) { 289 static _checkNonWindowsPathReservedCharacters(List<String> segments, bool argum entError) {
290 segments.forEach((segment) { 290 segments.forEach((segment) {
291 if (segment.contains("/")) { 291 if (segment.contains("/")) {
292 if (argumentError) { 292 if (argumentError) {
293 throw new ArgumentError("Illegal path character $segment"); 293 throw new ArgumentError("Illegal path character $segment");
294 } 294 }
295 else { 295 else {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (userInfo != null) { 393 if (userInfo != null) {
394 userInfo = _makeUserInfo(userInfo, 0, userInfo.length); 394 userInfo = _makeUserInfo(userInfo, 0, userInfo.length);
395 } 395 }
396 else { 396 else {
397 userInfo = this.userInfo; 397 userInfo = this.userInfo;
398 } 398 }
399 if (port != null) { 399 if (port != null) {
400 port = _makePort(port, scheme); 400 port = _makePort(port, scheme);
401 } 401 }
402 else { 402 else {
403 port = ((__x11) => DDC$RT.cast(__x11, num, int, "CastGeneral", """line 889, co lumn 14 of dart:core/uri.dart: """, __x11 is int, true))(this._port); 403 port = ((__x15) => DDC$RT.cast(__x15, num, int, "CastGeneral", """line 889, co lumn 14 of dart:core/uri.dart: """, __x15 is int, true))(this._port);
404 if (schemeChanged) { 404 if (schemeChanged) {
405 port = _makePort(port, scheme); 405 port = _makePort(port, scheme);
406 } 406 }
407 } 407 }
408 if (host != null) { 408 if (host != null) {
409 host = _makeHost(host, 0, host.length, false); 409 host = _makeHost(host, 0, host.length, false);
410 } 410 }
411 else if (this.hasAuthority) { 411 else if (this.hasAuthority) {
412 host = this.host; 412 host = this.host;
413 } 413 }
(...skipping 20 matching lines...) Expand all
434 fragment = _makeFragment(fragment, 0, fragment.length); 434 fragment = _makeFragment(fragment, 0, fragment.length);
435 } 435 }
436 else if (this.hasFragment) { 436 else if (this.hasFragment) {
437 fragment = this.fragment; 437 fragment = this.fragment;
438 } 438 }
439 return new Uri._internal(scheme, userInfo, host, port, path, query, fragment); 439 return new Uri._internal(scheme, userInfo, host, port, path, query, fragment);
440 } 440 }
441 List<String> get pathSegments { 441 List<String> get pathSegments {
442 if (_pathSegments == null) { 442 if (_pathSegments == null) {
443 var pathToSplit = !path.isEmpty && path.codeUnitAt(0) == _SLASH ? path.substri ng(1) : path; 443 var pathToSplit = !path.isEmpty && path.codeUnitAt(0) == _SLASH ? path.substri ng(1) : path;
444 _pathSegments = ((__x12) => DDC$RT.cast(__x12, DDC$RT.type((DDC$collection$.U nmodifiableListView<dynamic> _) { 444 _pathSegments = ((__x16) => DDC$RT.cast(__x16, DDC$RT.type((DDC$collection$.U nmodifiableListView<dynamic> _) {
445 } 445 }
446 ), DDC$RT.type((List<String> _) { 446 ), DDC$RT.type((List<String> _) {
447 } 447 }
448 ), "CastExact", """line 945, column 23 of dart:core/uri.dart: """, __x12 is Li st<String>, false))(new UnmodifiableListView(pathToSplit == "" ? const <String> [] : pathToSplit.split("/").map(Uri.decodeComponent).toList(growable: false))); 448 ), "CastExact", """line 945, column 23 of dart:core/uri.dart: """, __x16 is Li st<String>, false))(new UnmodifiableListView(pathToSplit == "" ? const <String> [] : pathToSplit.split("/").map(Uri.decodeComponent).toList(growable: false)));
449 } 449 }
450 return _pathSegments; 450 return _pathSegments;
451 } 451 }
452 Map<String, String> get queryParameters { 452 Map<String, String> get queryParameters {
453 if (_queryParameters == null) { 453 if (_queryParameters == null) {
454 _queryParameters = ((__x13) => DDC$RT.cast(__x13, DDC$RT.type((DDC$collection$ .UnmodifiableMapView<dynamic, dynamic> _) { 454 _queryParameters = ((__x17) => DDC$RT.cast(__x17, DDC$RT.type((DDC$collection$ .UnmodifiableMapView<dynamic, dynamic> _) {
455 } 455 }
456 ), DDC$RT.type((Map<String, String> _) { 456 ), DDC$RT.type((Map<String, String> _) {
457 } 457 }
458 ), "CastExact", """line 969, column 26 of dart:core/uri.dart: """, __x13 is Ma p<String, String>, false))(new UnmodifiableMapView(splitQueryString(query))); 458 ), "CastExact", """line 969, column 26 of dart:core/uri.dart: """, __x17 is Ma p<String, String>, false))(new UnmodifiableMapView(splitQueryString(query)));
459 } 459 }
460 return _queryParameters; 460 return _queryParameters;
461 } 461 }
462 static int _makePort(int port, String scheme) { 462 static int _makePort(int port, String scheme) {
463 if (port != null && port == _defaultPort(scheme)) return ((__x14) => DDC$RT.cast (__x14, Null, int, "CastLiteral", """line 976, column 62 of dart:core/uri.dart: """, __x14 is int, true))(null); 463 if (port != null && port == _defaultPort(scheme)) return ((__x18) => DDC$RT.cast (__x18, Null, int, "CastLiteral", """line 976, column 62 of dart:core/uri.dart: """, __x18 is int, true))(null);
464 return port; 464 return port;
465 } 465 }
466 static String _makeHost(String host, int start, int end, bool strictIPv6) { 466 static String _makeHost(String host, int start, int end, bool strictIPv6) {
467 if (host == null) return null; 467 if (host == null) return null;
468 if (start == end) return ""; 468 if (start == end) return "";
469 if (host.codeUnitAt(start) == _LEFT_BRACKET) { 469 if (host.codeUnitAt(start) == _LEFT_BRACKET) {
470 if (host.codeUnitAt(end - 1) != _RIGHT_BRACKET) { 470 if (host.codeUnitAt(end - 1) != _RIGHT_BRACKET) {
471 _fail(host, start, 'Missing end `]` to match `[` in host'); 471 _fail(host, start, 'Missing end `]` to match `[` in host');
472 } 472 }
473 parseIPv6Address(host, start + 1, end - 1); 473 parseIPv6Address(host, start + 1, end - 1);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 } 674 }
675 static bool _isUnreservedChar(int ch) { 675 static bool _isUnreservedChar(int ch) {
676 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); 676 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0);
677 } 677 }
678 static String _escapeChar(char) { 678 static String _escapeChar(char) {
679 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF"; 679 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF";
680 List codeUnits; 680 List codeUnits;
681 if (char < 0x80) { 681 if (char < 0x80) {
682 codeUnits = new List(3); 682 codeUnits = new List(3);
683 codeUnits[0] = _PERCENT; 683 codeUnits[0] = _PERCENT;
684 codeUnits[1] = hexDigits.codeUnitAt(((__x15) => DDC$RT.cast(__x15, dynamic, i nt, "CastGeneral", """line 1248, column 43 of dart:core/uri.dart: """, __x15 is int, true))(char >> 4)); 684 codeUnits[1] = hexDigits.codeUnitAt(((__x19) => DDC$RT.cast(__x19, dynamic, i nt, "CastGeneral", """line 1248, column 43 of dart:core/uri.dart: """, __x19 is int, true))(char >> 4));
685 codeUnits[2] = hexDigits.codeUnitAt(((__x16) => DDC$RT.cast(__x16, dynamic, i nt, "CastGeneral", """line 1249, column 43 of dart:core/uri.dart: """, __x16 is int, true))(char & 0xf)); 685 codeUnits[2] = hexDigits.codeUnitAt(((__x20) => DDC$RT.cast(__x20, dynamic, i nt, "CastGeneral", """line 1249, column 43 of dart:core/uri.dart: """, __x20 is int, true))(char & 0xf));
686 } 686 }
687 else { 687 else {
688 int flag = 0xc0; 688 int flag = 0xc0;
689 int encodedBytes = 2; 689 int encodedBytes = 2;
690 if (char > 0x7ff) { 690 if (char > 0x7ff) {
691 flag = 0xe0; 691 flag = 0xe0;
692 encodedBytes = 3; 692 encodedBytes = 3;
693 if (char > 0xffff) { 693 if (char > 0xffff) {
694 encodedBytes = 4; 694 encodedBytes = 4;
695 flag = 0xf0; 695 flag = 0xf0;
696 } 696 }
697 } 697 }
698 codeUnits = new List(3 * encodedBytes); 698 codeUnits = new List(3 * encodedBytes);
699 int index = 0; 699 int index = 0;
700 while (--encodedBytes >= 0) { 700 while (--encodedBytes >= 0) {
701 int byte = ((__x17) => DDC$RT.cast(__x17, dynamic, int, "CastGeneral", """li ne 1265, column 20 of dart:core/uri.dart: """, __x17 is int, true))(((char >> (6 * encodedBytes)) & 0x3f) | flag); 701 int byte = ((__x21) => DDC$RT.cast(__x21, dynamic, int, "CastGeneral", """li ne 1265, column 20 of dart:core/uri.dart: """, __x21 is int, true))(((char >> (6 * encodedBytes)) & 0x3f) | flag);
702 codeUnits[index] = _PERCENT; 702 codeUnits[index] = _PERCENT;
703 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4); 703 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4);
704 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf); 704 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf);
705 index += 3; 705 index += 3;
706 flag = 0x80; 706 flag = 0x80;
707 } 707 }
708 } 708 }
709 return new String.fromCharCodes(codeUnits); 709 return new String.fromCharCodes(codeUnits);
710 } 710 }
711 static String _normalize(String component, int start, int end, List<int> charTa ble) { 711 static String _normalize(String component, int start, int end, List<int> charTa ble) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 } 795 }
796 return base.substring(0, baseEnd + 1) + reference.substring(refStart - 3 * back Count); 796 return base.substring(0, baseEnd + 1) + reference.substring(refStart - 3 * back Count);
797 } 797 }
798 bool _hasDotSegments(String path) { 798 bool _hasDotSegments(String path) {
799 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true; 799 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true;
800 int index = path.indexOf("/."); 800 int index = path.indexOf("/.");
801 return index != -1; 801 return index != -1;
802 } 802 }
803 String _removeDotSegments(String path) { 803 String _removeDotSegments(String path) {
804 if (!_hasDotSegments(path)) return path; 804 if (!_hasDotSegments(path)) return path;
805 List<String> output = ((__x18) => DDC$RT.cast(__x18, DDC$RT.type((List<dynamic> _) { 805 List<String> output = ((__x22) => DDC$RT.cast(__x22, DDC$RT.type((List<dynamic> _) {
806 } 806 }
807 ), DDC$RT.type((List<String> _) { 807 ), DDC$RT.type((List<String> _) {
808 } 808 }
809 ), "CastLiteral", """line 1402, column 27 of dart:core/uri.dart: """, __x18 is L ist<String>, false))([]); 809 ), "CastLiteral", """line 1402, column 27 of dart:core/uri.dart: """, __x22 is L ist<String>, false))([]);
810 bool appendSlash = false; 810 bool appendSlash = false;
811 for (String segment in path.split("/")) { 811 for (String segment in path.split("/")) {
812 appendSlash = false; 812 appendSlash = false;
813 if (segment == "..") { 813 if (segment == "..") {
814 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output.r emoveLast(); 814 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output.r emoveLast();
815 appendSlash = true; 815 appendSlash = true;
816 } 816 }
817 else if ("." == segment) { 817 else if ("." == segment) {
818 appendSlash = true; 818 appendSlash = true;
819 } 819 }
(...skipping 12 matching lines...) Expand all
832 String targetUserInfo = ""; 832 String targetUserInfo = "";
833 String targetHost; 833 String targetHost;
834 int targetPort; 834 int targetPort;
835 String targetPath; 835 String targetPath;
836 String targetQuery; 836 String targetQuery;
837 if (reference.scheme.isNotEmpty) { 837 if (reference.scheme.isNotEmpty) {
838 targetScheme = reference.scheme; 838 targetScheme = reference.scheme;
839 if (reference.hasAuthority) { 839 if (reference.hasAuthority) {
840 targetUserInfo = reference.userInfo; 840 targetUserInfo = reference.userInfo;
841 targetHost = reference.host; 841 targetHost = reference.host;
842 targetPort = ((__x19) => DDC$RT.cast(__x19, dynamic, int, "CastGeneral", "" "line 1456, column 22 of dart:core/uri.dart: """, __x19 is int, true))(reference .hasPort ? reference.port : null); 842 targetPort = ((__x23) => DDC$RT.cast(__x23, dynamic, int, "CastGeneral", "" "line 1456, column 22 of dart:core/uri.dart: """, __x23 is int, true))(reference .hasPort ? reference.port : null);
843 } 843 }
844 targetPath = _removeDotSegments(reference.path); 844 targetPath = _removeDotSegments(reference.path);
845 if (reference.hasQuery) { 845 if (reference.hasQuery) {
846 targetQuery = reference.query; 846 targetQuery = reference.query;
847 } 847 }
848 } 848 }
849 else { 849 else {
850 targetScheme = this.scheme; 850 targetScheme = this.scheme;
851 if (reference.hasAuthority) { 851 if (reference.hasAuthority) {
852 targetUserInfo = reference.userInfo; 852 targetUserInfo = reference.userInfo;
853 targetHost = reference.host; 853 targetHost = reference.host;
854 targetPort = _makePort(((__x20) => DDC$RT.cast(__x20, dynamic, int, "CastGe neral", """line 1467, column 32 of dart:core/uri.dart: """, __x20 is int, true)) (reference.hasPort ? reference.port : null), targetScheme); 854 targetPort = _makePort(((__x24) => DDC$RT.cast(__x24, dynamic, int, "CastGe neral", """line 1467, column 32 of dart:core/uri.dart: """, __x24 is int, true)) (reference.hasPort ? reference.port : null), targetScheme);
855 targetPath = _removeDotSegments(reference.path); 855 targetPath = _removeDotSegments(reference.path);
856 if (reference.hasQuery) targetQuery = reference.query; 856 if (reference.hasQuery) targetQuery = reference.query;
857 } 857 }
858 else { 858 else {
859 if (reference.path == "") { 859 if (reference.path == "") {
860 targetPath = this._path; 860 targetPath = this._path;
861 if (reference.hasQuery) { 861 if (reference.hasQuery) {
862 targetQuery = reference.query; 862 targetQuery = reference.query;
863 } 863 }
864 else { 864 else {
865 targetQuery = this._query; 865 targetQuery = this._query;
866 } 866 }
867 } 867 }
868 else { 868 else {
869 if (reference.path.startsWith("/")) { 869 if (reference.path.startsWith("/")) {
870 targetPath = _removeDotSegments(reference.path); 870 targetPath = _removeDotSegments(reference.path);
871 } 871 }
872 else { 872 else {
873 targetPath = _removeDotSegments(_merge(this._path, reference.path)); 873 targetPath = _removeDotSegments(_merge(this._path, reference.path));
874 } 874 }
875 if (reference.hasQuery) targetQuery = reference.query; 875 if (reference.hasQuery) targetQuery = reference.query;
876 } 876 }
877 targetUserInfo = this._userInfo; 877 targetUserInfo = this._userInfo;
878 targetHost = this._host; 878 targetHost = this._host;
879 targetPort = ((__x21) => DDC$RT.cast(__x21, num, int, "CastGeneral", """lin e 1489, column 22 of dart:core/uri.dart: """, __x21 is int, true))(this._port); 879 targetPort = ((__x25) => DDC$RT.cast(__x25, num, int, "CastGeneral", """lin e 1489, column 22 of dart:core/uri.dart: """, __x25 is int, true))(this._port);
880 } 880 }
881 } 881 }
882 String fragment = ((__x22) => DDC$RT.cast(__x22, dynamic, String, "CastGeneral" , """line 1492, column 23 of dart:core/uri.dart: """, __x22 is String, true))(re ference.hasFragment ? reference.fragment : null); 882 String fragment = ((__x26) => DDC$RT.cast(__x26, dynamic, String, "CastGeneral" , """line 1492, column 23 of dart:core/uri.dart: """, __x26 is String, true))(re ference.hasFragment ? reference.fragment : null);
883 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, fragment); 883 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, fragment);
884 } 884 }
885 bool get hasAuthority => _host != null; 885 bool get hasAuthority => _host != null;
886 bool get hasPort => _port != null; 886 bool get hasPort => _port != null;
887 bool get hasQuery => _query != null; 887 bool get hasQuery => _query != null;
888 bool get hasFragment => _fragment != null; 888 bool get hasFragment => _fragment != null;
889 String get origin { 889 String get origin {
890 if (scheme == "" || _host == null || _host == "") { 890 if (scheme == "" || _host == null || _host == "") {
891 throw new StateError("Cannot use origin without a scheme: $this"); 891 throw new StateError("Cannot use origin without a scheme: $this");
892 } 892 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 } 974 }
975 return sb.toString(); 975 return sb.toString();
976 } 976 }
977 bool operator ==(other) { 977 bool operator ==(other) {
978 if (other is! Uri) return false; 978 if (other is! Uri) return false;
979 Uri uri = DDC$RT.cast(other, dynamic, Uri, "CastGeneral", """line 1698, column 15 of dart:core/uri.dart: """, other is Uri, true); 979 Uri uri = DDC$RT.cast(other, dynamic, Uri, "CastGeneral", """line 1698, column 15 of dart:core/uri.dart: """, other is Uri, true);
980 return scheme == uri.scheme && hasAuthority == uri.hasAuthority && userInfo == uri.userInfo && host == uri.host && port == uri.port && path == uri.path && hasQ uery == uri.hasQuery && query == uri.query && hasFragment == uri.hasFragment && fragment == uri.fragment; 980 return scheme == uri.scheme && hasAuthority == uri.hasAuthority && userInfo == uri.userInfo && host == uri.host && port == uri.port && path == uri.path && hasQ uery == uri.hasQuery && query == uri.query && hasFragment == uri.hasFragment && fragment == uri.fragment;
981 } 981 }
982 int get hashCode { 982 int get hashCode {
983 int combine(part, current) { 983 int combine(part, current) {
984 return ((__x23) => DDC$RT.cast(__x23, dynamic, int, "CastGeneral", """line 171 4, column 14 of dart:core/uri.dart: """, __x23 is int, true))((current * 31 + pa rt.hashCode) & 0x3FFFFFFF); 984 return ((__x27) => DDC$RT.cast(__x27, dynamic, int, "CastGeneral", """line 171 4, column 14 of dart:core/uri.dart: """, __x27 is int, true))((current * 31 + pa rt.hashCode) & 0x3FFFFFFF);
985 } 985 }
986 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(pa th, combine(query, combine(fragment, 1))))))); 986 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(pa th, combine(query, combine(fragment, 1)))))));
987 } 987 }
988 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s econd) { 988 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s econd) {
989 if ("" != test) { 989 if ("" != test) {
990 sb.write(first); 990 sb.write(first);
991 sb.write(second); 991 sb.write(second);
992 } 992 }
993 } 993 }
994 static String encodeComponent(String component) { 994 static String encodeComponent(String component) {
(...skipping 20 matching lines...) Expand all
1015 return _uriEncode(DDC$RT.cast(_encodeFullTable, dynamic, DDC$RT.type((List<int> _) { 1015 return _uriEncode(DDC$RT.cast(_encodeFullTable, dynamic, DDC$RT.type((List<int> _) {
1016 } 1016 }
1017 ), "CastGeneral", """line 1832, column 23 of dart:core/uri.dart: """, _encodeFul lTable is List<int>, false), uri); 1017 ), "CastGeneral", """line 1832, column 23 of dart:core/uri.dart: """, _encodeFul lTable is List<int>, false), uri);
1018 } 1018 }
1019 static String decodeFull(String uri) { 1019 static String decodeFull(String uri) {
1020 return _uriDecode(uri); 1020 return _uriDecode(uri);
1021 } 1021 }
1022 static Map<String, String> splitQueryString(String query, { 1022 static Map<String, String> splitQueryString(String query, {
1023 Encoding encoding : UTF8} 1023 Encoding encoding : UTF8}
1024 ) { 1024 ) {
1025 return ((__x24) => DDC$RT.cast(__x24, dynamic, DDC$RT.type((Map<String, String> _) { 1025 return ((__x28) => DDC$RT.cast(__x28, dynamic, DDC$RT.type((Map<String, String> _) {
1026 } 1026 }
1027 ), "CastGeneral", """line 1864, column 12 of dart:core/uri.dart: """, __x24 is M ap<String, String>, false))(query.split("&").fold({ 1027 ), "CastGeneral", """line 1864, column 12 of dart:core/uri.dart: """, __x28 is M ap<String, String>, false))(query.split("&").fold({
1028 } 1028 }
1029 , (map, element) { 1029 , (map, element) {
1030 int index = ((__x25) => DDC$RT.cast(__x25, dynamic, int, "CastGeneral", """lin e 1865, column 19 of dart:core/uri.dart: """, __x25 is int, true))(element.index Of("=")); 1030 int index = ((__x29) => DDC$RT.cast(__x29, dynamic, int, "CastGeneral", """lin e 1865, column 19 of dart:core/uri.dart: """, __x29 is int, true))(element.index Of("="));
1031 if (index == -1) { 1031 if (index == -1) {
1032 if (element != "") { 1032 if (element != "") {
1033 map[decodeQueryComponent(DDC$RT.cast(element, dynamic, String, "CastGenera l", """line 1868, column 36 of dart:core/uri.dart: """, element is String, true) , encoding: encoding)] = ""; 1033 map[decodeQueryComponent(DDC$RT.cast(element, dynamic, String, "CastGenera l", """line 1868, column 36 of dart:core/uri.dart: """, element is String, true) , encoding: encoding)] = "";
1034 } 1034 }
1035 } 1035 }
1036 else if (index != 0) { 1036 else if (index != 0) {
1037 var key = element.substring(0, index); 1037 var key = element.substring(0, index);
1038 var value = element.substring(index + 1); 1038 var value = element.substring(index + 1);
1039 map[Uri.decodeQueryComponent(DDC$RT.cast(key, dynamic, String, "CastGeneral ", """line 1873, column 38 of dart:core/uri.dart: """, key is String, true), enc oding: encoding)] = decodeQueryComponent(DDC$RT.cast(value, dynamic, String, "Ca stGeneral", """line 1874, column 34 of dart:core/uri.dart: """, value is String, true), encoding: encoding); 1039 map[Uri.decodeQueryComponent(DDC$RT.cast(key, dynamic, String, "CastGeneral ", """line 1873, column 38 of dart:core/uri.dart: """, key is String, true), enc oding: encoding)] = decodeQueryComponent(DDC$RT.cast(value, dynamic, String, "Ca stGeneral", """line 1874, column 34 of dart:core/uri.dart: """, value is String, true), encoding: encoding);
1040 } 1040 }
1041 return map; 1041 return map;
1042 } 1042 }
1043 )); 1043 ));
1044 } 1044 }
1045 static List<int> parseIPv4Address(String host) { 1045 static List<int> parseIPv4Address(String host) {
1046 void error(String msg) { 1046 void error(String msg) {
1047 throw new FormatException('Illegal IPv4 address, $msg'); 1047 throw new FormatException('Illegal IPv4 address, $msg');
1048 } 1048 }
1049 var bytes = host.split('.'); 1049 var bytes = host.split('.');
1050 if (bytes.length != 4) { 1050 if (bytes.length != 4) {
1051 error('IPv4 address should contain exactly 4 parts'); 1051 error('IPv4 address should contain exactly 4 parts');
1052 } 1052 }
1053 return ((__x26) => DDC$RT.cast(__x26, DDC$RT.type((List<dynamic> _) { 1053 return ((__x30) => DDC$RT.cast(__x30, DDC$RT.type((List<dynamic> _) {
1054 } 1054 }
1055 ), DDC$RT.type((List<int> _) { 1055 ), DDC$RT.type((List<int> _) {
1056 } 1056 }
1057 ), "CastDynamic", """line 1896, column 12 of dart:core/uri.dart: """, __x26 is L ist<int>, false))(bytes.map((byteString) { 1057 ), "CastDynamic", """line 1896, column 12 of dart:core/uri.dart: """, __x30 is L ist<int>, false))(bytes.map((byteString) {
1058 int byte = int.parse(DDC$RT.cast(byteString, dynamic, String, "CastGeneral", " ""line 1898, column 32 of dart:core/uri.dart: """, byteString is String, true)); 1058 int byte = int.parse(DDC$RT.cast(byteString, dynamic, String, "CastGeneral", " ""line 1898, column 32 of dart:core/uri.dart: """, byteString is String, true));
1059 if (byte < 0 || byte > 255) { 1059 if (byte < 0 || byte > 255) {
1060 error('each part must be in the range of `0..255`'); 1060 error('each part must be in the range of `0..255`');
1061 } 1061 }
1062 return byte; 1062 return byte;
1063 } 1063 }
1064 ).toList()); 1064 ).toList());
1065 } 1065 }
1066 static List<int> parseIPv6Address(String host, [int start = 0, int end]) { 1066 static List<int> parseIPv6Address(String host, [int start = 0, int end]) {
1067 if (end == null) end = host.length; 1067 if (end == null) end = host.length;
1068 void error(String msg, [position]) { 1068 void error(String msg, [position]) {
1069 throw new FormatException('Illegal IPv6 address, $msg', host, position); 1069 throw new FormatException('Illegal IPv6 address, $msg', host, position);
1070 } 1070 }
1071 int parseHex(int start, int end) { 1071 int parseHex(int start, int end) {
1072 if (end - start > 4) { 1072 if (end - start > 4) {
1073 error('an IPv6 part can only contain a maximum of 4 hex digits', start); 1073 error('an IPv6 part can only contain a maximum of 4 hex digits', start);
1074 } 1074 }
1075 int value = int.parse(host.substring(start, end), radix: 16); 1075 int value = int.parse(host.substring(start, end), radix: 16);
1076 if (value < 0 || value > (1 << 16) - 1) { 1076 if (value < 0 || value > (1 << 16) - 1) {
1077 error('each part must be in the range of `0x0..0xFFFF`', start); 1077 error('each part must be in the range of `0x0..0xFFFF`', start);
1078 } 1078 }
1079 return value; 1079 return value;
1080 } 1080 }
1081 if (host.length < 2) error('address is too short'); 1081 if (host.length < 2) error('address is too short');
1082 List<int> parts = ((__x27) => DDC$RT.cast(__x27, DDC$RT.type((List<dynamic> _) { 1082 List<int> parts = ((__x31) => DDC$RT.cast(__x31, DDC$RT.type((List<dynamic> _) {
1083 } 1083 }
1084 ), DDC$RT.type((List<int> _) { 1084 ), DDC$RT.type((List<int> _) {
1085 } 1085 }
1086 ), "CastLiteral", """line 1946, column 23 of dart:core/uri.dart: """, __x27 is L ist<int>, false))([]); 1086 ), "CastLiteral", """line 1946, column 23 of dart:core/uri.dart: """, __x31 is L ist<int>, false))([]);
1087 bool wildcardSeen = false; 1087 bool wildcardSeen = false;
1088 int partStart = start; 1088 int partStart = start;
1089 for (int i = start; 1089 for (int i = start;
1090 i < end; 1090 i < end;
1091 i++) { 1091 i++) {
1092 if (host.codeUnitAt(i) == _COLON) { 1092 if (host.codeUnitAt(i) == _COLON) {
1093 if (i == start) { 1093 if (i == start) {
1094 i++; 1094 i++;
1095 if (host.codeUnitAt(i) != _COLON) { 1095 if (host.codeUnitAt(i) != _COLON) {
1096 error('invalid start colon.', i); 1096 error('invalid start colon.', i);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 static const int _RIGHT_BRACKET = 0x5D; 1189 static const int _RIGHT_BRACKET = 0x5D;
1190 static const int _LOWER_CASE_A = 0x61; 1190 static const int _LOWER_CASE_A = 0x61;
1191 static const int _LOWER_CASE_F = 0x66; 1191 static const int _LOWER_CASE_F = 0x66;
1192 static const int _LOWER_CASE_Z = 0x7A; 1192 static const int _LOWER_CASE_Z = 0x7A;
1193 static const int _BAR = 0x7C; 1193 static const int _BAR = 0x7C;
1194 static String _uriEncode(List<int> canonicalTable, String text, { 1194 static String _uriEncode(List<int> canonicalTable, String text, {
1195 Encoding encoding : UTF8, bool spaceToPlus : false} 1195 Encoding encoding : UTF8, bool spaceToPlus : false}
1196 ) { 1196 ) {
1197 byteToHex(byte, buffer) { 1197 byteToHex(byte, buffer) {
1198 const String hex = '0123456789ABCDEF'; 1198 const String hex = '0123456789ABCDEF';
1199 buffer.writeCharCode(hex.codeUnitAt(((__x28) => DDC$RT.cast(__x28, dynamic, i nt, "CastGeneral", """line 2059, column 43 of dart:core/uri.dart: """, __x28 is int, true))(byte >> 4))); 1199 buffer.writeCharCode(hex.codeUnitAt(((__x32) => DDC$RT.cast(__x32, dynamic, i nt, "CastGeneral", """line 2059, column 43 of dart:core/uri.dart: """, __x32 is int, true))(byte >> 4)));
1200 buffer.writeCharCode(hex.codeUnitAt(((__x29) => DDC$RT.cast(__x29, dynamic, i nt, "CastGeneral", """line 2060, column 43 of dart:core/uri.dart: """, __x29 is int, true))(byte & 0x0f))); 1200 buffer.writeCharCode(hex.codeUnitAt(((__x33) => DDC$RT.cast(__x33, dynamic, i nt, "CastGeneral", """line 2060, column 43 of dart:core/uri.dart: """, __x33 is int, true))(byte & 0x0f)));
1201 } 1201 }
1202 StringBuffer result = new StringBuffer(); 1202 StringBuffer result = new StringBuffer();
1203 var bytes = encoding.encode(text); 1203 var bytes = encoding.encode(text);
1204 for (int i = 0; 1204 for (int i = 0;
1205 i < bytes.length; 1205 i < bytes.length;
1206 i++) { 1206 i++) {
1207 int byte = bytes[i]; 1207 int byte = bytes[i];
1208 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) { 1208 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)) {
1209 result.writeCharCode(byte); 1209 result.writeCharCode(byte);
1210 } 1210 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 List<int> bytes; 1252 List<int> bytes;
1253 if (simple) { 1253 if (simple) {
1254 if (encoding == UTF8 || encoding == LATIN1) { 1254 if (encoding == UTF8 || encoding == LATIN1) {
1255 return text; 1255 return text;
1256 } 1256 }
1257 else { 1257 else {
1258 bytes = text.codeUnits; 1258 bytes = text.codeUnits;
1259 } 1259 }
1260 } 1260 }
1261 else { 1261 else {
1262 bytes = ((__x30) => DDC$RT.cast(__x30, DDC$RT.type((List<dynamic> _) { 1262 bytes = ((__x34) => DDC$RT.cast(__x34, DDC$RT.type((List<dynamic> _) {
1263 } 1263 }
1264 ), DDC$RT.type((List<int> _) { 1264 ), DDC$RT.type((List<int> _) {
1265 } 1265 }
1266 ), "CastExact", """line 2134, column 15 of dart:core/uri.dart: """, __x30 is L ist<int>, false))(new List()); 1266 ), "CastExact", """line 2134, column 15 of dart:core/uri.dart: """, __x34 is L ist<int>, false))(new List());
1267 for (int i = 0; 1267 for (int i = 0;
1268 i < text.length; 1268 i < text.length;
1269 i++) { 1269 i++) {
1270 var codeUnit = text.codeUnitAt(i); 1270 var codeUnit = text.codeUnitAt(i);
1271 if (codeUnit > 127) { 1271 if (codeUnit > 127) {
1272 throw new ArgumentError("Illegal percent encoding in URI"); 1272 throw new ArgumentError("Illegal percent encoding in URI");
1273 } 1273 }
1274 if (codeUnit == _PERCENT) { 1274 if (codeUnit == _PERCENT) {
1275 if (i + 3 > text.length) { 1275 if (i + 3 > text.length) {
1276 throw new ArgumentError('Truncated URI'); 1276 throw new ArgumentError('Truncated URI');
(...skipping 18 matching lines...) Expand all
1295 static const _schemeTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0xfffe, 0x07 ff, 0xfffe, 0x07ff]; 1295 static const _schemeTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0xfffe, 0x07 ff, 0xfffe, 0x07ff];
1296 static const _schemeLowerTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0x0000, 0x0000, 0xfffe, 0x07ff]; 1296 static const _schemeLowerTable = const [0x0000, 0x0000, 0x6800, 0x03ff, 0x0000, 0x0000, 0xfffe, 0x07ff];
1297 static const _subDelimitersTable = const [0x0000, 0x0000, 0x7fd2, 0x2bff, 0xfff e, 0x87ff, 0xfffe, 0x47ff]; 1297 static const _subDelimitersTable = const [0x0000, 0x0000, 0x7fd2, 0x2bff, 0xfff e, 0x87ff, 0xfffe, 0x47ff];
1298 static const _genDelimitersTable = const [0x0000, 0x0000, 0x8008, 0x8400, 0x000 1, 0x2800, 0x0000, 0x0000]; 1298 static const _genDelimitersTable = const [0x0000, 0x0000, 0x8008, 0x8400, 0x000 1, 0x2800, 0x0000, 0x0000];
1299 static const _userinfoTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xfffe, 0x 87ff, 0xfffe, 0x47ff]; 1299 static const _userinfoTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xfffe, 0x 87ff, 0xfffe, 0x47ff];
1300 static const _regNameTable = const [0x0000, 0x0000, 0x7ff2, 0x2bff, 0xfffe, 0x8 7ff, 0xfffe, 0x47ff]; 1300 static const _regNameTable = const [0x0000, 0x0000, 0x7ff2, 0x2bff, 0xfffe, 0x8 7ff, 0xfffe, 0x47ff];
1301 static const _pathCharTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xffff, 0x 87ff, 0xfffe, 0x47ff]; 1301 static const _pathCharTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xffff, 0x 87ff, 0xfffe, 0x47ff];
1302 static const _pathCharOrSlashTable = const [0x0000, 0x0000, 0xffd2, 0x2fff, 0xf fff, 0x87ff, 0xfffe, 0x47ff]; 1302 static const _pathCharOrSlashTable = const [0x0000, 0x0000, 0xffd2, 0x2fff, 0xf fff, 0x87ff, 0xfffe, 0x47ff];
1303 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0 x87ff, 0xfffe, 0x47ff]; 1303 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0 x87ff, 0xfffe, 0x47ff];
1304 } 1304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698