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

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

Issue 961493003: don't run dart gen on JS patch code (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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 2
3 abstract class String implements Comparable<String>, Pattern { 3 abstract class String implements Comparable<String>, Pattern {
4 factory String.fromCharCodes(Iterable<int> charCodes, 4 external factory String.fromCharCodes(Iterable<int> charCodes,
5 [int start = 0, int end]) { 5 [int start = 0, int end]);
6 if (charCodes is! JSArray) { 6 external factory String.fromCharCode(int charCode);
7 return ((__x36) => DDC$RT.cast(__x36, dynamic, String, "CastGeneral", 7 external const factory String.fromEnvironment(String name,
8 """line 118, column 15 of dart:core/string.dart: """, __x36 is String, 8 {String defaultValue});
9 true))(_stringFromIterable(charCodes, start, end));
10 }
11 List list = DDC$RT.cast(charCodes, DDC$RT.type((Iterable<int> _) {}),
12 DDC$RT.type((List<dynamic> _) {}), "CastGeneral",
13 """line 121, column 18 of dart:core/string.dart: """,
14 charCodes is List<dynamic>, true);
15 int len = list.length;
16 if (start < 0 || start > len) {
17 throw new RangeError.range(start, 0, len);
18 }
19 if (end == null) {
20 end = len;
21 } else if (end < start || end > len) {
22 throw new RangeError.range(end, start, len);
23 }
24 if (start > 0 || end < len) {
25 list = list.sublist(start, end);
26 }
27 return ((__x37) => DDC$RT.cast(__x37, dynamic, String, "CastGeneral",
28 """line 135, column 13 of dart:core/string.dart: """, __x37 is String,
29 true))(Primitives.stringFromCharCodes(list));
30 }
31 factory String.fromCharCode(int charCode) {
32 return ((__x38) => DDC$RT.cast(__x38, dynamic, String, "CastGeneral",
33 """line 149, column 13 of dart:core/string.dart: """, __x38 is String,
34 true))(Primitives.stringFromCharCode(charCode));
35 }
36 factory String.fromEnvironment(String name, {String defaultValue}) {
37 throw new UnsupportedError(
38 'String.fromEnvironment can only be used as a const constructor');
39 }
40 String operator [](int index); 9 String operator [](int index);
41 int codeUnitAt(int index); 10 int codeUnitAt(int index);
42 int get length; 11 int get length;
43 int get hashCode; 12 int get hashCode;
44 bool operator ==(Object other); 13 bool operator ==(Object other);
45 bool endsWith(String other); 14 bool endsWith(String other);
46 bool startsWith(Pattern pattern, [int index = 0]); 15 bool startsWith(Pattern pattern, [int index = 0]);
47 int indexOf(Pattern pattern, [int start]); 16 int indexOf(Pattern pattern, [int start]);
48 int lastIndexOf(Pattern pattern, [int start]); 17 int lastIndexOf(Pattern pattern, [int start]);
49 bool get isEmpty; 18 bool get isEmpty;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 _checkSplitSurrogate(index); 78 _checkSplitSurrogate(index);
110 } 79 }
111 void _checkSplitSurrogate(int index) { 80 void _checkSplitSurrogate(int index) {
112 if (index > 0 && 81 if (index > 0 &&
113 index < string.length && 82 index < string.length &&
114 _isLeadSurrogate(string.codeUnitAt(index - 1)) && 83 _isLeadSurrogate(string.codeUnitAt(index - 1)) &&
115 _isTrailSurrogate(string.codeUnitAt(index))) { 84 _isTrailSurrogate(string.codeUnitAt(index))) {
116 throw new ArgumentError('Index inside surrogate pair: $index'); 85 throw new ArgumentError('Index inside surrogate pair: $index');
117 } 86 }
118 } 87 }
119 int get rawIndex => ((__x39) => DDC$RT.cast(__x39, dynamic, int, 88 int get rawIndex => ((__x9) => DDC$RT.cast(__x9, dynamic, int, "CastGeneral",
120 "CastGeneral", """line 690, column 24 of dart:core/string.dart: """, 89 """line 665, column 24 of dart:core/string.dart: """, __x9 is int,
121 __x39 is int, true))((_position != _nextPosition) ? _position : null); 90 true))((_position != _nextPosition) ? _position : null);
122 void set rawIndex(int rawIndex) { 91 void set rawIndex(int rawIndex) {
123 RangeError.checkValidIndex(rawIndex, string, "rawIndex"); 92 RangeError.checkValidIndex(rawIndex, string, "rawIndex");
124 reset(rawIndex); 93 reset(rawIndex);
125 moveNext(); 94 moveNext();
126 } 95 }
127 void reset([int rawIndex = 0]) { 96 void reset([int rawIndex = 0]) {
128 RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex"); 97 RangeError.checkValueInInterval(rawIndex, 0, string.length, "rawIndex");
129 _checkSplitSurrogate(rawIndex); 98 _checkSplitSurrogate(rawIndex);
130 _position = _nextPosition = rawIndex; 99 _position = _nextPosition = rawIndex;
131 _currentCodePoint = null; 100 _currentCodePoint = null;
132 } 101 }
133 int get current => DDC$RT.cast(_currentCodePoint, num, int, "CastGeneral", 102 int get current => DDC$RT.cast(_currentCodePoint, num, int, "CastGeneral",
134 """line 727, column 23 of dart:core/string.dart: """, 103 """line 702, column 23 of dart:core/string.dart: """,
135 _currentCodePoint is int, true); 104 _currentCodePoint is int, true);
136 int get currentSize => _nextPosition - _position; 105 int get currentSize => _nextPosition - _position;
137 String get currentAsString { 106 String get currentAsString {
138 if (_position == _nextPosition) return null; 107 if (_position == _nextPosition) return null;
139 if (_position + 1 == _nextPosition) return string[_position]; 108 if (_position + 1 == _nextPosition) return string[_position];
140 return string.substring(_position, _nextPosition); 109 return string.substring(_position, _nextPosition);
141 } 110 }
142 bool moveNext() { 111 bool moveNext() {
143 _position = _nextPosition; 112 _position = _nextPosition;
144 if (_position == string.length) { 113 if (_position == string.length) {
(...skipping 28 matching lines...) Expand all
173 _position = position - 1; 142 _position = position - 1;
174 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); 143 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit);
175 return true; 144 return true;
176 } 145 }
177 } 146 }
178 _position = position; 147 _position = position;
179 _currentCodePoint = codeUnit; 148 _currentCodePoint = codeUnit;
180 return true; 149 return true;
181 } 150 }
182 } 151 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/core/stopwatch.dart ('k') | test/dart_codegen/expect/core/string_buffer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698