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

Side by Side Diff: lib/runtime/dart/_interceptors.js

Issue 1156273010: fixes browser/runtime_test, and a few extension member fixes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | lib/runtime/dart/_internal.js » ('j') | lib/runtime/dart_runtime.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var _interceptors = dart.defineLibrary(_interceptors, {}); 1 var _interceptors = dart.defineLibrary(_interceptors, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var _internal = dart.import(_internal); 3 var _internal = dart.import(_internal);
4 var _js_helper = dart.lazyImport(_js_helper); 4 var _js_helper = dart.lazyImport(_js_helper);
5 var collection = dart.import(collection); 5 var collection = dart.import(collection);
6 var math = dart.import(math); 6 var math = dart.import(math);
7 (function(exports, core, _internal, _js_helper, collection, math) { 7 (function(exports, core, _internal, _js_helper, collection, math) {
8 'use strict'; 8 'use strict';
9 let JSArray$ = dart.generic(function(E) { 9 let JSArray$ = dart.generic(function(E) {
10 class JSArray extends core.Object { 10 class JSArray extends core.Object {
11 JSArray() { 11 JSArray() {
12 } 12 }
13 static typed(allocation) { 13 static typed(allocation) {
14 return dart.list(allocation, E); 14 return dart.list(allocation, E);
15 } 15 }
16 static markFixed(allocation) { 16 static markFixed(allocation) {
17 return JSArray$(E).typed(JSArray$().markFixedList(dart.as(allocation, co re.List))); 17 return JSArray$(E).typed(JSArray$().markFixedList(dart.as(allocation, co re.List)));
18 } 18 }
19 static markGrowable(allocation) { 19 static markGrowable(allocation) {
20 return JSArray$().typed(allocation); 20 return JSArray$().typed(allocation);
21 } 21 }
22 static markFixedList(list) { 22 static markFixedList(list) {
23 list.fixed$length = Array; 23 list.fixed$length = Array;
24 return list; 24 return list;
25 } 25 }
26 checkGrowable(reason) { 26 [dart.extensionMember('checkGrowable')](reason) {
Jennifer Messerly 2015/06/05 19:06:17 this is kind of ugly/confusing. Alternatively, we
Leaf 2015/06/05 20:42:23 It seems like the meta-programming could make debu
Jennifer Messerly 2015/06/05 21:08:57 yup, that's another option. would work for me.
27 if (this.fixed$length) { 27 if (this.fixed$length) {
28 throw new core.UnsupportedError(dart.as(reason, core.String)); 28 throw new core.UnsupportedError(dart.as(reason, core.String));
29 } 29 }
30 } 30 }
31 add(value) { 31 [dart.extensionMember('add')](value) {
32 dart.as(value, E); 32 dart.as(value, E);
33 this[dartx.checkGrowable]('add'); 33 this[dartx.checkGrowable]('add');
34 this.push(value); 34 this.push(value);
35 } 35 }
36 removeAt(index) { 36 [dart.extensionMember('removeAt')](index) {
37 if (!(typeof index == 'number')) 37 if (!(typeof index == 'number'))
38 throw new core.ArgumentError(index); 38 throw new core.ArgumentError(index);
39 if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(this. length)) { 39 if (dart.notNull(index) < 0 || dart.notNull(index) >= dart.notNull(this. length)) {
40 throw new core.RangeError.value(index); 40 throw new core.RangeError.value(index);
41 } 41 }
42 this[dartx.checkGrowable]('removeAt'); 42 this[dartx.checkGrowable]('removeAt');
43 return this.splice(index, 1)[0]; 43 return this.splice(index, 1)[0];
44 } 44 }
45 insert(index, value) { 45 [dart.extensionMember('insert')](index, value) {
46 dart.as(value, E); 46 dart.as(value, E);
47 if (!(typeof index == 'number')) 47 if (!(typeof index == 'number'))
48 throw new core.ArgumentError(index); 48 throw new core.ArgumentError(index);
49 if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this.l ength)) { 49 if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this.l ength)) {
50 throw new core.RangeError.value(index); 50 throw new core.RangeError.value(index);
51 } 51 }
52 this[dartx.checkGrowable]('insert'); 52 this[dartx.checkGrowable]('insert');
53 this.splice(index, 0, value); 53 this.splice(index, 0, value);
54 } 54 }
55 insertAll(index, iterable) { 55 [dart.extensionMember('insertAll')](index, iterable) {
56 dart.as(iterable, core.Iterable$(E)); 56 dart.as(iterable, core.Iterable$(E));
57 this[dartx.checkGrowable]('insertAll'); 57 this[dartx.checkGrowable]('insertAll');
58 _internal.IterableMixinWorkaround.insertAllList(this, index, iterable); 58 _internal.IterableMixinWorkaround.insertAllList(this, index, iterable);
59 } 59 }
60 setAll(index, iterable) { 60 [dart.extensionMember('setAll')](index, iterable) {
61 dart.as(iterable, core.Iterable$(E)); 61 dart.as(iterable, core.Iterable$(E));
62 _internal.IterableMixinWorkaround.setAllList(this, index, iterable); 62 _internal.IterableMixinWorkaround.setAllList(this, index, iterable);
63 } 63 }
64 removeLast() { 64 [dart.extensionMember('removeLast')]() {
65 this[dartx.checkGrowable]('removeLast'); 65 this[dartx.checkGrowable]('removeLast');
66 if (this.length == 0) 66 if (this.length == 0)
67 throw new core.RangeError.value(-1); 67 throw new core.RangeError.value(-1);
68 return dart.as(this.pop(), E); 68 return dart.as(this.pop(), E);
69 } 69 }
70 remove(element) { 70 [dart.extensionMember('remove')](element) {
71 this[dartx.checkGrowable]('remove'); 71 this[dartx.checkGrowable]('remove');
72 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) { 72 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) {
73 if (dart.equals(this[dartx.get](i), element)) { 73 if (dart.equals(this[dartx.get](i), element)) {
74 this.splice(i, 1); 74 this.splice(i, 1);
75 return true; 75 return true;
76 } 76 }
77 } 77 }
78 return false; 78 return false;
79 } 79 }
80 removeWhere(test) { 80 [dart.extensionMember('removeWhere')](test) {
81 dart.as(test, dart.functionType(core.bool, [E])); 81 dart.as(test, dart.functionType(core.bool, [E]));
82 _internal.IterableMixinWorkaround.removeWhereList(this, test); 82 _internal.IterableMixinWorkaround.removeWhereList(this, test);
83 } 83 }
84 retainWhere(test) { 84 [dart.extensionMember('retainWhere')](test) {
85 dart.as(test, dart.functionType(core.bool, [E])); 85 dart.as(test, dart.functionType(core.bool, [E]));
86 _internal.IterableMixinWorkaround.removeWhereList(this, dart.fn(element => !dart.notNull(test(element)), core.bool, [E])); 86 _internal.IterableMixinWorkaround.removeWhereList(this, dart.fn(element => !dart.notNull(test(element)), core.bool, [E]));
87 } 87 }
88 where(f) { 88 [dart.extensionMember('where')](f) {
89 dart.as(f, dart.functionType(core.bool, [E])); 89 dart.as(f, dart.functionType(core.bool, [E]));
90 return new (_internal.IterableMixinWorkaround$(E))().where(this, f); 90 return new (_internal.IterableMixinWorkaround$(E))().where(this, f);
91 } 91 }
92 expand(f) { 92 [dart.extensionMember('expand')](f) {
93 dart.as(f, dart.functionType(core.Iterable, [E])); 93 dart.as(f, dart.functionType(core.Iterable, [E]));
94 return _internal.IterableMixinWorkaround.expand(this, f); 94 return _internal.IterableMixinWorkaround.expand(this, f);
95 } 95 }
96 addAll(collection) { 96 [dart.extensionMember('addAll')](collection) {
97 dart.as(collection, core.Iterable$(E)); 97 dart.as(collection, core.Iterable$(E));
98 for (let e of collection) { 98 for (let e of collection) {
99 this[dartx.add](e); 99 this[dartx.add](e);
100 } 100 }
101 } 101 }
102 clear() { 102 [dart.extensionMember('clear')]() {
103 this.length = 0; 103 this.length = 0;
104 } 104 }
105 forEach(f) { 105 [dart.extensionMember('forEach')](f) {
106 dart.as(f, dart.functionType(dart.void, [E])); 106 dart.as(f, dart.functionType(dart.void, [E]));
107 let length = this.length; 107 let length = this.length;
108 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 108 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
109 f(dart.as(this[i], E)); 109 f(dart.as(this[i], E));
110 if (length != this.length) { 110 if (length != this.length) {
111 throw new core.ConcurrentModificationError(this); 111 throw new core.ConcurrentModificationError(this);
112 } 112 }
113 } 113 }
114 } 114 }
115 map(f) { 115 [dart.extensionMember('map')](f) {
116 dart.as(f, dart.functionType(core.Object, [E])); 116 dart.as(f, dart.functionType(core.Object, [E]));
117 return _internal.IterableMixinWorkaround.mapList(this, f); 117 return _internal.IterableMixinWorkaround.mapList(this, f);
118 } 118 }
119 join(separator) { 119 [dart.extensionMember('join')](separator) {
120 if (separator === void 0) 120 if (separator === void 0)
121 separator = ""; 121 separator = "";
122 let list = core.List.new(this.length); 122 let list = core.List.new(this.length);
123 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) { 123 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) {
124 list[dartx.set](i, `${this[dartx.get](i)}`); 124 list[dartx.set](i, `${this[dartx.get](i)}`);
125 } 125 }
126 return list.join(separator); 126 return list.join(separator);
127 } 127 }
128 take(n) { 128 [dart.extensionMember('take')](n) {
129 return new (_internal.IterableMixinWorkaround$(E))().takeList(this, n); 129 return new (_internal.IterableMixinWorkaround$(E))().takeList(this, n);
130 } 130 }
131 takeWhile(test) { 131 [dart.extensionMember('takeWhile')](test) {
132 dart.as(test, dart.functionType(core.bool, [E])); 132 dart.as(test, dart.functionType(core.bool, [E]));
133 return new (_internal.IterableMixinWorkaround$(E))().takeWhile(this, tes t); 133 return new (_internal.IterableMixinWorkaround$(E))().takeWhile(this, tes t);
134 } 134 }
135 skip(n) { 135 [dart.extensionMember('skip')](n) {
136 return new (_internal.IterableMixinWorkaround$(E))().skipList(this, n); 136 return new (_internal.IterableMixinWorkaround$(E))().skipList(this, n);
137 } 137 }
138 skipWhile(test) { 138 [dart.extensionMember('skipWhile')](test) {
139 dart.as(test, dart.functionType(core.bool, [E])); 139 dart.as(test, dart.functionType(core.bool, [E]));
140 return new (_internal.IterableMixinWorkaround$(E))().skipWhile(this, tes t); 140 return new (_internal.IterableMixinWorkaround$(E))().skipWhile(this, tes t);
141 } 141 }
142 reduce(combine) { 142 [dart.extensionMember('reduce')](combine) {
143 dart.as(combine, dart.functionType(E, [E, E])); 143 dart.as(combine, dart.functionType(E, [E, E]));
144 return dart.as(_internal.IterableMixinWorkaround.reduce(this, combine), E); 144 return dart.as(_internal.IterableMixinWorkaround.reduce(this, combine), E);
145 } 145 }
146 fold(initialValue, combine) { 146 [dart.extensionMember('fold')](initialValue, combine) {
147 dart.as(combine, dart.functionType(core.Object, [dart.bottom, E])); 147 dart.as(combine, dart.functionType(core.Object, [dart.bottom, E]));
148 return _internal.IterableMixinWorkaround.fold(this, initialValue, combin e); 148 return _internal.IterableMixinWorkaround.fold(this, initialValue, combin e);
149 } 149 }
150 firstWhere(test, opts) { 150 [dart.extensionMember('firstWhere')](test, opts) {
151 dart.as(test, dart.functionType(core.bool, [E])); 151 dart.as(test, dart.functionType(core.bool, [E]));
152 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 152 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
153 dart.as(orElse, dart.functionType(E, [])); 153 dart.as(orElse, dart.functionType(E, []));
154 return dart.as(_internal.IterableMixinWorkaround.firstWhere(this, test, orElse), E); 154 return dart.as(_internal.IterableMixinWorkaround.firstWhere(this, test, orElse), E);
155 } 155 }
156 lastWhere(test, opts) { 156 [dart.extensionMember('lastWhere')](test, opts) {
157 dart.as(test, dart.functionType(core.bool, [E])); 157 dart.as(test, dart.functionType(core.bool, [E]));
158 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 158 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
159 dart.as(orElse, dart.functionType(E, [])); 159 dart.as(orElse, dart.functionType(E, []));
160 return dart.as(_internal.IterableMixinWorkaround.lastWhereList(this, tes t, orElse), E); 160 return dart.as(_internal.IterableMixinWorkaround.lastWhereList(this, tes t, orElse), E);
161 } 161 }
162 singleWhere(test) { 162 [dart.extensionMember('singleWhere')](test) {
163 dart.as(test, dart.functionType(core.bool, [E])); 163 dart.as(test, dart.functionType(core.bool, [E]));
164 return dart.as(_internal.IterableMixinWorkaround.singleWhere(this, test) , E); 164 return dart.as(_internal.IterableMixinWorkaround.singleWhere(this, test) , E);
165 } 165 }
166 elementAt(index) { 166 [dart.extensionMember('elementAt')](index) {
167 return this[dartx.get](index); 167 return this[dartx.get](index);
168 } 168 }
169 sublist(start, end) { 169 [dart.extensionMember('sublist')](start, end) {
170 if (end === void 0) 170 if (end === void 0)
171 end = null; 171 end = null;
172 _js_helper.checkNull(start); 172 _js_helper.checkNull(start);
173 if (!(typeof start == 'number')) 173 if (!(typeof start == 'number'))
174 throw new core.ArgumentError(start); 174 throw new core.ArgumentError(start);
175 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.l ength)) { 175 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.l ength)) {
176 throw new core.RangeError.range(start, 0, this.length); 176 throw new core.RangeError.range(start, 0, this.length);
177 } 177 }
178 if (end == null) { 178 if (end == null) {
179 end = this.length; 179 end = this.length;
180 } else { 180 } else {
181 if (!(typeof end == 'number')) 181 if (!(typeof end == 'number'))
182 throw new core.ArgumentError(end); 182 throw new core.ArgumentError(end);
183 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dar t.notNull(this.length)) { 183 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dar t.notNull(this.length)) {
184 throw new core.RangeError.range(end, start, this.length); 184 throw new core.RangeError.range(end, start, this.length);
185 } 185 }
186 } 186 }
187 if (start == end) 187 if (start == end)
188 return dart.list([], E); 188 return dart.list([], E);
189 return JSArray$(E).typed(this.slice(start, end)); 189 return JSArray$(E).typed(this.slice(start, end));
190 } 190 }
191 getRange(start, end) { 191 [dart.extensionMember('getRange')](start, end) {
192 return new (_internal.IterableMixinWorkaround$(E))().getRangeList(this, start, end); 192 return new (_internal.IterableMixinWorkaround$(E))().getRangeList(this, start, end);
193 } 193 }
194 get first() { 194 get [dart.extensionMember('first')]() {
195 if (dart.notNull(this.length) > 0) 195 if (dart.notNull(this.length) > 0)
196 return this[dartx.get](0); 196 return this[dartx.get](0);
197 throw new core.StateError("No elements"); 197 throw new core.StateError("No elements");
198 } 198 }
199 get last() { 199 get [dart.extensionMember('last')]() {
200 if (dart.notNull(this.length) > 0) 200 if (dart.notNull(this.length) > 0)
201 return this[dartx.get](dart.notNull(this.length) - 1); 201 return this[dartx.get](dart.notNull(this.length) - 1);
202 throw new core.StateError("No elements"); 202 throw new core.StateError("No elements");
203 } 203 }
204 get single() { 204 get [dart.extensionMember('single')]() {
205 if (this.length == 1) 205 if (this.length == 1)
206 return this[dartx.get](0); 206 return this[dartx.get](0);
207 if (this.length == 0) 207 if (this.length == 0)
208 throw new core.StateError("No elements"); 208 throw new core.StateError("No elements");
209 throw new core.StateError("More than one element"); 209 throw new core.StateError("More than one element");
210 } 210 }
211 removeRange(start, end) { 211 [dart.extensionMember('removeRange')](start, end) {
212 this[dartx.checkGrowable]('removeRange'); 212 this[dartx.checkGrowable]('removeRange');
213 let receiverLength = this.length; 213 let receiverLength = this.length;
214 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(receiv erLength)) { 214 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(receiv erLength)) {
215 throw new core.RangeError.range(start, 0, receiverLength); 215 throw new core.RangeError.range(start, 0, receiverLength);
216 } 216 }
217 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart. notNull(receiverLength)) { 217 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart. notNull(receiverLength)) {
218 throw new core.RangeError.range(end, start, receiverLength); 218 throw new core.RangeError.range(end, start, receiverLength);
219 } 219 }
220 _internal.Lists.copy(this, end, this, start, dart.notNull(receiverLength ) - dart.notNull(end)); 220 _internal.Lists.copy(this, end, this, start, dart.notNull(receiverLength ) - dart.notNull(end));
221 this.length = dart.notNull(receiverLength) - (dart.notNull(end) - dart.n otNull(start)); 221 this.length = dart.notNull(receiverLength) - (dart.notNull(end) - dart.n otNull(start));
222 } 222 }
223 setRange(start, end, iterable, skipCount) { 223 [dart.extensionMember('setRange')](start, end, iterable, skipCount) {
224 dart.as(iterable, core.Iterable$(E)); 224 dart.as(iterable, core.Iterable$(E));
225 if (skipCount === void 0) 225 if (skipCount === void 0)
226 skipCount = 0; 226 skipCount = 0;
227 _internal.IterableMixinWorkaround.setRangeList(this, start, end, iterabl e, skipCount); 227 _internal.IterableMixinWorkaround.setRangeList(this, start, end, iterabl e, skipCount);
228 } 228 }
229 fillRange(start, end, fillValue) { 229 [dart.extensionMember('fillRange')](start, end, fillValue) {
230 if (fillValue === void 0) 230 if (fillValue === void 0)
231 fillValue = null; 231 fillValue = null;
232 dart.as(fillValue, E); 232 dart.as(fillValue, E);
233 _internal.IterableMixinWorkaround.fillRangeList(this, start, end, fillVa lue); 233 _internal.IterableMixinWorkaround.fillRangeList(this, start, end, fillVa lue);
234 } 234 }
235 replaceRange(start, end, iterable) { 235 [dart.extensionMember('replaceRange')](start, end, iterable) {
236 dart.as(iterable, core.Iterable$(E)); 236 dart.as(iterable, core.Iterable$(E));
237 _internal.IterableMixinWorkaround.replaceRangeList(this, start, end, ite rable); 237 _internal.IterableMixinWorkaround.replaceRangeList(this, start, end, ite rable);
238 } 238 }
239 any(f) { 239 [dart.extensionMember('any')](f) {
240 dart.as(f, dart.functionType(core.bool, [E])); 240 dart.as(f, dart.functionType(core.bool, [E]));
241 return _internal.IterableMixinWorkaround.any(this, f); 241 return _internal.IterableMixinWorkaround.any(this, f);
242 } 242 }
243 every(f) { 243 [dart.extensionMember('every')](f) {
244 dart.as(f, dart.functionType(core.bool, [E])); 244 dart.as(f, dart.functionType(core.bool, [E]));
245 return _internal.IterableMixinWorkaround.every(this, f); 245 return _internal.IterableMixinWorkaround.every(this, f);
246 } 246 }
247 get reversed() { 247 get [dart.extensionMember('reversed')]() {
248 return new (_internal.IterableMixinWorkaround$(E))().reversedList(this); 248 return new (_internal.IterableMixinWorkaround$(E))().reversedList(this);
249 } 249 }
250 sort(compare) { 250 [dart.extensionMember('sort')](compare) {
251 if (compare === void 0) 251 if (compare === void 0)
252 compare = null; 252 compare = null;
253 dart.as(compare, dart.functionType(core.int, [E, E])); 253 dart.as(compare, dart.functionType(core.int, [E, E]));
254 _internal.IterableMixinWorkaround.sortList(this, compare); 254 _internal.IterableMixinWorkaround.sortList(this, compare);
255 } 255 }
256 shuffle(random) { 256 [dart.extensionMember('shuffle')](random) {
257 if (random === void 0) 257 if (random === void 0)
258 random = null; 258 random = null;
259 _internal.IterableMixinWorkaround.shuffleList(this, random); 259 _internal.IterableMixinWorkaround.shuffleList(this, random);
260 } 260 }
261 indexOf(element, start) { 261 [dart.extensionMember('indexOf')](element, start) {
262 if (start === void 0) 262 if (start === void 0)
263 start = 0; 263 start = 0;
264 return _internal.IterableMixinWorkaround.indexOfList(this, element, star t); 264 return _internal.IterableMixinWorkaround.indexOfList(this, element, star t);
265 } 265 }
266 lastIndexOf(element, start) { 266 [dart.extensionMember('lastIndexOf')](element, start) {
267 if (start === void 0) 267 if (start === void 0)
268 start = null; 268 start = null;
269 return _internal.IterableMixinWorkaround.lastIndexOfList(this, element, start); 269 return _internal.IterableMixinWorkaround.lastIndexOfList(this, element, start);
270 } 270 }
271 contains(other) { 271 [dart.extensionMember('contains')](other) {
272 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) { 272 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) {
273 if (dart.equals(this[dartx.get](i), other)) 273 if (dart.equals(this[dartx.get](i), other))
274 return true; 274 return true;
275 } 275 }
276 return false; 276 return false;
277 } 277 }
278 get isEmpty() { 278 get [dart.extensionMember('isEmpty')]() {
279 return this.length == 0; 279 return this.length == 0;
280 } 280 }
281 get isNotEmpty() { 281 get [dart.extensionMember('isNotEmpty')]() {
282 return !dart.notNull(this[dartx.isEmpty]); 282 return !dart.notNull(this[dartx.isEmpty]);
283 } 283 }
284 toString() { 284 [dart.extensionMember('toString')]() {
285 return collection.ListBase.listToString(this); 285 return collection.ListBase.listToString(this);
286 } 286 }
287 toList(opts) { 287 [dart.extensionMember('toList')](opts) {
288 let growable = opts && 'growable' in opts ? opts.growable : true; 288 let growable = opts && 'growable' in opts ? opts.growable : true;
289 let list = this.slice(); 289 let list = this.slice();
290 if (!dart.notNull(growable)) 290 if (!dart.notNull(growable))
291 JSArray$().markFixedList(dart.as(list, core.List)); 291 JSArray$().markFixedList(dart.as(list, core.List));
292 return JSArray$(E).typed(list); 292 return JSArray$(E).typed(list);
293 } 293 }
294 toSet() { 294 [dart.extensionMember('toSet')]() {
295 return core.Set$(E).from(this); 295 return core.Set$(E).from(this);
296 } 296 }
297 get iterator() { 297 get [dart.extensionMember('iterator')]() {
298 return new (_internal.ListIterator$(E))(this); 298 return new (_internal.ListIterator$(E))(this);
299 } 299 }
300 get hashCode() { 300 get [dart.extensionMember('hashCode')]() {
301 return _js_helper.Primitives.objectHashCode(this); 301 return _js_helper.Primitives.objectHashCode(this);
302 } 302 }
303 get length() { 303 get length() {
304 return dart.as(this.length, core.int); 304 return dart.as(this.length, core.int);
305 } 305 }
306 set length(newLength) { 306 set length(newLength) {
307 if (!(typeof newLength == 'number')) 307 if (!(typeof newLength == 'number'))
308 throw new core.ArgumentError(newLength); 308 throw new core.ArgumentError(newLength);
309 if (dart.notNull(newLength) < 0) 309 if (dart.notNull(newLength) < 0)
310 throw new core.RangeError.value(newLength); 310 throw new core.RangeError.value(newLength);
311 this[dartx.checkGrowable]('set length'); 311 this[dartx.checkGrowable]('set length');
312 this.length = newLength; 312 this.length = newLength;
313 } 313 }
314 get(index) { 314 [dart.extensionMember('get')](index) {
315 if (!(typeof index == 'number')) 315 if (!(typeof index == 'number'))
316 throw new core.ArgumentError(index); 316 throw new core.ArgumentError(index);
317 if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(ind ex) < 0) 317 if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(ind ex) < 0)
318 throw new core.RangeError.value(index); 318 throw new core.RangeError.value(index);
319 return dart.as(this[index], E); 319 return dart.as(this[index], E);
320 } 320 }
321 set(index, value) { 321 [dart.extensionMember('set')](index, value) {
322 dart.as(value, E); 322 dart.as(value, E);
323 if (!(typeof index == 'number')) 323 if (!(typeof index == 'number'))
324 throw new core.ArgumentError(index); 324 throw new core.ArgumentError(index);
325 if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(ind ex) < 0) 325 if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(ind ex) < 0)
326 throw new core.RangeError.value(index); 326 throw new core.RangeError.value(index);
327 this[index] = value; 327 this[index] = value;
328 } 328 }
329 asMap() { 329 [dart.extensionMember('asMap')]() {
330 return new (_internal.IterableMixinWorkaround$(E))().asMapList(this); 330 return new (_internal.IterableMixinWorkaround$(E))().asMapList(this);
331 } 331 }
332 } 332 }
333 dart.setBaseClass(JSArray, dart.global.Array); 333 dart.setBaseClass(JSArray, dart.global.Array);
334 JSArray[dart.implements] = () => [core.List$(E), JSIndexable]; 334 JSArray[dart.implements] = () => [core.List$(E), JSIndexable];
335 dart.setSignature(JSArray, { 335 dart.setSignature(JSArray, {
336 constructors: () => ({ 336 constructors: () => ({
337 JSArray: [JSArray$(E), []], 337 JSArray: [JSArray$(E), []],
338 typed: [JSArray$(E), [core.Object]], 338 typed: [JSArray$(E), [core.Object]],
339 markFixed: [JSArray$(E), [core.Object]], 339 markFixed: [JSArray$(E), [core.Object]],
340 markGrowable: [JSArray$(E), [core.Object]] 340 markGrowable: [JSArray$(E), [core.Object]]
341 }), 341 }),
342 methods: () => ({ 342 methods: () => ({
343 checkGrowable: [core.Object, [core.Object]], 343 [dartx.checkGrowable]: [core.Object, [core.Object]],
344 add: [dart.void, [E]], 344 [dartx.add]: [dart.void, [E]],
345 removeAt: [E, [core.int]], 345 [dartx.removeAt]: [E, [core.int]],
346 insert: [dart.void, [core.int, E]], 346 [dartx.insert]: [dart.void, [core.int, E]],
347 insertAll: [dart.void, [core.int, core.Iterable$(E)]], 347 [dartx.insertAll]: [dart.void, [core.int, core.Iterable$(E)]],
348 setAll: [dart.void, [core.int, core.Iterable$(E)]], 348 [dartx.setAll]: [dart.void, [core.int, core.Iterable$(E)]],
349 removeLast: [E, []], 349 [dartx.removeLast]: [E, []],
350 remove: [core.bool, [core.Object]], 350 [dartx.remove]: [core.bool, [core.Object]],
351 removeWhere: [dart.void, [dart.functionType(core.bool, [E])]], 351 [dartx.removeWhere]: [dart.void, [dart.functionType(core.bool, [E])]],
352 retainWhere: [dart.void, [dart.functionType(core.bool, [E])]], 352 [dartx.retainWhere]: [dart.void, [dart.functionType(core.bool, [E])]],
353 where: [core.Iterable$(E), [dart.functionType(core.bool, [E])]], 353 [dartx.where]: [core.Iterable$(E), [dart.functionType(core.bool, [E])]],
354 expand: [core.Iterable, [dart.functionType(core.Iterable, [E])]], 354 [dartx.expand]: [core.Iterable, [dart.functionType(core.Iterable, [E])]] ,
355 addAll: [dart.void, [core.Iterable$(E)]], 355 [dartx.addAll]: [dart.void, [core.Iterable$(E)]],
356 clear: [dart.void, []], 356 [dartx.clear]: [dart.void, []],
357 forEach: [dart.void, [dart.functionType(dart.void, [E])]], 357 [dartx.forEach]: [dart.void, [dart.functionType(dart.void, [E])]],
358 map: [core.Iterable, [dart.functionType(core.Object, [E])]], 358 [dartx.map]: [core.Iterable, [dart.functionType(core.Object, [E])]],
359 join: [core.String, [], [core.String]], 359 [dartx.join]: [core.String, [], [core.String]],
360 take: [core.Iterable$(E), [core.int]], 360 [dartx.take]: [core.Iterable$(E), [core.int]],
361 takeWhile: [core.Iterable$(E), [dart.functionType(core.bool, [E])]], 361 [dartx.takeWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]],
362 skip: [core.Iterable$(E), [core.int]], 362 [dartx.skip]: [core.Iterable$(E), [core.int]],
363 skipWhile: [core.Iterable$(E), [dart.functionType(core.bool, [E])]], 363 [dartx.skipWhile]: [core.Iterable$(E), [dart.functionType(core.bool, [E] )]],
364 reduce: [E, [dart.functionType(E, [E, E])]], 364 [dartx.reduce]: [E, [dart.functionType(E, [E, E])]],
365 fold: [core.Object, [core.Object, dart.functionType(core.Object, [dart.b ottom, E])]], 365 [dartx.fold]: [core.Object, [core.Object, dart.functionType(core.Object, [dart.bottom, E])]],
366 firstWhere: [E, [dart.functionType(core.bool, [E])], {orElse: dart.funct ionType(E, [])}], 366 [dartx.firstWhere]: [E, [dart.functionType(core.bool, [E])], {orElse: da rt.functionType(E, [])}],
367 lastWhere: [E, [dart.functionType(core.bool, [E])], {orElse: dart.functi onType(E, [])}], 367 [dartx.lastWhere]: [E, [dart.functionType(core.bool, [E])], {orElse: dar t.functionType(E, [])}],
368 singleWhere: [E, [dart.functionType(core.bool, [E])]], 368 [dartx.singleWhere]: [E, [dart.functionType(core.bool, [E])]],
369 elementAt: [E, [core.int]], 369 [dartx.elementAt]: [E, [core.int]],
370 sublist: [core.List$(E), [core.int], [core.int]], 370 [dartx.sublist]: [core.List$(E), [core.int], [core.int]],
371 getRange: [core.Iterable$(E), [core.int, core.int]], 371 [dartx.getRange]: [core.Iterable$(E), [core.int, core.int]],
372 removeRange: [dart.void, [core.int, core.int]], 372 [dartx.removeRange]: [dart.void, [core.int, core.int]],
373 setRange: [dart.void, [core.int, core.int, core.Iterable$(E)], [core.int ]], 373 [dartx.setRange]: [dart.void, [core.int, core.int, core.Iterable$(E)], [ core.int]],
374 fillRange: [dart.void, [core.int, core.int], [E]], 374 [dartx.fillRange]: [dart.void, [core.int, core.int], [E]],
375 replaceRange: [dart.void, [core.int, core.int, core.Iterable$(E)]], 375 [dartx.replaceRange]: [dart.void, [core.int, core.int, core.Iterable$(E) ]],
376 any: [core.bool, [dart.functionType(core.bool, [E])]], 376 [dartx.any]: [core.bool, [dart.functionType(core.bool, [E])]],
377 every: [core.bool, [dart.functionType(core.bool, [E])]], 377 [dartx.every]: [core.bool, [dart.functionType(core.bool, [E])]],
378 sort: [dart.void, [], [dart.functionType(core.int, [E, E])]], 378 [dartx.sort]: [dart.void, [], [dart.functionType(core.int, [E, E])]],
379 shuffle: [dart.void, [], [math.Random]], 379 [dartx.shuffle]: [dart.void, [], [math.Random]],
380 indexOf: [core.int, [core.Object], [core.int]], 380 [dartx.indexOf]: [core.int, [core.Object], [core.int]],
381 lastIndexOf: [core.int, [core.Object], [core.int]], 381 [dartx.lastIndexOf]: [core.int, [core.Object], [core.int]],
382 contains: [core.bool, [core.Object]], 382 [dartx.contains]: [core.bool, [core.Object]],
383 toList: [core.List$(E), [], {growable: core.bool}], 383 [dartx.toList]: [core.List$(E), [], {growable: core.bool}],
384 toSet: [core.Set$(E), []], 384 [dartx.toSet]: [core.Set$(E), []],
385 get: [E, [core.int]], 385 [dartx.get]: [E, [core.int]],
386 set: [dart.void, [core.int, E]], 386 [dartx.set]: [dart.void, [core.int, E]],
387 asMap: [core.Map$(core.int, E), []] 387 [dartx.asMap]: [core.Map$(core.int, E), []]
388 }), 388 }),
389 statics: () => ({markFixedList: [core.List, [core.List]]}), 389 statics: () => ({markFixedList: [core.List, [core.List]]}),
390 names: ['markFixedList'] 390 names: ['markFixedList']
391 }); 391 });
392 return JSArray; 392 return JSArray;
393 }); 393 });
394 let JSArray = JSArray$(); 394 let JSArray = JSArray$();
395 dart.registerExtension(dart.global.Array, JSArray); 395 dart.registerExtension(dart.global.Array, JSArray);
396 let JSMutableArray$ = dart.generic(function(E) { 396 let JSMutableArray$ = dart.generic(function(E) {
397 class JSMutableArray extends JSArray$(E) { 397 class JSMutableArray extends JSArray$(E) {
(...skipping 26 matching lines...) Expand all
424 let _tdivFast = Symbol('_tdivFast'); 424 let _tdivFast = Symbol('_tdivFast');
425 let _tdivSlow = Symbol('_tdivSlow'); 425 let _tdivSlow = Symbol('_tdivSlow');
426 let _shlPositive = Symbol('_shlPositive'); 426 let _shlPositive = Symbol('_shlPositive');
427 let _shrReceiverPositive = Symbol('_shrReceiverPositive'); 427 let _shrReceiverPositive = Symbol('_shrReceiverPositive');
428 let _shrOtherPositive = Symbol('_shrOtherPositive'); 428 let _shrOtherPositive = Symbol('_shrOtherPositive');
429 let _shrBothPositive = Symbol('_shrBothPositive'); 429 let _shrBothPositive = Symbol('_shrBothPositive');
430 class JSNumber extends Interceptor { 430 class JSNumber extends Interceptor {
431 JSNumber() { 431 JSNumber() {
432 super.Interceptor(); 432 super.Interceptor();
433 } 433 }
434 compareTo(b) { 434 [dart.extensionMember('compareTo')](b) {
435 if (!dart.is(b, core.num)) 435 if (!dart.is(b, core.num))
436 throw new core.ArgumentError(b); 436 throw new core.ArgumentError(b);
437 if (this[dartx['<']](b)) { 437 if (this[dartx['<']](b)) {
438 return -1; 438 return -1;
439 } else if (this[dartx['>']](b)) { 439 } else if (this[dartx['>']](b)) {
440 return 1; 440 return 1;
441 } else if (dart.equals(this, b)) { 441 } else if (dart.equals(this, b)) {
442 if (dart.equals(this, 0)) { 442 if (dart.equals(this, 0)) {
443 let bIsNegative = b[dartx.isNegative]; 443 let bIsNegative = b[dartx.isNegative];
444 if (this[dartx.isNegative] == bIsNegative) 444 if (this[dartx.isNegative] == bIsNegative)
445 return 0; 445 return 0;
446 if (this[dartx.isNegative]) 446 if (this[dartx.isNegative])
447 return -1; 447 return -1;
448 return 1; 448 return 1;
449 } 449 }
450 return 0; 450 return 0;
451 } else if (this[dartx.isNaN]) { 451 } else if (this[dartx.isNaN]) {
452 if (b[dartx.isNaN]) { 452 if (b[dartx.isNaN]) {
453 return 0; 453 return 0;
454 } 454 }
455 return 1; 455 return 1;
456 } else { 456 } else {
457 return -1; 457 return -1;
458 } 458 }
459 } 459 }
460 get isNegative() { 460 get [dart.extensionMember('isNegative')]() {
461 return dart.equals(this, 0) ? (1)[dartx['/']](this) < 0 : this[dartx['<']] (0); 461 return dart.equals(this, 0) ? (1)[dartx['/']](this) < 0 : this[dartx['<']] (0);
462 } 462 }
463 get isNaN() { 463 get [dart.extensionMember('isNaN')]() {
464 return isNaN(this); 464 return isNaN(this);
465 } 465 }
466 get isInfinite() { 466 get [dart.extensionMember('isInfinite')]() {
467 return this == Infinity || this == -Infinity; 467 return this == Infinity || this == -Infinity;
468 } 468 }
469 get isFinite() { 469 get [dart.extensionMember('isFinite')]() {
470 return isFinite(this); 470 return isFinite(this);
471 } 471 }
472 remainder(b) { 472 [dart.extensionMember('remainder')](b) {
473 _js_helper.checkNull(b); 473 _js_helper.checkNull(b);
474 if (!dart.is(b, core.num)) 474 if (!dart.is(b, core.num))
475 throw new core.ArgumentError(b); 475 throw new core.ArgumentError(b);
476 return this % b; 476 return this % b;
477 } 477 }
478 abs() { 478 [dart.extensionMember('abs')]() {
479 return Math.abs(this); 479 return Math.abs(this);
480 } 480 }
481 get sign() { 481 get [dart.extensionMember('sign')]() {
482 return this[dartx['>']](0) ? 1 : this[dartx['<']](0) ? -1 : this; 482 return this[dartx['>']](0) ? 1 : this[dartx['<']](0) ? -1 : this;
483 } 483 }
484 toInt() { 484 [dart.extensionMember('toInt')]() {
485 if (dart.notNull(this[dartx['>=']](JSNumber._MIN_INT32)) && dart.notNull(t his[dartx['<=']](JSNumber._MAX_INT32))) { 485 if (dart.notNull(this[dartx['>=']](JSNumber._MIN_INT32)) && dart.notNull(t his[dartx['<=']](JSNumber._MAX_INT32))) {
486 return this | 0; 486 return this | 0;
487 } 487 }
488 if (isFinite(this)) { 488 if (isFinite(this)) {
489 return this[dartx.truncateToDouble]() + 0; 489 return this[dartx.truncateToDouble]() + 0;
490 } 490 }
491 throw new core.UnsupportedError('' + this); 491 throw new core.UnsupportedError('' + this);
492 } 492 }
493 truncate() { 493 [dart.extensionMember('truncate')]() {
494 return this[dartx.toInt](); 494 return this[dartx.toInt]();
495 } 495 }
496 ceil() { 496 [dart.extensionMember('ceil')]() {
497 return this[dartx.ceilToDouble]()[dartx.toInt](); 497 return this[dartx.ceilToDouble]()[dartx.toInt]();
498 } 498 }
499 floor() { 499 [dart.extensionMember('floor')]() {
500 return this[dartx.floorToDouble]()[dartx.toInt](); 500 return this[dartx.floorToDouble]()[dartx.toInt]();
501 } 501 }
502 round() { 502 [dart.extensionMember('round')]() {
503 return this[dartx.roundToDouble]()[dartx.toInt](); 503 return this[dartx.roundToDouble]()[dartx.toInt]();
504 } 504 }
505 ceilToDouble() { 505 [dart.extensionMember('ceilToDouble')]() {
506 return Math.ceil(this); 506 return Math.ceil(this);
507 } 507 }
508 floorToDouble() { 508 [dart.extensionMember('floorToDouble')]() {
509 return Math.floor(this); 509 return Math.floor(this);
510 } 510 }
511 roundToDouble() { 511 [dart.extensionMember('roundToDouble')]() {
512 if (this[dartx['<']](0)) { 512 if (this[dartx['<']](0)) {
513 return -Math.round(-this); 513 return -Math.round(-this);
514 } else { 514 } else {
515 return Math.round(this); 515 return Math.round(this);
516 } 516 }
517 } 517 }
518 truncateToDouble() { 518 [dart.extensionMember('truncateToDouble')]() {
519 return this[dartx['<']](0) ? this[dartx.ceilToDouble]() : this[dartx.floor ToDouble](); 519 return this[dartx['<']](0) ? this[dartx.ceilToDouble]() : this[dartx.floor ToDouble]();
520 } 520 }
521 clamp(lowerLimit, upperLimit) { 521 [dart.extensionMember('clamp')](lowerLimit, upperLimit) {
522 if (!dart.is(lowerLimit, core.num)) 522 if (!dart.is(lowerLimit, core.num))
523 throw new core.ArgumentError(lowerLimit); 523 throw new core.ArgumentError(lowerLimit);
524 if (!dart.is(upperLimit, core.num)) 524 if (!dart.is(upperLimit, core.num))
525 throw new core.ArgumentError(upperLimit); 525 throw new core.ArgumentError(upperLimit);
526 if (dart.notNull(lowerLimit[dartx.compareTo](upperLimit)) > 0) { 526 if (dart.notNull(lowerLimit[dartx.compareTo](upperLimit)) > 0) {
527 throw new core.ArgumentError(lowerLimit); 527 throw new core.ArgumentError(lowerLimit);
528 } 528 }
529 if (dart.notNull(this[dartx.compareTo](lowerLimit)) < 0) 529 if (dart.notNull(this[dartx.compareTo](lowerLimit)) < 0)
530 return lowerLimit; 530 return lowerLimit;
531 if (dart.notNull(this[dartx.compareTo](upperLimit)) > 0) 531 if (dart.notNull(this[dartx.compareTo](upperLimit)) > 0)
532 return upperLimit; 532 return upperLimit;
533 return this; 533 return this;
534 } 534 }
535 toDouble() { 535 [dart.extensionMember('toDouble')]() {
536 return this; 536 return this;
537 } 537 }
538 toStringAsFixed(fractionDigits) { 538 [dart.extensionMember('toStringAsFixed')](fractionDigits) {
539 _js_helper.checkInt(fractionDigits); 539 _js_helper.checkInt(fractionDigits);
540 if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 20) { 540 if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 20) {
541 throw new core.RangeError(fractionDigits); 541 throw new core.RangeError(fractionDigits);
542 } 542 }
543 let result = this.toFixed(fractionDigits); 543 let result = this.toFixed(fractionDigits);
544 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this[dartx.isNegati ve])) 544 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this[dartx.isNegati ve]))
545 return `-${result}`; 545 return `-${result}`;
546 return result; 546 return result;
547 } 547 }
548 toStringAsExponential(fractionDigits) { 548 [dart.extensionMember('toStringAsExponential')](fractionDigits) {
549 if (fractionDigits === void 0) 549 if (fractionDigits === void 0)
550 fractionDigits = null; 550 fractionDigits = null;
551 let result = null; 551 let result = null;
552 if (fractionDigits != null) { 552 if (fractionDigits != null) {
553 _js_helper.checkInt(fractionDigits); 553 _js_helper.checkInt(fractionDigits);
554 if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 2 0) { 554 if (dart.notNull(fractionDigits) < 0 || dart.notNull(fractionDigits) > 2 0) {
555 throw new core.RangeError(fractionDigits); 555 throw new core.RangeError(fractionDigits);
556 } 556 }
557 result = this.toExponential(fractionDigits); 557 result = this.toExponential(fractionDigits);
558 } else { 558 } else {
559 result = this.toExponential(); 559 result = this.toExponential();
560 } 560 }
561 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this[dartx.isNegati ve])) 561 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this[dartx.isNegati ve]))
562 return `-${result}`; 562 return `-${result}`;
563 return result; 563 return result;
564 } 564 }
565 toStringAsPrecision(precision) { 565 [dart.extensionMember('toStringAsPrecision')](precision) {
566 _js_helper.checkInt(precision); 566 _js_helper.checkInt(precision);
567 if (dart.notNull(precision) < 1 || dart.notNull(precision) > 21) { 567 if (dart.notNull(precision) < 1 || dart.notNull(precision) > 21) {
568 throw new core.RangeError(precision); 568 throw new core.RangeError(precision);
569 } 569 }
570 let result = this.toPrecision(precision); 570 let result = this.toPrecision(precision);
571 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this[dartx.isNegati ve])) 571 if (dart.notNull(dart.equals(this, 0)) && dart.notNull(this[dartx.isNegati ve]))
572 return `-${result}`; 572 return `-${result}`;
573 return result; 573 return result;
574 } 574 }
575 toRadixString(radix) { 575 [dart.extensionMember('toRadixString')](radix) {
576 _js_helper.checkInt(radix); 576 _js_helper.checkInt(radix);
577 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36) 577 if (dart.notNull(radix) < 2 || dart.notNull(radix) > 36)
578 throw new core.RangeError(radix); 578 throw new core.RangeError(radix);
579 let result = this.toString(radix); 579 let result = this.toString(radix);
580 let rightParenCode = 41; 580 let rightParenCode = 41;
581 if (result[dartx.codeUnitAt](dart.notNull(result.length) - 1) != rightPare nCode) { 581 if (result[dartx.codeUnitAt](dart.notNull(result.length) - 1) != rightPare nCode) {
582 return result; 582 return result;
583 } 583 }
584 return JSNumber._handleIEtoString(result); 584 return JSNumber._handleIEtoString(result);
585 } 585 }
586 static _handleIEtoString(result) { 586 static _handleIEtoString(result) {
587 let match = /^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(result); 587 let match = /^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(result);
588 if (match == null) { 588 if (match == null) {
589 throw new core.UnsupportedError(`Unexpected toString result: ${result}`) ; 589 throw new core.UnsupportedError(`Unexpected toString result: ${result}`) ;
590 } 590 }
591 result = dart.dindex(match, 1); 591 result = dart.dindex(match, 1);
592 let exponent = +dart.dindex(match, 3); 592 let exponent = +dart.dindex(match, 3);
593 if (dart.dindex(match, 2) != null) { 593 if (dart.dindex(match, 2) != null) {
594 result = result + dart.dindex(match, 2); 594 result = result + dart.dindex(match, 2);
595 exponent = dart.notNull(exponent) - dart.dindex(match, 2).length; 595 exponent = dart.notNull(exponent) - dart.dindex(match, 2).length;
596 } 596 }
597 return dart.notNull(result) + "0"[dartx['*']](exponent); 597 return dart.notNull(result) + "0"[dartx['*']](exponent);
598 } 598 }
599 toString() { 599 [dart.extensionMember('toString')]() {
600 if (dart.notNull(dart.equals(this, 0)) && 1 / this < 0) { 600 if (dart.notNull(dart.equals(this, 0)) && 1 / this < 0) {
601 return '-0.0'; 601 return '-0.0';
602 } else { 602 } else {
603 return "" + this; 603 return "" + this;
604 } 604 }
605 } 605 }
606 get hashCode() { 606 get [dart.extensionMember('hashCode')]() {
607 return this & 0x1FFFFFFF; 607 return this & 0x1FFFFFFF;
608 } 608 }
609 ['unary-']() { 609 [dart.extensionMember('unary-')]() {
610 return -this; 610 return -this;
611 } 611 }
612 ['+'](other) { 612 [dart.extensionMember('+')](other) {
613 if (!dart.is(other, core.num)) 613 if (!dart.is(other, core.num))
614 throw new core.ArgumentError(other); 614 throw new core.ArgumentError(other);
615 return this + other; 615 return this + other;
616 } 616 }
617 ['-'](other) { 617 [dart.extensionMember('-')](other) {
618 if (!dart.is(other, core.num)) 618 if (!dart.is(other, core.num))
619 throw new core.ArgumentError(other); 619 throw new core.ArgumentError(other);
620 return this - other; 620 return this - other;
621 } 621 }
622 ['/'](other) { 622 [dart.extensionMember('/')](other) {
623 if (!dart.is(other, core.num)) 623 if (!dart.is(other, core.num))
624 throw new core.ArgumentError(other); 624 throw new core.ArgumentError(other);
625 return this / other; 625 return this / other;
626 } 626 }
627 ['*'](other) { 627 [dart.extensionMember('*')](other) {
628 if (!dart.is(other, core.num)) 628 if (!dart.is(other, core.num))
629 throw new core.ArgumentError(other); 629 throw new core.ArgumentError(other);
630 return this * other; 630 return this * other;
631 } 631 }
632 ['%'](other) { 632 [dart.extensionMember('%')](other) {
633 if (!dart.is(other, core.num)) 633 if (!dart.is(other, core.num))
634 throw new core.ArgumentError(other); 634 throw new core.ArgumentError(other);
635 let result = this % other; 635 let result = this % other;
636 if (result == 0) 636 if (result == 0)
637 return 0; 637 return 0;
638 if (dart.notNull(result) > 0) 638 if (dart.notNull(result) > 0)
639 return result; 639 return result;
640 if (other < 0) { 640 if (other < 0) {
641 return dart.notNull(result) - other; 641 return dart.notNull(result) - other;
642 } else { 642 } else {
643 return dart.notNull(result) + other; 643 return dart.notNull(result) + other;
644 } 644 }
645 } 645 }
646 [_isInt32](value) { 646 [_isInt32](value) {
647 return (value | 0) === value; 647 return (value | 0) === value;
648 } 648 }
649 ['~/'](other) { 649 [dart.extensionMember('~/')](other) {
650 if (false) 650 if (false)
651 this[_tdivFast](other); 651 this[_tdivFast](other);
652 if (dart.notNull(this[_isInt32](this)) && dart.notNull(this[_isInt32](othe r)) && 0 != other && -1 != other) { 652 if (dart.notNull(this[_isInt32](this)) && dart.notNull(this[_isInt32](othe r)) && 0 != other && -1 != other) {
653 return this / other | 0; 653 return this / other | 0;
654 } else { 654 } else {
655 return this[_tdivSlow](other); 655 return this[_tdivSlow](other);
656 } 656 }
657 } 657 }
658 [_tdivFast](other) { 658 [_tdivFast](other) {
659 return this[_isInt32](this) ? this / other | 0 : (this / other)[dartx.toIn t](); 659 return this[_isInt32](this) ? this / other | 0 : (this / other)[dartx.toIn t]();
660 } 660 }
661 [_tdivSlow](other) { 661 [_tdivSlow](other) {
662 if (!dart.is(other, core.num)) 662 if (!dart.is(other, core.num))
663 throw new core.ArgumentError(other); 663 throw new core.ArgumentError(other);
664 return (this / other)[dartx.toInt](); 664 return (this / other)[dartx.toInt]();
665 } 665 }
666 ['<<'](other) { 666 [dart.extensionMember('<<')](other) {
667 if (!dart.is(other, core.num)) 667 if (!dart.is(other, core.num))
668 throw new core.ArgumentError(other); 668 throw new core.ArgumentError(other);
669 if (other < 0) 669 if (other < 0)
670 throw new core.ArgumentError(other); 670 throw new core.ArgumentError(other);
671 return this[_shlPositive](other); 671 return this[_shlPositive](other);
672 } 672 }
673 [_shlPositive](other) { 673 [_shlPositive](other) {
674 return other > 31 ? 0 : dart.as(this << other >>> 0, core.num); 674 return other > 31 ? 0 : dart.as(this << other >>> 0, core.num);
675 } 675 }
676 ['>>'](other) { 676 [dart.extensionMember('>>')](other) {
677 if (false) 677 if (false)
678 this[_shrReceiverPositive](other); 678 this[_shrReceiverPositive](other);
679 if (!dart.is(other, core.num)) 679 if (!dart.is(other, core.num))
680 throw new core.ArgumentError(other); 680 throw new core.ArgumentError(other);
681 if (other < 0) 681 if (other < 0)
682 throw new core.ArgumentError(other); 682 throw new core.ArgumentError(other);
683 return this[_shrOtherPositive](other); 683 return this[_shrOtherPositive](other);
684 } 684 }
685 [_shrOtherPositive](other) { 685 [_shrOtherPositive](other) {
686 return this > 0 ? this[_shrBothPositive](other) : dart.as(this >> (dart.no tNull(other) > 31 ? 31 : other) >>> 0, core.num); 686 return this > 0 ? this[_shrBothPositive](other) : dart.as(this >> (dart.no tNull(other) > 31 ? 31 : other) >>> 0, core.num);
687 } 687 }
688 [_shrReceiverPositive](other) { 688 [_shrReceiverPositive](other) {
689 if (other < 0) 689 if (other < 0)
690 throw new core.ArgumentError(other); 690 throw new core.ArgumentError(other);
691 return this[_shrBothPositive](other); 691 return this[_shrBothPositive](other);
692 } 692 }
693 [_shrBothPositive](other) { 693 [_shrBothPositive](other) {
694 return other > 31 ? 0 : dart.as(this >>> other, core.num); 694 return other > 31 ? 0 : dart.as(this >>> other, core.num);
695 } 695 }
696 ['&'](other) { 696 [dart.extensionMember('&')](other) {
697 if (!dart.is(other, core.num)) 697 if (!dart.is(other, core.num))
698 throw new core.ArgumentError(other); 698 throw new core.ArgumentError(other);
699 return dart.as((this & other) >>> 0, core.num); 699 return dart.as((this & other) >>> 0, core.num);
700 } 700 }
701 ['|'](other) { 701 [dart.extensionMember('|')](other) {
702 if (!dart.is(other, core.num)) 702 if (!dart.is(other, core.num))
703 throw new core.ArgumentError(other); 703 throw new core.ArgumentError(other);
704 return dart.as((this | other) >>> 0, core.num); 704 return dart.as((this | other) >>> 0, core.num);
705 } 705 }
706 ['^'](other) { 706 [dart.extensionMember('^')](other) {
707 if (!dart.is(other, core.num)) 707 if (!dart.is(other, core.num))
708 throw new core.ArgumentError(other); 708 throw new core.ArgumentError(other);
709 return dart.as((this ^ other) >>> 0, core.num); 709 return dart.as((this ^ other) >>> 0, core.num);
710 } 710 }
711 ['<'](other) { 711 [dart.extensionMember('<')](other) {
712 if (!dart.is(other, core.num)) 712 if (!dart.is(other, core.num))
713 throw new core.ArgumentError(other); 713 throw new core.ArgumentError(other);
714 return this < other; 714 return this < other;
715 } 715 }
716 ['>'](other) { 716 [dart.extensionMember('>')](other) {
717 if (!dart.is(other, core.num)) 717 if (!dart.is(other, core.num))
718 throw new core.ArgumentError(other); 718 throw new core.ArgumentError(other);
719 return this > other; 719 return this > other;
720 } 720 }
721 ['<='](other) { 721 [dart.extensionMember('<=')](other) {
722 if (!dart.is(other, core.num)) 722 if (!dart.is(other, core.num))
723 throw new core.ArgumentError(other); 723 throw new core.ArgumentError(other);
724 return this <= other; 724 return this <= other;
725 } 725 }
726 ['>='](other) { 726 [dart.extensionMember('>=')](other) {
727 if (!dart.is(other, core.num)) 727 if (!dart.is(other, core.num))
728 throw new core.ArgumentError(other); 728 throw new core.ArgumentError(other);
729 return this >= other; 729 return this >= other;
730 } 730 }
731 get runtimeType() { 731 get [dart.extensionMember('runtimeType')]() {
732 return core.num; 732 return core.num;
733 } 733 }
734 } 734 }
735 JSNumber[dart.implements] = () => [core.num]; 735 JSNumber[dart.implements] = () => [core.num];
736 dart.setSignature(JSNumber, { 736 dart.setSignature(JSNumber, {
737 constructors: () => ({JSNumber: [JSNumber, []]}), 737 constructors: () => ({JSNumber: [JSNumber, []]}),
738 methods: () => ({ 738 methods: () => ({
739 compareTo: [core.int, [core.num]], 739 [dartx.compareTo]: [core.int, [core.num]],
740 remainder: [core.num, [core.num]], 740 [dartx.remainder]: [core.num, [core.num]],
741 abs: [core.num, []], 741 [dartx.abs]: [core.num, []],
742 toInt: [core.int, []], 742 [dartx.toInt]: [core.int, []],
743 truncate: [core.int, []], 743 [dartx.truncate]: [core.int, []],
744 ceil: [core.int, []], 744 [dartx.ceil]: [core.int, []],
745 floor: [core.int, []], 745 [dartx.floor]: [core.int, []],
746 round: [core.int, []], 746 [dartx.round]: [core.int, []],
747 ceilToDouble: [core.double, []], 747 [dartx.ceilToDouble]: [core.double, []],
748 floorToDouble: [core.double, []], 748 [dartx.floorToDouble]: [core.double, []],
749 roundToDouble: [core.double, []], 749 [dartx.roundToDouble]: [core.double, []],
750 truncateToDouble: [core.double, []], 750 [dartx.truncateToDouble]: [core.double, []],
751 clamp: [core.num, [core.num, core.num]], 751 [dartx.clamp]: [core.num, [core.num, core.num]],
752 toDouble: [core.double, []], 752 [dartx.toDouble]: [core.double, []],
753 toStringAsFixed: [core.String, [core.int]], 753 [dartx.toStringAsFixed]: [core.String, [core.int]],
754 toStringAsExponential: [core.String, [], [core.int]], 754 [dartx.toStringAsExponential]: [core.String, [], [core.int]],
755 toStringAsPrecision: [core.String, [core.int]], 755 [dartx.toStringAsPrecision]: [core.String, [core.int]],
756 toRadixString: [core.String, [core.int]], 756 [dartx.toRadixString]: [core.String, [core.int]],
757 'unary-': [core.num, []], 757 [dartx['unary-']]: [core.num, []],
758 '+': [core.num, [core.num]], 758 [dartx['+']]: [core.num, [core.num]],
759 '-': [core.num, [core.num]], 759 [dartx['-']]: [core.num, [core.num]],
760 '/': [core.double, [core.num]], 760 [dartx['/']]: [core.double, [core.num]],
761 '*': [core.num, [core.num]], 761 [dartx['*']]: [core.num, [core.num]],
762 '%': [core.num, [core.num]], 762 [dartx['%']]: [core.num, [core.num]],
763 [_isInt32]: [core.bool, [core.Object]], 763 [_isInt32]: [core.bool, [core.Object]],
764 '~/': [core.int, [core.num]], 764 [dartx['~/']]: [core.int, [core.num]],
765 [_tdivFast]: [core.int, [core.num]], 765 [_tdivFast]: [core.int, [core.num]],
766 [_tdivSlow]: [core.int, [core.num]], 766 [_tdivSlow]: [core.int, [core.num]],
767 '<<': [core.num, [core.num]], 767 [dartx['<<']]: [core.num, [core.num]],
768 [_shlPositive]: [core.num, [core.num]], 768 [_shlPositive]: [core.num, [core.num]],
769 '>>': [core.num, [core.num]], 769 [dartx['>>']]: [core.num, [core.num]],
770 [_shrOtherPositive]: [core.num, [core.num]], 770 [_shrOtherPositive]: [core.num, [core.num]],
771 [_shrReceiverPositive]: [core.num, [core.num]], 771 [_shrReceiverPositive]: [core.num, [core.num]],
772 [_shrBothPositive]: [core.num, [core.num]], 772 [_shrBothPositive]: [core.num, [core.num]],
773 '&': [core.num, [core.num]], 773 [dartx['&']]: [core.num, [core.num]],
774 '|': [core.num, [core.num]], 774 [dartx['|']]: [core.num, [core.num]],
775 '^': [core.num, [core.num]], 775 [dartx['^']]: [core.num, [core.num]],
776 '<': [core.bool, [core.num]], 776 [dartx['<']]: [core.bool, [core.num]],
777 '>': [core.bool, [core.num]], 777 [dartx['>']]: [core.bool, [core.num]],
778 '<=': [core.bool, [core.num]], 778 [dartx['<=']]: [core.bool, [core.num]],
779 '>=': [core.bool, [core.num]] 779 [dartx['>=']]: [core.bool, [core.num]]
780 }), 780 }),
781 statics: () => ({_handleIEtoString: [core.String, [core.String]]}), 781 statics: () => ({_handleIEtoString: [core.String, [core.String]]}),
782 names: ['_handleIEtoString'] 782 names: ['_handleIEtoString']
783 }); 783 });
784 JSNumber._MIN_INT32 = -2147483648; 784 JSNumber._MIN_INT32 = -2147483648;
785 JSNumber._MAX_INT32 = 2147483647; 785 JSNumber._MAX_INT32 = 2147483647;
786 class JSInt extends JSNumber { 786 class JSInt extends JSNumber {
787 JSInt() { 787 JSInt() {
788 super.JSNumber(); 788 super.JSNumber();
789 } 789 }
790 get isEven() { 790 get [dart.extensionMember('isEven')]() {
791 return this[dartx['&']](1) == 0; 791 return this[dartx['&']](1) == 0;
792 } 792 }
793 get isOdd() { 793 get [dart.extensionMember('isOdd')]() {
794 return this[dartx['&']](1) == 1; 794 return this[dartx['&']](1) == 1;
795 } 795 }
796 toUnsigned(width) { 796 [dart.extensionMember('toUnsigned')](width) {
797 return this[dartx['&']]((1 << dart.notNull(width)) - 1); 797 return this[dartx['&']]((1 << dart.notNull(width)) - 1);
798 } 798 }
799 toSigned(width) { 799 [dart.extensionMember('toSigned')](width) {
800 let signMask = 1 << dart.notNull(width) - 1; 800 let signMask = 1 << dart.notNull(width) - 1;
801 return dart.notNull(this[dartx['&']](dart.notNull(signMask) - 1)) - dart.n otNull(this[dartx['&']](signMask)); 801 return dart.notNull(this[dartx['&']](dart.notNull(signMask) - 1)) - dart.n otNull(this[dartx['&']](signMask));
802 } 802 }
803 get bitLength() { 803 get [dart.extensionMember('bitLength')]() {
804 let nonneg = this[dartx['<']](0) ? dart.notNull(this[dartx['unary-']]()) - 1 : this; 804 let nonneg = this[dartx['<']](0) ? dart.notNull(this[dartx['unary-']]()) - 1 : this;
805 if (dart.notNull(nonneg) >= 4294967296) { 805 if (dart.notNull(nonneg) >= 4294967296) {
806 nonneg = (dart.notNull(nonneg) / 4294967296).truncate(); 806 nonneg = (dart.notNull(nonneg) / 4294967296).truncate();
807 return dart.notNull(JSInt._bitCount(JSInt._spread(nonneg))) + 32; 807 return dart.notNull(JSInt._bitCount(JSInt._spread(nonneg))) + 32;
808 } 808 }
809 return JSInt._bitCount(JSInt._spread(nonneg)); 809 return JSInt._bitCount(JSInt._spread(nonneg));
810 } 810 }
811 static _bitCount(i) { 811 static _bitCount(i) {
812 i = dart.notNull(JSInt._shru(i, 0)) - (dart.notNull(JSInt._shru(i, 1)) & 1 431655765); 812 i = dart.notNull(JSInt._shru(i, 0)) - (dart.notNull(JSInt._shru(i, 1)) & 1 431655765);
813 i = (dart.notNull(i) & 858993459) + (dart.notNull(JSInt._shru(i, 2)) & 858 993459); 813 i = (dart.notNull(i) & 858993459) + (dart.notNull(JSInt._shru(i, 2)) & 858 993459);
(...skipping 12 matching lines...) Expand all
826 return a | b; 826 return a | b;
827 } 827 }
828 static _spread(i) { 828 static _spread(i) {
829 i = JSInt._ors(i, JSInt._shrs(i, 1)); 829 i = JSInt._ors(i, JSInt._shrs(i, 1));
830 i = JSInt._ors(i, JSInt._shrs(i, 2)); 830 i = JSInt._ors(i, JSInt._shrs(i, 2));
831 i = JSInt._ors(i, JSInt._shrs(i, 4)); 831 i = JSInt._ors(i, JSInt._shrs(i, 4));
832 i = JSInt._ors(i, JSInt._shrs(i, 8)); 832 i = JSInt._ors(i, JSInt._shrs(i, 8));
833 i = JSInt._shru(JSInt._ors(i, JSInt._shrs(i, 16)), 0); 833 i = JSInt._shru(JSInt._ors(i, JSInt._shrs(i, 16)), 0);
834 return i; 834 return i;
835 } 835 }
836 get runtimeType() { 836 get [dart.extensionMember('runtimeType')]() {
837 return core.int; 837 return core.int;
838 } 838 }
839 ['~']() { 839 [dart.extensionMember('~')]() {
840 return dart.as(~this >>> 0, core.int); 840 return dart.as(~this >>> 0, core.int);
841 } 841 }
842 } 842 }
843 JSInt[dart.implements] = () => [core.int, core.double]; 843 JSInt[dart.implements] = () => [core.int, core.double];
844 dart.setSignature(JSInt, { 844 dart.setSignature(JSInt, {
845 constructors: () => ({JSInt: [JSInt, []]}), 845 constructors: () => ({JSInt: [JSInt, []]}),
846 methods: () => ({ 846 methods: () => ({
847 toUnsigned: [core.int, [core.int]], 847 [dartx.toUnsigned]: [core.int, [core.int]],
848 toSigned: [core.int, [core.int]], 848 [dartx.toSigned]: [core.int, [core.int]],
849 '~': [core.int, []] 849 [dartx['~']]: [core.int, []]
850 }), 850 }),
851 statics: () => ({ 851 statics: () => ({
852 _bitCount: [core.int, [core.int]], 852 _bitCount: [core.int, [core.int]],
853 _shru: [core.int, [core.int, core.int]], 853 _shru: [core.int, [core.int, core.int]],
854 _shrs: [core.int, [core.int, core.int]], 854 _shrs: [core.int, [core.int, core.int]],
855 _ors: [core.int, [core.int, core.int]], 855 _ors: [core.int, [core.int, core.int]],
856 _spread: [core.int, [core.int]] 856 _spread: [core.int, [core.int]]
857 }), 857 }),
858 names: ['_bitCount', '_shru', '_shrs', '_ors', '_spread'] 858 names: ['_bitCount', '_shru', '_shrs', '_ors', '_spread']
859 }); 859 });
860 dart.registerExtension(dart.global.Number, JSInt); 860 dart.registerExtension(dart.global.Number, JSInt);
861 class JSDouble extends JSNumber { 861 class JSDouble extends JSNumber {
862 JSDouble() { 862 JSDouble() {
863 super.JSNumber(); 863 super.JSNumber();
864 } 864 }
865 get runtimeType() { 865 get [dart.extensionMember('runtimeType')]() {
866 return core.double; 866 return core.double;
867 } 867 }
868 } 868 }
869 JSDouble[dart.implements] = () => [core.double]; 869 JSDouble[dart.implements] = () => [core.double];
870 dart.setSignature(JSDouble, { 870 dart.setSignature(JSDouble, {
871 constructors: () => ({JSDouble: [JSDouble, []]}) 871 constructors: () => ({JSDouble: [JSDouble, []]})
872 }); 872 });
873 class JSPositiveInt extends JSInt { 873 class JSPositiveInt extends JSInt {
874 JSPositiveInt() { 874 JSPositiveInt() {
875 super.JSInt(); 875 super.JSInt();
876 } 876 }
877 } 877 }
878 class JSUInt32 extends JSPositiveInt {} 878 class JSUInt32 extends JSPositiveInt {}
879 class JSUInt31 extends JSUInt32 {} 879 class JSUInt31 extends JSUInt32 {}
880 let _defaultSplit = Symbol('_defaultSplit'); 880 let _defaultSplit = Symbol('_defaultSplit');
881 class JSString extends Interceptor { 881 class JSString extends Interceptor {
882 JSString() { 882 JSString() {
883 super.Interceptor(); 883 super.Interceptor();
884 } 884 }
885 codeUnitAt(index) { 885 [dart.extensionMember('codeUnitAt')](index) {
886 if (!(typeof index == 'number')) 886 if (!(typeof index == 'number'))
887 throw new core.ArgumentError(index); 887 throw new core.ArgumentError(index);
888 if (dart.notNull(index) < 0) 888 if (dart.notNull(index) < 0)
889 throw new core.RangeError.value(index); 889 throw new core.RangeError.value(index);
890 if (dart.notNull(index) >= dart.notNull(this.length)) 890 if (dart.notNull(index) >= dart.notNull(this.length))
891 throw new core.RangeError.value(index); 891 throw new core.RangeError.value(index);
892 return dart.as(this.charCodeAt(index), core.int); 892 return dart.as(this.charCodeAt(index), core.int);
893 } 893 }
894 allMatches(string, start) { 894 [dart.extensionMember('allMatches')](string, start) {
895 if (start === void 0) 895 if (start === void 0)
896 start = 0; 896 start = 0;
897 _js_helper.checkString(string); 897 _js_helper.checkString(string);
898 _js_helper.checkInt(start); 898 _js_helper.checkInt(start);
899 if (0 > dart.notNull(start) || dart.notNull(start) > dart.notNull(string.l ength)) { 899 if (0 > dart.notNull(start) || dart.notNull(start) > dart.notNull(string.l ength)) {
900 throw new core.RangeError.range(start, 0, string.length); 900 throw new core.RangeError.range(start, 0, string.length);
901 } 901 }
902 return _js_helper.allMatchesInStringUnchecked(this, string, start); 902 return _js_helper.allMatchesInStringUnchecked(this, string, start);
903 } 903 }
904 matchAsPrefix(string, start) { 904 [dart.extensionMember('matchAsPrefix')](string, start) {
905 if (start === void 0) 905 if (start === void 0)
906 start = 0; 906 start = 0;
907 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string.l ength)) { 907 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string.l ength)) {
908 throw new core.RangeError.range(start, 0, string.length); 908 throw new core.RangeError.range(start, 0, string.length);
909 } 909 }
910 if (dart.notNull(start) + dart.notNull(this.length) > dart.notNull(string. length)) 910 if (dart.notNull(start) + dart.notNull(this.length) > dart.notNull(string. length))
911 return null; 911 return null;
912 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notN ull(i) + 1) { 912 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notN ull(i) + 1) {
913 if (string[dartx.codeUnitAt](dart.notNull(start) + dart.notNull(i)) != t his[dartx.codeUnitAt](i)) { 913 if (string[dartx.codeUnitAt](dart.notNull(start) + dart.notNull(i)) != t his[dartx.codeUnitAt](i)) {
914 return null; 914 return null;
915 } 915 }
916 } 916 }
917 return new _js_helper.StringMatch(start, string, this); 917 return new _js_helper.StringMatch(start, string, this);
918 } 918 }
919 ['+'](other) { 919 [dart.extensionMember('+')](other) {
920 if (!(typeof other == 'string')) 920 if (!(typeof other == 'string'))
921 throw new core.ArgumentError(other); 921 throw new core.ArgumentError(other);
922 return this + other; 922 return this + other;
923 } 923 }
924 endsWith(other) { 924 [dart.extensionMember('endsWith')](other) {
925 _js_helper.checkString(other); 925 _js_helper.checkString(other);
926 let otherLength = other.length; 926 let otherLength = other.length;
927 if (dart.notNull(otherLength) > dart.notNull(this.length)) 927 if (dart.notNull(otherLength) > dart.notNull(this.length))
928 return false; 928 return false;
929 return other == this[dartx.substring](dart.notNull(this.length) - dart.not Null(otherLength)); 929 return other == this[dartx.substring](dart.notNull(this.length) - dart.not Null(otherLength));
930 } 930 }
931 replaceAll(from, to) { 931 [dart.extensionMember('replaceAll')](from, to) {
932 _js_helper.checkString(to); 932 _js_helper.checkString(to);
933 return dart.as(_js_helper.stringReplaceAllUnchecked(this, from, to), core. String); 933 return dart.as(_js_helper.stringReplaceAllUnchecked(this, from, to), core. String);
934 } 934 }
935 replaceAllMapped(from, convert) { 935 [dart.extensionMember('replaceAllMapped')](from, convert) {
936 return this[dartx.splitMapJoin](from, {onMatch: convert}); 936 return this[dartx.splitMapJoin](from, {onMatch: convert});
937 } 937 }
938 splitMapJoin(from, opts) { 938 [dart.extensionMember('splitMapJoin')](from, opts) {
939 let onMatch = opts && 'onMatch' in opts ? opts.onMatch : null; 939 let onMatch = opts && 'onMatch' in opts ? opts.onMatch : null;
940 let onNonMatch = opts && 'onNonMatch' in opts ? opts.onNonMatch : null; 940 let onNonMatch = opts && 'onNonMatch' in opts ? opts.onNonMatch : null;
941 return dart.as(_js_helper.stringReplaceAllFuncUnchecked(this, from, onMatc h, onNonMatch), core.String); 941 return dart.as(_js_helper.stringReplaceAllFuncUnchecked(this, from, onMatc h, onNonMatch), core.String);
942 } 942 }
943 replaceFirst(from, to, startIndex) { 943 [dart.extensionMember('replaceFirst')](from, to, startIndex) {
944 if (startIndex === void 0) 944 if (startIndex === void 0)
945 startIndex = 0; 945 startIndex = 0;
946 _js_helper.checkString(to); 946 _js_helper.checkString(to);
947 _js_helper.checkInt(startIndex); 947 _js_helper.checkInt(startIndex);
948 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul l(this.length)) { 948 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul l(this.length)) {
949 throw new core.RangeError.range(startIndex, 0, this.length); 949 throw new core.RangeError.range(startIndex, 0, this.length);
950 } 950 }
951 return dart.as(_js_helper.stringReplaceFirstUnchecked(this, from, to, star tIndex), core.String); 951 return dart.as(_js_helper.stringReplaceFirstUnchecked(this, from, to, star tIndex), core.String);
952 } 952 }
953 split(pattern) { 953 [dart.extensionMember('split')](pattern) {
954 _js_helper.checkNull(pattern); 954 _js_helper.checkNull(pattern);
955 if (typeof pattern == 'string') { 955 if (typeof pattern == 'string') {
956 return dart.as(this.split(pattern), core.List$(core.String)); 956 return dart.as(this.split(pattern), core.List$(core.String));
957 } else if (dart.is(pattern, _js_helper.JSSyntaxRegExp) && _js_helper.regEx pCaptureCount(pattern) == 0) { 957 } else if (dart.is(pattern, _js_helper.JSSyntaxRegExp) && _js_helper.regEx pCaptureCount(pattern) == 0) {
958 let re = _js_helper.regExpGetNative(pattern); 958 let re = _js_helper.regExpGetNative(pattern);
959 return dart.as(this.split(re), core.List$(core.String)); 959 return dart.as(this.split(re), core.List$(core.String));
960 } else { 960 } else {
961 return this[_defaultSplit](pattern); 961 return this[_defaultSplit](pattern);
962 } 962 }
963 } 963 }
(...skipping 10 matching lines...) Expand all
974 } 974 }
975 let end = matchStart; 975 let end = matchStart;
976 result[dartx.add](this[dartx.substring](start, end)); 976 result[dartx.add](this[dartx.substring](start, end));
977 start = matchEnd; 977 start = matchEnd;
978 } 978 }
979 if (dart.notNull(start) < dart.notNull(this.length) || dart.notNull(length ) > 0) { 979 if (dart.notNull(start) < dart.notNull(this.length) || dart.notNull(length ) > 0) {
980 result[dartx.add](this[dartx.substring](start)); 980 result[dartx.add](this[dartx.substring](start));
981 } 981 }
982 return result; 982 return result;
983 } 983 }
984 startsWith(pattern, index) { 984 [dart.extensionMember('startsWith')](pattern, index) {
985 if (index === void 0) 985 if (index === void 0)
986 index = 0; 986 index = 0;
987 _js_helper.checkInt(index); 987 _js_helper.checkInt(index);
988 if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this.len gth)) { 988 if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this.len gth)) {
989 throw new core.RangeError.range(index, 0, this.length); 989 throw new core.RangeError.range(index, 0, this.length);
990 } 990 }
991 if (typeof pattern == 'string') { 991 if (typeof pattern == 'string') {
992 let other = pattern; 992 let other = pattern;
993 let otherLength = other.length; 993 let otherLength = other.length;
994 let endIndex = dart.notNull(index) + dart.notNull(otherLength); 994 let endIndex = dart.notNull(index) + dart.notNull(otherLength);
995 if (dart.notNull(endIndex) > dart.notNull(this.length)) 995 if (dart.notNull(endIndex) > dart.notNull(this.length))
996 return false; 996 return false;
997 return other == this.substring(index, endIndex); 997 return other == this.substring(index, endIndex);
998 } 998 }
999 return pattern[dartx.matchAsPrefix](this, index) != null; 999 return pattern[dartx.matchAsPrefix](this, index) != null;
1000 } 1000 }
1001 substring(startIndex, endIndex) { 1001 [dart.extensionMember('substring')](startIndex, endIndex) {
1002 if (endIndex === void 0) 1002 if (endIndex === void 0)
1003 endIndex = null; 1003 endIndex = null;
1004 _js_helper.checkInt(startIndex); 1004 _js_helper.checkInt(startIndex);
1005 if (endIndex == null) 1005 if (endIndex == null)
1006 endIndex = this.length; 1006 endIndex = this.length;
1007 _js_helper.checkInt(endIndex); 1007 _js_helper.checkInt(endIndex);
1008 if (dart.notNull(startIndex) < 0) 1008 if (dart.notNull(startIndex) < 0)
1009 throw new core.RangeError.value(startIndex); 1009 throw new core.RangeError.value(startIndex);
1010 if (dart.notNull(startIndex) > dart.notNull(endIndex)) 1010 if (dart.notNull(startIndex) > dart.notNull(endIndex))
1011 throw new core.RangeError.value(startIndex); 1011 throw new core.RangeError.value(startIndex);
1012 if (dart.notNull(endIndex) > dart.notNull(this.length)) 1012 if (dart.notNull(endIndex) > dart.notNull(this.length))
1013 throw new core.RangeError.value(endIndex); 1013 throw new core.RangeError.value(endIndex);
1014 return this.substring(startIndex, endIndex); 1014 return this.substring(startIndex, endIndex);
1015 } 1015 }
1016 toLowerCase() { 1016 [dart.extensionMember('toLowerCase')]() {
1017 return this.toLowerCase(); 1017 return this.toLowerCase();
1018 } 1018 }
1019 toUpperCase() { 1019 [dart.extensionMember('toUpperCase')]() {
1020 return this.toUpperCase(); 1020 return this.toUpperCase();
1021 } 1021 }
1022 static _isWhitespace(codeUnit) { 1022 static _isWhitespace(codeUnit) {
1023 if (dart.notNull(codeUnit) < 256) { 1023 if (dart.notNull(codeUnit) < 256) {
1024 switch (codeUnit) { 1024 switch (codeUnit) {
1025 case 9: 1025 case 9:
1026 case 10: 1026 case 10:
1027 case 11: 1027 case 11:
1028 case 12: 1028 case 12:
1029 case 13: 1029 case 13:
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 let CARRIAGE_RETURN = 13; 1085 let CARRIAGE_RETURN = 13;
1086 while (dart.notNull(index) > 0) { 1086 while (dart.notNull(index) > 0) {
1087 let codeUnit = string[dartx.codeUnitAt](dart.notNull(index) - 1); 1087 let codeUnit = string[dartx.codeUnitAt](dart.notNull(index) - 1);
1088 if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(JS String._isWhitespace(codeUnit))) { 1088 if (codeUnit != SPACE && codeUnit != CARRIAGE_RETURN && !dart.notNull(JS String._isWhitespace(codeUnit))) {
1089 break; 1089 break;
1090 } 1090 }
1091 index = dart.notNull(index) - 1; 1091 index = dart.notNull(index) - 1;
1092 } 1092 }
1093 return index; 1093 return index;
1094 } 1094 }
1095 trim() { 1095 [dart.extensionMember('trim')]() {
1096 let NEL = 133; 1096 let NEL = 133;
1097 let result = this.trim(); 1097 let result = this.trim();
1098 if (result.length == 0) 1098 if (result.length == 0)
1099 return result; 1099 return result;
1100 let firstCode = result[dartx.codeUnitAt](0); 1100 let firstCode = result[dartx.codeUnitAt](0);
1101 let startIndex = 0; 1101 let startIndex = 0;
1102 if (firstCode == NEL) { 1102 if (firstCode == NEL) {
1103 startIndex = JSString._skipLeadingWhitespace(result, 1); 1103 startIndex = JSString._skipLeadingWhitespace(result, 1);
1104 if (startIndex == result.length) 1104 if (startIndex == result.length)
1105 return ""; 1105 return "";
1106 } 1106 }
1107 let endIndex = result.length; 1107 let endIndex = result.length;
1108 let lastCode = result[dartx.codeUnitAt](dart.notNull(endIndex) - 1); 1108 let lastCode = result[dartx.codeUnitAt](dart.notNull(endIndex) - 1);
1109 if (lastCode == NEL) { 1109 if (lastCode == NEL) {
1110 endIndex = JSString._skipTrailingWhitespace(result, dart.notNull(endInde x) - 1); 1110 endIndex = JSString._skipTrailingWhitespace(result, dart.notNull(endInde x) - 1);
1111 } 1111 }
1112 if (startIndex == 0 && endIndex == result.length) 1112 if (startIndex == 0 && endIndex == result.length)
1113 return result; 1113 return result;
1114 return result.substring(startIndex, endIndex); 1114 return result.substring(startIndex, endIndex);
1115 } 1115 }
1116 trimLeft() { 1116 [dart.extensionMember('trimLeft')]() {
1117 let NEL = 133; 1117 let NEL = 133;
1118 let result = null; 1118 let result = null;
1119 let startIndex = 0; 1119 let startIndex = 0;
1120 if (typeof this.trimLeft != "undefined") { 1120 if (typeof this.trimLeft != "undefined") {
1121 result = this.trimLeft(); 1121 result = this.trimLeft();
1122 if (result.length == 0) 1122 if (result.length == 0)
1123 return result; 1123 return result;
1124 let firstCode = result[dartx.codeUnitAt](0); 1124 let firstCode = result[dartx.codeUnitAt](0);
1125 if (firstCode == NEL) { 1125 if (firstCode == NEL) {
1126 startIndex = JSString._skipLeadingWhitespace(result, 1); 1126 startIndex = JSString._skipLeadingWhitespace(result, 1);
1127 } 1127 }
1128 } else { 1128 } else {
1129 result = this; 1129 result = this;
1130 startIndex = JSString._skipLeadingWhitespace(this, 0); 1130 startIndex = JSString._skipLeadingWhitespace(this, 0);
1131 } 1131 }
1132 if (startIndex == 0) 1132 if (startIndex == 0)
1133 return result; 1133 return result;
1134 if (startIndex == result.length) 1134 if (startIndex == result.length)
1135 return ""; 1135 return "";
1136 return result.substring(startIndex); 1136 return result.substring(startIndex);
1137 } 1137 }
1138 trimRight() { 1138 [dart.extensionMember('trimRight')]() {
1139 let NEL = 133; 1139 let NEL = 133;
1140 let result = null; 1140 let result = null;
1141 let endIndex = null; 1141 let endIndex = null;
1142 if (typeof this.trimRight != "undefined") { 1142 if (typeof this.trimRight != "undefined") {
1143 result = this.trimRight(); 1143 result = this.trimRight();
1144 endIndex = result.length; 1144 endIndex = result.length;
1145 if (endIndex == 0) 1145 if (endIndex == 0)
1146 return result; 1146 return result;
1147 let lastCode = result[dartx.codeUnitAt](dart.notNull(endIndex) - 1); 1147 let lastCode = result[dartx.codeUnitAt](dart.notNull(endIndex) - 1);
1148 if (lastCode == NEL) { 1148 if (lastCode == NEL) {
1149 endIndex = JSString._skipTrailingWhitespace(result, dart.notNull(endIn dex) - 1); 1149 endIndex = JSString._skipTrailingWhitespace(result, dart.notNull(endIn dex) - 1);
1150 } 1150 }
1151 } else { 1151 } else {
1152 result = this; 1152 result = this;
1153 endIndex = JSString._skipTrailingWhitespace(this, this.length); 1153 endIndex = JSString._skipTrailingWhitespace(this, this.length);
1154 } 1154 }
1155 if (endIndex == result.length) 1155 if (endIndex == result.length)
1156 return result; 1156 return result;
1157 if (endIndex == 0) 1157 if (endIndex == 0)
1158 return ""; 1158 return "";
1159 return result.substring(0, endIndex); 1159 return result.substring(0, endIndex);
1160 } 1160 }
1161 ['*'](times) { 1161 [dart.extensionMember('*')](times) {
1162 if (0 >= dart.notNull(times)) 1162 if (0 >= dart.notNull(times))
1163 return ''; 1163 return '';
1164 if (times == 1 || this.length == 0) 1164 if (times == 1 || this.length == 0)
1165 return this; 1165 return this;
1166 if (!dart.equals(times, times >>> 0)) { 1166 if (!dart.equals(times, times >>> 0)) {
1167 throw dart.const(new core.OutOfMemoryError()); 1167 throw dart.const(new core.OutOfMemoryError());
1168 } 1168 }
1169 let result = ''; 1169 let result = '';
1170 let s = this; 1170 let s = this;
1171 while (true) { 1171 while (true) {
1172 if ((dart.notNull(times) & 1) == 1) 1172 if ((dart.notNull(times) & 1) == 1)
1173 result = s[dartx['+']](result); 1173 result = s[dartx['+']](result);
1174 times = dart.as(times >>> 1, core.int); 1174 times = dart.as(times >>> 1, core.int);
1175 if (times == 0) 1175 if (times == 0)
1176 break; 1176 break;
1177 s = s[dartx['+']](s); 1177 s = s[dartx['+']](s);
1178 } 1178 }
1179 return result; 1179 return result;
1180 } 1180 }
1181 padLeft(width, padding) { 1181 [dart.extensionMember('padLeft')](width, padding) {
1182 if (padding === void 0) 1182 if (padding === void 0)
1183 padding = ' '; 1183 padding = ' ';
1184 let delta = dart.notNull(width) - dart.notNull(this.length); 1184 let delta = dart.notNull(width) - dart.notNull(this.length);
1185 if (dart.notNull(delta) <= 0) 1185 if (dart.notNull(delta) <= 0)
1186 return this; 1186 return this;
1187 return padding[dartx['*']](delta) + this; 1187 return padding[dartx['*']](delta) + this;
1188 } 1188 }
1189 padRight(width, padding) { 1189 [dart.extensionMember('padRight')](width, padding) {
1190 if (padding === void 0) 1190 if (padding === void 0)
1191 padding = ' '; 1191 padding = ' ';
1192 let delta = dart.notNull(width) - dart.notNull(this.length); 1192 let delta = dart.notNull(width) - dart.notNull(this.length);
1193 if (dart.notNull(delta) <= 0) 1193 if (dart.notNull(delta) <= 0)
1194 return this; 1194 return this;
1195 return this[dartx['+']](padding[dartx['*']](delta)); 1195 return this[dartx['+']](padding[dartx['*']](delta));
1196 } 1196 }
1197 get codeUnits() { 1197 get [dart.extensionMember('codeUnits')]() {
1198 return new _CodeUnits(this); 1198 return new _CodeUnits(this);
1199 } 1199 }
1200 get runes() { 1200 get [dart.extensionMember('runes')]() {
1201 return new core.Runes(this); 1201 return new core.Runes(this);
1202 } 1202 }
1203 indexOf(pattern, start) { 1203 [dart.extensionMember('indexOf')](pattern, start) {
1204 if (start === void 0) 1204 if (start === void 0)
1205 start = 0; 1205 start = 0;
1206 _js_helper.checkNull(pattern); 1206 _js_helper.checkNull(pattern);
1207 if (!(typeof start == 'number')) 1207 if (!(typeof start == 'number'))
1208 throw new core.ArgumentError(start); 1208 throw new core.ArgumentError(start);
1209 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.len gth)) { 1209 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(this.len gth)) {
1210 throw new core.RangeError.range(start, 0, this.length); 1210 throw new core.RangeError.range(start, 0, this.length);
1211 } 1211 }
1212 if (typeof pattern == 'string') { 1212 if (typeof pattern == 'string') {
1213 return this.indexOf(pattern, start); 1213 return this.indexOf(pattern, start);
1214 } 1214 }
1215 if (dart.is(pattern, _js_helper.JSSyntaxRegExp)) { 1215 if (dart.is(pattern, _js_helper.JSSyntaxRegExp)) {
1216 let re = pattern; 1216 let re = pattern;
1217 let match = _js_helper.firstMatchAfter(re, this, start); 1217 let match = _js_helper.firstMatchAfter(re, this, start);
1218 return match == null ? -1 : match.start; 1218 return match == null ? -1 : match.start;
1219 } 1219 }
1220 for (let i = start; dart.notNull(i) <= dart.notNull(this.length); i = dart .notNull(i) + 1) { 1220 for (let i = start; dart.notNull(i) <= dart.notNull(this.length); i = dart .notNull(i) + 1) {
1221 if (pattern[dartx.matchAsPrefix](this, i) != null) 1221 if (pattern[dartx.matchAsPrefix](this, i) != null)
1222 return i; 1222 return i;
1223 } 1223 }
1224 return -1; 1224 return -1;
1225 } 1225 }
1226 lastIndexOf(pattern, start) { 1226 [dart.extensionMember('lastIndexOf')](pattern, start) {
1227 if (start === void 0) 1227 if (start === void 0)
1228 start = null; 1228 start = null;
1229 _js_helper.checkNull(pattern); 1229 _js_helper.checkNull(pattern);
1230 if (start == null) { 1230 if (start == null) {
1231 start = this.length; 1231 start = this.length;
1232 } else if (!(typeof start == 'number')) { 1232 } else if (!(typeof start == 'number')) {
1233 throw new core.ArgumentError(start); 1233 throw new core.ArgumentError(start);
1234 } else if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(t his.length)) { 1234 } else if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(t his.length)) {
1235 throw new core.RangeError.range(start, 0, this.length); 1235 throw new core.RangeError.range(start, 0, this.length);
1236 } 1236 }
1237 if (typeof pattern == 'string') { 1237 if (typeof pattern == 'string') {
1238 let other = pattern; 1238 let other = pattern;
1239 if (dart.notNull(start) + dart.notNull(other.length) > dart.notNull(this .length)) { 1239 if (dart.notNull(start) + dart.notNull(other.length) > dart.notNull(this .length)) {
1240 start = dart.notNull(this.length) - dart.notNull(other.length); 1240 start = dart.notNull(this.length) - dart.notNull(other.length);
1241 } 1241 }
1242 return dart.as(_js_helper.stringLastIndexOfUnchecked(this, other, start) , core.int); 1242 return dart.as(_js_helper.stringLastIndexOfUnchecked(this, other, start) , core.int);
1243 } 1243 }
1244 for (let i = start; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) { 1244 for (let i = start; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
1245 if (pattern[dartx.matchAsPrefix](this, i) != null) 1245 if (pattern[dartx.matchAsPrefix](this, i) != null)
1246 return i; 1246 return i;
1247 } 1247 }
1248 return -1; 1248 return -1;
1249 } 1249 }
1250 contains(other, startIndex) { 1250 [dart.extensionMember('contains')](other, startIndex) {
1251 if (startIndex === void 0) 1251 if (startIndex === void 0)
1252 startIndex = 0; 1252 startIndex = 0;
1253 _js_helper.checkNull(other); 1253 _js_helper.checkNull(other);
1254 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul l(this.length)) { 1254 if (dart.notNull(startIndex) < 0 || dart.notNull(startIndex) > dart.notNul l(this.length)) {
1255 throw new core.RangeError.range(startIndex, 0, this.length); 1255 throw new core.RangeError.range(startIndex, 0, this.length);
1256 } 1256 }
1257 return dart.as(_js_helper.stringContainsUnchecked(this, other, startIndex) , core.bool); 1257 return dart.as(_js_helper.stringContainsUnchecked(this, other, startIndex) , core.bool);
1258 } 1258 }
1259 get isEmpty() { 1259 get [dart.extensionMember('isEmpty')]() {
1260 return this.length == 0; 1260 return this.length == 0;
1261 } 1261 }
1262 get isNotEmpty() { 1262 get [dart.extensionMember('isNotEmpty')]() {
1263 return !dart.notNull(this[dartx.isEmpty]); 1263 return !dart.notNull(this[dartx.isEmpty]);
1264 } 1264 }
1265 compareTo(other) { 1265 [dart.extensionMember('compareTo')](other) {
1266 if (!(typeof other == 'string')) 1266 if (!(typeof other == 'string'))
1267 throw new core.ArgumentError(other); 1267 throw new core.ArgumentError(other);
1268 return dart.equals(this, other) ? 0 : this < other ? -1 : 1; 1268 return dart.equals(this, other) ? 0 : this < other ? -1 : 1;
1269 } 1269 }
1270 toString() { 1270 [dart.extensionMember('toString')]() {
1271 return this; 1271 return this;
1272 } 1272 }
1273 get hashCode() { 1273 get [dart.extensionMember('hashCode')]() {
1274 let hash = 0; 1274 let hash = 0;
1275 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notN ull(i) + 1) { 1275 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.notN ull(i) + 1) {
1276 hash = 536870911 & dart.notNull(hash) + this.charCodeAt(i); 1276 hash = 536870911 & dart.notNull(hash) + this.charCodeAt(i);
1277 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) < < 10); 1277 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) < < 10);
1278 hash = hash ^ hash >> 6; 1278 hash = hash ^ hash >> 6;
1279 } 1279 }
1280 hash = 536870911 & dart.notNull(hash) + ((67108863 & dart.notNull(hash)) < < 3); 1280 hash = 536870911 & dart.notNull(hash) + ((67108863 & dart.notNull(hash)) < < 3);
1281 hash = hash ^ hash >> 11; 1281 hash = hash ^ hash >> 11;
1282 return 536870911 & dart.notNull(hash) + ((16383 & dart.notNull(hash)) << 1 5); 1282 return 536870911 & dart.notNull(hash) + ((16383 & dart.notNull(hash)) << 1 5);
1283 } 1283 }
1284 get runtimeType() { 1284 get [dart.extensionMember('runtimeType')]() {
1285 return core.String; 1285 return core.String;
1286 } 1286 }
1287 get length() { 1287 get length() {
1288 return this.length; 1288 return this.length;
1289 } 1289 }
1290 get(index) { 1290 [dart.extensionMember('get')](index) {
1291 if (!(typeof index == 'number')) 1291 if (!(typeof index == 'number'))
1292 throw new core.ArgumentError(index); 1292 throw new core.ArgumentError(index);
1293 if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(index ) < 0) 1293 if (dart.notNull(index) >= dart.notNull(this.length) || dart.notNull(index ) < 0)
1294 throw new core.RangeError.value(index); 1294 throw new core.RangeError.value(index);
1295 return this[index]; 1295 return this[index];
1296 } 1296 }
1297 } 1297 }
1298 JSString[dart.implements] = () => [core.String, JSIndexable]; 1298 JSString[dart.implements] = () => [core.String, JSIndexable];
1299 dart.setSignature(JSString, { 1299 dart.setSignature(JSString, {
1300 constructors: () => ({JSString: [JSString, []]}), 1300 constructors: () => ({JSString: [JSString, []]}),
1301 methods: () => ({ 1301 methods: () => ({
1302 codeUnitAt: [core.int, [core.int]], 1302 [dartx.codeUnitAt]: [core.int, [core.int]],
1303 allMatches: [core.Iterable$(core.Match), [core.String], [core.int]], 1303 [dartx.allMatches]: [core.Iterable$(core.Match), [core.String], [core.int] ],
1304 matchAsPrefix: [core.Match, [core.String], [core.int]], 1304 [dartx.matchAsPrefix]: [core.Match, [core.String], [core.int]],
1305 '+': [core.String, [core.String]], 1305 [dartx['+']]: [core.String, [core.String]],
1306 endsWith: [core.bool, [core.String]], 1306 [dartx.endsWith]: [core.bool, [core.String]],
1307 replaceAll: [core.String, [core.Pattern, core.String]], 1307 [dartx.replaceAll]: [core.String, [core.Pattern, core.String]],
1308 replaceAllMapped: [core.String, [core.Pattern, dart.functionType(core.Stri ng, [core.Match])]], 1308 [dartx.replaceAllMapped]: [core.String, [core.Pattern, dart.functionType(c ore.String, [core.Match])]],
1309 splitMapJoin: [core.String, [core.Pattern], {onMatch: dart.functionType(co re.String, [core.Match]), onNonMatch: dart.functionType(core.String, [core.Strin g])}], 1309 [dartx.splitMapJoin]: [core.String, [core.Pattern], {onMatch: dart.functio nType(core.String, [core.Match]), onNonMatch: dart.functionType(core.String, [co re.String])}],
1310 replaceFirst: [core.String, [core.Pattern, core.String], [core.int]], 1310 [dartx.replaceFirst]: [core.String, [core.Pattern, core.String], [core.int ]],
1311 split: [core.List$(core.String), [core.Pattern]], 1311 [dartx.split]: [core.List$(core.String), [core.Pattern]],
1312 [_defaultSplit]: [core.List$(core.String), [core.Pattern]], 1312 [_defaultSplit]: [core.List$(core.String), [core.Pattern]],
1313 startsWith: [core.bool, [core.Pattern], [core.int]], 1313 [dartx.startsWith]: [core.bool, [core.Pattern], [core.int]],
1314 substring: [core.String, [core.int], [core.int]], 1314 [dartx.substring]: [core.String, [core.int], [core.int]],
1315 toLowerCase: [core.String, []], 1315 [dartx.toLowerCase]: [core.String, []],
1316 toUpperCase: [core.String, []], 1316 [dartx.toUpperCase]: [core.String, []],
1317 trim: [core.String, []], 1317 [dartx.trim]: [core.String, []],
1318 trimLeft: [core.String, []], 1318 [dartx.trimLeft]: [core.String, []],
1319 trimRight: [core.String, []], 1319 [dartx.trimRight]: [core.String, []],
1320 '*': [core.String, [core.int]], 1320 [dartx['*']]: [core.String, [core.int]],
1321 padLeft: [core.String, [core.int], [core.String]], 1321 [dartx.padLeft]: [core.String, [core.int], [core.String]],
1322 padRight: [core.String, [core.int], [core.String]], 1322 [dartx.padRight]: [core.String, [core.int], [core.String]],
1323 indexOf: [core.int, [core.Pattern], [core.int]], 1323 [dartx.indexOf]: [core.int, [core.Pattern], [core.int]],
1324 lastIndexOf: [core.int, [core.Pattern], [core.int]], 1324 [dartx.lastIndexOf]: [core.int, [core.Pattern], [core.int]],
1325 contains: [core.bool, [core.Pattern], [core.int]], 1325 [dartx.contains]: [core.bool, [core.Pattern], [core.int]],
1326 compareTo: [core.int, [core.String]], 1326 [dartx.compareTo]: [core.int, [core.String]],
1327 get: [core.String, [core.int]] 1327 [dartx.get]: [core.String, [core.int]]
1328 }), 1328 }),
1329 statics: () => ({ 1329 statics: () => ({
1330 _isWhitespace: [core.bool, [core.int]], 1330 _isWhitespace: [core.bool, [core.int]],
1331 _skipLeadingWhitespace: [core.int, [core.String, core.int]], 1331 _skipLeadingWhitespace: [core.int, [core.String, core.int]],
1332 _skipTrailingWhitespace: [core.int, [core.String, core.int]] 1332 _skipTrailingWhitespace: [core.int, [core.String, core.int]]
1333 }), 1333 }),
1334 names: ['_isWhitespace', '_skipLeadingWhitespace', '_skipTrailingWhitespace' ] 1334 names: ['_isWhitespace', '_skipLeadingWhitespace', '_skipTrailingWhitespace' ]
1335 }); 1335 });
1336 dart.registerExtension(dart.global.String, JSString); 1336 dart.registerExtension(dart.global.String, JSString);
1337 let _string = Symbol('_string'); 1337 let _string = Symbol('_string');
1338 class _CodeUnits extends _internal.UnmodifiableListBase$(core.int) { 1338 class _CodeUnits extends _internal.UnmodifiableListBase$(core.int) {
1339 _CodeUnits(string) { 1339 _CodeUnits(string) {
1340 this[_string] = string; 1340 this[_string] = string;
1341 } 1341 }
1342 get length() { 1342 get length() {
1343 return this[_string].length; 1343 return this[_string].length;
1344 } 1344 }
1345 get(i) { 1345 get(i) {
1346 return this[_string][dartx.codeUnitAt](i); 1346 return this[_string][dartx.codeUnitAt](i);
1347 } 1347 }
1348 } 1348 }
1349 dart.setSignature(_CodeUnits, { 1349 dart.setSignature(_CodeUnits, {
1350 constructors: () => ({_CodeUnits: [_CodeUnits, [core.String]]}), 1350 constructors: () => ({_CodeUnits: [_CodeUnits, [core.String]]}),
1351 methods: () => ({get: [core.int, [core.int]]}) 1351 methods: () => ({get: [core.int, [core.int]]})
1352 }); 1352 });
1353 dart.defineExtensionMembers(_CodeUnits, ['get', 'length']);
1353 function getInterceptor(obj) { 1354 function getInterceptor(obj) {
1354 return obj; 1355 return obj;
1355 } 1356 }
1356 dart.fn(getInterceptor); 1357 dart.fn(getInterceptor);
1357 class JSBool extends Interceptor { 1358 class JSBool extends Interceptor {
1358 JSBool() { 1359 JSBool() {
1359 super.Interceptor(); 1360 super.Interceptor();
1360 } 1361 }
1361 toString() { 1362 [dart.extensionMember('toString')]() {
1362 return String(this); 1363 return String(this);
1363 } 1364 }
1364 get hashCode() { 1365 get [dart.extensionMember('hashCode')]() {
1365 return this ? 2 * 3 * 23 * 3761 : 269 * 811; 1366 return this ? 2 * 3 * 23 * 3761 : 269 * 811;
1366 } 1367 }
1367 get runtimeType() { 1368 get [dart.extensionMember('runtimeType')]() {
1368 return core.bool; 1369 return core.bool;
1369 } 1370 }
1370 } 1371 }
1371 JSBool[dart.implements] = () => [core.bool]; 1372 JSBool[dart.implements] = () => [core.bool];
1372 dart.setSignature(JSBool, { 1373 dart.setSignature(JSBool, {
1373 constructors: () => ({JSBool: [JSBool, []]}) 1374 constructors: () => ({JSBool: [JSBool, []]})
1374 }); 1375 });
1375 dart.registerExtension(dart.global.Boolean, JSBool); 1376 dart.registerExtension(dart.global.Boolean, JSBool);
1376 class JSIndexable extends core.Object {} 1377 class JSIndexable extends core.Object {}
1377 class JSMutableIndexable extends JSIndexable {} 1378 class JSMutableIndexable extends JSIndexable {}
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 exports.JSString = JSString; 1430 exports.JSString = JSString;
1430 exports.getInterceptor = getInterceptor; 1431 exports.getInterceptor = getInterceptor;
1431 exports.JSBool = JSBool; 1432 exports.JSBool = JSBool;
1432 exports.JSIndexable = JSIndexable; 1433 exports.JSIndexable = JSIndexable;
1433 exports.JSMutableIndexable = JSMutableIndexable; 1434 exports.JSMutableIndexable = JSMutableIndexable;
1434 exports.JSObject = JSObject; 1435 exports.JSObject = JSObject;
1435 exports.JavaScriptObject = JavaScriptObject; 1436 exports.JavaScriptObject = JavaScriptObject;
1436 exports.PlainJavaScriptObject = PlainJavaScriptObject; 1437 exports.PlainJavaScriptObject = PlainJavaScriptObject;
1437 exports.UnknownJavaScriptObject = UnknownJavaScriptObject; 1438 exports.UnknownJavaScriptObject = UnknownJavaScriptObject;
1438 })(_interceptors, core, _internal, _js_helper, collection, math); 1439 })(_interceptors, core, _internal, _js_helper, collection, math);
OLDNEW
« no previous file with comments | « no previous file | lib/runtime/dart/_internal.js » ('j') | lib/runtime/dart_runtime.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698