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(); |
11 } | 11 } |
12 final String _userInfo; | 12 final String _userInfo; |
13 String get userInfo => _userInfo; | 13 String get userInfo => _userInfo; |
14 String get host { | 14 String get host { |
15 if (_host == null) return ""; | 15 if (_host == null) return ""; |
16 if (_host.startsWith('[')) { | 16 if (_host.startsWith('[')) { |
17 return _host.substring(1, _host.length - 1); | 17 return _host.substring(1, _host.length - 1); |
18 } | 18 } |
19 return _host; | 19 return _host; |
20 } | 20 } |
21 int get port { | 21 int get port { |
22 if (_port == null) return _defaultPort(scheme); | 22 if (_port == null) return _defaultPort(scheme); |
23 return DEVC$RT.cast(_port, num, int, "CastGeneral", """line 94, column 12 of
dart:core/uri.dart: """, _port is int, true); | 23 return DEVC$RT.cast(_port, num, int, "ImplicitCast", """line 94, column 12 of
dart:core/uri.dart: """, _port is int, true); |
24 } | 24 } |
25 static int _defaultPort(String scheme) { | 25 static int _defaultPort(String scheme) { |
26 if (scheme == "http") return 80; | 26 if (scheme == "http") return 80; |
27 if (scheme == "https") return 443; | 27 if (scheme == "https") return 443; |
28 return 0; | 28 return 0; |
29 } | 29 } |
30 String get path => _path; | 30 String get path => _path; |
31 final String _query; | 31 final String _query; |
32 String get query => (_query == null) ? "" : _query; | 32 String get query => (_query == null) ? "" : _query; |
33 final String _fragment; | 33 final String _fragment; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 bool hasPort = false; | 261 bool hasPort = false; |
262 for (; hostEnd < authority.length; hostEnd++) { | 262 for (; hostEnd < authority.length; hostEnd++) { |
263 if (authority.codeUnitAt(hostEnd) == _COLON) { | 263 if (authority.codeUnitAt(hostEnd) == _COLON) { |
264 var portString = authority.substring(hostEnd + 1); | 264 var portString = authority.substring(hostEnd + 1); |
265 if (portString.isNotEmpty) port = int.parse(portString); | 265 if (portString.isNotEmpty) port = int.parse(portString); |
266 break; | 266 break; |
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, "DynamicCast", """line 609, column 26 of dart:core/uri.dart: """
, host is String, true), port: DEVC$RT.cast(port, dynamic, int, "DynamicCast", "
""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 ((__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)); | 277 return ((__x12) => DEVC$RT.cast(__x12, dynamic, Uri, "DynamicCast", """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(((__x18) => DEVC$RT.wrap((dynamic f(dynamic __u13)) { | 282 segments.forEach(((__x18) => DEVC$RT.wrap((dynamic f(dynamic __u13)) { |
283 dynamic c(dynamic x0) => f(x0); | 283 dynamic c(dynamic x0) => f(x0); |
284 return f == null ? null : c; | 284 return f == null ? null : c; |
285 } | 285 } |
286 , __x18, __t16, __t14, "WrapLiteral", """line 716, column 22 of dart:core/uri.
dart: """, __x18 is __t14))((segment) { | 286 , __x18, __t16, __t14, "WrapLiteral", """line 716, column 22 of dart:core/uri.
dart: """, __x18 is __t14))((segment) { |
287 if (segment.contains("/")) { | 287 if (segment.contains("/")) { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 if (userInfo != null) { | 392 if (userInfo != null) { |
393 userInfo = _makeUserInfo(userInfo, 0, userInfo.length); | 393 userInfo = _makeUserInfo(userInfo, 0, userInfo.length); |
394 } | 394 } |
395 else { | 395 else { |
396 userInfo = this.userInfo; | 396 userInfo = this.userInfo; |
397 } | 397 } |
398 if (port != null) { | 398 if (port != null) { |
399 port = _makePort(port, scheme); | 399 port = _makePort(port, scheme); |
400 } | 400 } |
401 else { | 401 else { |
402 port = ((__x21) => DEVC$RT.cast(__x21, num, int, "CastGeneral", """line 889,
column 14 of dart:core/uri.dart: """, __x21 is int, true))(this._port); | 402 port = ((__x21) => DEVC$RT.cast(__x21, num, int, "ImplicitCast", """line 889
, column 14 of dart:core/uri.dart: """, __x21 is int, true))(this._port); |
403 if (schemeChanged) { | 403 if (schemeChanged) { |
404 port = _makePort(port, scheme); | 404 port = _makePort(port, scheme); |
405 } | 405 } |
406 } | 406 } |
407 if (host != null) { | 407 if (host != null) { |
408 host = _makeHost(host, 0, host.length, false); | 408 host = _makeHost(host, 0, host.length, false); |
409 } | 409 } |
410 else if (this.hasAuthority) { | 410 else if (this.hasAuthority) { |
411 host = this.host; | 411 host = this.host; |
412 } | 412 } |
(...skipping 24 matching lines...) Expand all Loading... |
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 = ((__x22) => DEVC$RT.cast(__x22, DEVC$RT.type((DDC$collectio
n$.UnmodifiableListView<dynamic> _) { |
444 } | 444 } |
445 ), DEVC$RT.type((List<String> _) { | 445 ), DEVC$RT.type((List<String> _) { |
446 } | 446 } |
447 ), "CastExact", """line 945, column 23 of dart:core/uri.dart: """, __x22 is
List<String>, false))(new UnmodifiableListView(pathToSplit == "" ? const <String
> [] : pathToSplit.split("/").map(Uri.decodeComponent).toList(growable: false)))
; | 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 } | 448 } |
449 return _pathSegments; | 449 return _pathSegments; |
450 } | 450 } |
451 Map<String, String> get queryParameters { | 451 Map<String, String> get queryParameters { |
452 if (_queryParameters == null) { | 452 if (_queryParameters == null) { |
453 _queryParameters = ((__x23) => DEVC$RT.cast(__x23, DEVC$RT.type((DDC$collect
ion$.UnmodifiableMapView<dynamic, dynamic> _) { | 453 _queryParameters = ((__x23) => DEVC$RT.cast(__x23, DEVC$RT.type((DDC$collect
ion$.UnmodifiableMapView<dynamic, dynamic> _) { |
454 } | 454 } |
455 ), DEVC$RT.type((Map<String, String> _) { | 455 ), DEVC$RT.type((Map<String, String> _) { |
456 } | 456 } |
457 ), "CastExact", """line 969, column 26 of dart:core/uri.dart: """, __x23 is
Map<String, String>, false))(new UnmodifiableMapView(splitQueryString(query))); | 457 ), "InferableAllocation", """line 969, column 26 of dart:core/uri.dart: """,
__x23 is Map<String, String>, false))(new UnmodifiableMapView(splitQueryString(
query))); |
458 } | 458 } |
459 return _queryParameters; | 459 return _queryParameters; |
460 } | 460 } |
461 static int _makePort(int port, String scheme) { | 461 static int _makePort(int port, String scheme) { |
462 if (port != null && port == _defaultPort(scheme)) return null; | 462 if (port != null && port == _defaultPort(scheme)) return null; |
463 return port; | 463 return port; |
464 } | 464 } |
465 static String _makeHost(String host, int start, int end, bool strictIPv6) { | 465 static String _makeHost(String host, int start, int end, bool strictIPv6) { |
466 if (host == null) return null; | 466 if (host == null) return null; |
467 if (start == end) return ""; | 467 if (start == end) return ""; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 scheme = scheme.substring(0, end); | 574 scheme = scheme.substring(0, end); |
575 if (!allLowercase) scheme = scheme.toLowerCase(); | 575 if (!allLowercase) scheme = scheme.toLowerCase(); |
576 return scheme; | 576 return scheme; |
577 } | 577 } |
578 static String _makeUserInfo(String userInfo, int start, int end) { | 578 static String _makeUserInfo(String userInfo, int start, int end) { |
579 if (userInfo == null) return ""; | 579 if (userInfo == null) return ""; |
580 return _normalize(userInfo, start, end, DEVC$RT.cast(_userinfoTable, DEVC$RT.
type((List<dynamic> _) { | 580 return _normalize(userInfo, start, end, DEVC$RT.cast(_userinfoTable, DEVC$RT.
type((List<dynamic> _) { |
581 } | 581 } |
582 ), DEVC$RT.type((List<int> _) { | 582 ), DEVC$RT.type((List<int> _) { |
583 } | 583 } |
584 ), "CastDynamic", """line 1126, column 45 of dart:core/uri.dart: """, _userinf
oTable is List<int>, false)); | 584 ), "CompositeCast", """line 1126, column 45 of dart:core/uri.dart: """, _useri
nfoTable is List<int>, false)); |
585 } | 585 } |
586 static String _makePath(String path, int start, int end, Iterable<String> pathS
egments, bool ensureLeadingSlash, bool isFile) { | 586 static String _makePath(String path, int start, int end, Iterable<String> pathS
egments, bool ensureLeadingSlash, bool isFile) { |
587 if (path == null && pathSegments == null) return isFile ? "/" : ""; | 587 if (path == null && pathSegments == null) return isFile ? "/" : ""; |
588 if (path != null && pathSegments != null) { | 588 if (path != null && pathSegments != null) { |
589 throw new ArgumentError('Both path and pathSegments specified'); | 589 throw new ArgumentError('Both path and pathSegments specified'); |
590 } | 590 } |
591 var result; | 591 var result; |
592 if (path != null) { | 592 if (path != null) { |
593 result = _normalize(path, start, end, DEVC$RT.cast(_pathCharOrSlashTable, DE
VC$RT.type((List<dynamic> _) { | 593 result = _normalize(path, start, end, DEVC$RT.cast(_pathCharOrSlashTable, DE
VC$RT.type((List<dynamic> _) { |
594 } | 594 } |
595 ), DEVC$RT.type((List<int> _) { | 595 ), DEVC$RT.type((List<int> _) { |
596 } | 596 } |
597 ), "CastDynamic", """line 1139, column 45 of dart:core/uri.dart: """, _pathC
harOrSlashTable is List<int>, false)); | 597 ), "CompositeCast", """line 1139, column 45 of dart:core/uri.dart: """, _pat
hCharOrSlashTable is List<int>, false)); |
598 } | 598 } |
599 else { | 599 else { |
600 result = pathSegments.map(((__x29) => DEVC$RT.wrap((String f(dynamic __u24))
{ | 600 result = pathSegments.map(((__x29) => DEVC$RT.wrap((String f(dynamic __u24))
{ |
601 String c(dynamic x0) => f(x0); | 601 String c(dynamic x0) => f(x0); |
602 return f == null ? null : c; | 602 return f == null ? null : c; |
603 } | 603 } |
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> _) { | 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> _) { |
605 } | 605 } |
606 ), DEVC$RT.type((List<int> _) { | 606 ), DEVC$RT.type((List<int> _) { |
607 } | 607 } |
608 ), "CastDynamic", """line 1141, column 51 of dart:core/uri.dart: """, _pathC
harTable is List<int>, false), DEVC$RT.cast(s, dynamic, String, "CastGeneral", "
""line 1141, column 67 of dart:core/uri.dart: """, s is String, true)))).join("/
"); | 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(
"/"); |
609 } | 609 } |
610 if (result.isEmpty) { | 610 if (result.isEmpty) { |
611 if (isFile) return "/"; | 611 if (isFile) return "/"; |
612 } | 612 } |
613 else if ((isFile || ensureLeadingSlash) && result.codeUnitAt(0) != _SLASH) { | 613 else if ((isFile || ensureLeadingSlash) && result.codeUnitAt(0) != _SLASH) { |
614 return "/$result"; | 614 return "/$result"; |
615 } | 615 } |
616 return DEVC$RT.cast(result, dynamic, String, "CastGeneral", """line 1149, col
umn 12 of dart:core/uri.dart: """, result is String, true); | 616 return DEVC$RT.cast(result, dynamic, String, "DynamicCast", """line 1149, col
umn 12 of dart:core/uri.dart: """, result is String, true); |
617 } | 617 } |
618 static String _makeQuery(String query, int start, int end, Map<String, String>
queryParameters) { | 618 static String _makeQuery(String query, int start, int end, Map<String, String>
queryParameters) { |
619 if (query == null && queryParameters == null) return null; | 619 if (query == null && queryParameters == null) return null; |
620 if (query != null && queryParameters != null) { | 620 if (query != null && queryParameters != null) { |
621 throw new ArgumentError('Both query and queryParameters specified'); | 621 throw new ArgumentError('Both query and queryParameters specified'); |
622 } | 622 } |
623 if (query != null) return _normalize(query, start, end, DEVC$RT.cast(_queryCh
arTable, DEVC$RT.type((List<dynamic> _) { | 623 if (query != null) return _normalize(query, start, end, DEVC$RT.cast(_queryCh
arTable, DEVC$RT.type((List<dynamic> _) { |
624 } | 624 } |
625 ), DEVC$RT.type((List<int> _) { | 625 ), DEVC$RT.type((List<int> _) { |
626 } | 626 } |
627 ), "CastDynamic", """line 1158, column 61 of dart:core/uri.dart: """, _queryCh
arTable is List<int>, false)); | 627 ), "CompositeCast", """line 1158, column 61 of dart:core/uri.dart: """, _query
CharTable is List<int>, false)); |
628 var result = new StringBuffer(); | 628 var result = new StringBuffer(); |
629 var first = true; | 629 var first = true; |
630 queryParameters.forEach(((__x38) => DEVC$RT.wrap((dynamic f(dynamic __u30, dy
namic __u31)) { | 630 queryParameters.forEach(((__x38) => DEVC$RT.wrap((dynamic f(dynamic __u30, dy
namic __u31)) { |
631 dynamic c(dynamic x0, dynamic x1) => f(x0, x1); | 631 dynamic c(dynamic x0, dynamic x1) => f(x0, x1); |
632 return f == null ? null : c; | 632 return f == null ? null : c; |
633 } | 633 } |
634 , __x38, __t35, __t32, "WrapLiteral", """line 1162, column 29 of dart:core/uri
.dart: """, __x38 is __t32))((key, value) { | 634 , __x38, __t35, __t32, "WrapLiteral", """line 1162, column 29 of dart:core/uri
.dart: """, __x38 is __t32))((key, value) { |
635 if (!first) { | 635 if (!first) { |
636 result.write("&"); | 636 result.write("&"); |
637 } | 637 } |
638 first = false; | 638 first = false; |
639 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(key, dynamic, String, "C
astGeneral", """line 1167, column 45 of dart:core/uri.dart: """, key is String,
true))); | 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))); |
640 if (value != null && !value.isEmpty) { | 640 if (value != null && !value.isEmpty) { |
641 result.write("="); | 641 result.write("="); |
642 result.write(Uri.encodeQueryComponent(DEVC$RT.cast(value, dynamic, String
, "CastGeneral", """line 1170, column 47 of dart:core/uri.dart: """, value is St
ring, true))); | 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))); |
643 } | 643 } |
644 } | 644 } |
645 )); | 645 )); |
646 return result.toString(); | 646 return result.toString(); |
647 } | 647 } |
648 static String _makeFragment(String fragment, int start, int end) { | 648 static String _makeFragment(String fragment, int start, int end) { |
649 if (fragment == null) return null; | 649 if (fragment == null) return null; |
650 return _normalize(fragment, start, end, DEVC$RT.cast(_queryCharTable, DEVC$RT
.type((List<dynamic> _) { | 650 return _normalize(fragment, start, end, DEVC$RT.cast(_queryCharTable, DEVC$RT
.type((List<dynamic> _) { |
651 } | 651 } |
652 ), DEVC$RT.type((List<int> _) { | 652 ), DEVC$RT.type((List<int> _) { |
653 } | 653 } |
654 ), "CastDynamic", """line 1178, column 45 of dart:core/uri.dart: """, _queryCh
arTable is List<int>, false)); | 654 ), "CompositeCast", """line 1178, column 45 of dart:core/uri.dart: """, _query
CharTable is List<int>, false)); |
655 } | 655 } |
656 static int _stringOrNullLength(String s) => (s == null) ? 0 : s.length; | 656 static int _stringOrNullLength(String s) => (s == null) ? 0 : s.length; |
657 static bool _isHexDigit(int char) { | 657 static bool _isHexDigit(int char) { |
658 if (_NINE >= char) return _ZERO <= char; | 658 if (_NINE >= char) return _ZERO <= char; |
659 char |= 0x20; | 659 char |= 0x20; |
660 return _LOWER_CASE_A <= char && _LOWER_CASE_F >= char; | 660 return _LOWER_CASE_A <= char && _LOWER_CASE_F >= char; |
661 } | 661 } |
662 static int _hexValue(int char) { | 662 static int _hexValue(int char) { |
663 assert (_isHexDigit(char)); if (_NINE >= char) return char - _ZERO; | 663 assert (_isHexDigit(char)); if (_NINE >= char) return char - _ZERO; |
664 char |= 0x20; | 664 char |= 0x20; |
(...skipping 22 matching lines...) Expand all Loading... |
687 } | 687 } |
688 static bool _isUnreservedChar(int ch) { | 688 static bool _isUnreservedChar(int ch) { |
689 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); | 689 return ch < 127 && ((_unreservedTable[ch >> 4] & (1 << (ch & 0x0f))) != 0); |
690 } | 690 } |
691 static String _escapeChar(char) { | 691 static String _escapeChar(char) { |
692 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF"; | 692 assert (char <= 0x10ffff); const hexDigits = "0123456789ABCDEF"; |
693 List codeUnits; | 693 List codeUnits; |
694 if (char < 0x80) { | 694 if (char < 0x80) { |
695 codeUnits = new List(3); | 695 codeUnits = new List(3); |
696 codeUnits[0] = _PERCENT; | 696 codeUnits[0] = _PERCENT; |
697 codeUnits[1] = hexDigits.codeUnitAt(((__x39) => DEVC$RT.cast(__x39, dynamic
, int, "CastGeneral", """line 1248, column 43 of dart:core/uri.dart: """, __x39
is int, true))(char >> 4)); | 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)); |
698 codeUnits[2] = hexDigits.codeUnitAt(((__x40) => DEVC$RT.cast(__x40, dynamic
, int, "CastGeneral", """line 1249, column 43 of dart:core/uri.dart: """, __x40
is int, true))(char & 0xf)); | 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)); |
699 } | 699 } |
700 else { | 700 else { |
701 int flag = 0xc0; | 701 int flag = 0xc0; |
702 int encodedBytes = 2; | 702 int encodedBytes = 2; |
703 if (char > 0x7ff) { | 703 if (char > 0x7ff) { |
704 flag = 0xe0; | 704 flag = 0xe0; |
705 encodedBytes = 3; | 705 encodedBytes = 3; |
706 if (char > 0xffff) { | 706 if (char > 0xffff) { |
707 encodedBytes = 4; | 707 encodedBytes = 4; |
708 flag = 0xf0; | 708 flag = 0xf0; |
709 } | 709 } |
710 } | 710 } |
711 codeUnits = new List(3 * encodedBytes); | 711 codeUnits = new List(3 * encodedBytes); |
712 int index = 0; | 712 int index = 0; |
713 while (--encodedBytes >= 0) { | 713 while (--encodedBytes >= 0) { |
714 int byte = ((__x41) => DEVC$RT.cast(__x41, dynamic, int, "CastGeneral", ""
"line 1265, column 20 of dart:core/uri.dart: """, __x41 is int, true))(((char >>
(6 * encodedBytes)) & 0x3f) | flag); | 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); |
715 codeUnits[index] = _PERCENT; | 715 codeUnits[index] = _PERCENT; |
716 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4); | 716 codeUnits[index + 1] = hexDigits.codeUnitAt(byte >> 4); |
717 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf); | 717 codeUnits[index + 2] = hexDigits.codeUnitAt(byte & 0xf); |
718 index += 3; | 718 index += 3; |
719 flag = 0x80; | 719 flag = 0x80; |
720 } | 720 } |
721 } | 721 } |
722 return new String.fromCharCodes(DEVC$RT.cast(codeUnits, DEVC$RT.type((List<dy
namic> _) { | 722 return new String.fromCharCodes(DEVC$RT.cast(codeUnits, DEVC$RT.type((List<dy
namic> _) { |
723 } | 723 } |
724 ), DEVC$RT.type((Iterable<int> _) { | 724 ), DEVC$RT.type((Iterable<int> _) { |
725 } | 725 } |
726 ), "CastDynamic", """line 1273, column 37 of dart:core/uri.dart: """, codeUnit
s is Iterable<int>, false)); | 726 ), "CompositeCast", """line 1273, column 37 of dart:core/uri.dart: """, codeUn
its is Iterable<int>, false)); |
727 } | 727 } |
728 static String _normalize(String component, int start, int end, List<int> charTa
ble) { | 728 static String _normalize(String component, int start, int end, List<int> charTa
ble) { |
729 StringBuffer buffer; | 729 StringBuffer buffer; |
730 int sectionStart = start; | 730 int sectionStart = start; |
731 int index = start; | 731 int index = start; |
732 while (index < end) { | 732 while (index < end) { |
733 int char = component.codeUnitAt(index); | 733 int char = component.codeUnitAt(index); |
734 if (char < 127 && (charTable[char >> 4] & (1 << (char & 0x0f))) != 0) { | 734 if (char < 127 && (charTable[char >> 4] & (1 << (char & 0x0f))) != 0) { |
735 index++; | 735 index++; |
736 } | 736 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true; | 816 if (path.length > 0 && path.codeUnitAt(0) == _DOT) return true; |
817 int index = path.indexOf("/."); | 817 int index = path.indexOf("/."); |
818 return index != -1; | 818 return index != -1; |
819 } | 819 } |
820 String _removeDotSegments(String path) { | 820 String _removeDotSegments(String path) { |
821 if (!_hasDotSegments(path)) return path; | 821 if (!_hasDotSegments(path)) return path; |
822 List<String> output = ((__x42) => DEVC$RT.cast(__x42, DEVC$RT.type((List<dyna
mic> _) { | 822 List<String> output = ((__x42) => DEVC$RT.cast(__x42, DEVC$RT.type((List<dyna
mic> _) { |
823 } | 823 } |
824 ), DEVC$RT.type((List<String> _) { | 824 ), DEVC$RT.type((List<String> _) { |
825 } | 825 } |
826 ), "CastLiteral", """line 1402, column 27 of dart:core/uri.dart: """, __x42 is
List<String>, false))([]); | 826 ), "InferableLiteral", """line 1402, column 27 of dart:core/uri.dart: """, __x
42 is List<String>, false))([]); |
827 bool appendSlash = false; | 827 bool appendSlash = false; |
828 for (String segment in path.split("/")) { | 828 for (String segment in path.split("/")) { |
829 appendSlash = false; | 829 appendSlash = false; |
830 if (segment == "..") { | 830 if (segment == "..") { |
831 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output
.removeLast(); | 831 if (!output.isEmpty && ((output.length != 1) || (output[0] != ""))) output
.removeLast(); |
832 appendSlash = true; | 832 appendSlash = true; |
833 } | 833 } |
834 else if ("." == segment) { | 834 else if ("." == segment) { |
835 appendSlash = true; | 835 appendSlash = true; |
836 } | 836 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 if (reference.path.startsWith("/")) { | 886 if (reference.path.startsWith("/")) { |
887 targetPath = _removeDotSegments(reference.path); | 887 targetPath = _removeDotSegments(reference.path); |
888 } | 888 } |
889 else { | 889 else { |
890 targetPath = _removeDotSegments(_merge(this._path, reference.path)); | 890 targetPath = _removeDotSegments(_merge(this._path, reference.path)); |
891 } | 891 } |
892 if (reference.hasQuery) targetQuery = reference.query; | 892 if (reference.hasQuery) targetQuery = reference.query; |
893 } | 893 } |
894 targetUserInfo = this._userInfo; | 894 targetUserInfo = this._userInfo; |
895 targetHost = this._host; | 895 targetHost = this._host; |
896 targetPort = ((__x43) => DEVC$RT.cast(__x43, num, int, "CastGeneral", """
line 1489, column 22 of dart:core/uri.dart: """, __x43 is int, true))(this._port
); | 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); |
897 } | 897 } |
898 } | 898 } |
899 String fragment = reference.hasFragment ? reference.fragment : null; | 899 String fragment = reference.hasFragment ? reference.fragment : null; |
900 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort
, targetPath, targetQuery, fragment); | 900 return new Uri._internal(targetScheme, targetUserInfo, targetHost, targetPort
, targetPath, targetQuery, fragment); |
901 } | 901 } |
902 bool get hasAuthority => _host != null; | 902 bool get hasAuthority => _host != null; |
903 bool get hasPort => _port != null; | 903 bool get hasPort => _port != null; |
904 bool get hasQuery => _query != null; | 904 bool get hasQuery => _query != null; |
905 bool get hasFragment => _fragment != null; | 905 bool get hasFragment => _fragment != null; |
906 String get origin { | 906 String get origin { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 if (_query != null) { | 986 if (_query != null) { |
987 sb..write("?")..write(_query); | 987 sb..write("?")..write(_query); |
988 } | 988 } |
989 if (_fragment != null) { | 989 if (_fragment != null) { |
990 sb..write("#")..write(_fragment); | 990 sb..write("#")..write(_fragment); |
991 } | 991 } |
992 return sb.toString(); | 992 return sb.toString(); |
993 } | 993 } |
994 bool operator ==(other) { | 994 bool operator ==(other) { |
995 if (other is! Uri) return false; | 995 if (other is! Uri) return false; |
996 Uri uri = DEVC$RT.cast(other, dynamic, Uri, "CastGeneral", """line 1698, colu
mn 15 of dart:core/uri.dart: """, other is Uri, true); | 996 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; | 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; |
998 } | 998 } |
999 int get hashCode { | 999 int get hashCode { |
1000 int combine(part, current) { | 1000 int combine(part, current) { |
1001 return ((__x44) => DEVC$RT.cast(__x44, dynamic, int, "CastGeneral", """line
1714, column 14 of dart:core/uri.dart: """, __x44 is int, true))((current * 31 +
part.hashCode) & 0x3FFFFFFF); | 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); |
1002 } | 1002 } |
1003 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(
path, combine(query, combine(fragment, 1))))))); | 1003 return combine(scheme, combine(userInfo, combine(host, combine(port, combine(
path, combine(query, combine(fragment, 1))))))); |
1004 } | 1004 } |
1005 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s
econd) { | 1005 static void _addIfNonEmpty(StringBuffer sb, String test, String first, String s
econd) { |
1006 if ("" != test) { | 1006 if ("" != test) { |
1007 sb.write(first); | 1007 sb.write(first); |
1008 sb.write(second); | 1008 sb.write(second); |
1009 } | 1009 } |
1010 } | 1010 } |
1011 static String encodeComponent(String component) { | 1011 static String encodeComponent(String component) { |
1012 return _uriEncode(DEVC$RT.cast(_unreserved2396Table, DEVC$RT.type((List<dynami
c> _) { | 1012 return _uriEncode(DEVC$RT.cast(_unreserved2396Table, DEVC$RT.type((List<dynami
c> _) { |
1013 } | 1013 } |
1014 ), DEVC$RT.type((List<int> _) { | 1014 ), DEVC$RT.type((List<int> _) { |
1015 } | 1015 } |
1016 ), "CastDynamic", """line 1749, column 23 of dart:core/uri.dart: """, _unreser
ved2396Table is List<int>, false), component); | 1016 ), "CompositeCast", """line 1749, column 23 of dart:core/uri.dart: """, _unres
erved2396Table is List<int>, false), component); |
1017 } | 1017 } |
1018 static String encodeQueryComponent(String component, { | 1018 static String encodeQueryComponent(String component, { |
1019 Encoding encoding : UTF8} | 1019 Encoding encoding : UTF8} |
1020 ) { | 1020 ) { |
1021 return _uriEncode(DEVC$RT.cast(_unreservedTable, DEVC$RT.type((List<dynamic> _
) { | 1021 return _uriEncode(DEVC$RT.cast(_unreservedTable, DEVC$RT.type((List<dynamic> _
) { |
1022 } | 1022 } |
1023 ), DEVC$RT.type((List<int> _) { | 1023 ), DEVC$RT.type((List<int> _) { |
1024 } | 1024 } |
1025 ), "CastDynamic", """line 1788, column 9 of dart:core/uri.dart: """, _unreserv
edTable is List<int>, false), component, encoding: encoding, spaceToPlus: true); | 1025 ), "CompositeCast", """line 1788, column 9 of dart:core/uri.dart: """, _unrese
rvedTable is List<int>, false), component, encoding: encoding, spaceToPlus: true
); |
1026 } | 1026 } |
1027 static String decodeComponent(String encodedComponent) { | 1027 static String decodeComponent(String encodedComponent) { |
1028 return _uriDecode(encodedComponent); | 1028 return _uriDecode(encodedComponent); |
1029 } | 1029 } |
1030 static String decodeQueryComponent(String encodedComponent, { | 1030 static String decodeQueryComponent(String encodedComponent, { |
1031 Encoding encoding : UTF8} | 1031 Encoding encoding : UTF8} |
1032 ) { | 1032 ) { |
1033 return _uriDecode(encodedComponent, plusToSpace: true, encoding: encoding); | 1033 return _uriDecode(encodedComponent, plusToSpace: true, encoding: encoding); |
1034 } | 1034 } |
1035 static String encodeFull(String uri) { | 1035 static String encodeFull(String uri) { |
1036 return _uriEncode(DEVC$RT.cast(_encodeFullTable, DEVC$RT.type((List<dynamic> _
) { | 1036 return _uriEncode(DEVC$RT.cast(_encodeFullTable, DEVC$RT.type((List<dynamic> _
) { |
1037 } | 1037 } |
1038 ), DEVC$RT.type((List<int> _) { | 1038 ), DEVC$RT.type((List<int> _) { |
1039 } | 1039 } |
1040 ), "CastDynamic", """line 1832, column 23 of dart:core/uri.dart: """, _encodeF
ullTable is List<int>, false), uri); | 1040 ), "CompositeCast", """line 1832, column 23 of dart:core/uri.dart: """, _encod
eFullTable is List<int>, false), uri); |
1041 } | 1041 } |
1042 static String decodeFull(String uri) { | 1042 static String decodeFull(String uri) { |
1043 return _uriDecode(uri); | 1043 return _uriDecode(uri); |
1044 } | 1044 } |
1045 static Map<String, String> splitQueryString(String query, { | 1045 static Map<String, String> splitQueryString(String query, { |
1046 Encoding encoding : UTF8} | 1046 Encoding encoding : UTF8} |
1047 ) { | 1047 ) { |
1048 return ((__x45) => DEVC$RT.cast(__x45, dynamic, DEVC$RT.type((Map<String, Stri
ng> _) { | 1048 return ((__x45) => DEVC$RT.cast(__x45, dynamic, DEVC$RT.type((Map<String, Stri
ng> _) { |
1049 } | 1049 } |
1050 ), "CastGeneral", """line 1864, column 12 of dart:core/uri.dart: """, __x45 is
Map<String, String>, false))(query.split("&").fold({ | 1050 ), "CompositeCast", """line 1864, column 12 of dart:core/uri.dart: """, __x45
is Map<String, String>, false))(query.split("&").fold({ |
1051 } | 1051 } |
1052 , ((__x51) => DEVC$RT.wrap((dynamic f(dynamic __u46, dynamic __u47)) { | 1052 , ((__x51) => DEVC$RT.wrap((dynamic f(dynamic __u46, dynamic __u47)) { |
1053 dynamic c(dynamic x0, dynamic x1) => f(x0, x1); | 1053 dynamic c(dynamic x0, dynamic x1) => f(x0, x1); |
1054 return f == null ? null : c; | 1054 return f == null ? null : c; |
1055 } | 1055 } |
1056 , __x51, __t35, __t48, "WrapLiteral", """line 1864, column 38 of dart:core/uri
.dart: """, __x51 is __t48))((map, element) { | 1056 , __x51, __t35, __t48, "WrapLiteral", """line 1864, column 38 of dart:core/uri
.dart: """, __x51 is __t48))((map, element) { |
1057 int index = ((__x52) => DEVC$RT.cast(__x52, dynamic, int, "CastGeneral", """
line 1865, column 19 of dart:core/uri.dart: """, __x52 is int, true))(element.in
dexOf("=")); | 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("=")); |
1058 if (index == -1) { | 1058 if (index == -1) { |
1059 if (element != "") { | 1059 if (element != "") { |
1060 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)] = ""; | 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)] = ""; |
1061 } | 1061 } |
1062 } | 1062 } |
1063 else if (index != 0) { | 1063 else if (index != 0) { |
1064 var key = element.substring(0, index); | 1064 var key = element.substring(0, index); |
1065 var value = element.substring(index + 1); | 1065 var value = element.substring(index + 1); |
1066 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); | 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); |
1067 } | 1067 } |
1068 return map; | 1068 return map; |
1069 } | 1069 } |
1070 ))); | 1070 ))); |
1071 } | 1071 } |
1072 static List<int> parseIPv4Address(String host) { | 1072 static List<int> parseIPv4Address(String host) { |
1073 void error(String msg) { | 1073 void error(String msg) { |
1074 throw new FormatException('Illegal IPv4 address, $msg'); | 1074 throw new FormatException('Illegal IPv4 address, $msg'); |
1075 } | 1075 } |
1076 var bytes = host.split('.'); | 1076 var bytes = host.split('.'); |
1077 if (bytes.length != 4) { | 1077 if (bytes.length != 4) { |
1078 error('IPv4 address should contain exactly 4 parts'); | 1078 error('IPv4 address should contain exactly 4 parts'); |
1079 } | 1079 } |
1080 return ((__x53) => DEVC$RT.cast(__x53, DEVC$RT.type((List<dynamic> _) { | 1080 return ((__x53) => DEVC$RT.cast(__x53, DEVC$RT.type((List<dynamic> _) { |
1081 } | 1081 } |
1082 ), DEVC$RT.type((List<int> _) { | 1082 ), DEVC$RT.type((List<int> _) { |
1083 } | 1083 } |
1084 ), "CastDynamic", """line 1896, column 12 of dart:core/uri.dart: """, __x53 is
List<int>, false))(bytes.map(((__x55) => DEVC$RT.wrap((dynamic f(dynamic __u54)
) { | 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)) { |
1085 dynamic c(dynamic x0) => f(x0); | 1085 dynamic c(dynamic x0) => f(x0); |
1086 return f == null ? null : c; | 1086 return f == null ? null : c; |
1087 } | 1087 } |
1088 , __x55, __t16, __t25, "WrapLiteral", """line 1897, column 14 of dart:core/uri
.dart: """, __x55 is __t25))((byteString) { | 1088 , __x55, __t16, __t25, "WrapLiteral", """line 1897, column 14 of dart:core/uri
.dart: """, __x55 is __t25))((byteString) { |
1089 int byte = int.parse(DEVC$RT.cast(byteString, dynamic, String, "CastGeneral"
, """line 1898, column 32 of dart:core/uri.dart: """, byteString is String, true
)); | 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
)); |
1090 if (byte < 0 || byte > 255) { | 1090 if (byte < 0 || byte > 255) { |
1091 error('each part must be in the range of `0..255`'); | 1091 error('each part must be in the range of `0..255`'); |
1092 } | 1092 } |
1093 return byte; | 1093 return byte; |
1094 } | 1094 } |
1095 )).toList()); | 1095 )).toList()); |
1096 } | 1096 } |
1097 static List<int> parseIPv6Address(String host, [int start = 0, int end]) { | 1097 static List<int> parseIPv6Address(String host, [int start = 0, int end]) { |
1098 if (end == null) end = host.length; | 1098 if (end == null) end = host.length; |
1099 void error(String msg, [position]) { | 1099 void error(String msg, [position]) { |
1100 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)); | 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)); |
1101 } | 1101 } |
1102 int parseHex(int start, int end) { | 1102 int parseHex(int start, int end) { |
1103 if (end - start > 4) { | 1103 if (end - start > 4) { |
1104 error('an IPv6 part can only contain a maximum of 4 hex digits', start); | 1104 error('an IPv6 part can only contain a maximum of 4 hex digits', start); |
1105 } | 1105 } |
1106 int value = int.parse(host.substring(start, end), radix: 16); | 1106 int value = int.parse(host.substring(start, end), radix: 16); |
1107 if (value < 0 || value > (1 << 16) - 1) { | 1107 if (value < 0 || value > (1 << 16) - 1) { |
1108 error('each part must be in the range of `0x0..0xFFFF`', start); | 1108 error('each part must be in the range of `0x0..0xFFFF`', start); |
1109 } | 1109 } |
1110 return value; | 1110 return value; |
1111 } | 1111 } |
1112 if (host.length < 2) error('address is too short'); | 1112 if (host.length < 2) error('address is too short'); |
1113 List<int> parts = ((__x56) => DEVC$RT.cast(__x56, DEVC$RT.type((List<dynamic>
_) { | 1113 List<int> parts = ((__x56) => DEVC$RT.cast(__x56, DEVC$RT.type((List<dynamic>
_) { |
1114 } | 1114 } |
1115 ), DEVC$RT.type((List<int> _) { | 1115 ), DEVC$RT.type((List<int> _) { |
1116 } | 1116 } |
1117 ), "CastLiteral", """line 1946, column 23 of dart:core/uri.dart: """, __x56 is
List<int>, false))([]); | 1117 ), "InferableLiteral", """line 1946, column 23 of dart:core/uri.dart: """, __x
56 is List<int>, false))([]); |
1118 bool wildcardSeen = false; | 1118 bool wildcardSeen = false; |
1119 int partStart = start; | 1119 int partStart = start; |
1120 for (int i = start; i < end; i++) { | 1120 for (int i = start; i < end; i++) { |
1121 if (host.codeUnitAt(i) == _COLON) { | 1121 if (host.codeUnitAt(i) == _COLON) { |
1122 if (i == start) { | 1122 if (i == start) { |
1123 i++; | 1123 i++; |
1124 if (host.codeUnitAt(i) != _COLON) { | 1124 if (host.codeUnitAt(i) != _COLON) { |
1125 error('invalid start colon.', i); | 1125 error('invalid start colon.', i); |
1126 } | 1126 } |
1127 partStart = i; | 1127 partStart = i; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 else { | 1182 else { |
1183 bytes[index] = value >> 8; | 1183 bytes[index] = value >> 8; |
1184 bytes[index + 1] = value & 0xff; | 1184 bytes[index + 1] = value & 0xff; |
1185 index += 2; | 1185 index += 2; |
1186 } | 1186 } |
1187 } | 1187 } |
1188 return DEVC$RT.cast(bytes, DEVC$RT.type((List<dynamic> _) { | 1188 return DEVC$RT.cast(bytes, DEVC$RT.type((List<dynamic> _) { |
1189 } | 1189 } |
1190 ), DEVC$RT.type((List<int> _) { | 1190 ), DEVC$RT.type((List<int> _) { |
1191 } | 1191 } |
1192 ), "CastDynamic", """line 2018, column 12 of dart:core/uri.dart: """, bytes is
List<int>, false); | 1192 ), "CompositeCast", """line 2018, column 12 of dart:core/uri.dart: """, bytes
is List<int>, false); |
1193 } | 1193 } |
1194 static const int _SPACE = 0x20; | 1194 static const int _SPACE = 0x20; |
1195 static const int _DOUBLE_QUOTE = 0x22; | 1195 static const int _DOUBLE_QUOTE = 0x22; |
1196 static const int _NUMBER_SIGN = 0x23; | 1196 static const int _NUMBER_SIGN = 0x23; |
1197 static const int _PERCENT = 0x25; | 1197 static const int _PERCENT = 0x25; |
1198 static const int _ASTERISK = 0x2A; | 1198 static const int _ASTERISK = 0x2A; |
1199 static const int _PLUS = 0x2B; | 1199 static const int _PLUS = 0x2B; |
1200 static const int _DOT = 0x2E; | 1200 static const int _DOT = 0x2E; |
1201 static const int _SLASH = 0x2F; | 1201 static const int _SLASH = 0x2F; |
1202 static const int _ZERO = 0x30; | 1202 static const int _ZERO = 0x30; |
(...skipping 11 matching lines...) Expand all Loading... |
1214 static const int _RIGHT_BRACKET = 0x5D; | 1214 static const int _RIGHT_BRACKET = 0x5D; |
1215 static const int _LOWER_CASE_A = 0x61; | 1215 static const int _LOWER_CASE_A = 0x61; |
1216 static const int _LOWER_CASE_F = 0x66; | 1216 static const int _LOWER_CASE_F = 0x66; |
1217 static const int _LOWER_CASE_Z = 0x7A; | 1217 static const int _LOWER_CASE_Z = 0x7A; |
1218 static const int _BAR = 0x7C; | 1218 static const int _BAR = 0x7C; |
1219 static String _uriEncode(List<int> canonicalTable, String text, { | 1219 static String _uriEncode(List<int> canonicalTable, String text, { |
1220 Encoding encoding : UTF8, bool spaceToPlus : false} | 1220 Encoding encoding : UTF8, bool spaceToPlus : false} |
1221 ) { | 1221 ) { |
1222 byteToHex(byte, buffer) { | 1222 byteToHex(byte, buffer) { |
1223 const String hex = '0123456789ABCDEF'; | 1223 const String hex = '0123456789ABCDEF'; |
1224 buffer.writeCharCode(hex.codeUnitAt(((__x57) => DEVC$RT.cast(__x57, dynamic
, int, "CastGeneral", """line 2059, column 43 of dart:core/uri.dart: """, __x57
is int, true))(byte >> 4))); | 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))); |
1225 buffer.writeCharCode(hex.codeUnitAt(((__x58) => DEVC$RT.cast(__x58, dynamic
, int, "CastGeneral", """line 2060, column 43 of dart:core/uri.dart: """, __x58
is int, true))(byte & 0x0f))); | 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))); |
1226 } | 1226 } |
1227 StringBuffer result = new StringBuffer(); | 1227 StringBuffer result = new StringBuffer(); |
1228 var bytes = encoding.encode(text); | 1228 var bytes = encoding.encode(text); |
1229 for (int i = 0; i < bytes.length; i++) { | 1229 for (int i = 0; i < bytes.length; i++) { |
1230 int byte = bytes[i]; | 1230 int byte = bytes[i]; |
1231 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)
) { | 1231 if (byte < 128 && ((canonicalTable[byte >> 4] & (1 << (byte & 0x0f))) != 0)
) { |
1232 result.writeCharCode(byte); | 1232 result.writeCharCode(byte); |
1233 } | 1233 } |
1234 else if (spaceToPlus && byte == _SPACE) { | 1234 else if (spaceToPlus && byte == _SPACE) { |
1235 result.writeCharCode(_PLUS); | 1235 result.writeCharCode(_PLUS); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 } | 1275 } |
1276 else { | 1276 else { |
1277 bytes = text.codeUnits; | 1277 bytes = text.codeUnits; |
1278 } | 1278 } |
1279 } | 1279 } |
1280 else { | 1280 else { |
1281 bytes = ((__x59) => DEVC$RT.cast(__x59, DEVC$RT.type((List<dynamic> _) { | 1281 bytes = ((__x59) => DEVC$RT.cast(__x59, DEVC$RT.type((List<dynamic> _) { |
1282 } | 1282 } |
1283 ), DEVC$RT.type((List<int> _) { | 1283 ), DEVC$RT.type((List<int> _) { |
1284 } | 1284 } |
1285 ), "CastExact", """line 2134, column 15 of dart:core/uri.dart: """, __x59 is
List<int>, false))(new List()); | 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++) { | 1286 for (int i = 0; i < text.length; i++) { |
1287 var codeUnit = text.codeUnitAt(i); | 1287 var codeUnit = text.codeUnitAt(i); |
1288 if (codeUnit > 127) { | 1288 if (codeUnit > 127) { |
1289 throw new ArgumentError("Illegal percent encoding in URI"); | 1289 throw new ArgumentError("Illegal percent encoding in URI"); |
1290 } | 1290 } |
1291 if (codeUnit == _PERCENT) { | 1291 if (codeUnit == _PERCENT) { |
1292 if (i + 3 > text.length) { | 1292 if (i + 3 > text.length) { |
1293 throw new ArgumentError('Truncated URI'); | 1293 throw new ArgumentError('Truncated URI'); |
1294 } | 1294 } |
1295 bytes.add(_hexCharPairToByte(text, i + 1)); | 1295 bytes.add(_hexCharPairToByte(text, i + 1)); |
(...skipping 23 matching lines...) Expand all Loading... |
1319 static const _pathCharOrSlashTable = const [0x0000, 0x0000, 0xffd2, 0x2fff, 0xf
fff, 0x87ff, 0xfffe, 0x47ff]; | 1319 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]; | 1320 static const _queryCharTable = const [0x0000, 0x0000, 0xffd2, 0xafff, 0xffff, 0
x87ff, 0xfffe, 0x47ff]; |
1321 } | 1321 } |
1322 typedef void __t14(String __u15); | 1322 typedef void __t14(String __u15); |
1323 typedef dynamic __t16(dynamic __u17); | 1323 typedef dynamic __t16(dynamic __u17); |
1324 typedef dynamic __t25(String __u26); | 1324 typedef dynamic __t25(String __u26); |
1325 typedef String __t27(dynamic __u28); | 1325 typedef String __t27(dynamic __u28); |
1326 typedef void __t32(String __u33, String __u34); | 1326 typedef void __t32(String __u33, String __u34); |
1327 typedef dynamic __t35(dynamic __u36, dynamic __u37); | 1327 typedef dynamic __t35(dynamic __u36, dynamic __u37); |
1328 typedef dynamic __t48(dynamic __u49, String __u50); | 1328 typedef dynamic __t48(dynamic __u49, String __u50); |
OLD | NEW |