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

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

Issue 1038213003: Downward inference (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Rebase Created 5 years, 8 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
« no previous file with comments | « test/dart_codegen/expect/core/core ('k') | test/dart_codegen/expect/typed_data/typed_data » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 fragment = _makeFragment(fragment, 0, fragment.length); 433 fragment = _makeFragment(fragment, 0, fragment.length);
434 } 434 }
435 else if (this.hasFragment) { 435 else if (this.hasFragment) {
436 fragment = this.fragment; 436 fragment = this.fragment;
437 } 437 }
438 return new Uri._internal(scheme, userInfo, host, port, path, query, fragment) ; 438 return new Uri._internal(scheme, userInfo, host, port, path, query, fragment) ;
439 } 439 }
440 List<String> get pathSegments { 440 List<String> get pathSegments {
441 if (_pathSegments == null) { 441 if (_pathSegments == null) {
442 var pathToSplit = !path.isEmpty && path.codeUnitAt(0) == _SLASH ? path.subst ring(1) : path; 442 var pathToSplit = !path.isEmpty && path.codeUnitAt(0) == _SLASH ? path.subst ring(1) : path;
443 _pathSegments = ((__x22) => DEVC$RT.cast(__x22, DEVC$RT.type((DDC$collectio n$.UnmodifiableListView<dynamic> _) { 443 _pathSegments = new UnmodifiableListView(pathToSplit == "" ? const <String> [] : pathToSplit.split("/").map(Uri.decodeComponent).toList(growable: false));
444 }
445 ), DEVC$RT.type((List<String> _) {
446 }
447 ), "InferableAllocation", """line 945, column 23 of dart:core/uri.dart: """, __x22 is List<String>, false))(new UnmodifiableListView(pathToSplit == "" ? con st <String> [] : pathToSplit.split("/").map(Uri.decodeComponent).toList(growable : false)));
448 } 444 }
449 return _pathSegments; 445 return _pathSegments;
450 } 446 }
451 Map<String, String> get queryParameters { 447 Map<String, String> get queryParameters {
452 if (_queryParameters == null) { 448 if (_queryParameters == null) {
453 _queryParameters = ((__x23) => DEVC$RT.cast(__x23, DEVC$RT.type((DDC$collect ion$.UnmodifiableMapView<dynamic, dynamic> _) { 449 _queryParameters = new UnmodifiableMapView<String, String>(splitQueryString( query));
454 }
455 ), DEVC$RT.type((Map<String, String> _) {
456 }
457 ), "InferableAllocation", """line 969, column 26 of dart:core/uri.dart: """, __x23 is Map<String, String>, false))(new UnmodifiableMapView(splitQueryString( query)));
458 } 450 }
459 return _queryParameters; 451 return _queryParameters;
460 } 452 }
461 static int _makePort(int port, String scheme) { 453 static int _makePort(int port, String scheme) {
462 if (port != null && port == _defaultPort(scheme)) return null; 454 if (port != null && port == _defaultPort(scheme)) return null;
463 return port; 455 return port;
464 } 456 }
465 static String _makeHost(String host, int start, int end, bool strictIPv6) { 457 static String _makeHost(String host, int start, int end, bool strictIPv6) {
466 if (host == null) return null; 458 if (host == null) return null;
467 if (start == end) return ""; 459 if (start == end) return "";
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 } 582 }
591 var result; 583 var result;
592 if (path != null) { 584 if (path != null) {
593 result = _normalize(path, start, end, DEVC$RT.cast(_pathCharOrSlashTable, DE VC$RT.type((List<dynamic> _) { 585 result = _normalize(path, start, end, DEVC$RT.cast(_pathCharOrSlashTable, DE VC$RT.type((List<dynamic> _) {
594 } 586 }
595 ), DEVC$RT.type((List<int> _) { 587 ), DEVC$RT.type((List<int> _) {
596 } 588 }
597 ), "CompositeCast", """line 1139, column 45 of dart:core/uri.dart: """, _pat hCharOrSlashTable is List<int>, false)); 589 ), "CompositeCast", """line 1139, column 45 of dart:core/uri.dart: """, _pat hCharOrSlashTable is List<int>, false));
598 } 590 }
599 else { 591 else {
600 result = pathSegments.map(((__x29) => DEVC$RT.wrap((String f(dynamic __u24)) { 592 result = pathSegments.map(((__x27) => DEVC$RT.wrap((String f(dynamic __u22)) {
601 String c(dynamic x0) => f(x0); 593 String c(dynamic x0) => f(x0);
602 return f == null ? null : c; 594 return f == null ? null : c;
603 } 595 }
604 , __x29, __t27, __t25, "WrapLiteral", """line 1141, column 33 of dart:core/u ri.dart: """, __x29 is __t25))((s) => _uriEncode(DEVC$RT.cast(_pathCharTable, DE VC$RT.type((List<dynamic> _) { 596 , __x27, __t25, __t23, "WrapLiteral", """line 1141, column 33 of dart:core/u ri.dart: """, __x27 is __t23))((s) => _uriEncode(DEVC$RT.cast(_pathCharTable, DE VC$RT.type((List<dynamic> _) {
605 } 597 }
606 ), DEVC$RT.type((List<int> _) { 598 ), DEVC$RT.type((List<int> _) {
607 } 599 }
608 ), "CompositeCast", """line 1141, column 51 of dart:core/uri.dart: """, _pat hCharTable is List<int>, false), DEVC$RT.cast(s, dynamic, String, "DynamicCast", """line 1141, column 67 of dart:core/uri.dart: """, s is String, true)))).join( "/"); 600 ), "CompositeCast", """line 1141, column 51 of dart:core/uri.dart: """, _pat hCharTable is List<int>, false), DEVC$RT.cast(s, dynamic, String, "DynamicCast", """line 1141, column 67 of dart:core/uri.dart: """, s is String, true)))).join( "/");
609 } 601 }
610 if (result.isEmpty) { 602 if (result.isEmpty) {
611 if (isFile) return "/"; 603 if (isFile) return "/";
612 } 604 }
613 else if ((isFile || ensureLeadingSlash) && result.codeUnitAt(0) != _SLASH) { 605 else if ((isFile || ensureLeadingSlash) && result.codeUnitAt(0) != _SLASH) {
614 return "/$result"; 606 return "/$result";
615 } 607 }
616 return DEVC$RT.cast(result, dynamic, String, "DynamicCast", """line 1149, col umn 12 of dart:core/uri.dart: """, result is String, true); 608 return DEVC$RT.cast(result, dynamic, String, "DynamicCast", """line 1149, col umn 12 of dart:core/uri.dart: """, result is String, true);
617 } 609 }
618 static String _makeQuery(String query, int start, int end, Map<String, String> queryParameters) { 610 static String _makeQuery(String query, int start, int end, Map<String, String> queryParameters) {
619 if (query == null && queryParameters == null) return null; 611 if (query == null && queryParameters == null) return null;
620 if (query != null && queryParameters != null) { 612 if (query != null && queryParameters != null) {
621 throw new ArgumentError('Both query and queryParameters specified'); 613 throw new ArgumentError('Both query and queryParameters specified');
622 } 614 }
623 if (query != null) return _normalize(query, start, end, DEVC$RT.cast(_queryCh arTable, DEVC$RT.type((List<dynamic> _) { 615 if (query != null) return _normalize(query, start, end, DEVC$RT.cast(_queryCh arTable, DEVC$RT.type((List<dynamic> _) {
624 } 616 }
625 ), DEVC$RT.type((List<int> _) { 617 ), DEVC$RT.type((List<int> _) {
626 } 618 }
627 ), "CompositeCast", """line 1158, column 61 of dart:core/uri.dart: """, _query CharTable is List<int>, false)); 619 ), "CompositeCast", """line 1158, column 61 of dart:core/uri.dart: """, _query CharTable is List<int>, false));
628 var result = new StringBuffer(); 620 var result = new StringBuffer();
629 var first = true; 621 var first = true;
630 queryParameters.forEach(((__x38) => DEVC$RT.wrap((dynamic f(dynamic __u30, dy namic __u31)) { 622 queryParameters.forEach(((__x36) => DEVC$RT.wrap((dynamic f(dynamic __u28, dy namic __u29)) {
631 dynamic c(dynamic x0, dynamic x1) => f(x0, x1); 623 dynamic c(dynamic x0, dynamic x1) => f(x0, x1);
632 return f == null ? null : c; 624 return f == null ? null : c;
633 } 625 }
634 , __x38, __t35, __t32, "WrapLiteral", """line 1162, column 29 of dart:core/uri .dart: """, __x38 is __t32))((key, value) { 626 , __x36, __t33, __t30, "WrapLiteral", """line 1162, column 29 of dart:core/uri .dart: """, __x36 is __t30))((key, value) {
635 if (!first) { 627 if (!first) {
636 result.write("&"); 628 result.write("&");
637 } 629 }
638 first = false; 630 first = false;
639 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "D ynamicCast", """line 1167, column 45 of dart:core/uri.dart: """, key is String, true))); 631 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "D ynamicCast", """line 1167, column 45 of dart:core/uri.dart: """, key is String, true)));
640 if (value != null && !value.isEmpty) { 632 if (value != null && !value.isEmpty) {
641 result.write("="); 633 result.write("=");
642 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(value, dynamic, String , "DynamicCast", """line 1170, column 47 of dart:core/uri.dart: """, value is St ring, true))); 634 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(value, dynamic, String , "DynamicCast", """line 1170, column 47 of dart:core/uri.dart: """, value is St ring, true)));
643 } 635 }
644 } 636 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 } 679 }
688 static bool _isUnreservedChar(int ch) { 680 static bool _isUnreservedChar(int ch) {
689 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); 681 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0);
690 } 682 }
691 static String _escapeChar(char) { 683 static String _escapeChar(char) {
692 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF"; 684 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF";
693 List codeUnits; 685 List codeUnits;
694 if (char < 0x80) { 686 if (char < 0x80) {
695 codeUnits = new List(3); 687 codeUnits = new List(3);
696 codeUnits[0] = _PERCENT; 688 codeUnits[0] = _PERCENT;
697 codeUnits[1] = hexDigits.codeUnitAt(((__x39) => DEVC$RT.cast(__x39, dynamic , int, "DynamicCast", """line 1248, column 43 of dart:core/uri.dart: """, __x39 is int, true))(char >> 4)); 689 codeUnits[1] = hexDigits.codeUnitAt(((__x37) => DEVC$RT.cast(__x37, dynamic , int, "DynamicCast", """line 1248, column 43 of dart:core/uri.dart: """, __x37 is int, true))(char >> 4));
698 codeUnits[2] = hexDigits.codeUnitAt(((__x40) => DEVC$RT.cast(__x40, dynamic , int, "DynamicCast", """line 1249, column 43 of dart:core/uri.dart: """, __x40 is int, true))(char & 0xf)); 690 codeUnits[2] = hexDigits.codeUnitAt(((__x38) => DEVC$RT.cast(__x38, dynamic , int, "DynamicCast", """line 1249, column 43 of dart:core/uri.dart: """, __x38 is int, true))(char & 0xf));
699 } 691 }
700 else { 692 else {
701 int flag = 0xc0; 693 int flag = 0xc0;
702 int encodedBytes = 2; 694 int encodedBytes = 2;
703 if (char > 0x7ff) { 695 if (char > 0x7ff) {
704 flag = 0xe0; 696 flag = 0xe0;
705 encodedBytes = 3; 697 encodedBytes = 3;
706 if (char > 0xffff) { 698 if (char > 0xffff) {
707 encodedBytes = 4; 699 encodedBytes = 4;
708 flag = 0xf0; 700 flag = 0xf0;
709 } 701 }
710 } 702 }
711 codeUnits = new List(3 * encodedBytes); 703 codeUnits = new List(3 * encodedBytes);
712 int index = 0; 704 int index = 0;
713 while (--encodedBytes >= 0) { 705 while (--encodedBytes >= 0) {
714 int byte = ((__x41) => DEVC$RT.cast(__x41, dynamic, int, "DynamicCast", "" "line 1265, column 20 of dart:core/uri.dart: """, __x41 is int, true))(((char >> (6 * encodedBytes)) & 0x3f) | flag); 706 int byte = ((__x39) => DEVC$RT.cast(__x39, dynamic, int, "DynamicCast", "" "line 1265, column 20 of dart:core/uri.dart: """, __x39 is int, true))(((char >> (6 * encodedBytes)) & 0x3f) | flag);
715 codeUnits[index] = _PERCENT; 707 codeUnits[index] = _PERCENT;
716 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4); 708 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4);
717 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf); 709 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf);
718 index += 3; 710 index += 3;
719 flag = 0x80; 711 flag = 0x80;
720 } 712 }
721 } 713 }
722 return new String.fromCharCodes(DEVC$RT.cast(codeUnits, DEVC$RT.type((List<dy namic> _) { 714 return new String.fromCharCodes(DEVC$RT.cast(codeUnits, DEVC$RT.type((List<dy namic> _) {
723 } 715 }
724 ), DEVC$RT.type((Iterable<int> _) { 716 ), DEVC$RT.type((Iterable<int> _) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 } 804 }
813 return base.substring(0, baseEnd + 1) + reference.substring(refStart - 3 * ba ckCount); 805 return base.substring(0, baseEnd + 1) + reference.substring(refStart - 3 * ba ckCount);
814 } 806 }
815 bool _hasDotSegments(String path) { 807 bool _hasDotSegments(String path) {
816 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true; 808 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true;
817 int index = path.indexOf("/."); 809 int index = path.indexOf("/.");
818 return index != -1; 810 return index != -1;
819 } 811 }
820 String _removeDotSegments(String path) { 812 String _removeDotSegments(String path) {
821 if (!_hasDotSegments(path)) return path; 813 if (!_hasDotSegments(path)) return path;
822 List<String> output = ((__x42) => DEVC$RT.cast(__x42, DEVC$RT.type((List<dyna mic> _) { 814 List<String> output = <String> [];
823 }
824 ), DEVC$RT.type((List<String> _) {
825 }
826 ), "InferableLiteral", """line 1402, column 27 of dart:core/uri.dart: """, __x 42 is List<String>, false))([]);
827 bool appendSlash = false; 815 bool appendSlash = false;
828 for (String segment in path.split("/")) { 816 for (String segment in path.split("/")) {
829 appendSlash = false; 817 appendSlash = false;
830 if (segment == "..") { 818 if (segment == "..") {
831 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output .removeLast(); 819 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output .removeLast();
832 appendSlash = true; 820 appendSlash = true;
833 } 821 }
834 else if ("." == segment) { 822 else if ("." == segment) {
835 appendSlash = true; 823 appendSlash = true;
836 } 824 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 if (reference.path.startsWith("/")) { 874 if (reference.path.startsWith("/")) {
887 targetPath = _removeDotSegments(reference.path); 875 targetPath = _removeDotSegments(reference.path);
888 } 876 }
889 else { 877 else {
890 targetPath = _removeDotSegments(_merge(this._path, reference.path)); 878 targetPath = _removeDotSegments(_merge(this._path, reference.path));
891 } 879 }
892 if (reference.hasQuery) targetQuery = reference.query; 880 if (reference.hasQuery) targetQuery = reference.query;
893 } 881 }
894 targetUserInfo = this._userInfo; 882 targetUserInfo = this._userInfo;
895 targetHost = this._host; 883 targetHost = this._host;
896 targetPort = ((__x43) => DEVC$RT.cast(__x43, num, int, "ImplicitCast", "" "line 1489, column 22 of dart:core/uri.dart: """, __x43 is int, true))(this._por t); 884 targetPort = ((__x40) => DEVC$RT.cast(__x40, num, int, "ImplicitCast", "" "line 1489, column 22 of dart:core/uri.dart: """, __x40 is int, true))(this._por t);
897 } 885 }
898 } 886 }
899 String fragment = reference.hasFragment ? reference.fragment : null; 887 String fragment = reference.hasFragment ? reference.fragment : null;
900 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort , targetPath, targetQuery, fragment); 888 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort , targetPath, targetQuery, fragment);
901 } 889 }
902 bool get hasAuthority => _host != null; 890 bool get hasAuthority => _host != null;
903 bool get hasPort => _port != null; 891 bool get hasPort => _port != null;
904 bool get hasQuery => _query != null; 892 bool get hasQuery => _query != null;
905 bool get hasFragment => _fragment != null; 893 bool get hasFragment => _fragment != null;
906 String get origin { 894 String get origin {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 } 979 }
992 return sb.toString(); 980 return sb.toString();
993 } 981 }
994 bool operator ==(other) { 982 bool operator ==(other) {
995 if (other is! Uri) return false; 983 if (other is! Uri) return false;
996 Uri uri = DEVC$RT.cast(other, dynamic, Uri, "DynamicCast", """line 1698, colu mn 15 of dart:core/uri.dart: """, other is Uri, true); 984 Uri uri = DEVC$RT.cast(other, dynamic, Uri, "DynamicCast", """line 1698, colu mn 15 of dart:core/uri.dart: """, other is Uri, true);
997 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; 985 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;
998 } 986 }
999 int get hashCode { 987 int get hashCode {
1000 int combine(part, current) { 988 int combine(part, current) {
1001 return ((__x44) => DEVC$RT.cast(__x44, dynamic, int, "DynamicCast", """line 1714, column 14 of dart:core/uri.dart: """, __x44 is int, true))((current * 31 + part.hashCode) & 0x3FFFFFFF); 989 return ((__x41) => DEVC$RT.cast(__x41, dynamic, int, "DynamicCast", """line 1714, column 14 of dart:core/uri.dart: """, __x41 is int, true))((current * 31 + part.hashCode) & 0x3FFFFFFF);
1002 } 990 }
1003 return combine(scheme, combine(userInfo, combine(host, combine(port, combine( path, combine(query, combine(fragment, 1))))))); 991 return combine(scheme, combine(userInfo, combine(host, combine(port, combine( path, combine(query, combine(fragment, 1)))))));
1004 } 992 }
1005 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s econd) { 993 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s econd) {
1006 if ("" != test) { 994 if ("" != test) {
1007 sb.write(first); 995 sb.write(first);
1008 sb.write(second); 996 sb.write(second);
1009 } 997 }
1010 } 998 }
1011 static String encodeComponent(String component) { 999 static String encodeComponent(String component) {
(...skipping 26 matching lines...) Expand all
1038 ), DEVC$RT.type((List<int> _) { 1026 ), DEVC$RT.type((List<int> _) {
1039 } 1027 }
1040 ), "CompositeCast", """line 1832, column 23 of dart:core/uri.dart: """, _encod eFullTable is List<int>, false), uri); 1028 ), "CompositeCast", """line 1832, column 23 of dart:core/uri.dart: """, _encod eFullTable is List<int>, false), uri);
1041 } 1029 }
1042 static String decodeFull(String uri) { 1030 static String decodeFull(String uri) {
1043 return _uriDecode(uri); 1031 return _uriDecode(uri);
1044 } 1032 }
1045 static Map<String, String> splitQueryString(String query, { 1033 static Map<String, String> splitQueryString(String query, {
1046 Encoding encoding : UTF8} 1034 Encoding encoding : UTF8}
1047 ) { 1035 ) {
1048 return ((__x45) => DEVC$RT.cast(__x45, dynamic, DEVC$RT.type((Map<String, Stri ng> _) { 1036 return ((__x42) => DEVC$RT.cast(__x42, dynamic, DEVC$RT.type((Map<String, Stri ng> _) {
1049 } 1037 }
1050 ), "CompositeCast", """line 1864, column 12 of dart:core/uri.dart: """, __x45 is Map<String, String>, false))(query.split("&").fold({ 1038 ), "CompositeCast", """line 1864, column 12 of dart:core/uri.dart: """, __x42 is Map<String, String>, false))(query.split("&").fold({
1051 } 1039 }
1052 , ((__x51) => DEVC$RT.wrap((dynamic f(dynamic __u46, dynamic __u47)) { 1040 , ((__x48) => DEVC$RT.wrap((dynamic f(dynamic __u43, dynamic __u44)) {
1053 dynamic c(dynamic x0, dynamic x1) => f(x0, x1); 1041 dynamic c(dynamic x0, dynamic x1) => f(x0, x1);
1054 return f == null ? null : c; 1042 return f == null ? null : c;
1055 } 1043 }
1056 , __x51, __t35, __t48, "WrapLiteral", """line 1864, column 38 of dart:core/uri .dart: """, __x51 is __t48))((map, element) { 1044 , __x48, __t33, __t45, "WrapLiteral", """line 1864, column 38 of dart:core/uri .dart: """, __x48 is __t45))((map, element) {
1057 int index = ((__x52) => DEVC$RT.cast(__x52, dynamic, int, "DynamicCast", """ line 1865, column 19 of dart:core/uri.dart: """, __x52 is int, true))(element.in dexOf("=")); 1045 int index = ((__x49) => DEVC$RT.cast(__x49, dynamic, int, "DynamicCast", """ line 1865, column 19 of dart:core/uri.dart: """, __x49 is int, true))(element.in dexOf("="));
1058 if (index == -1) { 1046 if (index == -1) {
1059 if (element != "") { 1047 if (element != "") {
1060 map[decodeQueryComponent(DEVC$RT.cast(element, dynamic, String, "Dynamic Cast", """line 1868, column 36 of dart:core/uri.dart: """, element is String, tr ue), encoding: encoding)] = ""; 1048 map[decodeQueryComponent(DEVC$RT.cast(element, dynamic, String, "Dynamic Cast", """line 1868, column 36 of dart:core/uri.dart: """, element is String, tr ue), encoding: encoding)] = "";
1061 } 1049 }
1062 } 1050 }
1063 else if (index != 0) { 1051 else if (index != 0) {
1064 var key = element.substring(0, index); 1052 var key = element.substring(0, index);
1065 var value = element.substring(index + 1); 1053 var value = element.substring(index + 1);
1066 map[Uri.decodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "DynamicC ast", """line 1873, column 38 of dart:core/uri.dart: """, key is String, true), encoding: encoding)] = decodeQueryComponent(DEVC$RT.cast(value, dynamic, String, "DynamicCast", """line 1874, column 34 of dart:core/uri.dart: """, value is Str ing, true), encoding: encoding); 1054 map[Uri.decodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "DynamicC ast", """line 1873, column 38 of dart:core/uri.dart: """, key is String, true), encoding: encoding)] = decodeQueryComponent(DEVC$RT.cast(value, dynamic, String, "DynamicCast", """line 1874, column 34 of dart:core/uri.dart: """, value is Str ing, true), encoding: encoding);
1067 } 1055 }
1068 return map; 1056 return map;
1069 } 1057 }
1070 ))); 1058 )));
1071 } 1059 }
1072 static List<int> parseIPv4Address(String host) { 1060 static List<int> parseIPv4Address(String host) {
1073 void error(String msg) { 1061 void error(String msg) {
1074 throw new FormatException('Illegal IPv4 address, $msg'); 1062 throw new FormatException('Illegal IPv4 address, $msg');
1075 } 1063 }
1076 var bytes = host.split('.'); 1064 var bytes = host.split('.');
1077 if (bytes.length != 4) { 1065 if (bytes.length != 4) {
1078 error('IPv4 address should contain exactly 4 parts'); 1066 error('IPv4 address should contain exactly 4 parts');
1079 } 1067 }
1080 return ((__x53) => DEVC$RT.cast(__x53, DEVC$RT.type((List<dynamic> _) { 1068 return ((__x50) => DEVC$RT.cast(__x50, DEVC$RT.type((List<dynamic> _) {
1081 } 1069 }
1082 ), DEVC$RT.type((List<int> _) { 1070 ), DEVC$RT.type((List<int> _) {
1083 } 1071 }
1084 ), "CompositeCast", """line 1896, column 12 of dart:core/uri.dart: """, __x53 is List<int>, false))(bytes.map(((__x55) => DEVC$RT.wrap((dynamic f(dynamic __u5 4)) { 1072 ), "CompositeCast", """line 1896, column 12 of dart:core/uri.dart: """, __x50 is List<int>, false))(bytes.map(((__x52) => DEVC$RT.wrap((dynamic f(dynamic __u5 1)) {
1085 dynamic c(dynamic x0) => f(x0); 1073 dynamic c(dynamic x0) => f(x0);
1086 return f == null ? null : c; 1074 return f == null ? null : c;
1087 } 1075 }
1088 , __x55, __t16, __t25, "WrapLiteral", """line 1897, column 14 of dart:core/uri .dart: """, __x55 is __t25))((byteString) { 1076 , __x52, __t16, __t23, "WrapLiteral", """line 1897, column 14 of dart:core/uri .dart: """, __x52 is __t23))((byteString) {
1089 int byte = int.parse(DEVC$RT.cast(byteString, dynamic, String, "DynamicCast" , """line 1898, column 32 of dart:core/uri.dart: """, byteString is String, true )); 1077 int byte = int.parse(DEVC$RT.cast(byteString, dynamic, String, "DynamicCast" , """line 1898, column 32 of dart:core/uri.dart: """, byteString is String, true ));
1090 if (byte < 0 || byte > 255) { 1078 if (byte < 0 || byte > 255) {
1091 error('each part must be in the range of `0..255`'); 1079 error('each part must be in the range of `0..255`');
1092 } 1080 }
1093 return byte; 1081 return byte;
1094 } 1082 }
1095 )).toList()); 1083 )).toList());
1096 } 1084 }
1097 static List<int> parseIPv6Address(String host, [int start = 0, int end]) { 1085 static List<int> parseIPv6Address(String host, [int start = 0, int end]) {
1098 if (end == null) end = host.length; 1086 if (end == null) end = host.length;
1099 void error(String msg, [position]) { 1087 void error(String msg, [position]) {
1100 throw new FormatException('Illegal IPv6 address, $msg', host, DEVC$RT.cast(p osition, dynamic, int, "DynamicCast", """line 1933, column 69 of dart:core/uri.d art: """, position is int, true)); 1088 throw new FormatException('Illegal IPv6 address, $msg', host, DEVC$RT.cast(p osition, dynamic, int, "DynamicCast", """line 1933, column 69 of dart:core/uri.d art: """, position is int, true));
1101 } 1089 }
1102 int parseHex(int start, int end) { 1090 int parseHex(int start, int end) {
1103 if (end - start > 4) { 1091 if (end - start > 4) {
1104 error('an IPv6 part can only contain a maximum of 4 hex digits', start); 1092 error('an IPv6 part can only contain a maximum of 4 hex digits', start);
1105 } 1093 }
1106 int value = int.parse(host.substring(start, end), radix: 16); 1094 int value = int.parse(host.substring(start, end), radix: 16);
1107 if (value < 0 || value > (1 << 16) - 1) { 1095 if (value < 0 || value > (1 << 16) - 1) {
1108 error('each part must be in the range of `0x0..0xFFFF`', start); 1096 error('each part must be in the range of `0x0..0xFFFF`', start);
1109 } 1097 }
1110 return value; 1098 return value;
1111 } 1099 }
1112 if (host.length < 2) error('address is too short'); 1100 if (host.length < 2) error('address is too short');
1113 List<int> parts = ((__x56) => DEVC$RT.cast(__x56, DEVC$RT.type((List<dynamic> _) { 1101 List<int> parts = <int> [];
1114 }
1115 ), DEVC$RT.type((List<int> _) {
1116 }
1117 ), "InferableLiteral", """line 1946, column 23 of dart:core/uri.dart: """, __x 56 is List<int>, false))([]);
1118 bool wildcardSeen = false; 1102 bool wildcardSeen = false;
1119 int partStart = start; 1103 int partStart = start;
1120 for (int i = start; i < end; i++) { 1104 for (int i = start; i < end; i++) {
1121 if (host.codeUnitAt(i) == _COLON) { 1105 if (host.codeUnitAt(i) == _COLON) {
1122 if (i == start) { 1106 if (i == start) {
1123 i++; 1107 i++;
1124 if (host.codeUnitAt(i) != _COLON) { 1108 if (host.codeUnitAt(i) != _COLON) {
1125 error('invalid start colon.', i); 1109 error('invalid start colon.', i);
1126 } 1110 }
1127 partStart = i; 1111 partStart = i;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 static const int _RIGHT_BRACKET = 0x5D; 1198 static const int _RIGHT_BRACKET = 0x5D;
1215 static const int _LOWER_CASE_A = 0x61; 1199 static const int _LOWER_CASE_A = 0x61;
1216 static const int _LOWER_CASE_F = 0x66; 1200 static const int _LOWER_CASE_F = 0x66;
1217 static const int _LOWER_CASE_Z = 0x7A; 1201 static const int _LOWER_CASE_Z = 0x7A;
1218 static const int _BAR = 0x7C; 1202 static const int _BAR = 0x7C;
1219 static String _uriEncode(List<int> canonicalTable, String text, { 1203 static String _uriEncode(List<int> canonicalTable, String text, {
1220 Encoding encoding : UTF8, bool spaceToPlus : false} 1204 Encoding encoding : UTF8, bool spaceToPlus : false}
1221 ) { 1205 ) {
1222 byteToHex(byte, buffer) { 1206 byteToHex(byte, buffer) {
1223 const String hex = '0123456789ABCDEF'; 1207 const String hex = '0123456789ABCDEF';
1224 buffer.writeCharCode(hex.codeUnitAt(((__x57) => DEVC$RT.cast(__x57, dynamic , int, "DynamicCast", """line 2059, column 43 of dart:core/uri.dart: """, __x57 is int, true))(byte >> 4))); 1208 buffer.writeCharCode(hex.codeUnitAt(((__x53) => DEVC$RT.cast(__x53, dynamic , int, "DynamicCast", """line 2059, column 43 of dart:core/uri.dart: """, __x53 is int, true))(byte >> 4)));
1225 buffer.writeCharCode(hex.codeUnitAt(((__x58) => DEVC$RT.cast(__x58, dynamic , int, "DynamicCast", """line 2060, column 43 of dart:core/uri.dart: """, __x58 is int, true))(byte & 0x0f))); 1209 buffer.writeCharCode(hex.codeUnitAt(((__x54) => DEVC$RT.cast(__x54, dynamic , int, "DynamicCast", """line 2060, column 43 of dart:core/uri.dart: """, __x54 is int, true))(byte & 0x0f)));
1226 } 1210 }
1227 StringBuffer result = new StringBuffer(); 1211 StringBuffer result = new StringBuffer();
1228 var bytes = encoding.encode(text); 1212 var bytes = encoding.encode(text);
1229 for (int i = 0; i < bytes.length; i++) { 1213 for (int i = 0; i < bytes.length; i++) {
1230 int byte = bytes[i]; 1214 int byte = bytes[i];
1231 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0) ) { 1215 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0) ) {
1232 result.writeCharCode(byte); 1216 result.writeCharCode(byte);
1233 } 1217 }
1234 else if (spaceToPlus && byte == _SPACE) { 1218 else if (spaceToPlus && byte == _SPACE) {
1235 result.writeCharCode(_PLUS); 1219 result.writeCharCode(_PLUS);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 List<int> bytes; 1255 List<int> bytes;
1272 if (simple) { 1256 if (simple) {
1273 if (encoding == UTF8 || encoding == LATIN1) { 1257 if (encoding == UTF8 || encoding == LATIN1) {
1274 return text; 1258 return text;
1275 } 1259 }
1276 else { 1260 else {
1277 bytes = text.codeUnits; 1261 bytes = text.codeUnits;
1278 } 1262 }
1279 } 1263 }
1280 else { 1264 else {
1281 bytes = ((__x59) => DEVC$RT.cast(__x59, DEVC$RT.type((List<dynamic> _) { 1265 bytes = new List<int>();
1282 }
1283 ), DEVC$RT.type((List<int> _) {
1284 }
1285 ), "InferableAllocation", """line 2134, column 15 of dart:core/uri.dart: """ , __x59 is List<int>, false))(new List());
1286 for (int i = 0; i < text.length; i++) { 1266 for (int i = 0; i < text.length; i++) {
1287 var codeUnit = text.codeUnitAt(i); 1267 var codeUnit = text.codeUnitAt(i);
1288 if (codeUnit > 127) { 1268 if (codeUnit > 127) {
1289 throw new ArgumentError("Illegal percent encoding in URI"); 1269 throw new ArgumentError("Illegal percent encoding in URI");
1290 } 1270 }
1291 if (codeUnit == _PERCENT) { 1271 if (codeUnit == _PERCENT) {
1292 if (i + 3 > text.length) { 1272 if (i + 3 > text.length) {
1293 throw new ArgumentError('Truncated URI'); 1273 throw new ArgumentError('Truncated URI');
1294 } 1274 }
1295 bytes.add(_hexCharPairToByte(text, i + 1)); 1275 bytes.add(_hexCharPairToByte(text, i + 1));
(...skipping 18 matching lines...) Expand all
1314 static const _subDelimitersTable = const [0x0000, 0x0000, 0x7fd2, 0x2bff, 0xfff e, 0x87ff, 0xfffe, 0x47ff]; 1294 static const _subDelimitersTable = const [0x0000, 0x0000, 0x7fd2, 0x2bff, 0xfff e, 0x87ff, 0xfffe, 0x47ff];
1315 static const _genDelimitersTable = const [0x0000, 0x0000, 0x8008, 0x8400, 0x000 1, 0x2800, 0x0000, 0x0000]; 1295 static const _genDelimitersTable = const [0x0000, 0x0000, 0x8008, 0x8400, 0x000 1, 0x2800, 0x0000, 0x0000];
1316 static const _userinfoTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xfffe, 0x 87ff, 0xfffe, 0x47ff]; 1296 static const _userinfoTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xfffe, 0x 87ff, 0xfffe, 0x47ff];
1317 static const _regNameTable = const [0x0000, 0x0000, 0x7ff2, 0x2bff, 0xfffe, 0x8 7ff, 0xfffe, 0x47ff]; 1297 static const _regNameTable = const [0x0000, 0x0000, 0x7ff2, 0x2bff, 0xfffe, 0x8 7ff, 0xfffe, 0x47ff];
1318 static const _pathCharTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xffff, 0x 87ff, 0xfffe, 0x47ff]; 1298 static const _pathCharTable = const [0x0000, 0x0000, 0x7fd2, 0x2fff, 0xffff, 0x 87ff, 0xfffe, 0x47ff];
1319 static const _pathCharOrSlashTable = const [0x0000, 0x0000, 0xffd2, 0x2fff, 0xf fff, 0x87ff, 0xfffe, 0x47ff]; 1299 static const _pathCharOrSlashTable = const [0x0000, 0x0000, 0xffd2, 0x2fff, 0xf fff, 0x87ff, 0xfffe, 0x47ff];
1320 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0 x87ff, 0xfffe, 0x47ff]; 1300 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0 x87ff, 0xfffe, 0x47ff];
1321 } 1301 }
1322 typedef void __t14(String __u15); 1302 typedef void __t14(String __u15);
1323 typedef dynamic __t16(dynamic __u17); 1303 typedef dynamic __t16(dynamic __u17);
1324 typedef dynamic __t25(String __u26); 1304 typedef dynamic __t23(String __u24);
1325 typedef String __t27(dynamic __u28); 1305 typedef String __t25(dynamic __u26);
1326 typedef void __t32(String __u33, String __u34); 1306 typedef void __t30(String __u31, String __u32);
1327 typedef dynamic __t35(dynamic __u36, dynamic __u37); 1307 typedef dynamic __t33(dynamic __u34, dynamic __u35);
1328 typedef dynamic __t48(dynamic __u49, String __u50); 1308 typedef dynamic __t45(dynamic __u46, String __u47);
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/core/core ('k') | test/dart_codegen/expect/typed_data/typed_data » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698