| OLD | NEW |
| 1 part of dart.core; | 1 part of dart.core; |
| 2 | 2 |
| 3 abstract class String implements Comparable<String>, Pattern { | 3 abstract class String implements Comparable<String>, Pattern { |
| 4 @patch factory String.fromCharCodes(Iterable<int> charCodes, | 4 factory String.fromCharCodes(Iterable<int> charCodes, |
| 5 [int start = 0, int end]) { | 5 [int start = 0, int end]) { |
| 6 if (charCodes is! JSArray) { | 6 if (charCodes is! JSArray) { |
| 7 return ((__x36) => DDC$RT.cast(__x36, dynamic, String, "CastGeneral", | 7 return ((__x36) => DDC$RT.cast(__x36, dynamic, String, "CastGeneral", |
| 8 """line 99, column 15 of dart:core/string.dart: """, __x36 is String, | 8 """line 118, column 15 of dart:core/string.dart: """, __x36 is String, |
| 9 true))(_stringFromIterable(charCodes, start, end)); | 9 true))(_stringFromIterable(charCodes, start, end)); |
| 10 } | 10 } |
| 11 List list = DDC$RT.cast(charCodes, DDC$RT.type((Iterable<int> _) {}), | 11 List list = DDC$RT.cast(charCodes, DDC$RT.type((Iterable<int> _) {}), |
| 12 DDC$RT.type((List<dynamic> _) {}), "CastGeneral", | 12 DDC$RT.type((List<dynamic> _) {}), "CastGeneral", |
| 13 """line 102, column 18 of dart:core/string.dart: """, | 13 """line 121, column 18 of dart:core/string.dart: """, |
| 14 charCodes is List<dynamic>, true); | 14 charCodes is List<dynamic>, true); |
| 15 int len = list.length; | 15 int len = list.length; |
| 16 if (start < 0 || start > len) { | 16 if (start < 0 || start > len) { |
| 17 throw new RangeError.range(start, 0, len); | 17 throw new RangeError.range(start, 0, len); |
| 18 } | 18 } |
| 19 if (end == null) { | 19 if (end == null) { |
| 20 end = len; | 20 end = len; |
| 21 } else if (end < start || end > len) { | 21 } else if (end < start || end > len) { |
| 22 throw new RangeError.range(end, start, len); | 22 throw new RangeError.range(end, start, len); |
| 23 } | 23 } |
| 24 if (start > 0 || end < len) { | 24 if (start > 0 || end < len) { |
| 25 list = list.sublist(start, end); | 25 list = list.sublist(start, end); |
| 26 } | 26 } |
| 27 return ((__x37) => DDC$RT.cast(__x37, dynamic, String, "CastGeneral", | 27 return ((__x37) => DDC$RT.cast(__x37, dynamic, String, "CastGeneral", |
| 28 """line 116, column 13 of dart:core/string.dart: """, __x37 is String, | 28 """line 135, column 13 of dart:core/string.dart: """, __x37 is String, |
| 29 true))(Primitives.stringFromCharCodes(list)); | 29 true))(Primitives.stringFromCharCodes(list)); |
| 30 } | 30 } |
| 31 @patch factory String.fromCharCode(int charCode) { | 31 factory String.fromCharCode(int charCode) { |
| 32 return ((__x38) => DDC$RT.cast(__x38, dynamic, String, "CastGeneral", | 32 return ((__x38) => DDC$RT.cast(__x38, dynamic, String, "CastGeneral", |
| 33 """line 121, column 13 of dart:core/string.dart: """, __x38 is String, | 33 """line 149, column 13 of dart:core/string.dart: """, __x38 is String, |
| 34 true))(Primitives.stringFromCharCode(charCode)); | 34 true))(Primitives.stringFromCharCode(charCode)); |
| 35 } | 35 } |
| 36 @patch factory String.fromEnvironment(String name, {String defaultValue}) { | 36 factory String.fromEnvironment(String name, {String defaultValue}) { |
| 37 throw new UnsupportedError( | 37 throw new UnsupportedError( |
| 38 'String.fromEnvironment can only be used as a const constructor'); | 38 'String.fromEnvironment can only be used as a const constructor'); |
| 39 } | 39 } |
| 40 String operator [](int index); | 40 String operator [](int index); |
| 41 int codeUnitAt(int index); | 41 int codeUnitAt(int index); |
| 42 int get length; | 42 int get length; |
| 43 int get hashCode; | 43 int get hashCode; |
| 44 bool operator ==(Object other); | 44 bool operator ==(Object other); |
| 45 bool endsWith(String other); | 45 bool endsWith(String other); |
| 46 bool startsWith(Pattern pattern, [int index = 0]); | 46 bool startsWith(Pattern pattern, [int index = 0]); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 void _checkSplitSurrogate(int index) { | 111 void _checkSplitSurrogate(int index) { |
| 112 if (index > 0 && | 112 if (index > 0 && |
| 113 index < string.length && | 113 index < string.length && |
| 114 _isLeadSurrogate(string.codeUnitAt(index - 1)) && | 114 _isLeadSurrogate(string.codeUnitAt(index - 1)) && |
| 115 _isTrailSurrogate(string.codeUnitAt(index))) { | 115 _isTrailSurrogate(string.codeUnitAt(index))) { |
| 116 throw new ArgumentError('Index inside surrogate pair: $index'); | 116 throw new ArgumentError('Index inside surrogate pair: $index'); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 int get rawIndex => ((__x39) => DDC$RT.cast(__x39, dynamic, int, | 119 int get rawIndex => ((__x39) => DDC$RT.cast(__x39, dynamic, int, |
| 120 "CastGeneral", """line 645, column 24 of dart:core/string.dart: """, | 120 "CastGeneral", """line 690, column 24 of dart:core/string.dart: """, |
| 121 __x39 is int, true))((_position != _nextPosition) ? _position : null); | 121 __x39 is int, true))((_position != _nextPosition) ? _position : null); |
| 122 void set rawIndex(int rawIndex) { | 122 void set rawIndex(int rawIndex) { |
| 123 RangeError.checkValidIndex(rawIndex, string, "rawIndex"); | 123 RangeError.checkValidIndex(rawIndex, string, "rawIndex"); |
| 124 reset(rawIndex); | 124 reset(rawIndex); |
| 125 moveNext(); | 125 moveNext(); |
| 126 } | 126 } |
| 127 void reset([int rawIndex = 0]) { | 127 void reset([int rawIndex = 0]) { |
| 128 RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex"); | 128 RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex"); |
| 129 _checkSplitSurrogate(rawIndex); | 129 _checkSplitSurrogate(rawIndex); |
| 130 _position = _nextPosition = rawIndex; | 130 _position = _nextPosition = rawIndex; |
| 131 _currentCodePoint = null; | 131 _currentCodePoint = null; |
| 132 } | 132 } |
| 133 int get current => DDC$RT.cast(_currentCodePoint, num, int, "CastGeneral", | 133 int get current => DDC$RT.cast(_currentCodePoint, num, int, "CastGeneral", |
| 134 """line 682, column 23 of dart:core/string.dart: """, | 134 """line 727, column 23 of dart:core/string.dart: """, |
| 135 _currentCodePoint is int, true); | 135 _currentCodePoint is int, true); |
| 136 int get currentSize => _nextPosition - _position; | 136 int get currentSize => _nextPosition - _position; |
| 137 String get currentAsString { | 137 String get currentAsString { |
| 138 if (_position == _nextPosition) return null; | 138 if (_position == _nextPosition) return null; |
| 139 if (_position + 1 == _nextPosition) return string[_position]; | 139 if (_position + 1 == _nextPosition) return string[_position]; |
| 140 return string.substring(_position, _nextPosition); | 140 return string.substring(_position, _nextPosition); |
| 141 } | 141 } |
| 142 bool moveNext() { | 142 bool moveNext() { |
| 143 _position = _nextPosition; | 143 _position = _nextPosition; |
| 144 if (_position == string.length) { | 144 if (_position == string.length) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 173 _position = position - 1; | 173 _position = position - 1; |
| 174 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); | 174 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); |
| 175 return true; | 175 return true; |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 _position = position; | 178 _position = position; |
| 179 _currentCodePoint = codeUnit; | 179 _currentCodePoint = codeUnit; |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 } | 182 } |
| OLD | NEW |