OLD | NEW |
1 var collection; | 1 var collection; |
2 (function(exports) { | 2 (function(exports) { |
3 'use strict'; | 3 'use strict'; |
4 let _source = Symbol('_source'); | 4 let _source = Symbol('_source'); |
5 let UnmodifiableListView$ = dart.generic(function(E) { | 5 let UnmodifiableListView$ = dart.generic(function(E) { |
6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { | 6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { |
7 UnmodifiableListView(source) { | 7 UnmodifiableListView(source) { |
8 this[_source] = source; | 8 this[_source] = source; |
9 } | 9 } |
10 get [core.$length]() { | 10 get [core.$length]() { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 get [core.$isEmpty]() { | 112 get [core.$isEmpty]() { |
113 return this[core.$length] == 0; | 113 return this[core.$length] == 0; |
114 } | 114 } |
115 get [core.$isNotEmpty]() { | 115 get [core.$isNotEmpty]() { |
116 return this[core.$length] != 0; | 116 return this[core.$length] != 0; |
117 } | 117 } |
118 clear() { | 118 clear() { |
119 this.removeAll(this[core.$toList]()); | 119 this.removeAll(this[core.$toList]()); |
120 } | 120 } |
121 addAll(elements) { | 121 addAll(elements) { |
| 122 dart.as(elements, core.Iterable$(E)); |
122 for (let element of elements) | 123 for (let element of elements) |
123 this.add(element); | 124 this.add(element); |
124 } | 125 } |
125 removeAll(elements) { | 126 removeAll(elements) { |
126 for (let element of elements) | 127 for (let element of elements) |
127 this.remove(element); | 128 this.remove(element); |
128 } | 129 } |
129 retainAll(elements) { | 130 retainAll(elements) { |
130 let toRemove = this[core.$toSet](); | 131 let toRemove = this[core.$toSet](); |
131 for (let o of elements) { | 132 for (let o of elements) { |
132 toRemove.remove(o); | 133 toRemove.remove(o); |
133 } | 134 } |
134 this.removeAll(toRemove); | 135 this.removeAll(toRemove); |
135 } | 136 } |
136 removeWhere(test) { | 137 removeWhere(test) { |
| 138 dart.as(test, dart.functionType(core.bool, [E])); |
137 let toRemove = []; | 139 let toRemove = []; |
138 for (let element of this) { | 140 for (let element of this) { |
139 if (test(element)) | 141 if (test(element)) |
140 toRemove[core.$add](element); | 142 toRemove[core.$add](element); |
141 } | 143 } |
142 this.removeAll(toRemove); | 144 this.removeAll(toRemove); |
143 } | 145 } |
144 retainWhere(test) { | 146 retainWhere(test) { |
| 147 dart.as(test, dart.functionType(core.bool, [E])); |
145 let toRemove = []; | 148 let toRemove = []; |
146 for (let element of this) { | 149 for (let element of this) { |
147 if (!dart.notNull(test(element))) | 150 if (!dart.notNull(test(element))) |
148 toRemove[core.$add](element); | 151 toRemove[core.$add](element); |
149 } | 152 } |
150 this.removeAll(toRemove); | 153 this.removeAll(toRemove); |
151 } | 154 } |
152 containsAll(other) { | 155 containsAll(other) { |
153 for (let o of other) { | 156 for (let o of other) { |
154 if (!dart.notNull(this[core.$contains](o))) | 157 if (!dart.notNull(this[core.$contains](o))) |
155 return false; | 158 return false; |
156 } | 159 } |
157 return true; | 160 return true; |
158 } | 161 } |
159 union(other) { | 162 union(other) { |
| 163 dart.as(other, core.Set$(E)); |
160 let _ = this[core.$toSet](); | 164 let _ = this[core.$toSet](); |
161 _.addAll(other); | 165 _.addAll(other); |
162 return _; | 166 return _; |
163 } | 167 } |
164 intersection(other) { | 168 intersection(other) { |
165 let result = this[core.$toSet](); | 169 let result = this[core.$toSet](); |
166 for (let element of this) { | 170 for (let element of this) { |
167 if (!dart.notNull(other[core.$contains](element))) | 171 if (!dart.notNull(other[core.$contains](element))) |
168 result.remove(element); | 172 result.remove(element); |
169 } | 173 } |
(...skipping 17 matching lines...) Expand all Loading... |
187 let i = 0; | 191 let i = 0; |
188 for (let element of this) | 192 for (let element of this) |
189 result[core.$set]((() => { | 193 result[core.$set]((() => { |
190 let x = i; | 194 let x = i; |
191 i = dart.notNull(x) + 1; | 195 i = dart.notNull(x) + 1; |
192 return x; | 196 return x; |
193 })(), element); | 197 })(), element); |
194 return result; | 198 return result; |
195 } | 199 } |
196 [core.$map](f) { | 200 [core.$map](f) { |
| 201 dart.as(f, dart.functionType(dart.dynamic, [E])); |
197 return new (_internal.EfficientLengthMappedIterable$(E, dart.dynamic))(t
his, f); | 202 return new (_internal.EfficientLengthMappedIterable$(E, dart.dynamic))(t
his, f); |
198 } | 203 } |
199 get [core.$single]() { | 204 get [core.$single]() { |
200 if (dart.notNull(this[core.$length]) > 1) | 205 if (dart.notNull(this[core.$length]) > 1) |
201 throw _internal.IterableElementError.tooMany(); | 206 throw _internal.IterableElementError.tooMany(); |
202 let it = this[core.$iterator]; | 207 let it = this[core.$iterator]; |
203 if (!dart.notNull(it.moveNext())) | 208 if (!dart.notNull(it.moveNext())) |
204 throw _internal.IterableElementError.noElement(); | 209 throw _internal.IterableElementError.noElement(); |
205 let result = dart.as(it.current, E); | 210 let result = dart.as(it.current, E); |
206 return result; | 211 return result; |
207 } | 212 } |
208 toString() { | 213 toString() { |
209 return IterableBase.iterableToFullString(this, '{', '}'); | 214 return IterableBase.iterableToFullString(this, '{', '}'); |
210 } | 215 } |
211 [core.$where](f) { | 216 [core.$where](f) { |
| 217 dart.as(f, dart.functionType(core.bool, [E])); |
212 return new (_internal.WhereIterable$(E))(this, f); | 218 return new (_internal.WhereIterable$(E))(this, f); |
213 } | 219 } |
214 [core.$expand](f) { | 220 [core.$expand](f) { |
| 221 dart.as(f, dart.functionType(core.Iterable, [E])); |
215 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); | 222 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); |
216 } | 223 } |
217 [core.$forEach](f) { | 224 [core.$forEach](f) { |
| 225 dart.as(f, dart.functionType(dart.void, [E])); |
218 for (let element of this) | 226 for (let element of this) |
219 f(element); | 227 f(element); |
220 } | 228 } |
221 [core.$reduce](combine) { | 229 [core.$reduce](combine) { |
| 230 dart.as(combine, dart.functionType(E, [E, E])); |
222 let iterator = this[core.$iterator]; | 231 let iterator = this[core.$iterator]; |
223 if (!dart.notNull(iterator.moveNext())) { | 232 if (!dart.notNull(iterator.moveNext())) { |
224 throw _internal.IterableElementError.noElement(); | 233 throw _internal.IterableElementError.noElement(); |
225 } | 234 } |
226 let value = iterator.current; | 235 let value = iterator.current; |
227 while (iterator.moveNext()) { | 236 while (iterator.moveNext()) { |
228 value = combine(value, iterator.current); | 237 value = combine(value, iterator.current); |
229 } | 238 } |
230 return value; | 239 return value; |
231 } | 240 } |
232 [core.$fold](initialValue, combine) { | 241 [core.$fold](initialValue, combine) { |
| 242 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); |
233 let value = initialValue; | 243 let value = initialValue; |
234 for (let element of this) | 244 for (let element of this) |
235 value = dart.dcall(combine, value, element); | 245 value = dart.dcall(combine, value, element); |
236 return value; | 246 return value; |
237 } | 247 } |
238 [core.$every](f) { | 248 [core.$every](f) { |
| 249 dart.as(f, dart.functionType(core.bool, [E])); |
239 for (let element of this) { | 250 for (let element of this) { |
240 if (!dart.notNull(f(element))) | 251 if (!dart.notNull(f(element))) |
241 return false; | 252 return false; |
242 } | 253 } |
243 return true; | 254 return true; |
244 } | 255 } |
245 [core.$join](separator) { | 256 [core.$join](separator) { |
246 if (separator === void 0) | 257 if (separator === void 0) |
247 separator = ""; | 258 separator = ""; |
248 let iterator = this[core.$iterator]; | 259 let iterator = this[core.$iterator]; |
249 if (!dart.notNull(iterator.moveNext())) | 260 if (!dart.notNull(iterator.moveNext())) |
250 return ""; | 261 return ""; |
251 let buffer = new core.StringBuffer(); | 262 let buffer = new core.StringBuffer(); |
252 if (separator == null || separator == "") { | 263 if (separator == null || separator == "") { |
253 do { | 264 do { |
254 buffer.write(`${iterator.current}`); | 265 buffer.write(`${iterator.current}`); |
255 } while (iterator.moveNext()); | 266 } while (iterator.moveNext()); |
256 } else { | 267 } else { |
257 buffer.write(`${iterator.current}`); | 268 buffer.write(`${iterator.current}`); |
258 while (iterator.moveNext()) { | 269 while (iterator.moveNext()) { |
259 buffer.write(separator); | 270 buffer.write(separator); |
260 buffer.write(`${iterator.current}`); | 271 buffer.write(`${iterator.current}`); |
261 } | 272 } |
262 } | 273 } |
263 return dart.toString(buffer); | 274 return dart.toString(buffer); |
264 } | 275 } |
265 [core.$any](test) { | 276 [core.$any](test) { |
| 277 dart.as(test, dart.functionType(core.bool, [E])); |
266 for (let element of this) { | 278 for (let element of this) { |
267 if (test(element)) | 279 if (test(element)) |
268 return true; | 280 return true; |
269 } | 281 } |
270 return false; | 282 return false; |
271 } | 283 } |
272 [core.$take](n) { | 284 [core.$take](n) { |
273 return new (_internal.TakeIterable$(E))(this, n); | 285 return new (_internal.TakeIterable$(E))(this, n); |
274 } | 286 } |
275 [core.$takeWhile](test) { | 287 [core.$takeWhile](test) { |
| 288 dart.as(test, dart.functionType(core.bool, [E])); |
276 return new (_internal.TakeWhileIterable$(E))(this, test); | 289 return new (_internal.TakeWhileIterable$(E))(this, test); |
277 } | 290 } |
278 [core.$skip](n) { | 291 [core.$skip](n) { |
279 return new (_internal.SkipIterable$(E))(this, n); | 292 return new (_internal.SkipIterable$(E))(this, n); |
280 } | 293 } |
281 [core.$skipWhile](test) { | 294 [core.$skipWhile](test) { |
| 295 dart.as(test, dart.functionType(core.bool, [E])); |
282 return new (_internal.SkipWhileIterable$(E))(this, test); | 296 return new (_internal.SkipWhileIterable$(E))(this, test); |
283 } | 297 } |
284 get [core.$first]() { | 298 get [core.$first]() { |
285 let it = this[core.$iterator]; | 299 let it = this[core.$iterator]; |
286 if (!dart.notNull(it.moveNext())) { | 300 if (!dart.notNull(it.moveNext())) { |
287 throw _internal.IterableElementError.noElement(); | 301 throw _internal.IterableElementError.noElement(); |
288 } | 302 } |
289 return dart.as(it.current, E); | 303 return dart.as(it.current, E); |
290 } | 304 } |
291 get [core.$last]() { | 305 get [core.$last]() { |
292 let it = this[core.$iterator]; | 306 let it = this[core.$iterator]; |
293 if (!dart.notNull(it.moveNext())) { | 307 if (!dart.notNull(it.moveNext())) { |
294 throw _internal.IterableElementError.noElement(); | 308 throw _internal.IterableElementError.noElement(); |
295 } | 309 } |
296 let result = null; | 310 let result = null; |
297 do { | 311 do { |
298 result = dart.as(it.current, E); | 312 result = dart.as(it.current, E); |
299 } while (it.moveNext()); | 313 } while (it.moveNext()); |
300 return result; | 314 return result; |
301 } | 315 } |
302 [core.$firstWhere](test, opts) { | 316 [core.$firstWhere](test, opts) { |
| 317 dart.as(test, dart.functionType(core.bool, [E])); |
303 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 318 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 319 dart.as(orElse, dart.functionType(E, [])); |
304 for (let element of this) { | 320 for (let element of this) { |
305 if (test(element)) | 321 if (test(element)) |
306 return element; | 322 return element; |
307 } | 323 } |
308 if (orElse != null) | 324 if (orElse != null) |
309 return orElse(); | 325 return orElse(); |
310 throw _internal.IterableElementError.noElement(); | 326 throw _internal.IterableElementError.noElement(); |
311 } | 327 } |
312 [core.$lastWhere](test, opts) { | 328 [core.$lastWhere](test, opts) { |
| 329 dart.as(test, dart.functionType(core.bool, [E])); |
313 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 330 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 331 dart.as(orElse, dart.functionType(E, [])); |
314 let result = null; | 332 let result = null; |
315 let foundMatching = false; | 333 let foundMatching = false; |
316 for (let element of this) { | 334 for (let element of this) { |
317 if (test(element)) { | 335 if (test(element)) { |
318 result = element; | 336 result = element; |
319 foundMatching = true; | 337 foundMatching = true; |
320 } | 338 } |
321 } | 339 } |
322 if (foundMatching) | 340 if (foundMatching) |
323 return result; | 341 return result; |
324 if (orElse != null) | 342 if (orElse != null) |
325 return orElse(); | 343 return orElse(); |
326 throw _internal.IterableElementError.noElement(); | 344 throw _internal.IterableElementError.noElement(); |
327 } | 345 } |
328 [core.$singleWhere](test) { | 346 [core.$singleWhere](test) { |
| 347 dart.as(test, dart.functionType(core.bool, [E])); |
329 let result = null; | 348 let result = null; |
330 let foundMatching = false; | 349 let foundMatching = false; |
331 for (let element of this) { | 350 for (let element of this) { |
332 if (test(element)) { | 351 if (test(element)) { |
333 if (foundMatching) { | 352 if (foundMatching) { |
334 throw _internal.IterableElementError.tooMany(); | 353 throw _internal.IterableElementError.tooMany(); |
335 } | 354 } |
336 result = element; | 355 result = element; |
337 foundMatching = true; | 356 foundMatching = true; |
338 } | 357 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 }); | 467 }); |
449 let __CastType5 = __CastType5$(); | 468 let __CastType5 = __CastType5$(); |
450 let __CastType7$ = dart.generic(function(E) { | 469 let __CastType7$ = dart.generic(function(E) { |
451 let __CastType7 = dart.typedef('__CastType7', () => dart.functionType(core.b
ool, [E, E])); | 470 let __CastType7 = dart.typedef('__CastType7', () => dart.functionType(core.b
ool, [E, E])); |
452 return __CastType7; | 471 return __CastType7; |
453 }); | 472 }); |
454 let __CastType7 = __CastType7$(); | 473 let __CastType7 = __CastType7$(); |
455 let IterableMixin$ = dart.generic(function(E) { | 474 let IterableMixin$ = dart.generic(function(E) { |
456 class IterableMixin extends core.Object { | 475 class IterableMixin extends core.Object { |
457 [core.$map](f) { | 476 [core.$map](f) { |
| 477 dart.as(f, dart.functionType(dart.dynamic, [E])); |
458 return new (_internal.MappedIterable$(E, dart.dynamic))(this, f); | 478 return new (_internal.MappedIterable$(E, dart.dynamic))(this, f); |
459 } | 479 } |
460 [core.$where](f) { | 480 [core.$where](f) { |
| 481 dart.as(f, dart.functionType(core.bool, [E])); |
461 return new (_internal.WhereIterable$(E))(this, f); | 482 return new (_internal.WhereIterable$(E))(this, f); |
462 } | 483 } |
463 [core.$expand](f) { | 484 [core.$expand](f) { |
| 485 dart.as(f, dart.functionType(core.Iterable, [E])); |
464 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); | 486 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); |
465 } | 487 } |
466 [core.$contains](element) { | 488 [core.$contains](element) { |
467 for (let e of this) { | 489 for (let e of this) { |
468 if (dart.equals(e, element)) | 490 if (dart.equals(e, element)) |
469 return true; | 491 return true; |
470 } | 492 } |
471 return false; | 493 return false; |
472 } | 494 } |
473 [core.$forEach](f) { | 495 [core.$forEach](f) { |
| 496 dart.as(f, dart.functionType(dart.void, [E])); |
474 for (let element of this) | 497 for (let element of this) |
475 f(element); | 498 f(element); |
476 } | 499 } |
477 [core.$reduce](combine) { | 500 [core.$reduce](combine) { |
| 501 dart.as(combine, dart.functionType(E, [E, E])); |
478 let iterator = this[core.$iterator]; | 502 let iterator = this[core.$iterator]; |
479 if (!dart.notNull(iterator.moveNext())) { | 503 if (!dart.notNull(iterator.moveNext())) { |
480 throw _internal.IterableElementError.noElement(); | 504 throw _internal.IterableElementError.noElement(); |
481 } | 505 } |
482 let value = iterator.current; | 506 let value = iterator.current; |
483 while (iterator.moveNext()) { | 507 while (iterator.moveNext()) { |
484 value = combine(value, iterator.current); | 508 value = combine(value, iterator.current); |
485 } | 509 } |
486 return value; | 510 return value; |
487 } | 511 } |
488 [core.$fold](initialValue, combine) { | 512 [core.$fold](initialValue, combine) { |
| 513 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); |
489 let value = initialValue; | 514 let value = initialValue; |
490 for (let element of this) | 515 for (let element of this) |
491 value = dart.dcall(combine, value, element); | 516 value = dart.dcall(combine, value, element); |
492 return value; | 517 return value; |
493 } | 518 } |
494 [core.$every](f) { | 519 [core.$every](f) { |
| 520 dart.as(f, dart.functionType(core.bool, [E])); |
495 for (let element of this) { | 521 for (let element of this) { |
496 if (!dart.notNull(f(element))) | 522 if (!dart.notNull(f(element))) |
497 return false; | 523 return false; |
498 } | 524 } |
499 return true; | 525 return true; |
500 } | 526 } |
501 [core.$join](separator) { | 527 [core.$join](separator) { |
502 if (separator === void 0) | 528 if (separator === void 0) |
503 separator = ""; | 529 separator = ""; |
504 let iterator = this[core.$iterator]; | 530 let iterator = this[core.$iterator]; |
505 if (!dart.notNull(iterator.moveNext())) | 531 if (!dart.notNull(iterator.moveNext())) |
506 return ""; | 532 return ""; |
507 let buffer = new core.StringBuffer(); | 533 let buffer = new core.StringBuffer(); |
508 if (separator == null || separator == "") { | 534 if (separator == null || separator == "") { |
509 do { | 535 do { |
510 buffer.write(`${iterator.current}`); | 536 buffer.write(`${iterator.current}`); |
511 } while (iterator.moveNext()); | 537 } while (iterator.moveNext()); |
512 } else { | 538 } else { |
513 buffer.write(`${iterator.current}`); | 539 buffer.write(`${iterator.current}`); |
514 while (iterator.moveNext()) { | 540 while (iterator.moveNext()) { |
515 buffer.write(separator); | 541 buffer.write(separator); |
516 buffer.write(`${iterator.current}`); | 542 buffer.write(`${iterator.current}`); |
517 } | 543 } |
518 } | 544 } |
519 return dart.toString(buffer); | 545 return dart.toString(buffer); |
520 } | 546 } |
521 [core.$any](f) { | 547 [core.$any](f) { |
| 548 dart.as(f, dart.functionType(core.bool, [E])); |
522 for (let element of this) { | 549 for (let element of this) { |
523 if (f(element)) | 550 if (f(element)) |
524 return true; | 551 return true; |
525 } | 552 } |
526 return false; | 553 return false; |
527 } | 554 } |
528 [core.$toList](opts) { | 555 [core.$toList](opts) { |
529 let growable = opts && 'growable' in opts ? opts.growable : true; | 556 let growable = opts && 'growable' in opts ? opts.growable : true; |
530 return new core.List$(E).from(this, {growable: growable}); | 557 return new core.List$(E).from(this, {growable: growable}); |
531 } | 558 } |
(...skipping 12 matching lines...) Expand all Loading... |
544 get [core.$isEmpty]() { | 571 get [core.$isEmpty]() { |
545 return !dart.notNull(this[core.$iterator].moveNext()); | 572 return !dart.notNull(this[core.$iterator].moveNext()); |
546 } | 573 } |
547 get [core.$isNotEmpty]() { | 574 get [core.$isNotEmpty]() { |
548 return !dart.notNull(this[core.$isEmpty]); | 575 return !dart.notNull(this[core.$isEmpty]); |
549 } | 576 } |
550 [core.$take](n) { | 577 [core.$take](n) { |
551 return new (_internal.TakeIterable$(E))(this, n); | 578 return new (_internal.TakeIterable$(E))(this, n); |
552 } | 579 } |
553 [core.$takeWhile](test) { | 580 [core.$takeWhile](test) { |
| 581 dart.as(test, dart.functionType(core.bool, [E])); |
554 return new (_internal.TakeWhileIterable$(E))(this, test); | 582 return new (_internal.TakeWhileIterable$(E))(this, test); |
555 } | 583 } |
556 [core.$skip](n) { | 584 [core.$skip](n) { |
557 return new (_internal.SkipIterable$(E))(this, n); | 585 return new (_internal.SkipIterable$(E))(this, n); |
558 } | 586 } |
559 [core.$skipWhile](test) { | 587 [core.$skipWhile](test) { |
| 588 dart.as(test, dart.functionType(core.bool, [E])); |
560 return new (_internal.SkipWhileIterable$(E))(this, test); | 589 return new (_internal.SkipWhileIterable$(E))(this, test); |
561 } | 590 } |
562 get [core.$first]() { | 591 get [core.$first]() { |
563 let it = this[core.$iterator]; | 592 let it = this[core.$iterator]; |
564 if (!dart.notNull(it.moveNext())) { | 593 if (!dart.notNull(it.moveNext())) { |
565 throw _internal.IterableElementError.noElement(); | 594 throw _internal.IterableElementError.noElement(); |
566 } | 595 } |
567 return dart.as(it.current, E); | 596 return dart.as(it.current, E); |
568 } | 597 } |
569 get [core.$last]() { | 598 get [core.$last]() { |
(...skipping 10 matching lines...) Expand all Loading... |
580 get [core.$single]() { | 609 get [core.$single]() { |
581 let it = this[core.$iterator]; | 610 let it = this[core.$iterator]; |
582 if (!dart.notNull(it.moveNext())) | 611 if (!dart.notNull(it.moveNext())) |
583 throw _internal.IterableElementError.noElement(); | 612 throw _internal.IterableElementError.noElement(); |
584 let result = dart.as(it.current, E); | 613 let result = dart.as(it.current, E); |
585 if (it.moveNext()) | 614 if (it.moveNext()) |
586 throw _internal.IterableElementError.tooMany(); | 615 throw _internal.IterableElementError.tooMany(); |
587 return result; | 616 return result; |
588 } | 617 } |
589 [core.$firstWhere](test, opts) { | 618 [core.$firstWhere](test, opts) { |
| 619 dart.as(test, dart.functionType(core.bool, [E])); |
590 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 620 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 621 dart.as(orElse, dart.functionType(E, [])); |
591 for (let element of this) { | 622 for (let element of this) { |
592 if (test(element)) | 623 if (test(element)) |
593 return element; | 624 return element; |
594 } | 625 } |
595 if (orElse != null) | 626 if (orElse != null) |
596 return orElse(); | 627 return orElse(); |
597 throw _internal.IterableElementError.noElement(); | 628 throw _internal.IterableElementError.noElement(); |
598 } | 629 } |
599 [core.$lastWhere](test, opts) { | 630 [core.$lastWhere](test, opts) { |
| 631 dart.as(test, dart.functionType(core.bool, [E])); |
600 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 632 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 633 dart.as(orElse, dart.functionType(E, [])); |
601 let result = null; | 634 let result = null; |
602 let foundMatching = false; | 635 let foundMatching = false; |
603 for (let element of this) { | 636 for (let element of this) { |
604 if (test(element)) { | 637 if (test(element)) { |
605 result = element; | 638 result = element; |
606 foundMatching = true; | 639 foundMatching = true; |
607 } | 640 } |
608 } | 641 } |
609 if (foundMatching) | 642 if (foundMatching) |
610 return result; | 643 return result; |
611 if (orElse != null) | 644 if (orElse != null) |
612 return orElse(); | 645 return orElse(); |
613 throw _internal.IterableElementError.noElement(); | 646 throw _internal.IterableElementError.noElement(); |
614 } | 647 } |
615 [core.$singleWhere](test) { | 648 [core.$singleWhere](test) { |
| 649 dart.as(test, dart.functionType(core.bool, [E])); |
616 let result = null; | 650 let result = null; |
617 let foundMatching = false; | 651 let foundMatching = false; |
618 for (let element of this) { | 652 for (let element of this) { |
619 if (test(element)) { | 653 if (test(element)) { |
620 if (foundMatching) { | 654 if (foundMatching) { |
621 throw _internal.IterableElementError.tooMany(); | 655 throw _internal.IterableElementError.tooMany(); |
622 } | 656 } |
623 result = element; | 657 result = element; |
624 foundMatching = true; | 658 foundMatching = true; |
625 } | 659 } |
(...skipping 20 matching lines...) Expand all Loading... |
646 } | 680 } |
647 IterableMixin[dart.implements] = () => [core.Iterable$(E)]; | 681 IterableMixin[dart.implements] = () => [core.Iterable$(E)]; |
648 return IterableMixin; | 682 return IterableMixin; |
649 }); | 683 }); |
650 let IterableMixin = IterableMixin$(); | 684 let IterableMixin = IterableMixin$(); |
651 let IterableBase$ = dart.generic(function(E) { | 685 let IterableBase$ = dart.generic(function(E) { |
652 class IterableBase extends core.Object { | 686 class IterableBase extends core.Object { |
653 IterableBase() { | 687 IterableBase() { |
654 } | 688 } |
655 [core.$map](f) { | 689 [core.$map](f) { |
| 690 dart.as(f, dart.functionType(dart.dynamic, [E])); |
656 return new (_internal.MappedIterable$(E, dart.dynamic))(this, f); | 691 return new (_internal.MappedIterable$(E, dart.dynamic))(this, f); |
657 } | 692 } |
658 [core.$where](f) { | 693 [core.$where](f) { |
| 694 dart.as(f, dart.functionType(core.bool, [E])); |
659 return new (_internal.WhereIterable$(E))(this, f); | 695 return new (_internal.WhereIterable$(E))(this, f); |
660 } | 696 } |
661 [core.$expand](f) { | 697 [core.$expand](f) { |
| 698 dart.as(f, dart.functionType(core.Iterable, [E])); |
662 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); | 699 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); |
663 } | 700 } |
664 [core.$contains](element) { | 701 [core.$contains](element) { |
665 for (let e of this) { | 702 for (let e of this) { |
666 if (dart.equals(e, element)) | 703 if (dart.equals(e, element)) |
667 return true; | 704 return true; |
668 } | 705 } |
669 return false; | 706 return false; |
670 } | 707 } |
671 [core.$forEach](f) { | 708 [core.$forEach](f) { |
| 709 dart.as(f, dart.functionType(dart.void, [E])); |
672 for (let element of this) | 710 for (let element of this) |
673 f(element); | 711 f(element); |
674 } | 712 } |
675 [core.$reduce](combine) { | 713 [core.$reduce](combine) { |
| 714 dart.as(combine, dart.functionType(E, [E, E])); |
676 let iterator = this[core.$iterator]; | 715 let iterator = this[core.$iterator]; |
677 if (!dart.notNull(iterator.moveNext())) { | 716 if (!dart.notNull(iterator.moveNext())) { |
678 throw _internal.IterableElementError.noElement(); | 717 throw _internal.IterableElementError.noElement(); |
679 } | 718 } |
680 let value = iterator.current; | 719 let value = iterator.current; |
681 while (iterator.moveNext()) { | 720 while (iterator.moveNext()) { |
682 value = combine(value, iterator.current); | 721 value = combine(value, iterator.current); |
683 } | 722 } |
684 return value; | 723 return value; |
685 } | 724 } |
686 [core.$fold](initialValue, combine) { | 725 [core.$fold](initialValue, combine) { |
| 726 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); |
687 let value = initialValue; | 727 let value = initialValue; |
688 for (let element of this) | 728 for (let element of this) |
689 value = dart.dcall(combine, value, element); | 729 value = dart.dcall(combine, value, element); |
690 return value; | 730 return value; |
691 } | 731 } |
692 [core.$every](f) { | 732 [core.$every](f) { |
| 733 dart.as(f, dart.functionType(core.bool, [E])); |
693 for (let element of this) { | 734 for (let element of this) { |
694 if (!dart.notNull(f(element))) | 735 if (!dart.notNull(f(element))) |
695 return false; | 736 return false; |
696 } | 737 } |
697 return true; | 738 return true; |
698 } | 739 } |
699 [core.$join](separator) { | 740 [core.$join](separator) { |
700 if (separator === void 0) | 741 if (separator === void 0) |
701 separator = ""; | 742 separator = ""; |
702 let iterator = this[core.$iterator]; | 743 let iterator = this[core.$iterator]; |
703 if (!dart.notNull(iterator.moveNext())) | 744 if (!dart.notNull(iterator.moveNext())) |
704 return ""; | 745 return ""; |
705 let buffer = new core.StringBuffer(); | 746 let buffer = new core.StringBuffer(); |
706 if (separator == null || separator == "") { | 747 if (separator == null || separator == "") { |
707 do { | 748 do { |
708 buffer.write(`${iterator.current}`); | 749 buffer.write(`${iterator.current}`); |
709 } while (iterator.moveNext()); | 750 } while (iterator.moveNext()); |
710 } else { | 751 } else { |
711 buffer.write(`${iterator.current}`); | 752 buffer.write(`${iterator.current}`); |
712 while (iterator.moveNext()) { | 753 while (iterator.moveNext()) { |
713 buffer.write(separator); | 754 buffer.write(separator); |
714 buffer.write(`${iterator.current}`); | 755 buffer.write(`${iterator.current}`); |
715 } | 756 } |
716 } | 757 } |
717 return dart.toString(buffer); | 758 return dart.toString(buffer); |
718 } | 759 } |
719 [core.$any](f) { | 760 [core.$any](f) { |
| 761 dart.as(f, dart.functionType(core.bool, [E])); |
720 for (let element of this) { | 762 for (let element of this) { |
721 if (f(element)) | 763 if (f(element)) |
722 return true; | 764 return true; |
723 } | 765 } |
724 return false; | 766 return false; |
725 } | 767 } |
726 [core.$toList](opts) { | 768 [core.$toList](opts) { |
727 let growable = opts && 'growable' in opts ? opts.growable : true; | 769 let growable = opts && 'growable' in opts ? opts.growable : true; |
728 return new core.List$(E).from(this, {growable: growable}); | 770 return new core.List$(E).from(this, {growable: growable}); |
729 } | 771 } |
(...skipping 12 matching lines...) Expand all Loading... |
742 get [core.$isEmpty]() { | 784 get [core.$isEmpty]() { |
743 return !dart.notNull(this[core.$iterator].moveNext()); | 785 return !dart.notNull(this[core.$iterator].moveNext()); |
744 } | 786 } |
745 get [core.$isNotEmpty]() { | 787 get [core.$isNotEmpty]() { |
746 return !dart.notNull(this[core.$isEmpty]); | 788 return !dart.notNull(this[core.$isEmpty]); |
747 } | 789 } |
748 [core.$take](n) { | 790 [core.$take](n) { |
749 return new (_internal.TakeIterable$(E))(this, n); | 791 return new (_internal.TakeIterable$(E))(this, n); |
750 } | 792 } |
751 [core.$takeWhile](test) { | 793 [core.$takeWhile](test) { |
| 794 dart.as(test, dart.functionType(core.bool, [E])); |
752 return new (_internal.TakeWhileIterable$(E))(this, test); | 795 return new (_internal.TakeWhileIterable$(E))(this, test); |
753 } | 796 } |
754 [core.$skip](n) { | 797 [core.$skip](n) { |
755 return new (_internal.SkipIterable$(E))(this, n); | 798 return new (_internal.SkipIterable$(E))(this, n); |
756 } | 799 } |
757 [core.$skipWhile](test) { | 800 [core.$skipWhile](test) { |
| 801 dart.as(test, dart.functionType(core.bool, [E])); |
758 return new (_internal.SkipWhileIterable$(E))(this, test); | 802 return new (_internal.SkipWhileIterable$(E))(this, test); |
759 } | 803 } |
760 get [core.$first]() { | 804 get [core.$first]() { |
761 let it = this[core.$iterator]; | 805 let it = this[core.$iterator]; |
762 if (!dart.notNull(it.moveNext())) { | 806 if (!dart.notNull(it.moveNext())) { |
763 throw _internal.IterableElementError.noElement(); | 807 throw _internal.IterableElementError.noElement(); |
764 } | 808 } |
765 return dart.as(it.current, E); | 809 return dart.as(it.current, E); |
766 } | 810 } |
767 get [core.$last]() { | 811 get [core.$last]() { |
(...skipping 10 matching lines...) Expand all Loading... |
778 get [core.$single]() { | 822 get [core.$single]() { |
779 let it = this[core.$iterator]; | 823 let it = this[core.$iterator]; |
780 if (!dart.notNull(it.moveNext())) | 824 if (!dart.notNull(it.moveNext())) |
781 throw _internal.IterableElementError.noElement(); | 825 throw _internal.IterableElementError.noElement(); |
782 let result = dart.as(it.current, E); | 826 let result = dart.as(it.current, E); |
783 if (it.moveNext()) | 827 if (it.moveNext()) |
784 throw _internal.IterableElementError.tooMany(); | 828 throw _internal.IterableElementError.tooMany(); |
785 return result; | 829 return result; |
786 } | 830 } |
787 [core.$firstWhere](test, opts) { | 831 [core.$firstWhere](test, opts) { |
| 832 dart.as(test, dart.functionType(core.bool, [E])); |
788 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 833 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 834 dart.as(orElse, dart.functionType(E, [])); |
789 for (let element of this) { | 835 for (let element of this) { |
790 if (test(element)) | 836 if (test(element)) |
791 return element; | 837 return element; |
792 } | 838 } |
793 if (orElse != null) | 839 if (orElse != null) |
794 return orElse(); | 840 return orElse(); |
795 throw _internal.IterableElementError.noElement(); | 841 throw _internal.IterableElementError.noElement(); |
796 } | 842 } |
797 [core.$lastWhere](test, opts) { | 843 [core.$lastWhere](test, opts) { |
| 844 dart.as(test, dart.functionType(core.bool, [E])); |
798 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 845 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 846 dart.as(orElse, dart.functionType(E, [])); |
799 let result = null; | 847 let result = null; |
800 let foundMatching = false; | 848 let foundMatching = false; |
801 for (let element of this) { | 849 for (let element of this) { |
802 if (test(element)) { | 850 if (test(element)) { |
803 result = element; | 851 result = element; |
804 foundMatching = true; | 852 foundMatching = true; |
805 } | 853 } |
806 } | 854 } |
807 if (foundMatching) | 855 if (foundMatching) |
808 return result; | 856 return result; |
809 if (orElse != null) | 857 if (orElse != null) |
810 return orElse(); | 858 return orElse(); |
811 throw _internal.IterableElementError.noElement(); | 859 throw _internal.IterableElementError.noElement(); |
812 } | 860 } |
813 [core.$singleWhere](test) { | 861 [core.$singleWhere](test) { |
| 862 dart.as(test, dart.functionType(core.bool, [E])); |
814 let result = null; | 863 let result = null; |
815 let foundMatching = false; | 864 let foundMatching = false; |
816 for (let element of this) { | 865 for (let element of this) { |
817 if (test(element)) { | 866 if (test(element)) { |
818 if (foundMatching) { | 867 if (foundMatching) { |
819 throw _internal.IterableElementError.tooMany(); | 868 throw _internal.IterableElementError.tooMany(); |
820 } | 869 } |
821 result = element; | 870 result = element; |
822 foundMatching = true; | 871 foundMatching = true; |
823 } | 872 } |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 class LinkedList extends IterableBase$(E) { | 1213 class LinkedList extends IterableBase$(E) { |
1165 LinkedList() { | 1214 LinkedList() { |
1166 this[_modificationCount] = 0; | 1215 this[_modificationCount] = 0; |
1167 this[_length] = 0; | 1216 this[_length] = 0; |
1168 this[_next] = null; | 1217 this[_next] = null; |
1169 this[_previous] = null; | 1218 this[_previous] = null; |
1170 super.IterableBase(); | 1219 super.IterableBase(); |
1171 this[_next] = this[_previous] = this; | 1220 this[_next] = this[_previous] = this; |
1172 } | 1221 } |
1173 addFirst(entry) { | 1222 addFirst(entry) { |
| 1223 dart.as(entry, E); |
1174 this[_insertAfter](this, entry); | 1224 this[_insertAfter](this, entry); |
1175 } | 1225 } |
1176 add(entry) { | 1226 add(entry) { |
| 1227 dart.as(entry, E); |
1177 this[_insertAfter](this[_previous], entry); | 1228 this[_insertAfter](this[_previous], entry); |
1178 } | 1229 } |
1179 addAll(entries) { | 1230 addAll(entries) { |
| 1231 dart.as(entries, core.Iterable$(E)); |
1180 entries[core.$forEach]((entry => this[_insertAfter](this[_previous], dar
t.as(entry, E))).bind(this)); | 1232 entries[core.$forEach]((entry => this[_insertAfter](this[_previous], dar
t.as(entry, E))).bind(this)); |
1181 } | 1233 } |
1182 remove(entry) { | 1234 remove(entry) { |
| 1235 dart.as(entry, E); |
1183 if (!dart.equals(entry[_list], this)) | 1236 if (!dart.equals(entry[_list], this)) |
1184 return false; | 1237 return false; |
1185 this[_unlink](entry); | 1238 this[_unlink](entry); |
1186 return true; | 1239 return true; |
1187 } | 1240 } |
1188 get [core.$iterator]() { | 1241 get [core.$iterator]() { |
1189 return new (_LinkedListIterator$(E))(this); | 1242 return new (_LinkedListIterator$(E))(this); |
1190 } | 1243 } |
1191 get [core.$length]() { | 1244 get [core.$length]() { |
1192 return this[_length]; | 1245 return this[_length]; |
(...skipping 24 matching lines...) Expand all Loading... |
1217 get [core.$single]() { | 1270 get [core.$single]() { |
1218 if (core.identical(this[_previous], this)) { | 1271 if (core.identical(this[_previous], this)) { |
1219 throw new core.StateError('No such element'); | 1272 throw new core.StateError('No such element'); |
1220 } | 1273 } |
1221 if (!dart.notNull(core.identical(this[_previous], this[_next]))) { | 1274 if (!dart.notNull(core.identical(this[_previous], this[_next]))) { |
1222 throw new core.StateError('Too many elements'); | 1275 throw new core.StateError('Too many elements'); |
1223 } | 1276 } |
1224 return dart.as(this[_next], E); | 1277 return dart.as(this[_next], E); |
1225 } | 1278 } |
1226 [core.$forEach](action) { | 1279 [core.$forEach](action) { |
| 1280 dart.as(action, dart.functionType(dart.void, [E])); |
1227 let modificationCount = this[_modificationCount]; | 1281 let modificationCount = this[_modificationCount]; |
1228 let current = this[_next]; | 1282 let current = this[_next]; |
1229 while (!dart.notNull(core.identical(current, this))) { | 1283 while (!dart.notNull(core.identical(current, this))) { |
1230 action(dart.as(current, E)); | 1284 action(dart.as(current, E)); |
1231 if (modificationCount != this[_modificationCount]) { | 1285 if (modificationCount != this[_modificationCount]) { |
1232 throw new core.ConcurrentModificationError(this); | 1286 throw new core.ConcurrentModificationError(this); |
1233 } | 1287 } |
1234 current = current[_next]; | 1288 current = current[_next]; |
1235 } | 1289 } |
1236 } | 1290 } |
1237 get [core.$isEmpty]() { | 1291 get [core.$isEmpty]() { |
1238 return this[_length] == 0; | 1292 return this[_length] == 0; |
1239 } | 1293 } |
1240 [_insertAfter](entry, newEntry) { | 1294 [_insertAfter](entry, newEntry) { |
| 1295 dart.as(newEntry, E); |
1241 if (newEntry.list != null) { | 1296 if (newEntry.list != null) { |
1242 throw new core.StateError('LinkedListEntry is already in a LinkedList'
); | 1297 throw new core.StateError('LinkedListEntry is already in a LinkedList'
); |
1243 } | 1298 } |
1244 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 1299 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
1245 newEntry[_list] = this; | 1300 newEntry[_list] = this; |
1246 let predecessor = entry; | 1301 let predecessor = entry; |
1247 let successor = entry[_next]; | 1302 let successor = entry[_next]; |
1248 successor[_previous] = newEntry; | 1303 successor[_previous] = newEntry; |
1249 newEntry[_previous] = predecessor; | 1304 newEntry[_previous] = predecessor; |
1250 newEntry[_next] = successor; | 1305 newEntry[_next] = successor; |
1251 predecessor[_next] = newEntry; | 1306 predecessor[_next] = newEntry; |
1252 this[_length] = dart.notNull(this[_length]) + 1; | 1307 this[_length] = dart.notNull(this[_length]) + 1; |
1253 } | 1308 } |
1254 [_unlink](entry) { | 1309 [_unlink](entry) { |
| 1310 dart.as(entry, LinkedListEntry$(E)); |
1255 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 1311 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
1256 entry[_next][_previous] = entry[_previous]; | 1312 entry[_next][_previous] = entry[_previous]; |
1257 entry[_previous][_next] = entry[_next]; | 1313 entry[_previous][_next] = entry[_next]; |
1258 this[_length] = dart.notNull(this[_length]) - 1; | 1314 this[_length] = dart.notNull(this[_length]) - 1; |
1259 entry[_list] = entry[_next] = entry[_previous] = null; | 1315 entry[_list] = entry[_next] = entry[_previous] = null; |
1260 } | 1316 } |
1261 } | 1317 } |
1262 LinkedList[dart.implements] = () => [_LinkedListLink]; | 1318 LinkedList[dart.implements] = () => [_LinkedListLink]; |
1263 return LinkedList; | 1319 return LinkedList; |
1264 }); | 1320 }); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 return null; | 1372 return null; |
1317 let result = dart.as(this[_next], E); | 1373 let result = dart.as(this[_next], E); |
1318 return result; | 1374 return result; |
1319 } | 1375 } |
1320 get previous() { | 1376 get previous() { |
1321 if (core.identical(this[_previous], this[_list])) | 1377 if (core.identical(this[_previous], this[_list])) |
1322 return null; | 1378 return null; |
1323 return dart.as(this[_previous], E); | 1379 return dart.as(this[_previous], E); |
1324 } | 1380 } |
1325 insertAfter(entry) { | 1381 insertAfter(entry) { |
| 1382 dart.as(entry, E); |
1326 this[_list][_insertAfter](this, entry); | 1383 this[_list][_insertAfter](this, entry); |
1327 } | 1384 } |
1328 insertBefore(entry) { | 1385 insertBefore(entry) { |
| 1386 dart.as(entry, E); |
1329 this[_list][_insertAfter](this[_previous], entry); | 1387 this[_list][_insertAfter](this[_previous], entry); |
1330 } | 1388 } |
1331 } | 1389 } |
1332 LinkedListEntry[dart.implements] = () => [_LinkedListLink]; | 1390 LinkedListEntry[dart.implements] = () => [_LinkedListLink]; |
1333 return LinkedListEntry; | 1391 return LinkedListEntry; |
1334 }); | 1392 }); |
1335 let LinkedListEntry = LinkedListEntry$(); | 1393 let LinkedListEntry = LinkedListEntry$(); |
1336 let ListMixin$ = dart.generic(function(E) { | 1394 let ListMixin$ = dart.generic(function(E) { |
1337 class ListMixin extends core.Object { | 1395 class ListMixin extends core.Object { |
1338 get [core.$iterator]() { | 1396 get [core.$iterator]() { |
1339 return new (_internal.ListIterator$(E))(this); | 1397 return new (_internal.ListIterator$(E))(this); |
1340 } | 1398 } |
1341 [core.$elementAt](index) { | 1399 [core.$elementAt](index) { |
1342 return this[core.$get](index); | 1400 return this[core.$get](index); |
1343 } | 1401 } |
1344 [core.$forEach](action) { | 1402 [core.$forEach](action) { |
| 1403 dart.as(action, dart.functionType(dart.void, [E])); |
1345 let length = this[core.$length]; | 1404 let length = this[core.$length]; |
1346 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1405 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1347 action(this[core.$get](i)); | 1406 action(this[core.$get](i)); |
1348 if (length != this[core.$length]) { | 1407 if (length != this[core.$length]) { |
1349 throw new core.ConcurrentModificationError(this); | 1408 throw new core.ConcurrentModificationError(this); |
1350 } | 1409 } |
1351 } | 1410 } |
1352 } | 1411 } |
1353 get [core.$isEmpty]() { | 1412 get [core.$isEmpty]() { |
1354 return this[core.$length] == 0; | 1413 return this[core.$length] == 0; |
(...skipping 23 matching lines...) Expand all Loading... |
1378 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { | 1437 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { |
1379 if (dart.equals(this[core.$get](i), element)) | 1438 if (dart.equals(this[core.$get](i), element)) |
1380 return true; | 1439 return true; |
1381 if (length != this[core.$length]) { | 1440 if (length != this[core.$length]) { |
1382 throw new core.ConcurrentModificationError(this); | 1441 throw new core.ConcurrentModificationError(this); |
1383 } | 1442 } |
1384 } | 1443 } |
1385 return false; | 1444 return false; |
1386 } | 1445 } |
1387 [core.$every](test) { | 1446 [core.$every](test) { |
| 1447 dart.as(test, dart.functionType(core.bool, [E])); |
1388 let length = this[core.$length]; | 1448 let length = this[core.$length]; |
1389 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1449 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1390 if (!dart.notNull(test(this[core.$get](i)))) | 1450 if (!dart.notNull(test(this[core.$get](i)))) |
1391 return false; | 1451 return false; |
1392 if (length != this[core.$length]) { | 1452 if (length != this[core.$length]) { |
1393 throw new core.ConcurrentModificationError(this); | 1453 throw new core.ConcurrentModificationError(this); |
1394 } | 1454 } |
1395 } | 1455 } |
1396 return true; | 1456 return true; |
1397 } | 1457 } |
1398 [core.$any](test) { | 1458 [core.$any](test) { |
| 1459 dart.as(test, dart.functionType(core.bool, [E])); |
1399 let length = this[core.$length]; | 1460 let length = this[core.$length]; |
1400 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1461 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1401 if (test(this[core.$get](i))) | 1462 if (test(this[core.$get](i))) |
1402 return true; | 1463 return true; |
1403 if (length != this[core.$length]) { | 1464 if (length != this[core.$length]) { |
1404 throw new core.ConcurrentModificationError(this); | 1465 throw new core.ConcurrentModificationError(this); |
1405 } | 1466 } |
1406 } | 1467 } |
1407 return false; | 1468 return false; |
1408 } | 1469 } |
1409 [core.$firstWhere](test, opts) { | 1470 [core.$firstWhere](test, opts) { |
| 1471 dart.as(test, dart.functionType(core.bool, [E])); |
1410 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 1472 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 1473 dart.as(orElse, dart.functionType(E, [])); |
1411 let length = this[core.$length]; | 1474 let length = this[core.$length]; |
1412 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1475 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1413 let element = this[core.$get](i); | 1476 let element = this[core.$get](i); |
1414 if (test(element)) | 1477 if (test(element)) |
1415 return element; | 1478 return element; |
1416 if (length != this[core.$length]) { | 1479 if (length != this[core.$length]) { |
1417 throw new core.ConcurrentModificationError(this); | 1480 throw new core.ConcurrentModificationError(this); |
1418 } | 1481 } |
1419 } | 1482 } |
1420 if (orElse != null) | 1483 if (orElse != null) |
1421 return orElse(); | 1484 return orElse(); |
1422 throw _internal.IterableElementError.noElement(); | 1485 throw _internal.IterableElementError.noElement(); |
1423 } | 1486 } |
1424 [core.$lastWhere](test, opts) { | 1487 [core.$lastWhere](test, opts) { |
| 1488 dart.as(test, dart.functionType(core.bool, [E])); |
1425 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | 1489 let orElse = opts && 'orElse' in opts ? opts.orElse : null; |
| 1490 dart.as(orElse, dart.functionType(E, [])); |
1426 let length = this[core.$length]; | 1491 let length = this[core.$length]; |
1427 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no
tNull(i) - 1) { | 1492 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no
tNull(i) - 1) { |
1428 let element = this[core.$get](i); | 1493 let element = this[core.$get](i); |
1429 if (test(element)) | 1494 if (test(element)) |
1430 return element; | 1495 return element; |
1431 if (length != this[core.$length]) { | 1496 if (length != this[core.$length]) { |
1432 throw new core.ConcurrentModificationError(this); | 1497 throw new core.ConcurrentModificationError(this); |
1433 } | 1498 } |
1434 } | 1499 } |
1435 if (orElse != null) | 1500 if (orElse != null) |
1436 return orElse(); | 1501 return orElse(); |
1437 throw _internal.IterableElementError.noElement(); | 1502 throw _internal.IterableElementError.noElement(); |
1438 } | 1503 } |
1439 [core.$singleWhere](test) { | 1504 [core.$singleWhere](test) { |
| 1505 dart.as(test, dart.functionType(core.bool, [E])); |
1440 let length = this[core.$length]; | 1506 let length = this[core.$length]; |
1441 let match = null; | 1507 let match = null; |
1442 let matchFound = false; | 1508 let matchFound = false; |
1443 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1509 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1444 let element = this[core.$get](i); | 1510 let element = this[core.$get](i); |
1445 if (test(element)) { | 1511 if (test(element)) { |
1446 if (matchFound) { | 1512 if (matchFound) { |
1447 throw _internal.IterableElementError.tooMany(); | 1513 throw _internal.IterableElementError.tooMany(); |
1448 } | 1514 } |
1449 matchFound = true; | 1515 matchFound = true; |
(...skipping 10 matching lines...) Expand all Loading... |
1460 [core.$join](separator) { | 1526 [core.$join](separator) { |
1461 if (separator === void 0) | 1527 if (separator === void 0) |
1462 separator = ""; | 1528 separator = ""; |
1463 if (this[core.$length] == 0) | 1529 if (this[core.$length] == 0) |
1464 return ""; | 1530 return ""; |
1465 let buffer = new core.StringBuffer(); | 1531 let buffer = new core.StringBuffer(); |
1466 buffer.writeAll(this, separator); | 1532 buffer.writeAll(this, separator); |
1467 return dart.toString(buffer); | 1533 return dart.toString(buffer); |
1468 } | 1534 } |
1469 [core.$where](test) { | 1535 [core.$where](test) { |
| 1536 dart.as(test, dart.functionType(core.bool, [E])); |
1470 return new (_internal.WhereIterable$(E))(this, test); | 1537 return new (_internal.WhereIterable$(E))(this, test); |
1471 } | 1538 } |
1472 [core.$map](f) { | 1539 [core.$map](f) { |
| 1540 dart.as(f, dart.functionType(dart.dynamic, [E])); |
1473 return new _internal.MappedListIterable(this, f); | 1541 return new _internal.MappedListIterable(this, f); |
1474 } | 1542 } |
1475 [core.$expand](f) { | 1543 [core.$expand](f) { |
| 1544 dart.as(f, dart.functionType(core.Iterable, [E])); |
1476 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); | 1545 return new (_internal.ExpandIterable$(E, dart.dynamic))(this, f); |
1477 } | 1546 } |
1478 [core.$reduce](combine) { | 1547 [core.$reduce](combine) { |
| 1548 dart.as(combine, dart.functionType(E, [E, E])); |
1479 let length = this[core.$length]; | 1549 let length = this[core.$length]; |
1480 if (length == 0) | 1550 if (length == 0) |
1481 throw _internal.IterableElementError.noElement(); | 1551 throw _internal.IterableElementError.noElement(); |
1482 let value = this[core.$get](0); | 1552 let value = this[core.$get](0); |
1483 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1553 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1484 value = combine(value, this[core.$get](i)); | 1554 value = combine(value, this[core.$get](i)); |
1485 if (length != this[core.$length]) { | 1555 if (length != this[core.$length]) { |
1486 throw new core.ConcurrentModificationError(this); | 1556 throw new core.ConcurrentModificationError(this); |
1487 } | 1557 } |
1488 } | 1558 } |
1489 return value; | 1559 return value; |
1490 } | 1560 } |
1491 [core.$fold](initialValue, combine) { | 1561 [core.$fold](initialValue, combine) { |
| 1562 dart.as(combine, dart.functionType(dart.dynamic, [dart.dynamic, E])); |
1492 let value = initialValue; | 1563 let value = initialValue; |
1493 let length = this[core.$length]; | 1564 let length = this[core.$length]; |
1494 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1565 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1495 value = dart.dcall(combine, value, this[core.$get](i)); | 1566 value = dart.dcall(combine, value, this[core.$get](i)); |
1496 if (length != this[core.$length]) { | 1567 if (length != this[core.$length]) { |
1497 throw new core.ConcurrentModificationError(this); | 1568 throw new core.ConcurrentModificationError(this); |
1498 } | 1569 } |
1499 } | 1570 } |
1500 return value; | 1571 return value; |
1501 } | 1572 } |
1502 [core.$skip](count) { | 1573 [core.$skip](count) { |
1503 return new (_internal.SubListIterable$(E))(this, count, null); | 1574 return new (_internal.SubListIterable$(E))(this, count, null); |
1504 } | 1575 } |
1505 [core.$skipWhile](test) { | 1576 [core.$skipWhile](test) { |
| 1577 dart.as(test, dart.functionType(core.bool, [E])); |
1506 return new (_internal.SkipWhileIterable$(E))(this, test); | 1578 return new (_internal.SkipWhileIterable$(E))(this, test); |
1507 } | 1579 } |
1508 [core.$take](count) { | 1580 [core.$take](count) { |
1509 return new (_internal.SubListIterable$(E))(this, 0, count); | 1581 return new (_internal.SubListIterable$(E))(this, 0, count); |
1510 } | 1582 } |
1511 [core.$takeWhile](test) { | 1583 [core.$takeWhile](test) { |
| 1584 dart.as(test, dart.functionType(core.bool, [E])); |
1512 return new (_internal.TakeWhileIterable$(E))(this, test); | 1585 return new (_internal.TakeWhileIterable$(E))(this, test); |
1513 } | 1586 } |
1514 [core.$toList](opts) { | 1587 [core.$toList](opts) { |
1515 let growable = opts && 'growable' in opts ? opts.growable : true; | 1588 let growable = opts && 'growable' in opts ? opts.growable : true; |
1516 let result = null; | 1589 let result = null; |
1517 if (growable) { | 1590 if (growable) { |
1518 result = new (core.List$(E))(); | 1591 result = new (core.List$(E))(); |
1519 result[core.$length] = this[core.$length]; | 1592 result[core.$length] = this[core.$length]; |
1520 } else { | 1593 } else { |
1521 result = new (core.List$(E))(this[core.$length]); | 1594 result = new (core.List$(E))(this[core.$length]); |
1522 } | 1595 } |
1523 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { | 1596 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { |
1524 result[core.$set](i, this[core.$get](i)); | 1597 result[core.$set](i, this[core.$get](i)); |
1525 } | 1598 } |
1526 return result; | 1599 return result; |
1527 } | 1600 } |
1528 [core.$toSet]() { | 1601 [core.$toSet]() { |
1529 let result = new (core.Set$(E))(); | 1602 let result = new (core.Set$(E))(); |
1530 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { | 1603 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { |
1531 result.add(this[core.$get](i)); | 1604 result.add(this[core.$get](i)); |
1532 } | 1605 } |
1533 return result; | 1606 return result; |
1534 } | 1607 } |
1535 [core.$add](element) { | 1608 [core.$add](element) { |
| 1609 dart.as(element, E); |
1536 this[core.$set]((() => { | 1610 this[core.$set]((() => { |
1537 let o = this, x = o[core.$length]; | 1611 let o = this, x = o[core.$length]; |
1538 o[core.$length] = dart.notNull(x) + 1; | 1612 o[core.$length] = dart.notNull(x) + 1; |
1539 return x; | 1613 return x; |
1540 }).bind(this)(), element); | 1614 }).bind(this)(), element); |
1541 } | 1615 } |
1542 [core.$addAll](iterable) { | 1616 [core.$addAll](iterable) { |
| 1617 dart.as(iterable, core.Iterable$(E)); |
1543 for (let element of iterable) { | 1618 for (let element of iterable) { |
1544 this[core.$set]((() => { | 1619 this[core.$set]((() => { |
1545 let o = this, x = o[core.$length]; | 1620 let o = this, x = o[core.$length]; |
1546 o[core.$length] = dart.notNull(x) + 1; | 1621 o[core.$length] = dart.notNull(x) + 1; |
1547 return x; | 1622 return x; |
1548 }).bind(this)(), element); | 1623 }).bind(this)(), element); |
1549 } | 1624 } |
1550 } | 1625 } |
1551 [core.$remove](element) { | 1626 [core.$remove](element) { |
1552 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { | 1627 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i =
dart.notNull(i) + 1) { |
1553 if (dart.equals(this[core.$get](i), element)) { | 1628 if (dart.equals(this[core.$get](i), element)) { |
1554 this[core.$setRange](i, dart.notNull(this[core.$length]) - 1, this,
dart.notNull(i) + 1); | 1629 this[core.$setRange](i, dart.notNull(this[core.$length]) - 1, this,
dart.notNull(i) + 1); |
1555 let o = this; | 1630 let o = this; |
1556 o[core.$length] = dart.notNull(o[core.$length]) - 1; | 1631 o[core.$length] = dart.notNull(o[core.$length]) - 1; |
1557 return true; | 1632 return true; |
1558 } | 1633 } |
1559 } | 1634 } |
1560 return false; | 1635 return false; |
1561 } | 1636 } |
1562 [core.$removeWhere](test) { | 1637 [core.$removeWhere](test) { |
| 1638 dart.as(test, dart.functionType(core.bool, [E])); |
1563 ListMixin._filter(this, test, false); | 1639 ListMixin._filter(this, test, false); |
1564 } | 1640 } |
1565 [core.$retainWhere](test) { | 1641 [core.$retainWhere](test) { |
| 1642 dart.as(test, dart.functionType(core.bool, [E])); |
1566 ListMixin._filter(this, test, true); | 1643 ListMixin._filter(this, test, true); |
1567 } | 1644 } |
1568 static _filter(source, test, retainMatching) { | 1645 static _filter(source, test, retainMatching) { |
| 1646 dart.as(test, dart.functionType(core.bool, [dart.dynamic])); |
1569 let retained = []; | 1647 let retained = []; |
1570 let length = source[core.$length]; | 1648 let length = source[core.$length]; |
1571 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1649 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1572 let element = source[core.$get](i); | 1650 let element = source[core.$get](i); |
1573 if (dart.dcall(test, element) == retainMatching) { | 1651 if (dart.dcall(test, element) == retainMatching) { |
1574 retained[core.$add](element); | 1652 retained[core.$add](element); |
1575 } | 1653 } |
1576 if (length != source[core.$length]) { | 1654 if (length != source[core.$length]) { |
1577 throw new core.ConcurrentModificationError(source); | 1655 throw new core.ConcurrentModificationError(source); |
1578 } | 1656 } |
(...skipping 10 matching lines...) Expand all Loading... |
1589 if (this[core.$length] == 0) { | 1667 if (this[core.$length] == 0) { |
1590 throw _internal.IterableElementError.noElement(); | 1668 throw _internal.IterableElementError.noElement(); |
1591 } | 1669 } |
1592 let result = this[core.$get](dart.notNull(this[core.$length]) - 1); | 1670 let result = this[core.$get](dart.notNull(this[core.$length]) - 1); |
1593 this[core.$length] = dart.notNull(this[core.$length]) - 1; | 1671 this[core.$length] = dart.notNull(this[core.$length]) - 1; |
1594 return result; | 1672 return result; |
1595 } | 1673 } |
1596 [core.$sort](compare) { | 1674 [core.$sort](compare) { |
1597 if (compare === void 0) | 1675 if (compare === void 0) |
1598 compare = null; | 1676 compare = null; |
| 1677 dart.as(compare, dart.functionType(core.int, [E, E])); |
1599 if (compare == null) { | 1678 if (compare == null) { |
1600 let defaultCompare = dart.bind(core.Comparable, 'compare'); | 1679 let defaultCompare = dart.bind(core.Comparable, 'compare'); |
1601 compare = defaultCompare; | 1680 compare = defaultCompare; |
1602 } | 1681 } |
1603 _internal.Sort.sort(this, compare); | 1682 _internal.Sort.sort(this, compare); |
1604 } | 1683 } |
1605 [core.$shuffle](random) { | 1684 [core.$shuffle](random) { |
1606 if (random === void 0) | 1685 if (random === void 0) |
1607 random = null; | 1686 random = null; |
1608 if (random == null) | 1687 if (random == null) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 [core.$removeRange](start, end) { | 1720 [core.$removeRange](start, end) { |
1642 core.RangeError.checkValidRange(start, end, this[core.$length]); | 1721 core.RangeError.checkValidRange(start, end, this[core.$length]); |
1643 let length = dart.notNull(end) - dart.notNull(start); | 1722 let length = dart.notNull(end) - dart.notNull(start); |
1644 this[core.$setRange](start, dart.notNull(this[core.$length]) - dart.notN
ull(length), this, end); | 1723 this[core.$setRange](start, dart.notNull(this[core.$length]) - dart.notN
ull(length), this, end); |
1645 let o = this; | 1724 let o = this; |
1646 o[core.$length] = dart.notNull(o[core.$length]) - dart.notNull(length); | 1725 o[core.$length] = dart.notNull(o[core.$length]) - dart.notNull(length); |
1647 } | 1726 } |
1648 [core.$fillRange](start, end, fill) { | 1727 [core.$fillRange](start, end, fill) { |
1649 if (fill === void 0) | 1728 if (fill === void 0) |
1650 fill = null; | 1729 fill = null; |
| 1730 dart.as(fill, E); |
1651 core.RangeError.checkValidRange(start, end, this[core.$length]); | 1731 core.RangeError.checkValidRange(start, end, this[core.$length]); |
1652 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { | 1732 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { |
1653 this[core.$set](i, fill); | 1733 this[core.$set](i, fill); |
1654 } | 1734 } |
1655 } | 1735 } |
1656 [core.$setRange](start, end, iterable, skipCount) { | 1736 [core.$setRange](start, end, iterable, skipCount) { |
| 1737 dart.as(iterable, core.Iterable$(E)); |
1657 if (skipCount === void 0) | 1738 if (skipCount === void 0) |
1658 skipCount = 0; | 1739 skipCount = 0; |
1659 core.RangeError.checkValidRange(start, end, this[core.$length]); | 1740 core.RangeError.checkValidRange(start, end, this[core.$length]); |
1660 let length = dart.notNull(end) - dart.notNull(start); | 1741 let length = dart.notNull(end) - dart.notNull(start); |
1661 if (length == 0) | 1742 if (length == 0) |
1662 return; | 1743 return; |
1663 core.RangeError.checkNotNegative(skipCount, "skipCount"); | 1744 core.RangeError.checkNotNegative(skipCount, "skipCount"); |
1664 let otherList = null; | 1745 let otherList = null; |
1665 let otherStart = null; | 1746 let otherStart = null; |
1666 if (dart.is(iterable, core.List)) { | 1747 if (dart.is(iterable, core.List)) { |
(...skipping 10 matching lines...) Expand all Loading... |
1677 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.
notNull(i) - 1) { | 1758 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.
notNull(i) - 1) { |
1678 this[core.$set](dart.notNull(start) + dart.notNull(i), dart.as(other
List[core.$get](dart.notNull(otherStart) + dart.notNull(i)), E)); | 1759 this[core.$set](dart.notNull(start) + dart.notNull(i), dart.as(other
List[core.$get](dart.notNull(otherStart) + dart.notNull(i)), E)); |
1679 } | 1760 } |
1680 } else { | 1761 } else { |
1681 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNu
ll(i) + 1) { | 1762 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNu
ll(i) + 1) { |
1682 this[core.$set](dart.notNull(start) + dart.notNull(i), dart.as(other
List[core.$get](dart.notNull(otherStart) + dart.notNull(i)), E)); | 1763 this[core.$set](dart.notNull(start) + dart.notNull(i), dart.as(other
List[core.$get](dart.notNull(otherStart) + dart.notNull(i)), E)); |
1683 } | 1764 } |
1684 } | 1765 } |
1685 } | 1766 } |
1686 [core.$replaceRange](start, end, newContents) { | 1767 [core.$replaceRange](start, end, newContents) { |
| 1768 dart.as(newContents, core.Iterable$(E)); |
1687 core.RangeError.checkValidRange(start, end, this[core.$length]); | 1769 core.RangeError.checkValidRange(start, end, this[core.$length]); |
1688 if (!dart.is(newContents, _internal.EfficientLength)) { | 1770 if (!dart.is(newContents, _internal.EfficientLength)) { |
1689 newContents = newContents[core.$toList](); | 1771 newContents = newContents[core.$toList](); |
1690 } | 1772 } |
1691 let removeLength = dart.notNull(end) - dart.notNull(start); | 1773 let removeLength = dart.notNull(end) - dart.notNull(start); |
1692 let insertLength = newContents[core.$length]; | 1774 let insertLength = newContents[core.$length]; |
1693 if (dart.notNull(removeLength) >= dart.notNull(insertLength)) { | 1775 if (dart.notNull(removeLength) >= dart.notNull(insertLength)) { |
1694 let delta = dart.notNull(removeLength) - dart.notNull(insertLength); | 1776 let delta = dart.notNull(removeLength) - dart.notNull(insertLength); |
1695 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); | 1777 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); |
1696 let newLength = dart.notNull(this[core.$length]) - dart.notNull(delta)
; | 1778 let newLength = dart.notNull(this[core.$length]) - dart.notNull(delta)
; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 } | 1820 } |
1739 } | 1821 } |
1740 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1)
{ | 1822 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1)
{ |
1741 if (dart.equals(this[core.$get](i), element)) { | 1823 if (dart.equals(this[core.$get](i), element)) { |
1742 return i; | 1824 return i; |
1743 } | 1825 } |
1744 } | 1826 } |
1745 return -1; | 1827 return -1; |
1746 } | 1828 } |
1747 [core.$insert](index, element) { | 1829 [core.$insert](index, element) { |
| 1830 dart.as(element, E); |
1748 core.RangeError.checkValueInInterval(index, 0, this[core.$length], "inde
x"); | 1831 core.RangeError.checkValueInInterval(index, 0, this[core.$length], "inde
x"); |
1749 if (index == this[core.$length]) { | 1832 if (index == this[core.$length]) { |
1750 this[core.$add](element); | 1833 this[core.$add](element); |
1751 return; | 1834 return; |
1752 } | 1835 } |
1753 if (!(typeof index == 'number')) | 1836 if (!(typeof index == 'number')) |
1754 throw new core.ArgumentError(index); | 1837 throw new core.ArgumentError(index); |
1755 let o = this; | 1838 let o = this; |
1756 o[core.$length] = dart.notNull(o[core.$length]) + 1; | 1839 o[core.$length] = dart.notNull(o[core.$length]) + 1; |
1757 this[core.$setRange](dart.notNull(index) + 1, this[core.$length], this,
index); | 1840 this[core.$setRange](dart.notNull(index) + 1, this[core.$length], this,
index); |
1758 this[core.$set](index, element); | 1841 this[core.$set](index, element); |
1759 } | 1842 } |
1760 [core.$removeAt](index) { | 1843 [core.$removeAt](index) { |
1761 let result = this[core.$get](index); | 1844 let result = this[core.$get](index); |
1762 this[core.$setRange](index, dart.notNull(this[core.$length]) - 1, this,
dart.notNull(index) + 1); | 1845 this[core.$setRange](index, dart.notNull(this[core.$length]) - 1, this,
dart.notNull(index) + 1); |
1763 this[core.$length] = dart.notNull(this[core.$length]) - 1; | 1846 this[core.$length] = dart.notNull(this[core.$length]) - 1; |
1764 return result; | 1847 return result; |
1765 } | 1848 } |
1766 [core.$insertAll](index, iterable) { | 1849 [core.$insertAll](index, iterable) { |
| 1850 dart.as(iterable, core.Iterable$(E)); |
1767 core.RangeError.checkValueInInterval(index, 0, this[core.$length], "inde
x"); | 1851 core.RangeError.checkValueInInterval(index, 0, this[core.$length], "inde
x"); |
1768 if (dart.is(iterable, _internal.EfficientLength)) { | 1852 if (dart.is(iterable, _internal.EfficientLength)) { |
1769 iterable = iterable[core.$toList](); | 1853 iterable = iterable[core.$toList](); |
1770 } | 1854 } |
1771 let insertionLength = iterable[core.$length]; | 1855 let insertionLength = iterable[core.$length]; |
1772 let o = this; | 1856 let o = this; |
1773 o[core.$length] = dart.notNull(o[core.$length]) + dart.notNull(insertion
Length); | 1857 o[core.$length] = dart.notNull(o[core.$length]) + dart.notNull(insertion
Length); |
1774 this[core.$setRange](dart.notNull(index) + dart.notNull(insertionLength)
, this[core.$length], this, index); | 1858 this[core.$setRange](dart.notNull(index) + dart.notNull(insertionLength)
, this[core.$length], this, index); |
1775 this[core.$setAll](index, iterable); | 1859 this[core.$setAll](index, iterable); |
1776 } | 1860 } |
1777 [core.$setAll](index, iterable) { | 1861 [core.$setAll](index, iterable) { |
| 1862 dart.as(iterable, core.Iterable$(E)); |
1778 if (dart.is(iterable, core.List)) { | 1863 if (dart.is(iterable, core.List)) { |
1779 this[core.$setRange](index, dart.notNull(index) + dart.notNull(iterabl
e[core.$length]), iterable); | 1864 this[core.$setRange](index, dart.notNull(index) + dart.notNull(iterabl
e[core.$length]), iterable); |
1780 } else { | 1865 } else { |
1781 for (let element of iterable) { | 1866 for (let element of iterable) { |
1782 this[core.$set]((() => { | 1867 this[core.$set]((() => { |
1783 let x = index; | 1868 let x = index; |
1784 index = dart.notNull(x) + 1; | 1869 index = dart.notNull(x) + 1; |
1785 return x; | 1870 return x; |
1786 })(), element); | 1871 })(), element); |
1787 } | 1872 } |
(...skipping 15 matching lines...) Expand all Loading... |
1803 static listToString(list) { | 1888 static listToString(list) { |
1804 return IterableBase.iterableToFullString(list, '[', ']'); | 1889 return IterableBase.iterableToFullString(list, '[', ']'); |
1805 } | 1890 } |
1806 } | 1891 } |
1807 return ListBase; | 1892 return ListBase; |
1808 }); | 1893 }); |
1809 let ListBase = ListBase$(); | 1894 let ListBase = ListBase$(); |
1810 let MapMixin$ = dart.generic(function(K, V) { | 1895 let MapMixin$ = dart.generic(function(K, V) { |
1811 class MapMixin extends core.Object { | 1896 class MapMixin extends core.Object { |
1812 forEach(action) { | 1897 forEach(action) { |
| 1898 dart.as(action, dart.functionType(dart.void, [K, V])); |
1813 for (let key of this.keys) { | 1899 for (let key of this.keys) { |
1814 action(key, this.get(key)); | 1900 action(key, this.get(key)); |
1815 } | 1901 } |
1816 } | 1902 } |
1817 addAll(other) { | 1903 addAll(other) { |
| 1904 dart.as(other, core.Map$(K, V)); |
1818 for (let key of other.keys) { | 1905 for (let key of other.keys) { |
1819 this.set(key, other.get(key)); | 1906 this.set(key, other.get(key)); |
1820 } | 1907 } |
1821 } | 1908 } |
1822 containsValue(value) { | 1909 containsValue(value) { |
| 1910 dart.as(value, V); |
1823 for (let key of this.keys) { | 1911 for (let key of this.keys) { |
1824 if (dart.equals(this.get(key), value)) | 1912 if (dart.equals(this.get(key), value)) |
1825 return true; | 1913 return true; |
1826 } | 1914 } |
1827 return false; | 1915 return false; |
1828 } | 1916 } |
1829 putIfAbsent(key, ifAbsent) { | 1917 putIfAbsent(key, ifAbsent) { |
| 1918 dart.as(key, K); |
| 1919 dart.as(ifAbsent, dart.functionType(V, [])); |
1830 if (this.keys[core.$contains](key)) { | 1920 if (this.keys[core.$contains](key)) { |
1831 return this.get(key); | 1921 return this.get(key); |
1832 } | 1922 } |
1833 return this.set(key, ifAbsent()); | 1923 return this.set(key, ifAbsent()); |
1834 } | 1924 } |
1835 containsKey(key) { | 1925 containsKey(key) { |
1836 return this.keys[core.$contains](key); | 1926 return this.keys[core.$contains](key); |
1837 } | 1927 } |
1838 get length() { | 1928 get length() { |
1839 return this.keys[core.$length]; | 1929 return this.keys[core.$length]; |
(...skipping 16 matching lines...) Expand all Loading... |
1856 }); | 1946 }); |
1857 let MapMixin = MapMixin$(); | 1947 let MapMixin = MapMixin$(); |
1858 let MapBase$ = dart.generic(function(K, V) { | 1948 let MapBase$ = dart.generic(function(K, V) { |
1859 class MapBase extends dart.mixin(core.Object, MapMixin$(K, V)) {} | 1949 class MapBase extends dart.mixin(core.Object, MapMixin$(K, V)) {} |
1860 return MapBase; | 1950 return MapBase; |
1861 }); | 1951 }); |
1862 let MapBase = MapBase$(); | 1952 let MapBase = MapBase$(); |
1863 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { | 1953 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { |
1864 class _UnmodifiableMapMixin extends core.Object { | 1954 class _UnmodifiableMapMixin extends core.Object { |
1865 set(key, value) { | 1955 set(key, value) { |
| 1956 dart.as(key, K); |
| 1957 dart.as(value, V); |
1866 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 1958 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
1867 } | 1959 } |
1868 addAll(other) { | 1960 addAll(other) { |
| 1961 dart.as(other, core.Map$(K, V)); |
1869 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 1962 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
1870 } | 1963 } |
1871 clear() { | 1964 clear() { |
1872 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 1965 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
1873 } | 1966 } |
1874 remove(key) { | 1967 remove(key) { |
1875 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 1968 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
1876 } | 1969 } |
1877 putIfAbsent(key, ifAbsent) { | 1970 putIfAbsent(key, ifAbsent) { |
| 1971 dart.as(key, K); |
| 1972 dart.as(ifAbsent, dart.functionType(V, [])); |
1878 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 1973 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
1879 } | 1974 } |
1880 } | 1975 } |
1881 _UnmodifiableMapMixin[dart.implements] = () => [core.Map$(K, V)]; | 1976 _UnmodifiableMapMixin[dart.implements] = () => [core.Map$(K, V)]; |
1882 return _UnmodifiableMapMixin; | 1977 return _UnmodifiableMapMixin; |
1883 }); | 1978 }); |
1884 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(); | 1979 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(); |
1885 let UnmodifiableMapBase$ = dart.generic(function(K, V) { | 1980 let UnmodifiableMapBase$ = dart.generic(function(K, V) { |
1886 class UnmodifiableMapBase extends dart.mixin(MapBase$(K, V), _UnmodifiableMa
pMixin$(K, V)) {} | 1981 class UnmodifiableMapBase extends dart.mixin(MapBase$(K, V), _UnmodifiableMa
pMixin$(K, V)) {} |
1887 return UnmodifiableMapBase; | 1982 return UnmodifiableMapBase; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 let _MapBaseValueIterator = _MapBaseValueIterator$(); | 2041 let _MapBaseValueIterator = _MapBaseValueIterator$(); |
1947 let MapView$ = dart.generic(function(K, V) { | 2042 let MapView$ = dart.generic(function(K, V) { |
1948 class MapView extends core.Object { | 2043 class MapView extends core.Object { |
1949 MapView(map) { | 2044 MapView(map) { |
1950 this[_map] = map; | 2045 this[_map] = map; |
1951 } | 2046 } |
1952 get(key) { | 2047 get(key) { |
1953 return this[_map].get(key); | 2048 return this[_map].get(key); |
1954 } | 2049 } |
1955 set(key, value) { | 2050 set(key, value) { |
| 2051 dart.as(key, K); |
| 2052 dart.as(value, V); |
1956 this[_map].set(key, value); | 2053 this[_map].set(key, value); |
1957 } | 2054 } |
1958 addAll(other) { | 2055 addAll(other) { |
| 2056 dart.as(other, core.Map$(K, V)); |
1959 this[_map].addAll(other); | 2057 this[_map].addAll(other); |
1960 } | 2058 } |
1961 clear() { | 2059 clear() { |
1962 this[_map].clear(); | 2060 this[_map].clear(); |
1963 } | 2061 } |
1964 putIfAbsent(key, ifAbsent) { | 2062 putIfAbsent(key, ifAbsent) { |
| 2063 dart.as(key, K); |
| 2064 dart.as(ifAbsent, dart.functionType(V, [])); |
1965 return this[_map].putIfAbsent(key, ifAbsent); | 2065 return this[_map].putIfAbsent(key, ifAbsent); |
1966 } | 2066 } |
1967 containsKey(key) { | 2067 containsKey(key) { |
1968 return this[_map].containsKey(key); | 2068 return this[_map].containsKey(key); |
1969 } | 2069 } |
1970 containsValue(value) { | 2070 containsValue(value) { |
1971 return this[_map].containsValue(value); | 2071 return this[_map].containsValue(value); |
1972 } | 2072 } |
1973 forEach(action) { | 2073 forEach(action) { |
| 2074 dart.as(action, dart.functionType(dart.void, [K, V])); |
1974 this[_map].forEach(action); | 2075 this[_map].forEach(action); |
1975 } | 2076 } |
1976 get isEmpty() { | 2077 get isEmpty() { |
1977 return this[_map].isEmpty; | 2078 return this[_map].isEmpty; |
1978 } | 2079 } |
1979 get isNotEmpty() { | 2080 get isNotEmpty() { |
1980 return this[_map].isNotEmpty; | 2081 return this[_map].isNotEmpty; |
1981 } | 2082 } |
1982 get length() { | 2083 get length() { |
1983 return this[_map].length; | 2084 return this[_map].length; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 let _link = Symbol('_link'); | 2222 let _link = Symbol('_link'); |
2122 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry'); | 2223 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry'); |
2123 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { | 2224 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { |
2124 class DoubleLinkedQueueEntry extends core.Object { | 2225 class DoubleLinkedQueueEntry extends core.Object { |
2125 DoubleLinkedQueueEntry(e) { | 2226 DoubleLinkedQueueEntry(e) { |
2126 this[_element] = e; | 2227 this[_element] = e; |
2127 this[_previous] = null; | 2228 this[_previous] = null; |
2128 this[_next] = null; | 2229 this[_next] = null; |
2129 } | 2230 } |
2130 [_link](previous, next) { | 2231 [_link](previous, next) { |
| 2232 dart.as(previous, DoubleLinkedQueueEntry$(E)); |
| 2233 dart.as(next, DoubleLinkedQueueEntry$(E)); |
2131 this[_next] = next; | 2234 this[_next] = next; |
2132 this[_previous] = previous; | 2235 this[_previous] = previous; |
2133 previous[_next] = this; | 2236 previous[_next] = this; |
2134 next[_previous] = this; | 2237 next[_previous] = this; |
2135 } | 2238 } |
2136 append(e) { | 2239 append(e) { |
| 2240 dart.as(e, E); |
2137 new (DoubleLinkedQueueEntry$(E))(e)[_link](this, this[_next]); | 2241 new (DoubleLinkedQueueEntry$(E))(e)[_link](this, this[_next]); |
2138 } | 2242 } |
2139 prepend(e) { | 2243 prepend(e) { |
| 2244 dart.as(e, E); |
2140 new (DoubleLinkedQueueEntry$(E))(e)[_link](this[_previous], this); | 2245 new (DoubleLinkedQueueEntry$(E))(e)[_link](this[_previous], this); |
2141 } | 2246 } |
2142 remove() { | 2247 remove() { |
2143 this[_previous][_next] = this[_next]; | 2248 this[_previous][_next] = this[_next]; |
2144 this[_next][_previous] = this[_previous]; | 2249 this[_next][_previous] = this[_previous]; |
2145 this[_next] = null; | 2250 this[_next] = null; |
2146 this[_previous] = null; | 2251 this[_previous] = null; |
2147 return this[_element]; | 2252 return this[_element]; |
2148 } | 2253 } |
2149 [_asNonSentinelEntry]() { | 2254 [_asNonSentinelEntry]() { |
2150 return this; | 2255 return this; |
2151 } | 2256 } |
2152 previousEntry() { | 2257 previousEntry() { |
2153 return this[_previous][_asNonSentinelEntry](); | 2258 return this[_previous][_asNonSentinelEntry](); |
2154 } | 2259 } |
2155 nextEntry() { | 2260 nextEntry() { |
2156 return this[_next][_asNonSentinelEntry](); | 2261 return this[_next][_asNonSentinelEntry](); |
2157 } | 2262 } |
2158 get element() { | 2263 get element() { |
2159 return this[_element]; | 2264 return this[_element]; |
2160 } | 2265 } |
2161 set element(e) { | 2266 set element(e) { |
| 2267 dart.as(e, E); |
2162 this[_element] = e; | 2268 this[_element] = e; |
2163 } | 2269 } |
2164 } | 2270 } |
2165 return DoubleLinkedQueueEntry; | 2271 return DoubleLinkedQueueEntry; |
2166 }); | 2272 }); |
2167 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(); | 2273 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(); |
2168 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { | 2274 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { |
2169 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { | 2275 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { |
2170 _DoubleLinkedQueueEntrySentinel() { | 2276 _DoubleLinkedQueueEntrySentinel() { |
2171 super.DoubleLinkedQueueEntry(null); | 2277 super.DoubleLinkedQueueEntry(null); |
2172 this[_link](this, this); | 2278 this[_link](this, this); |
2173 } | 2279 } |
2174 remove() { | 2280 remove() { |
2175 throw _internal.IterableElementError.noElement(); | 2281 throw _internal.IterableElementError.noElement(); |
2176 } | 2282 } |
2177 [_asNonSentinelEntry]() { | 2283 [_asNonSentinelEntry]() { |
2178 return null; | 2284 return null; |
2179 } | 2285 } |
2180 set element(e) { | 2286 set element(e) { |
| 2287 dart.as(e, E); |
2181 dart.assert(false); | 2288 dart.assert(false); |
2182 } | 2289 } |
2183 get element() { | 2290 get element() { |
2184 throw _internal.IterableElementError.noElement(); | 2291 throw _internal.IterableElementError.noElement(); |
2185 } | 2292 } |
2186 } | 2293 } |
2187 return _DoubleLinkedQueueEntrySentinel; | 2294 return _DoubleLinkedQueueEntrySentinel; |
2188 }); | 2295 }); |
2189 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(); | 2296 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(); |
2190 let _sentinel = Symbol('_sentinel'); | 2297 let _sentinel = Symbol('_sentinel'); |
(...skipping 11 matching lines...) Expand all Loading... |
2202 let list = new (DoubleLinkedQueue$(E))(); | 2309 let list = new (DoubleLinkedQueue$(E))(); |
2203 for (let e of dart.as(elements, core.Iterable$(E))) { | 2310 for (let e of dart.as(elements, core.Iterable$(E))) { |
2204 list.addLast(e); | 2311 list.addLast(e); |
2205 } | 2312 } |
2206 return dart.as(list, DoubleLinkedQueue$(E)); | 2313 return dart.as(list, DoubleLinkedQueue$(E)); |
2207 } | 2314 } |
2208 get [core.$length]() { | 2315 get [core.$length]() { |
2209 return this[_elementCount]; | 2316 return this[_elementCount]; |
2210 } | 2317 } |
2211 addLast(value) { | 2318 addLast(value) { |
| 2319 dart.as(value, E); |
2212 this[_sentinel].prepend(value); | 2320 this[_sentinel].prepend(value); |
2213 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | 2321 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
2214 } | 2322 } |
2215 addFirst(value) { | 2323 addFirst(value) { |
| 2324 dart.as(value, E); |
2216 this[_sentinel].append(value); | 2325 this[_sentinel].append(value); |
2217 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | 2326 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
2218 } | 2327 } |
2219 add(value) { | 2328 add(value) { |
| 2329 dart.as(value, E); |
2220 this[_sentinel].prepend(value); | 2330 this[_sentinel].prepend(value); |
2221 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | 2331 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
2222 } | 2332 } |
2223 addAll(iterable) { | 2333 addAll(iterable) { |
| 2334 dart.as(iterable, core.Iterable$(E)); |
2224 for (let value of iterable) { | 2335 for (let value of iterable) { |
2225 this[_sentinel].prepend(value); | 2336 this[_sentinel].prepend(value); |
2226 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | 2337 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
2227 } | 2338 } |
2228 } | 2339 } |
2229 removeLast() { | 2340 removeLast() { |
2230 let result = this[_sentinel][_previous].remove(); | 2341 let result = this[_sentinel][_previous].remove(); |
2231 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | 2342 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
2232 return result; | 2343 return result; |
2233 } | 2344 } |
2234 removeFirst() { | 2345 removeFirst() { |
2235 let result = this[_sentinel][_next].remove(); | 2346 let result = this[_sentinel][_next].remove(); |
2236 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | 2347 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
2237 return result; | 2348 return result; |
2238 } | 2349 } |
2239 remove(o) { | 2350 remove(o) { |
2240 let entry = this[_sentinel][_next]; | 2351 let entry = this[_sentinel][_next]; |
2241 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { | 2352 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
2242 if (dart.equals(entry.element, o)) { | 2353 if (dart.equals(entry.element, o)) { |
2243 entry.remove(); | 2354 entry.remove(); |
2244 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | 2355 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
2245 return true; | 2356 return true; |
2246 } | 2357 } |
2247 entry = entry[_next]; | 2358 entry = entry[_next]; |
2248 } | 2359 } |
2249 return false; | 2360 return false; |
2250 } | 2361 } |
2251 [_filter](test, removeMatching) { | 2362 [_filter](test, removeMatching) { |
| 2363 dart.as(test, dart.functionType(core.bool, [E])); |
2252 let entry = this[_sentinel][_next]; | 2364 let entry = this[_sentinel][_next]; |
2253 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { | 2365 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
2254 let next = entry[_next]; | 2366 let next = entry[_next]; |
2255 if (core.identical(removeMatching, test(entry.element))) { | 2367 if (core.identical(removeMatching, test(entry.element))) { |
2256 entry.remove(); | 2368 entry.remove(); |
2257 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | 2369 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
2258 } | 2370 } |
2259 entry = next; | 2371 entry = next; |
2260 } | 2372 } |
2261 } | 2373 } |
2262 removeWhere(test) { | 2374 removeWhere(test) { |
| 2375 dart.as(test, dart.functionType(core.bool, [E])); |
2263 this[_filter](test, true); | 2376 this[_filter](test, true); |
2264 } | 2377 } |
2265 retainWhere(test) { | 2378 retainWhere(test) { |
| 2379 dart.as(test, dart.functionType(core.bool, [E])); |
2266 this[_filter](test, false); | 2380 this[_filter](test, false); |
2267 } | 2381 } |
2268 get [core.$first]() { | 2382 get [core.$first]() { |
2269 return this[_sentinel][_next].element; | 2383 return this[_sentinel][_next].element; |
2270 } | 2384 } |
2271 get [core.$last]() { | 2385 get [core.$last]() { |
2272 return this[_sentinel][_previous].element; | 2386 return this[_sentinel][_previous].element; |
2273 } | 2387 } |
2274 get [core.$single]() { | 2388 get [core.$single]() { |
2275 if (core.identical(this[_sentinel][_next], this[_sentinel][_previous]))
{ | 2389 if (core.identical(this[_sentinel][_next], this[_sentinel][_previous]))
{ |
2276 return this[_sentinel][_next].element; | 2390 return this[_sentinel][_next].element; |
2277 } | 2391 } |
2278 throw _internal.IterableElementError.tooMany(); | 2392 throw _internal.IterableElementError.tooMany(); |
2279 } | 2393 } |
2280 lastEntry() { | 2394 lastEntry() { |
2281 return this[_sentinel].previousEntry(); | 2395 return this[_sentinel].previousEntry(); |
2282 } | 2396 } |
2283 firstEntry() { | 2397 firstEntry() { |
2284 return this[_sentinel].nextEntry(); | 2398 return this[_sentinel].nextEntry(); |
2285 } | 2399 } |
2286 get [core.$isEmpty]() { | 2400 get [core.$isEmpty]() { |
2287 return core.identical(this[_sentinel][_next], this[_sentinel]); | 2401 return core.identical(this[_sentinel][_next], this[_sentinel]); |
2288 } | 2402 } |
2289 clear() { | 2403 clear() { |
2290 this[_sentinel][_next] = this[_sentinel]; | 2404 this[_sentinel][_next] = this[_sentinel]; |
2291 this[_sentinel][_previous] = this[_sentinel]; | 2405 this[_sentinel][_previous] = this[_sentinel]; |
2292 this[_elementCount] = 0; | 2406 this[_elementCount] = 0; |
2293 } | 2407 } |
2294 forEachEntry(f) { | 2408 forEachEntry(f) { |
| 2409 dart.as(f, dart.functionType(dart.void, [DoubleLinkedQueueEntry$(E)])); |
2295 let entry = this[_sentinel][_next]; | 2410 let entry = this[_sentinel][_next]; |
2296 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { | 2411 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
2297 let nextEntry = entry[_next]; | 2412 let nextEntry = entry[_next]; |
2298 f(entry); | 2413 f(entry); |
2299 entry = nextEntry; | 2414 entry = nextEntry; |
2300 } | 2415 } |
2301 } | 2416 } |
2302 get [core.$iterator]() { | 2417 get [core.$iterator]() { |
2303 return new (_DoubleLinkedQueueIterator$(E))(this[_sentinel]); | 2418 return new (_DoubleLinkedQueueIterator$(E))(this[_sentinel]); |
2304 } | 2419 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 for (let element of dart.as(elements, core.Iterable$(E))) { | 2498 for (let element of dart.as(elements, core.Iterable$(E))) { |
2384 result.addLast(element); | 2499 result.addLast(element); |
2385 } | 2500 } |
2386 return result; | 2501 return result; |
2387 } | 2502 } |
2388 } | 2503 } |
2389 get [core.$iterator]() { | 2504 get [core.$iterator]() { |
2390 return new (_ListQueueIterator$(E))(this); | 2505 return new (_ListQueueIterator$(E))(this); |
2391 } | 2506 } |
2392 [core.$forEach](action) { | 2507 [core.$forEach](action) { |
| 2508 dart.as(action, dart.functionType(dart.void, [E])); |
2393 let modificationCount = this[_modificationCount]; | 2509 let modificationCount = this[_modificationCount]; |
2394 for (let i = this[_head]; i != this[_tail]; i = dart.notNull(i) + 1 & da
rt.notNull(this[_table][core.$length]) - 1) { | 2510 for (let i = this[_head]; i != this[_tail]; i = dart.notNull(i) + 1 & da
rt.notNull(this[_table][core.$length]) - 1) { |
2395 action(this[_table][core.$get](i)); | 2511 action(this[_table][core.$get](i)); |
2396 this[_checkModification](modificationCount); | 2512 this[_checkModification](modificationCount); |
2397 } | 2513 } |
2398 } | 2514 } |
2399 get [core.$isEmpty]() { | 2515 get [core.$isEmpty]() { |
2400 return this[_head] == this[_tail]; | 2516 return this[_head] == this[_tail]; |
2401 } | 2517 } |
2402 get [core.$length]() { | 2518 get [core.$length]() { |
(...skipping 26 matching lines...) Expand all Loading... |
2429 if (growable) { | 2545 if (growable) { |
2430 list = new (core.List$(E))(); | 2546 list = new (core.List$(E))(); |
2431 list[core.$length] = this[core.$length]; | 2547 list[core.$length] = this[core.$length]; |
2432 } else { | 2548 } else { |
2433 list = new (core.List$(E))(this[core.$length]); | 2549 list = new (core.List$(E))(this[core.$length]); |
2434 } | 2550 } |
2435 this[_writeToList](list); | 2551 this[_writeToList](list); |
2436 return list; | 2552 return list; |
2437 } | 2553 } |
2438 add(element) { | 2554 add(element) { |
| 2555 dart.as(element, E); |
2439 this[_add](element); | 2556 this[_add](element); |
2440 } | 2557 } |
2441 addAll(elements) { | 2558 addAll(elements) { |
| 2559 dart.as(elements, core.Iterable$(E)); |
2442 if (dart.is(elements, core.List)) { | 2560 if (dart.is(elements, core.List)) { |
2443 let list = dart.as(elements, core.List); | 2561 let list = dart.as(elements, core.List); |
2444 let addCount = list[core.$length]; | 2562 let addCount = list[core.$length]; |
2445 let length = this[core.$length]; | 2563 let length = this[core.$length]; |
2446 if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this
[_table][core.$length])) { | 2564 if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this
[_table][core.$length])) { |
2447 this[_preGrow](dart.notNull(length) + dart.notNull(addCount)); | 2565 this[_preGrow](dart.notNull(length) + dart.notNull(addCount)); |
2448 this[_table][core.$setRange](length, dart.notNull(length) + dart.not
Null(addCount), dart.as(list, core.Iterable$(E)), 0); | 2566 this[_table][core.$setRange](length, dart.notNull(length) + dart.not
Null(addCount), dart.as(list, core.Iterable$(E)), 0); |
2449 this[_tail] = dart.notNull(this[_tail]) + dart.notNull(addCount); | 2567 this[_tail] = dart.notNull(this[_tail]) + dart.notNull(addCount); |
2450 } else { | 2568 } else { |
2451 let endSpace = dart.notNull(this[_table][core.$length]) - dart.notNu
ll(this[_tail]); | 2569 let endSpace = dart.notNull(this[_table][core.$length]) - dart.notNu
ll(this[_tail]); |
(...skipping 18 matching lines...) Expand all Loading... |
2470 let element = this[_table][core.$get](i); | 2588 let element = this[_table][core.$get](i); |
2471 if (dart.equals(element, object)) { | 2589 if (dart.equals(element, object)) { |
2472 this[_remove](i); | 2590 this[_remove](i); |
2473 this[_modificationCount] = dart.notNull(this[_modificationCount]) +
1; | 2591 this[_modificationCount] = dart.notNull(this[_modificationCount]) +
1; |
2474 return true; | 2592 return true; |
2475 } | 2593 } |
2476 } | 2594 } |
2477 return false; | 2595 return false; |
2478 } | 2596 } |
2479 [_filterWhere](test, removeMatching) { | 2597 [_filterWhere](test, removeMatching) { |
| 2598 dart.as(test, dart.functionType(core.bool, [E])); |
2480 let index = this[_head]; | 2599 let index = this[_head]; |
2481 let modificationCount = this[_modificationCount]; | 2600 let modificationCount = this[_modificationCount]; |
2482 let i = this[_head]; | 2601 let i = this[_head]; |
2483 while (i != this[_tail]) { | 2602 while (i != this[_tail]) { |
2484 let element = this[_table][core.$get](i); | 2603 let element = this[_table][core.$get](i); |
2485 let remove = core.identical(removeMatching, test(element)); | 2604 let remove = core.identical(removeMatching, test(element)); |
2486 this[_checkModification](modificationCount); | 2605 this[_checkModification](modificationCount); |
2487 if (remove) { | 2606 if (remove) { |
2488 i = this[_remove](i); | 2607 i = this[_remove](i); |
2489 modificationCount = this[_modificationCount] = dart.notNull(this[_mo
dificationCount]) + 1; | 2608 modificationCount = this[_modificationCount] = dart.notNull(this[_mo
dificationCount]) + 1; |
2490 } else { | 2609 } else { |
2491 i = dart.notNull(i) + 1 & dart.notNull(this[_table][core.$length]) -
1; | 2610 i = dart.notNull(i) + 1 & dart.notNull(this[_table][core.$length]) -
1; |
2492 } | 2611 } |
2493 } | 2612 } |
2494 } | 2613 } |
2495 removeWhere(test) { | 2614 removeWhere(test) { |
| 2615 dart.as(test, dart.functionType(core.bool, [E])); |
2496 this[_filterWhere](test, true); | 2616 this[_filterWhere](test, true); |
2497 } | 2617 } |
2498 retainWhere(test) { | 2618 retainWhere(test) { |
| 2619 dart.as(test, dart.functionType(core.bool, [E])); |
2499 this[_filterWhere](test, false); | 2620 this[_filterWhere](test, false); |
2500 } | 2621 } |
2501 clear() { | 2622 clear() { |
2502 if (this[_head] != this[_tail]) { | 2623 if (this[_head] != this[_tail]) { |
2503 for (let i = this[_head]; i != this[_tail]; i = dart.notNull(i) + 1 &
dart.notNull(this[_table][core.$length]) - 1) { | 2624 for (let i = this[_head]; i != this[_tail]; i = dart.notNull(i) + 1 &
dart.notNull(this[_table][core.$length]) - 1) { |
2504 this[_table][core.$set](i, null); | 2625 this[_table][core.$set](i, null); |
2505 } | 2626 } |
2506 this[_head] = this[_tail] = 0; | 2627 this[_head] = this[_tail] = 0; |
2507 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 2628 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
2508 } | 2629 } |
2509 } | 2630 } |
2510 toString() { | 2631 toString() { |
2511 return IterableBase.iterableToFullString(this, "{", "}"); | 2632 return IterableBase.iterableToFullString(this, "{", "}"); |
2512 } | 2633 } |
2513 addLast(element) { | 2634 addLast(element) { |
| 2635 dart.as(element, E); |
2514 this[_add](element); | 2636 this[_add](element); |
2515 } | 2637 } |
2516 addFirst(element) { | 2638 addFirst(element) { |
| 2639 dart.as(element, E); |
2517 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][
core.$length]) - 1; | 2640 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][
core.$length]) - 1; |
2518 this[_table][core.$set](this[_head], element); | 2641 this[_table][core.$set](this[_head], element); |
2519 if (this[_head] == this[_tail]) | 2642 if (this[_head] == this[_tail]) |
2520 this[_grow](); | 2643 this[_grow](); |
2521 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 2644 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
2522 } | 2645 } |
2523 removeFirst() { | 2646 removeFirst() { |
2524 if (this[_head] == this[_tail]) | 2647 if (this[_head] == this[_tail]) |
2525 throw _internal.IterableElementError.noElement(); | 2648 throw _internal.IterableElementError.noElement(); |
2526 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 2649 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
(...skipping 23 matching lines...) Expand all Loading... |
2550 return number; | 2673 return number; |
2551 number = nextNumber; | 2674 number = nextNumber; |
2552 } | 2675 } |
2553 } | 2676 } |
2554 [_checkModification](expectedModificationCount) { | 2677 [_checkModification](expectedModificationCount) { |
2555 if (expectedModificationCount != this[_modificationCount]) { | 2678 if (expectedModificationCount != this[_modificationCount]) { |
2556 throw new core.ConcurrentModificationError(this); | 2679 throw new core.ConcurrentModificationError(this); |
2557 } | 2680 } |
2558 } | 2681 } |
2559 [_add](element) { | 2682 [_add](element) { |
| 2683 dart.as(element, E); |
2560 this[_table][core.$set](this[_tail], element); | 2684 this[_table][core.$set](this[_tail], element); |
2561 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][
core.$length]) - 1; | 2685 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][
core.$length]) - 1; |
2562 if (this[_head] == this[_tail]) | 2686 if (this[_head] == this[_tail]) |
2563 this[_grow](); | 2687 this[_grow](); |
2564 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 2688 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
2565 } | 2689 } |
2566 [_remove](offset) { | 2690 [_remove](offset) { |
2567 let mask = dart.notNull(this[_table][core.$length]) - 1; | 2691 let mask = dart.notNull(this[_table][core.$length]) - 1; |
2568 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d
art.notNull(mask); | 2692 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d
art.notNull(mask); |
2569 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar
t.notNull(mask); | 2693 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar
t.notNull(mask); |
(...skipping 22 matching lines...) Expand all Loading... |
2592 [_grow]() { | 2716 [_grow]() { |
2593 let newTable = new (core.List$(E))(dart.notNull(this[_table][core.$lengt
h]) * 2); | 2717 let newTable = new (core.List$(E))(dart.notNull(this[_table][core.$lengt
h]) * 2); |
2594 let split = dart.notNull(this[_table][core.$length]) - dart.notNull(this
[_head]); | 2718 let split = dart.notNull(this[_table][core.$length]) - dart.notNull(this
[_head]); |
2595 newTable[core.$setRange](0, split, this[_table], this[_head]); | 2719 newTable[core.$setRange](0, split, this[_table], this[_head]); |
2596 newTable[core.$setRange](split, dart.notNull(split) + dart.notNull(this[
_head]), this[_table], 0); | 2720 newTable[core.$setRange](split, dart.notNull(split) + dart.notNull(this[
_head]), this[_table], 0); |
2597 this[_head] = 0; | 2721 this[_head] = 0; |
2598 this[_tail] = this[_table][core.$length]; | 2722 this[_tail] = this[_table][core.$length]; |
2599 this[_table] = newTable; | 2723 this[_table] = newTable; |
2600 } | 2724 } |
2601 [_writeToList](target) { | 2725 [_writeToList](target) { |
| 2726 dart.as(target, core.List$(E)); |
2602 dart.assert(dart.notNull(target[core.$length]) >= dart.notNull(this[core
.$length])); | 2727 dart.assert(dart.notNull(target[core.$length]) >= dart.notNull(this[core
.$length])); |
2603 if (dart.notNull(this[_head]) <= dart.notNull(this[_tail])) { | 2728 if (dart.notNull(this[_head]) <= dart.notNull(this[_tail])) { |
2604 let length = dart.notNull(this[_tail]) - dart.notNull(this[_head]); | 2729 let length = dart.notNull(this[_tail]) - dart.notNull(this[_head]); |
2605 target[core.$setRange](0, length, this[_table], this[_head]); | 2730 target[core.$setRange](0, length, this[_table], this[_head]); |
2606 return length; | 2731 return length; |
2607 } else { | 2732 } else { |
2608 let firstPartSize = dart.notNull(this[_table][core.$length]) - dart.no
tNull(this[_head]); | 2733 let firstPartSize = dart.notNull(this[_table][core.$length]) - dart.no
tNull(this[_head]); |
2609 target[core.$setRange](0, firstPartSize, this[_table], this[_head]); | 2734 target[core.$setRange](0, firstPartSize, this[_table], this[_head]); |
2610 target[core.$setRange](firstPartSize, dart.notNull(firstPartSize) + da
rt.notNull(this[_tail]), this[_table], 0); | 2735 target[core.$setRange](firstPartSize, dart.notNull(firstPartSize) + da
rt.notNull(this[_tail]), this[_table], 0); |
2611 return dart.notNull(this[_tail]) + dart.notNull(firstPartSize); | 2736 return dart.notNull(this[_tail]) + dart.notNull(firstPartSize); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2698 let _SplayTree$ = dart.generic(function(K) { | 2823 let _SplayTree$ = dart.generic(function(K) { |
2699 class _SplayTree extends core.Object { | 2824 class _SplayTree extends core.Object { |
2700 _SplayTree() { | 2825 _SplayTree() { |
2701 this[_dummy] = new (_SplayTreeNode$(K))(null); | 2826 this[_dummy] = new (_SplayTreeNode$(K))(null); |
2702 this[_root] = null; | 2827 this[_root] = null; |
2703 this[_count] = 0; | 2828 this[_count] = 0; |
2704 this[_modificationCount] = 0; | 2829 this[_modificationCount] = 0; |
2705 this[_splayCount] = 0; | 2830 this[_splayCount] = 0; |
2706 } | 2831 } |
2707 [_splay](key) { | 2832 [_splay](key) { |
| 2833 dart.as(key, K); |
2708 if (this[_root] == null) | 2834 if (this[_root] == null) |
2709 return -1; | 2835 return -1; |
2710 let left = this[_dummy]; | 2836 let left = this[_dummy]; |
2711 let right = this[_dummy]; | 2837 let right = this[_dummy]; |
2712 let current = this[_root]; | 2838 let current = this[_root]; |
2713 let comp = null; | 2839 let comp = null; |
2714 while (true) { | 2840 while (true) { |
2715 comp = this[_compare](current.key, key); | 2841 comp = this[_compare](current.key, key); |
2716 if (dart.notNull(comp) > 0) { | 2842 if (dart.notNull(comp) > 0) { |
2717 if (current.left == null) | 2843 if (current.left == null) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2751 right.left = current.right; | 2877 right.left = current.right; |
2752 current.left = this[_dummy].right; | 2878 current.left = this[_dummy].right; |
2753 current.right = this[_dummy].left; | 2879 current.right = this[_dummy].left; |
2754 this[_root] = current; | 2880 this[_root] = current; |
2755 this[_dummy].right = null; | 2881 this[_dummy].right = null; |
2756 this[_dummy].left = null; | 2882 this[_dummy].left = null; |
2757 this[_splayCount] = dart.notNull(this[_splayCount]) + 1; | 2883 this[_splayCount] = dart.notNull(this[_splayCount]) + 1; |
2758 return comp; | 2884 return comp; |
2759 } | 2885 } |
2760 [_splayMin](node) { | 2886 [_splayMin](node) { |
| 2887 dart.as(node, _SplayTreeNode$(K)); |
2761 let current = node; | 2888 let current = node; |
2762 while (current.left != null) { | 2889 while (current.left != null) { |
2763 let left = current.left; | 2890 let left = current.left; |
2764 current.left = left.right; | 2891 current.left = left.right; |
2765 left.right = current; | 2892 left.right = current; |
2766 current = left; | 2893 current = left; |
2767 } | 2894 } |
2768 return dart.as(current, _SplayTreeNode$(K)); | 2895 return dart.as(current, _SplayTreeNode$(K)); |
2769 } | 2896 } |
2770 [_splayMax](node) { | 2897 [_splayMax](node) { |
| 2898 dart.as(node, _SplayTreeNode$(K)); |
2771 let current = node; | 2899 let current = node; |
2772 while (current.right != null) { | 2900 while (current.right != null) { |
2773 let right = current.right; | 2901 let right = current.right; |
2774 current.right = right.left; | 2902 current.right = right.left; |
2775 right.left = current; | 2903 right.left = current; |
2776 current = right; | 2904 current = right; |
2777 } | 2905 } |
2778 return dart.as(current, _SplayTreeNode$(K)); | 2906 return dart.as(current, _SplayTreeNode$(K)); |
2779 } | 2907 } |
2780 [_remove](key) { | 2908 [_remove](key) { |
| 2909 dart.as(key, K); |
2781 if (this[_root] == null) | 2910 if (this[_root] == null) |
2782 return null; | 2911 return null; |
2783 let comp = this[_splay](key); | 2912 let comp = this[_splay](key); |
2784 if (comp != 0) | 2913 if (comp != 0) |
2785 return null; | 2914 return null; |
2786 let result = this[_root]; | 2915 let result = this[_root]; |
2787 this[_count] = dart.notNull(this[_count]) - 1; | 2916 this[_count] = dart.notNull(this[_count]) - 1; |
2788 if (this[_root].left == null) { | 2917 if (this[_root].left == null) { |
2789 this[_root] = this[_root].right; | 2918 this[_root] = this[_root].right; |
2790 } else { | 2919 } else { |
2791 let right = this[_root].right; | 2920 let right = this[_root].right; |
2792 this[_root] = this[_splayMax](this[_root].left); | 2921 this[_root] = this[_splayMax](this[_root].left); |
2793 this[_root].right = right; | 2922 this[_root].right = right; |
2794 } | 2923 } |
2795 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 2924 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
2796 return result; | 2925 return result; |
2797 } | 2926 } |
2798 [_addNewRoot](node, comp) { | 2927 [_addNewRoot](node, comp) { |
| 2928 dart.as(node, _SplayTreeNode$(K)); |
2799 this[_count] = dart.notNull(this[_count]) + 1; | 2929 this[_count] = dart.notNull(this[_count]) + 1; |
2800 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 2930 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
2801 if (this[_root] == null) { | 2931 if (this[_root] == null) { |
2802 this[_root] = node; | 2932 this[_root] = node; |
2803 return; | 2933 return; |
2804 } | 2934 } |
2805 if (dart.notNull(comp) < 0) { | 2935 if (dart.notNull(comp) < 0) { |
2806 node.left = this[_root]; | 2936 node.left = this[_root]; |
2807 node.right = this[_root].right; | 2937 node.right = this[_root].right; |
2808 this[_root].right = null; | 2938 this[_root].right = null; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2879 fromIterables(keys, values, compare, isValidKey) { | 3009 fromIterables(keys, values, compare, isValidKey) { |
2880 if (compare === void 0) | 3010 if (compare === void 0) |
2881 compare = null; | 3011 compare = null; |
2882 if (isValidKey === void 0) | 3012 if (isValidKey === void 0) |
2883 isValidKey = null; | 3013 isValidKey = null; |
2884 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); | 3014 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); |
2885 Maps._fillMapWithIterables(map, keys, values); | 3015 Maps._fillMapWithIterables(map, keys, values); |
2886 return map; | 3016 return map; |
2887 } | 3017 } |
2888 [_compare](key1, key2) { | 3018 [_compare](key1, key2) { |
| 3019 dart.as(key1, K); |
| 3020 dart.as(key2, K); |
2889 return this[_comparator](key1, key2); | 3021 return this[_comparator](key1, key2); |
2890 } | 3022 } |
2891 _internal() { | 3023 _internal() { |
2892 this[_comparator] = null; | 3024 this[_comparator] = null; |
2893 this[_validKey] = null; | 3025 this[_validKey] = null; |
2894 super._SplayTree(); | 3026 super._SplayTree(); |
2895 } | 3027 } |
2896 get(key) { | 3028 get(key) { |
2897 if (key == null) | 3029 if (key == null) |
2898 throw new core.ArgumentError(key); | 3030 throw new core.ArgumentError(key); |
(...skipping 10 matching lines...) Expand all Loading... |
2909 } | 3041 } |
2910 remove(key) { | 3042 remove(key) { |
2911 if (!dart.notNull(dart.dcall(this[_validKey], key))) | 3043 if (!dart.notNull(dart.dcall(this[_validKey], key))) |
2912 return null; | 3044 return null; |
2913 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode)
; | 3045 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode)
; |
2914 if (mapRoot != null) | 3046 if (mapRoot != null) |
2915 return dart.as(mapRoot.value, V); | 3047 return dart.as(mapRoot.value, V); |
2916 return null; | 3048 return null; |
2917 } | 3049 } |
2918 set(key, value) { | 3050 set(key, value) { |
| 3051 dart.as(key, K); |
| 3052 dart.as(value, V); |
2919 if (key == null) | 3053 if (key == null) |
2920 throw new core.ArgumentError(key); | 3054 throw new core.ArgumentError(key); |
2921 let comp = this[_splay](key); | 3055 let comp = this[_splay](key); |
2922 if (comp == 0) { | 3056 if (comp == 0) { |
2923 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); | 3057 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
2924 mapRoot.value = value; | 3058 mapRoot.value = value; |
2925 return; | 3059 return; |
2926 } | 3060 } |
2927 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value),
comp); | 3061 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value),
comp); |
2928 } | 3062 } |
2929 putIfAbsent(key, ifAbsent) { | 3063 putIfAbsent(key, ifAbsent) { |
| 3064 dart.as(key, K); |
| 3065 dart.as(ifAbsent, dart.functionType(V, [])); |
2930 if (key == null) | 3066 if (key == null) |
2931 throw new core.ArgumentError(key); | 3067 throw new core.ArgumentError(key); |
2932 let comp = this[_splay](key); | 3068 let comp = this[_splay](key); |
2933 if (comp == 0) { | 3069 if (comp == 0) { |
2934 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); | 3070 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
2935 return dart.as(mapRoot.value, V); | 3071 return dart.as(mapRoot.value, V); |
2936 } | 3072 } |
2937 let modificationCount = this[_modificationCount]; | 3073 let modificationCount = this[_modificationCount]; |
2938 let splayCount = this[_splayCount]; | 3074 let splayCount = this[_splayCount]; |
2939 let value = ifAbsent(); | 3075 let value = ifAbsent(); |
2940 if (modificationCount != this[_modificationCount]) { | 3076 if (modificationCount != this[_modificationCount]) { |
2941 throw new core.ConcurrentModificationError(this); | 3077 throw new core.ConcurrentModificationError(this); |
2942 } | 3078 } |
2943 if (splayCount != this[_splayCount]) { | 3079 if (splayCount != this[_splayCount]) { |
2944 comp = this[_splay](key); | 3080 comp = this[_splay](key); |
2945 dart.assert(comp != 0); | 3081 dart.assert(comp != 0); |
2946 } | 3082 } |
2947 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value),
comp); | 3083 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value),
comp); |
2948 return value; | 3084 return value; |
2949 } | 3085 } |
2950 addAll(other) { | 3086 addAll(other) { |
| 3087 dart.as(other, core.Map$(K, V)); |
2951 other.forEach(((key, value) => { | 3088 other.forEach(((key, value) => { |
| 3089 dart.as(key, K); |
| 3090 dart.as(value, V); |
2952 this.set(key, value); | 3091 this.set(key, value); |
2953 }).bind(this)); | 3092 }).bind(this)); |
2954 } | 3093 } |
2955 get isEmpty() { | 3094 get isEmpty() { |
2956 return this[_root] == null; | 3095 return this[_root] == null; |
2957 } | 3096 } |
2958 get isNotEmpty() { | 3097 get isNotEmpty() { |
2959 return !dart.notNull(this.isEmpty); | 3098 return !dart.notNull(this.isEmpty); |
2960 } | 3099 } |
2961 forEach(f) { | 3100 forEach(f) { |
| 3101 dart.as(f, dart.functionType(dart.void, [K, V])); |
2962 let nodes = new (_SplayTreeNodeIterator$(K))(this); | 3102 let nodes = new (_SplayTreeNodeIterator$(K))(this); |
2963 while (nodes.moveNext()) { | 3103 while (nodes.moveNext()) { |
2964 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V)); | 3104 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V)); |
2965 f(node.key, node.value); | 3105 f(node.key, node.value); |
2966 } | 3106 } |
2967 } | 3107 } |
2968 get length() { | 3108 get length() { |
2969 return this[_count]; | 3109 return this[_count]; |
2970 } | 3110 } |
2971 clear() { | 3111 clear() { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3006 if (this[_root] == null) | 3146 if (this[_root] == null) |
3007 return null; | 3147 return null; |
3008 return dart.as(this[_first].key, K); | 3148 return dart.as(this[_first].key, K); |
3009 } | 3149 } |
3010 lastKey() { | 3150 lastKey() { |
3011 if (this[_root] == null) | 3151 if (this[_root] == null) |
3012 return null; | 3152 return null; |
3013 return dart.as(this[_last].key, K); | 3153 return dart.as(this[_last].key, K); |
3014 } | 3154 } |
3015 lastKeyBefore(key) { | 3155 lastKeyBefore(key) { |
| 3156 dart.as(key, K); |
3016 if (key == null) | 3157 if (key == null) |
3017 throw new core.ArgumentError(key); | 3158 throw new core.ArgumentError(key); |
3018 if (this[_root] == null) | 3159 if (this[_root] == null) |
3019 return null; | 3160 return null; |
3020 let comp = this[_splay](key); | 3161 let comp = this[_splay](key); |
3021 if (dart.notNull(comp) < 0) | 3162 if (dart.notNull(comp) < 0) |
3022 return this[_root].key; | 3163 return this[_root].key; |
3023 let node = this[_root].left; | 3164 let node = this[_root].left; |
3024 if (node == null) | 3165 if (node == null) |
3025 return null; | 3166 return null; |
3026 while (node.right != null) { | 3167 while (node.right != null) { |
3027 node = node.right; | 3168 node = node.right; |
3028 } | 3169 } |
3029 return node.key; | 3170 return node.key; |
3030 } | 3171 } |
3031 firstKeyAfter(key) { | 3172 firstKeyAfter(key) { |
| 3173 dart.as(key, K); |
3032 if (key == null) | 3174 if (key == null) |
3033 throw new core.ArgumentError(key); | 3175 throw new core.ArgumentError(key); |
3034 if (this[_root] == null) | 3176 if (this[_root] == null) |
3035 return null; | 3177 return null; |
3036 let comp = this[_splay](key); | 3178 let comp = this[_splay](key); |
3037 if (dart.notNull(comp) > 0) | 3179 if (dart.notNull(comp) > 0) |
3038 return this[_root].key; | 3180 return this[_root].key; |
3039 let node = this[_root].right; | 3181 let node = this[_root].right; |
3040 if (node == null) | 3182 if (node == null) |
3041 return null; | 3183 return null; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3233 compare = null; | 3375 compare = null; |
3234 if (isValidKey === void 0) | 3376 if (isValidKey === void 0) |
3235 isValidKey = null; | 3377 isValidKey = null; |
3236 let result = new (SplayTreeSet$(E))(compare, isValidKey); | 3378 let result = new (SplayTreeSet$(E))(compare, isValidKey); |
3237 for (let element of dart.as(elements, core.Iterable$(E))) { | 3379 for (let element of dart.as(elements, core.Iterable$(E))) { |
3238 result.add(element); | 3380 result.add(element); |
3239 } | 3381 } |
3240 return result; | 3382 return result; |
3241 } | 3383 } |
3242 [_compare](e1, e2) { | 3384 [_compare](e1, e2) { |
| 3385 dart.as(e1, E); |
| 3386 dart.as(e2, E); |
3243 return dart.dcall(this[_comparator], e1, e2); | 3387 return dart.dcall(this[_comparator], e1, e2); |
3244 } | 3388 } |
3245 get [core.$iterator]() { | 3389 get [core.$iterator]() { |
3246 return new (_SplayTreeKeyIterator$(E))(this); | 3390 return new (_SplayTreeKeyIterator$(E))(this); |
3247 } | 3391 } |
3248 get [core.$length]() { | 3392 get [core.$length]() { |
3249 return this[_count]; | 3393 return this[_count]; |
3250 } | 3394 } |
3251 get [core.$isEmpty]() { | 3395 get [core.$isEmpty]() { |
3252 return this[_root] == null; | 3396 return this[_root] == null; |
(...skipping 15 matching lines...) Expand all Loading... |
3268 if (this[_count] == 0) | 3412 if (this[_count] == 0) |
3269 throw _internal.IterableElementError.noElement(); | 3413 throw _internal.IterableElementError.noElement(); |
3270 if (dart.notNull(this[_count]) > 1) | 3414 if (dart.notNull(this[_count]) > 1) |
3271 throw _internal.IterableElementError.tooMany(); | 3415 throw _internal.IterableElementError.tooMany(); |
3272 return this[_root].key; | 3416 return this[_root].key; |
3273 } | 3417 } |
3274 [core.$contains](object) { | 3418 [core.$contains](object) { |
3275 return dart.notNull(dart.dcall(this[_validKey], object)) && this[_splay]
(dart.as(object, E)) == 0; | 3419 return dart.notNull(dart.dcall(this[_validKey], object)) && this[_splay]
(dart.as(object, E)) == 0; |
3276 } | 3420 } |
3277 add(element) { | 3421 add(element) { |
| 3422 dart.as(element, E); |
3278 let compare = this[_splay](element); | 3423 let compare = this[_splay](element); |
3279 if (compare == 0) | 3424 if (compare == 0) |
3280 return false; | 3425 return false; |
3281 this[_addNewRoot](new (_SplayTreeNode$(E))(element), compare); | 3426 this[_addNewRoot](new (_SplayTreeNode$(E))(element), compare); |
3282 return true; | 3427 return true; |
3283 } | 3428 } |
3284 remove(object) { | 3429 remove(object) { |
3285 if (!dart.notNull(dart.dcall(this[_validKey], object))) | 3430 if (!dart.notNull(dart.dcall(this[_validKey], object))) |
3286 return false; | 3431 return false; |
3287 return this[_remove](dart.as(object, E)) != null; | 3432 return this[_remove](dart.as(object, E)) != null; |
3288 } | 3433 } |
3289 addAll(elements) { | 3434 addAll(elements) { |
| 3435 dart.as(elements, core.Iterable$(E)); |
3290 for (let element of elements) { | 3436 for (let element of elements) { |
3291 let compare = this[_splay](element); | 3437 let compare = this[_splay](element); |
3292 if (compare != 0) { | 3438 if (compare != 0) { |
3293 this[_addNewRoot](new (_SplayTreeNode$(E))(element), compare); | 3439 this[_addNewRoot](new (_SplayTreeNode$(E))(element), compare); |
3294 } | 3440 } |
3295 } | 3441 } |
3296 } | 3442 } |
3297 removeAll(elements) { | 3443 removeAll(elements) { |
3298 for (let element of elements) { | 3444 for (let element of elements) { |
3299 if (dart.dcall(this[_validKey], element)) | 3445 if (dart.dcall(this[_validKey], element)) |
(...skipping 18 matching lines...) Expand all Loading... |
3318 } | 3464 } |
3319 lookup(object) { | 3465 lookup(object) { |
3320 if (!dart.notNull(dart.dcall(this[_validKey], object))) | 3466 if (!dart.notNull(dart.dcall(this[_validKey], object))) |
3321 return null; | 3467 return null; |
3322 let comp = this[_splay](dart.as(object, E)); | 3468 let comp = this[_splay](dart.as(object, E)); |
3323 if (comp != 0) | 3469 if (comp != 0) |
3324 return null; | 3470 return null; |
3325 return this[_root].key; | 3471 return this[_root].key; |
3326 } | 3472 } |
3327 intersection(other) { | 3473 intersection(other) { |
| 3474 dart.as(other, core.Set$(E)); |
3328 let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.func
tionType(core.int, [E, E])), this[_validKey]); | 3475 let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.func
tionType(core.int, [E, E])), this[_validKey]); |
3329 for (let element of this) { | 3476 for (let element of this) { |
3330 if (other[core.$contains](element)) | 3477 if (other[core.$contains](element)) |
3331 result.add(element); | 3478 result.add(element); |
3332 } | 3479 } |
3333 return result; | 3480 return result; |
3334 } | 3481 } |
3335 difference(other) { | 3482 difference(other) { |
| 3483 dart.as(other, core.Set$(E)); |
3336 let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.func
tionType(core.int, [E, E])), this[_validKey]); | 3484 let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.func
tionType(core.int, [E, E])), this[_validKey]); |
3337 for (let element of this) { | 3485 for (let element of this) { |
3338 if (!dart.notNull(other[core.$contains](element))) | 3486 if (!dart.notNull(other[core.$contains](element))) |
3339 result.add(element); | 3487 result.add(element); |
3340 } | 3488 } |
3341 return result; | 3489 return result; |
3342 } | 3490 } |
3343 union(other) { | 3491 union(other) { |
| 3492 dart.as(other, core.Set$(E)); |
3344 let _ = this[_clone](); | 3493 let _ = this[_clone](); |
3345 _.addAll(other); | 3494 _.addAll(other); |
3346 return _; | 3495 return _; |
3347 } | 3496 } |
3348 [_clone]() { | 3497 [_clone]() { |
3349 let set = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.functio
nType(core.int, [E, E])), this[_validKey]); | 3498 let set = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.functio
nType(core.int, [E, E])), this[_validKey]); |
3350 set[_count] = this[_count]; | 3499 set[_count] = this[_count]; |
3351 set[_root] = this[_copyNode](this[_root]); | 3500 set[_root] = this[_copyNode](this[_root]); |
3352 return set; | 3501 return set; |
3353 } | 3502 } |
3354 [_copyNode](node) { | 3503 [_copyNode](node) { |
| 3504 dart.as(node, _SplayTreeNode$(E)); |
3355 if (node == null) | 3505 if (node == null) |
3356 return null; | 3506 return null; |
3357 let _ = new (_SplayTreeNode$(E))(node.key); | 3507 let _ = new (_SplayTreeNode$(E))(node.key); |
3358 _.left = this[_copyNode](node.left); | 3508 _.left = this[_copyNode](node.left); |
3359 _.right = this[_copyNode](node.right); | 3509 _.right = this[_copyNode](node.right); |
3360 return _; | 3510 return _; |
3361 } | 3511 } |
3362 clear() { | 3512 clear() { |
3363 this[_clear](); | 3513 this[_clear](); |
3364 } | 3514 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3435 let rest = this[_rest]; | 3585 let rest = this[_rest]; |
3436 if (rest == null) | 3586 if (rest == null) |
3437 return false; | 3587 return false; |
3438 let bucket = this[_getBucket](rest, key); | 3588 let bucket = this[_getBucket](rest, key); |
3439 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; | 3589 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; |
3440 } | 3590 } |
3441 containsValue(value) { | 3591 containsValue(value) { |
3442 return this[_computeKeys]()[core.$any]((each => dart.equals(this.get(eac
h), value)).bind(this)); | 3592 return this[_computeKeys]()[core.$any]((each => dart.equals(this.get(eac
h), value)).bind(this)); |
3443 } | 3593 } |
3444 addAll(other) { | 3594 addAll(other) { |
| 3595 dart.as(other, core.Map$(K, V)); |
3445 other.forEach(((key, value) => { | 3596 other.forEach(((key, value) => { |
| 3597 dart.as(key, K); |
| 3598 dart.as(value, V); |
3446 this.set(key, value); | 3599 this.set(key, value); |
3447 }).bind(this)); | 3600 }).bind(this)); |
3448 } | 3601 } |
3449 get(key) { | 3602 get(key) { |
3450 if (_HashMap._isStringKey(key)) { | 3603 if (_HashMap._isStringKey(key)) { |
3451 let strings = this[_strings]; | 3604 let strings = this[_strings]; |
3452 return dart.as(strings == null ? null : _HashMap._getTableEntry(string
s, key), V); | 3605 return dart.as(strings == null ? null : _HashMap._getTableEntry(string
s, key), V); |
3453 } else if (_HashMap._isNumericKey(key)) { | 3606 } else if (_HashMap._isNumericKey(key)) { |
3454 let nums = this[_nums]; | 3607 let nums = this[_nums]; |
3455 return dart.as(nums == null ? null : _HashMap._getTableEntry(nums, key
), V); | 3608 return dart.as(nums == null ? null : _HashMap._getTableEntry(nums, key
), V); |
3456 } else { | 3609 } else { |
3457 return this[_get](key); | 3610 return this[_get](key); |
3458 } | 3611 } |
3459 } | 3612 } |
3460 [_get](key) { | 3613 [_get](key) { |
3461 let rest = this[_rest]; | 3614 let rest = this[_rest]; |
3462 if (rest == null) | 3615 if (rest == null) |
3463 return null; | 3616 return null; |
3464 let bucket = this[_getBucket](rest, key); | 3617 let bucket = this[_getBucket](rest, key); |
3465 let index = this[_findBucketIndex](bucket, key); | 3618 let index = this[_findBucketIndex](bucket, key); |
3466 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde
x) + 1], V); | 3619 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde
x) + 1], V); |
3467 } | 3620 } |
3468 set(key, value) { | 3621 set(key, value) { |
| 3622 dart.as(key, K); |
| 3623 dart.as(value, V); |
3469 if (_HashMap._isStringKey(key)) { | 3624 if (_HashMap._isStringKey(key)) { |
3470 let strings = this[_strings]; | 3625 let strings = this[_strings]; |
3471 if (strings == null) | 3626 if (strings == null) |
3472 this[_strings] = strings = _HashMap._newHashTable(); | 3627 this[_strings] = strings = _HashMap._newHashTable(); |
3473 this[_addHashTableEntry](strings, key, value); | 3628 this[_addHashTableEntry](strings, key, value); |
3474 } else if (_HashMap._isNumericKey(key)) { | 3629 } else if (_HashMap._isNumericKey(key)) { |
3475 let nums = this[_nums]; | 3630 let nums = this[_nums]; |
3476 if (nums == null) | 3631 if (nums == null) |
3477 this[_nums] = nums = _HashMap._newHashTable(); | 3632 this[_nums] = nums = _HashMap._newHashTable(); |
3478 this[_addHashTableEntry](nums, key, value); | 3633 this[_addHashTableEntry](nums, key, value); |
3479 } else { | 3634 } else { |
3480 this[_set](key, value); | 3635 this[_set](key, value); |
3481 } | 3636 } |
3482 } | 3637 } |
3483 [_set](key, value) { | 3638 [_set](key, value) { |
| 3639 dart.as(key, K); |
| 3640 dart.as(value, V); |
3484 let rest = this[_rest]; | 3641 let rest = this[_rest]; |
3485 if (rest == null) | 3642 if (rest == null) |
3486 this[_rest] = rest = _HashMap._newHashTable(); | 3643 this[_rest] = rest = _HashMap._newHashTable(); |
3487 let hash = this[_computeHashCode](key); | 3644 let hash = this[_computeHashCode](key); |
3488 let bucket = rest[hash]; | 3645 let bucket = rest[hash]; |
3489 if (bucket == null) { | 3646 if (bucket == null) { |
3490 _HashMap._setTableEntry(rest, hash, [key, value]); | 3647 _HashMap._setTableEntry(rest, hash, [key, value]); |
3491 this[_length] = dart.notNull(this[_length]) + 1; | 3648 this[_length] = dart.notNull(this[_length]) + 1; |
3492 this[_keys] = null; | 3649 this[_keys] = null; |
3493 } else { | 3650 } else { |
3494 let index = this[_findBucketIndex](bucket, key); | 3651 let index = this[_findBucketIndex](bucket, key); |
3495 if (dart.notNull(index) >= 0) { | 3652 if (dart.notNull(index) >= 0) { |
3496 bucket[dart.notNull(index) + 1] = value; | 3653 bucket[dart.notNull(index) + 1] = value; |
3497 } else { | 3654 } else { |
3498 bucket.push(key, value); | 3655 bucket.push(key, value); |
3499 this[_length] = dart.notNull(this[_length]) + 1; | 3656 this[_length] = dart.notNull(this[_length]) + 1; |
3500 this[_keys] = null; | 3657 this[_keys] = null; |
3501 } | 3658 } |
3502 } | 3659 } |
3503 } | 3660 } |
3504 putIfAbsent(key, ifAbsent) { | 3661 putIfAbsent(key, ifAbsent) { |
| 3662 dart.as(key, K); |
| 3663 dart.as(ifAbsent, dart.functionType(V, [])); |
3505 if (this.containsKey(key)) | 3664 if (this.containsKey(key)) |
3506 return this.get(key); | 3665 return this.get(key); |
3507 let value = ifAbsent(); | 3666 let value = ifAbsent(); |
3508 this.set(key, value); | 3667 this.set(key, value); |
3509 return value; | 3668 return value; |
3510 } | 3669 } |
3511 remove(key) { | 3670 remove(key) { |
3512 if (_HashMap._isStringKey(key)) { | 3671 if (_HashMap._isStringKey(key)) { |
3513 return this[_removeHashTableEntry](this[_strings], key); | 3672 return this[_removeHashTableEntry](this[_strings], key); |
3514 } else if (_HashMap._isNumericKey(key)) { | 3673 } else if (_HashMap._isNumericKey(key)) { |
(...skipping 14 matching lines...) Expand all Loading... |
3529 this[_keys] = null; | 3688 this[_keys] = null; |
3530 return dart.as(bucket.splice(index, 2)[1], V); | 3689 return dart.as(bucket.splice(index, 2)[1], V); |
3531 } | 3690 } |
3532 clear() { | 3691 clear() { |
3533 if (dart.notNull(this[_length]) > 0) { | 3692 if (dart.notNull(this[_length]) > 0) { |
3534 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; | 3693 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; |
3535 this[_length] = 0; | 3694 this[_length] = 0; |
3536 } | 3695 } |
3537 } | 3696 } |
3538 forEach(action) { | 3697 forEach(action) { |
| 3698 dart.as(action, dart.functionType(dart.void, [K, V])); |
3539 let keys = this[_computeKeys](); | 3699 let keys = this[_computeKeys](); |
3540 for (let i = 0, length = keys[core.$length]; dart.notNull(i) < dart.notN
ull(length); i = dart.notNull(i) + 1) { | 3700 for (let i = 0, length = keys[core.$length]; dart.notNull(i) < dart.notN
ull(length); i = dart.notNull(i) + 1) { |
3541 let key = keys[i]; | 3701 let key = keys[i]; |
3542 action(dart.as(key, K), this.get(key)); | 3702 action(dart.as(key, K), this.get(key)); |
3543 if (keys !== this[_keys]) { | 3703 if (keys !== this[_keys]) { |
3544 throw new core.ConcurrentModificationError(this); | 3704 throw new core.ConcurrentModificationError(this); |
3545 } | 3705 } |
3546 } | 3706 } |
3547 } | 3707 } |
3548 [_computeKeys]() { | 3708 [_computeKeys]() { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3582 let key = bucket[i]; | 3742 let key = bucket[i]; |
3583 result[index] = key; | 3743 result[index] = key; |
3584 index = dart.notNull(index) + 1; | 3744 index = dart.notNull(index) + 1; |
3585 } | 3745 } |
3586 } | 3746 } |
3587 } | 3747 } |
3588 dart.assert(index == this[_length]); | 3748 dart.assert(index == this[_length]); |
3589 return this[_keys] = result; | 3749 return this[_keys] = result; |
3590 } | 3750 } |
3591 [_addHashTableEntry](table, key, value) { | 3751 [_addHashTableEntry](table, key, value) { |
| 3752 dart.as(key, K); |
| 3753 dart.as(value, V); |
3592 if (!dart.notNull(_HashMap._hasTableEntry(table, key))) { | 3754 if (!dart.notNull(_HashMap._hasTableEntry(table, key))) { |
3593 this[_length] = dart.notNull(this[_length]) + 1; | 3755 this[_length] = dart.notNull(this[_length]) + 1; |
3594 this[_keys] = null; | 3756 this[_keys] = null; |
3595 } | 3757 } |
3596 _HashMap._setTableEntry(table, key, value); | 3758 _HashMap._setTableEntry(table, key, value); |
3597 } | 3759 } |
3598 [_removeHashTableEntry](table, key) { | 3760 [_removeHashTableEntry](table, key) { |
3599 if (dart.notNull(table != null) && dart.notNull(_HashMap._hasTableEntry(
table, key))) { | 3761 if (dart.notNull(table != null) && dart.notNull(_HashMap._hasTableEntry(
table, key))) { |
3600 let value = dart.as(_HashMap._getTableEntry(table, key), V); | 3762 let value = dart.as(_HashMap._getTableEntry(table, key), V); |
3601 _HashMap._deleteTableEntry(table, key); | 3763 _HashMap._deleteTableEntry(table, key); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3687 this[_hashCode] = hashCode; | 3849 this[_hashCode] = hashCode; |
3688 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v,
K), _Predicate); | 3850 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v,
K), _Predicate); |
3689 super._HashMap(); | 3851 super._HashMap(); |
3690 } | 3852 } |
3691 get(key) { | 3853 get(key) { |
3692 if (!dart.notNull(dart.dcall(this[_validKey], key))) | 3854 if (!dart.notNull(dart.dcall(this[_validKey], key))) |
3693 return null; | 3855 return null; |
3694 return super[_get](key); | 3856 return super[_get](key); |
3695 } | 3857 } |
3696 set(key, value) { | 3858 set(key, value) { |
| 3859 dart.as(key, K); |
| 3860 dart.as(value, V); |
3697 super[_set](key, value); | 3861 super[_set](key, value); |
3698 } | 3862 } |
3699 containsKey(key) { | 3863 containsKey(key) { |
3700 if (!dart.notNull(dart.dcall(this[_validKey], key))) | 3864 if (!dart.notNull(dart.dcall(this[_validKey], key))) |
3701 return false; | 3865 return false; |
3702 return super[_containsKey](key); | 3866 return super[_containsKey](key); |
3703 } | 3867 } |
3704 remove(key) { | 3868 remove(key) { |
3705 if (!dart.notNull(dart.dcall(this[_validKey], key))) | 3869 if (!dart.notNull(dart.dcall(this[_validKey], key))) |
3706 return null; | 3870 return null; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3738 get [core.$isEmpty]() { | 3902 get [core.$isEmpty]() { |
3739 return dart.equals(dart.dload(this[_map], _length), 0); | 3903 return dart.equals(dart.dload(this[_map], _length), 0); |
3740 } | 3904 } |
3741 get [core.$iterator]() { | 3905 get [core.$iterator]() { |
3742 return new (HashMapKeyIterator$(E))(this[_map], dart.as(dart.dsend(this[
_map], _computeKeys), core.List)); | 3906 return new (HashMapKeyIterator$(E))(this[_map], dart.as(dart.dsend(this[
_map], _computeKeys), core.List)); |
3743 } | 3907 } |
3744 [core.$contains](element) { | 3908 [core.$contains](element) { |
3745 return dart.as(dart.dsend(this[_map], 'containsKey', element), core.bool
); | 3909 return dart.as(dart.dsend(this[_map], 'containsKey', element), core.bool
); |
3746 } | 3910 } |
3747 [core.$forEach](f) { | 3911 [core.$forEach](f) { |
| 3912 dart.as(f, dart.functionType(dart.void, [E])); |
3748 let keys = dart.as(dart.dsend(this[_map], _computeKeys), core.List); | 3913 let keys = dart.as(dart.dsend(this[_map], _computeKeys), core.List); |
3749 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len
gth); i = dart.notNull(i) + 1) { | 3914 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len
gth); i = dart.notNull(i) + 1) { |
3750 f(dart.as(keys[i], E)); | 3915 f(dart.as(keys[i], E)); |
3751 if (keys !== dart.dload(this[_map], _keys)) { | 3916 if (keys !== dart.dload(this[_map], _keys)) { |
3752 throw new core.ConcurrentModificationError(this[_map]); | 3917 throw new core.ConcurrentModificationError(this[_map]); |
3753 } | 3918 } |
3754 } | 3919 } |
3755 } | 3920 } |
3756 } | 3921 } |
3757 HashMapKeyIterable[dart.implements] = () => [_internal.EfficientLength]; | 3922 HashMapKeyIterable[dart.implements] = () => [_internal.EfficientLength]; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3842 let rest = this[_rest]; | 4007 let rest = this[_rest]; |
3843 if (rest == null) | 4008 if (rest == null) |
3844 return false; | 4009 return false; |
3845 let bucket = this[_getBucket](rest, key); | 4010 let bucket = this[_getBucket](rest, key); |
3846 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; | 4011 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; |
3847 } | 4012 } |
3848 containsValue(value) { | 4013 containsValue(value) { |
3849 return this.keys[core.$any]((each => dart.equals(this.get(each), value))
.bind(this)); | 4014 return this.keys[core.$any]((each => dart.equals(this.get(each), value))
.bind(this)); |
3850 } | 4015 } |
3851 addAll(other) { | 4016 addAll(other) { |
| 4017 dart.as(other, core.Map$(K, V)); |
3852 other.forEach(((key, value) => { | 4018 other.forEach(((key, value) => { |
| 4019 dart.as(key, K); |
| 4020 dart.as(value, V); |
3853 this.set(key, value); | 4021 this.set(key, value); |
3854 }).bind(this)); | 4022 }).bind(this)); |
3855 } | 4023 } |
3856 get(key) { | 4024 get(key) { |
3857 if (_LinkedHashMap._isStringKey(key)) { | 4025 if (_LinkedHashMap._isStringKey(key)) { |
3858 let strings = this[_strings]; | 4026 let strings = this[_strings]; |
3859 if (strings == null) | 4027 if (strings == null) |
3860 return null; | 4028 return null; |
3861 let cell = dart.as(_LinkedHashMap._getTableEntry(strings, key), Linked
HashMapCell); | 4029 let cell = dart.as(_LinkedHashMap._getTableEntry(strings, key), Linked
HashMapCell); |
3862 return dart.as(cell == null ? null : cell[_value], V); | 4030 return dart.as(cell == null ? null : cell[_value], V); |
(...skipping 12 matching lines...) Expand all Loading... |
3875 if (rest == null) | 4043 if (rest == null) |
3876 return null; | 4044 return null; |
3877 let bucket = this[_getBucket](rest, key); | 4045 let bucket = this[_getBucket](rest, key); |
3878 let index = this[_findBucketIndex](bucket, key); | 4046 let index = this[_findBucketIndex](bucket, key); |
3879 if (dart.notNull(index) < 0) | 4047 if (dart.notNull(index) < 0) |
3880 return null; | 4048 return null; |
3881 let cell = dart.as(bucket[index], LinkedHashMapCell); | 4049 let cell = dart.as(bucket[index], LinkedHashMapCell); |
3882 return dart.as(cell[_value], V); | 4050 return dart.as(cell[_value], V); |
3883 } | 4051 } |
3884 set(key, value) { | 4052 set(key, value) { |
| 4053 dart.as(key, K); |
| 4054 dart.as(value, V); |
3885 if (_LinkedHashMap._isStringKey(key)) { | 4055 if (_LinkedHashMap._isStringKey(key)) { |
3886 let strings = this[_strings]; | 4056 let strings = this[_strings]; |
3887 if (strings == null) | 4057 if (strings == null) |
3888 this[_strings] = strings = _LinkedHashMap._newHashTable(); | 4058 this[_strings] = strings = _LinkedHashMap._newHashTable(); |
3889 this[_addHashTableEntry](strings, key, value); | 4059 this[_addHashTableEntry](strings, key, value); |
3890 } else if (_LinkedHashMap._isNumericKey(key)) { | 4060 } else if (_LinkedHashMap._isNumericKey(key)) { |
3891 let nums = this[_nums]; | 4061 let nums = this[_nums]; |
3892 if (nums == null) | 4062 if (nums == null) |
3893 this[_nums] = nums = _LinkedHashMap._newHashTable(); | 4063 this[_nums] = nums = _LinkedHashMap._newHashTable(); |
3894 this[_addHashTableEntry](nums, key, value); | 4064 this[_addHashTableEntry](nums, key, value); |
3895 } else { | 4065 } else { |
3896 this[_set](key, value); | 4066 this[_set](key, value); |
3897 } | 4067 } |
3898 } | 4068 } |
3899 [_set](key, value) { | 4069 [_set](key, value) { |
| 4070 dart.as(key, K); |
| 4071 dart.as(value, V); |
3900 let rest = this[_rest]; | 4072 let rest = this[_rest]; |
3901 if (rest == null) | 4073 if (rest == null) |
3902 this[_rest] = rest = _LinkedHashMap._newHashTable(); | 4074 this[_rest] = rest = _LinkedHashMap._newHashTable(); |
3903 let hash = this[_computeHashCode](key); | 4075 let hash = this[_computeHashCode](key); |
3904 let bucket = rest[hash]; | 4076 let bucket = rest[hash]; |
3905 if (bucket == null) { | 4077 if (bucket == null) { |
3906 let cell = this[_newLinkedCell](key, value); | 4078 let cell = this[_newLinkedCell](key, value); |
3907 _LinkedHashMap._setTableEntry(rest, hash, [cell]); | 4079 _LinkedHashMap._setTableEntry(rest, hash, [cell]); |
3908 } else { | 4080 } else { |
3909 let index = this[_findBucketIndex](bucket, key); | 4081 let index = this[_findBucketIndex](bucket, key); |
3910 if (dart.notNull(index) >= 0) { | 4082 if (dart.notNull(index) >= 0) { |
3911 let cell = dart.as(bucket[index], LinkedHashMapCell); | 4083 let cell = dart.as(bucket[index], LinkedHashMapCell); |
3912 cell[_value] = value; | 4084 cell[_value] = value; |
3913 } else { | 4085 } else { |
3914 let cell = this[_newLinkedCell](key, value); | 4086 let cell = this[_newLinkedCell](key, value); |
3915 bucket.push(cell); | 4087 bucket.push(cell); |
3916 } | 4088 } |
3917 } | 4089 } |
3918 } | 4090 } |
3919 putIfAbsent(key, ifAbsent) { | 4091 putIfAbsent(key, ifAbsent) { |
| 4092 dart.as(key, K); |
| 4093 dart.as(ifAbsent, dart.functionType(V, [])); |
3920 if (this.containsKey(key)) | 4094 if (this.containsKey(key)) |
3921 return this.get(key); | 4095 return this.get(key); |
3922 let value = ifAbsent(); | 4096 let value = ifAbsent(); |
3923 this.set(key, value); | 4097 this.set(key, value); |
3924 return value; | 4098 return value; |
3925 } | 4099 } |
3926 remove(key) { | 4100 remove(key) { |
3927 if (_LinkedHashMap._isStringKey(key)) { | 4101 if (_LinkedHashMap._isStringKey(key)) { |
3928 return this[_removeHashTableEntry](this[_strings], key); | 4102 return this[_removeHashTableEntry](this[_strings], key); |
3929 } else if (_LinkedHashMap._isNumericKey(key)) { | 4103 } else if (_LinkedHashMap._isNumericKey(key)) { |
(...skipping 15 matching lines...) Expand all Loading... |
3945 return dart.as(cell[_value], V); | 4119 return dart.as(cell[_value], V); |
3946 } | 4120 } |
3947 clear() { | 4121 clear() { |
3948 if (dart.notNull(this[_length]) > 0) { | 4122 if (dart.notNull(this[_length]) > 0) { |
3949 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; | 4123 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
3950 this[_length] = 0; | 4124 this[_length] = 0; |
3951 this[_modified](); | 4125 this[_modified](); |
3952 } | 4126 } |
3953 } | 4127 } |
3954 forEach(action) { | 4128 forEach(action) { |
| 4129 dart.as(action, dart.functionType(dart.void, [K, V])); |
3955 let cell = this[_first]; | 4130 let cell = this[_first]; |
3956 let modifications = this[_modifications]; | 4131 let modifications = this[_modifications]; |
3957 while (cell != null) { | 4132 while (cell != null) { |
3958 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); | 4133 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); |
3959 if (modifications != this[_modifications]) { | 4134 if (modifications != this[_modifications]) { |
3960 throw new core.ConcurrentModificationError(this); | 4135 throw new core.ConcurrentModificationError(this); |
3961 } | 4136 } |
3962 cell = cell[_next]; | 4137 cell = cell[_next]; |
3963 } | 4138 } |
3964 } | 4139 } |
3965 [_addHashTableEntry](table, key, value) { | 4140 [_addHashTableEntry](table, key, value) { |
| 4141 dart.as(key, K); |
| 4142 dart.as(value, V); |
3966 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash
MapCell); | 4143 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash
MapCell); |
3967 if (cell == null) { | 4144 if (cell == null) { |
3968 _LinkedHashMap._setTableEntry(table, key, this[_newLinkedCell](key, va
lue)); | 4145 _LinkedHashMap._setTableEntry(table, key, this[_newLinkedCell](key, va
lue)); |
3969 } else { | 4146 } else { |
3970 cell[_value] = value; | 4147 cell[_value] = value; |
3971 } | 4148 } |
3972 } | 4149 } |
3973 [_removeHashTableEntry](table, key) { | 4150 [_removeHashTableEntry](table, key) { |
3974 if (table == null) | 4151 if (table == null) |
3975 return null; | 4152 return null; |
3976 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash
MapCell); | 4153 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash
MapCell); |
3977 if (cell == null) | 4154 if (cell == null) |
3978 return null; | 4155 return null; |
3979 this[_unlinkCell](cell); | 4156 this[_unlinkCell](cell); |
3980 _LinkedHashMap._deleteTableEntry(table, key); | 4157 _LinkedHashMap._deleteTableEntry(table, key); |
3981 return dart.as(cell[_value], V); | 4158 return dart.as(cell[_value], V); |
3982 } | 4159 } |
3983 [_modified]() { | 4160 [_modified]() { |
3984 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; | 4161 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; |
3985 } | 4162 } |
3986 [_newLinkedCell](key, value) { | 4163 [_newLinkedCell](key, value) { |
| 4164 dart.as(key, K); |
| 4165 dart.as(value, V); |
3987 let cell = new LinkedHashMapCell(key, value); | 4166 let cell = new LinkedHashMapCell(key, value); |
3988 if (this[_first] == null) { | 4167 if (this[_first] == null) { |
3989 this[_first] = this[_last] = cell; | 4168 this[_first] = this[_last] = cell; |
3990 } else { | 4169 } else { |
3991 let last = this[_last]; | 4170 let last = this[_last]; |
3992 cell[_previous] = last; | 4171 cell[_previous] = last; |
3993 this[_last] = last[_next] = cell; | 4172 this[_last] = last[_next] = cell; |
3994 } | 4173 } |
3995 this[_length] = dart.notNull(this[_length]) + 1; | 4174 this[_length] = dart.notNull(this[_length]) + 1; |
3996 this[_modified](); | 4175 this[_modified](); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4090 this[_hashCode] = hashCode; | 4269 this[_hashCode] = hashCode; |
4091 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v,
K), _Predicate); | 4270 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v,
K), _Predicate); |
4092 super._LinkedHashMap(); | 4271 super._LinkedHashMap(); |
4093 } | 4272 } |
4094 get(key) { | 4273 get(key) { |
4095 if (!dart.notNull(dart.dcall(this[_validKey], key))) | 4274 if (!dart.notNull(dart.dcall(this[_validKey], key))) |
4096 return null; | 4275 return null; |
4097 return super[_get](key); | 4276 return super[_get](key); |
4098 } | 4277 } |
4099 set(key, value) { | 4278 set(key, value) { |
| 4279 dart.as(key, K); |
| 4280 dart.as(value, V); |
4100 super[_set](key, value); | 4281 super[_set](key, value); |
4101 } | 4282 } |
4102 containsKey(key) { | 4283 containsKey(key) { |
4103 if (!dart.notNull(dart.dcall(this[_validKey], key))) | 4284 if (!dart.notNull(dart.dcall(this[_validKey], key))) |
4104 return false; | 4285 return false; |
4105 return super[_containsKey](key); | 4286 return super[_containsKey](key); |
4106 } | 4287 } |
4107 remove(key) { | 4288 remove(key) { |
4108 if (!dart.notNull(dart.dcall(this[_validKey], key))) | 4289 if (!dart.notNull(dart.dcall(this[_validKey], key))) |
4109 return null; | 4290 return null; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4147 get [core.$isEmpty]() { | 4328 get [core.$isEmpty]() { |
4148 return dart.equals(dart.dload(this[_map], _length), 0); | 4329 return dart.equals(dart.dload(this[_map], _length), 0); |
4149 } | 4330 } |
4150 get [core.$iterator]() { | 4331 get [core.$iterator]() { |
4151 return new (LinkedHashMapKeyIterator$(E))(this[_map], dart.as(dart.dload
(this[_map], _modifications), core.int)); | 4332 return new (LinkedHashMapKeyIterator$(E))(this[_map], dart.as(dart.dload
(this[_map], _modifications), core.int)); |
4152 } | 4333 } |
4153 [core.$contains](element) { | 4334 [core.$contains](element) { |
4154 return dart.as(dart.dsend(this[_map], 'containsKey', element), core.bool
); | 4335 return dart.as(dart.dsend(this[_map], 'containsKey', element), core.bool
); |
4155 } | 4336 } |
4156 [core.$forEach](f) { | 4337 [core.$forEach](f) { |
| 4338 dart.as(f, dart.functionType(dart.void, [E])); |
4157 let cell = dart.as(dart.dload(this[_map], _first), LinkedHashMapCell); | 4339 let cell = dart.as(dart.dload(this[_map], _first), LinkedHashMapCell); |
4158 let modifications = dart.as(dart.dload(this[_map], _modifications), core
.int); | 4340 let modifications = dart.as(dart.dload(this[_map], _modifications), core
.int); |
4159 while (cell != null) { | 4341 while (cell != null) { |
4160 f(dart.as(cell[_key], E)); | 4342 f(dart.as(cell[_key], E)); |
4161 if (!dart.equals(modifications, dart.dload(this[_map], _modifications)
)) { | 4343 if (!dart.equals(modifications, dart.dload(this[_map], _modifications)
)) { |
4162 throw new core.ConcurrentModificationError(this[_map]); | 4344 throw new core.ConcurrentModificationError(this[_map]); |
4163 } | 4345 } |
4164 cell = cell[_next]; | 4346 cell = cell[_next]; |
4165 } | 4347 } |
4166 } | 4348 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4255 let rest = this[_rest]; | 4437 let rest = this[_rest]; |
4256 if (rest == null) | 4438 if (rest == null) |
4257 return null; | 4439 return null; |
4258 let bucket = this[_getBucket](rest, object); | 4440 let bucket = this[_getBucket](rest, object); |
4259 let index = this[_findBucketIndex](bucket, object); | 4441 let index = this[_findBucketIndex](bucket, object); |
4260 if (dart.notNull(index) < 0) | 4442 if (dart.notNull(index) < 0) |
4261 return null; | 4443 return null; |
4262 return dart.as(bucket[core.$get](index), E); | 4444 return dart.as(bucket[core.$get](index), E); |
4263 } | 4445 } |
4264 add(element) { | 4446 add(element) { |
| 4447 dart.as(element, E); |
4265 if (_HashSet._isStringElement(element)) { | 4448 if (_HashSet._isStringElement(element)) { |
4266 let strings = this[_strings]; | 4449 let strings = this[_strings]; |
4267 if (strings == null) | 4450 if (strings == null) |
4268 this[_strings] = strings = _HashSet._newHashTable(); | 4451 this[_strings] = strings = _HashSet._newHashTable(); |
4269 return this[_addHashTableEntry](strings, element); | 4452 return this[_addHashTableEntry](strings, element); |
4270 } else if (_HashSet._isNumericElement(element)) { | 4453 } else if (_HashSet._isNumericElement(element)) { |
4271 let nums = this[_nums]; | 4454 let nums = this[_nums]; |
4272 if (nums == null) | 4455 if (nums == null) |
4273 this[_nums] = nums = _HashSet._newHashTable(); | 4456 this[_nums] = nums = _HashSet._newHashTable(); |
4274 return this[_addHashTableEntry](nums, element); | 4457 return this[_addHashTableEntry](nums, element); |
4275 } else { | 4458 } else { |
4276 return this[_add](element); | 4459 return this[_add](element); |
4277 } | 4460 } |
4278 } | 4461 } |
4279 [_add](element) { | 4462 [_add](element) { |
| 4463 dart.as(element, E); |
4280 let rest = this[_rest]; | 4464 let rest = this[_rest]; |
4281 if (rest == null) | 4465 if (rest == null) |
4282 this[_rest] = rest = _HashSet._newHashTable(); | 4466 this[_rest] = rest = _HashSet._newHashTable(); |
4283 let hash = this[_computeHashCode](element); | 4467 let hash = this[_computeHashCode](element); |
4284 let bucket = rest[hash]; | 4468 let bucket = rest[hash]; |
4285 if (bucket == null) { | 4469 if (bucket == null) { |
4286 _HashSet._setTableEntry(rest, hash, [element]); | 4470 _HashSet._setTableEntry(rest, hash, [element]); |
4287 } else { | 4471 } else { |
4288 let index = this[_findBucketIndex](bucket, element); | 4472 let index = this[_findBucketIndex](bucket, element); |
4289 if (dart.notNull(index) >= 0) | 4473 if (dart.notNull(index) >= 0) |
4290 return false; | 4474 return false; |
4291 bucket.push(element); | 4475 bucket.push(element); |
4292 } | 4476 } |
4293 this[_length] = dart.notNull(this[_length]) + 1; | 4477 this[_length] = dart.notNull(this[_length]) + 1; |
4294 this[_elements] = null; | 4478 this[_elements] = null; |
4295 return true; | 4479 return true; |
4296 } | 4480 } |
4297 addAll(objects) { | 4481 addAll(objects) { |
| 4482 dart.as(objects, core.Iterable$(E)); |
4298 for (let each of objects) { | 4483 for (let each of objects) { |
4299 this.add(each); | 4484 this.add(each); |
4300 } | 4485 } |
4301 } | 4486 } |
4302 remove(object) { | 4487 remove(object) { |
4303 if (_HashSet._isStringElement(object)) { | 4488 if (_HashSet._isStringElement(object)) { |
4304 return this[_removeHashTableEntry](this[_strings], object); | 4489 return this[_removeHashTableEntry](this[_strings], object); |
4305 } else if (_HashSet._isNumericElement(object)) { | 4490 } else if (_HashSet._isNumericElement(object)) { |
4306 return this[_removeHashTableEntry](this[_nums], object); | 4491 return this[_removeHashTableEntry](this[_nums], object); |
4307 } else { | 4492 } else { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4363 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not
Null(i) + 1) { | 4548 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not
Null(i) + 1) { |
4364 result[index] = bucket[i]; | 4549 result[index] = bucket[i]; |
4365 index = dart.notNull(index) + 1; | 4550 index = dart.notNull(index) + 1; |
4366 } | 4551 } |
4367 } | 4552 } |
4368 } | 4553 } |
4369 dart.assert(index == this[_length]); | 4554 dart.assert(index == this[_length]); |
4370 return this[_elements] = result; | 4555 return this[_elements] = result; |
4371 } | 4556 } |
4372 [_addHashTableEntry](table, element) { | 4557 [_addHashTableEntry](table, element) { |
| 4558 dart.as(element, E); |
4373 if (_HashSet._hasTableEntry(table, element)) | 4559 if (_HashSet._hasTableEntry(table, element)) |
4374 return false; | 4560 return false; |
4375 _HashSet._setTableEntry(table, element, 0); | 4561 _HashSet._setTableEntry(table, element, 0); |
4376 this[_length] = dart.notNull(this[_length]) + 1; | 4562 this[_length] = dart.notNull(this[_length]) + 1; |
4377 this[_elements] = null; | 4563 this[_elements] = null; |
4378 return true; | 4564 return true; |
4379 } | 4565 } |
4380 [_removeHashTableEntry](table, element) { | 4566 [_removeHashTableEntry](table, element) { |
4381 if (dart.notNull(table != null) && dart.notNull(_HashSet._hasTableEntry(
table, element))) { | 4567 if (dart.notNull(table != null) && dart.notNull(_HashSet._hasTableEntry(
table, element))) { |
4382 _HashSet._deleteTableEntry(table, element); | 4568 _HashSet._deleteTableEntry(table, element); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4475 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 4661 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
4476 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) | 4662 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) |
4477 return i; | 4663 return i; |
4478 } | 4664 } |
4479 return -1; | 4665 return -1; |
4480 } | 4666 } |
4481 [_computeHashCode](element) { | 4667 [_computeHashCode](element) { |
4482 return this[_hasher](dart.as(element, E)) & 0x3ffffff; | 4668 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
4483 } | 4669 } |
4484 add(object) { | 4670 add(object) { |
| 4671 dart.as(object, E); |
4485 return super[_add](object); | 4672 return super[_add](object); |
4486 } | 4673 } |
4487 [core.$contains](object) { | 4674 [core.$contains](object) { |
4488 if (!dart.notNull(dart.dcall(this[_validKey], object))) | 4675 if (!dart.notNull(dart.dcall(this[_validKey], object))) |
4489 return false; | 4676 return false; |
4490 return super[_contains](object); | 4677 return super[_contains](object); |
4491 } | 4678 } |
4492 lookup(object) { | 4679 lookup(object) { |
4493 if (!dart.notNull(dart.dcall(this[_validKey], object))) | 4680 if (!dart.notNull(dart.dcall(this[_validKey], object))) |
4494 return null; | 4681 return null; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4598 let rest = this[_rest]; | 4785 let rest = this[_rest]; |
4599 if (rest == null) | 4786 if (rest == null) |
4600 return null; | 4787 return null; |
4601 let bucket = this[_getBucket](rest, object); | 4788 let bucket = this[_getBucket](rest, object); |
4602 let index = this[_findBucketIndex](bucket, object); | 4789 let index = this[_findBucketIndex](bucket, object); |
4603 if (dart.notNull(index) < 0) | 4790 if (dart.notNull(index) < 0) |
4604 return null; | 4791 return null; |
4605 return dart.as(dart.dload(bucket[core.$get](index), _element), E); | 4792 return dart.as(dart.dload(bucket[core.$get](index), _element), E); |
4606 } | 4793 } |
4607 [core.$forEach](action) { | 4794 [core.$forEach](action) { |
| 4795 dart.as(action, dart.functionType(dart.void, [E])); |
4608 let cell = this[_first]; | 4796 let cell = this[_first]; |
4609 let modifications = this[_modifications]; | 4797 let modifications = this[_modifications]; |
4610 while (cell != null) { | 4798 while (cell != null) { |
4611 action(dart.as(cell[_element], E)); | 4799 action(dart.as(cell[_element], E)); |
4612 if (modifications != this[_modifications]) { | 4800 if (modifications != this[_modifications]) { |
4613 throw new core.ConcurrentModificationError(this); | 4801 throw new core.ConcurrentModificationError(this); |
4614 } | 4802 } |
4615 cell = cell[_next]; | 4803 cell = cell[_next]; |
4616 } | 4804 } |
4617 } | 4805 } |
4618 get [core.$first]() { | 4806 get [core.$first]() { |
4619 if (this[_first] == null) | 4807 if (this[_first] == null) |
4620 throw new core.StateError("No elements"); | 4808 throw new core.StateError("No elements"); |
4621 return dart.as(this[_first][_element], E); | 4809 return dart.as(this[_first][_element], E); |
4622 } | 4810 } |
4623 get [core.$last]() { | 4811 get [core.$last]() { |
4624 if (this[_last] == null) | 4812 if (this[_last] == null) |
4625 throw new core.StateError("No elements"); | 4813 throw new core.StateError("No elements"); |
4626 return dart.as(this[_last][_element], E); | 4814 return dart.as(this[_last][_element], E); |
4627 } | 4815 } |
4628 add(element) { | 4816 add(element) { |
| 4817 dart.as(element, E); |
4629 if (_LinkedHashSet._isStringElement(element)) { | 4818 if (_LinkedHashSet._isStringElement(element)) { |
4630 let strings = this[_strings]; | 4819 let strings = this[_strings]; |
4631 if (strings == null) | 4820 if (strings == null) |
4632 this[_strings] = strings = _LinkedHashSet._newHashTable(); | 4821 this[_strings] = strings = _LinkedHashSet._newHashTable(); |
4633 return this[_addHashTableEntry](strings, element); | 4822 return this[_addHashTableEntry](strings, element); |
4634 } else if (_LinkedHashSet._isNumericElement(element)) { | 4823 } else if (_LinkedHashSet._isNumericElement(element)) { |
4635 let nums = this[_nums]; | 4824 let nums = this[_nums]; |
4636 if (nums == null) | 4825 if (nums == null) |
4637 this[_nums] = nums = _LinkedHashSet._newHashTable(); | 4826 this[_nums] = nums = _LinkedHashSet._newHashTable(); |
4638 return this[_addHashTableEntry](nums, element); | 4827 return this[_addHashTableEntry](nums, element); |
4639 } else { | 4828 } else { |
4640 return this[_add](element); | 4829 return this[_add](element); |
4641 } | 4830 } |
4642 } | 4831 } |
4643 [_add](element) { | 4832 [_add](element) { |
| 4833 dart.as(element, E); |
4644 let rest = this[_rest]; | 4834 let rest = this[_rest]; |
4645 if (rest == null) | 4835 if (rest == null) |
4646 this[_rest] = rest = _LinkedHashSet._newHashTable(); | 4836 this[_rest] = rest = _LinkedHashSet._newHashTable(); |
4647 let hash = this[_computeHashCode](element); | 4837 let hash = this[_computeHashCode](element); |
4648 let bucket = rest[hash]; | 4838 let bucket = rest[hash]; |
4649 if (bucket == null) { | 4839 if (bucket == null) { |
4650 let cell = this[_newLinkedCell](element); | 4840 let cell = this[_newLinkedCell](element); |
4651 _LinkedHashSet._setTableEntry(rest, hash, [cell]); | 4841 _LinkedHashSet._setTableEntry(rest, hash, [cell]); |
4652 } else { | 4842 } else { |
4653 let index = this[_findBucketIndex](bucket, element); | 4843 let index = this[_findBucketIndex](bucket, element); |
(...skipping 19 matching lines...) Expand all Loading... |
4673 return false; | 4863 return false; |
4674 let bucket = this[_getBucket](rest, object); | 4864 let bucket = this[_getBucket](rest, object); |
4675 let index = this[_findBucketIndex](bucket, object); | 4865 let index = this[_findBucketIndex](bucket, object); |
4676 if (dart.notNull(index) < 0) | 4866 if (dart.notNull(index) < 0) |
4677 return false; | 4867 return false; |
4678 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); | 4868 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); |
4679 this[_unlinkCell](cell); | 4869 this[_unlinkCell](cell); |
4680 return true; | 4870 return true; |
4681 } | 4871 } |
4682 removeWhere(test) { | 4872 removeWhere(test) { |
| 4873 dart.as(test, dart.functionType(core.bool, [E])); |
4683 this[_filterWhere](test, true); | 4874 this[_filterWhere](test, true); |
4684 } | 4875 } |
4685 retainWhere(test) { | 4876 retainWhere(test) { |
| 4877 dart.as(test, dart.functionType(core.bool, [E])); |
4686 this[_filterWhere](test, false); | 4878 this[_filterWhere](test, false); |
4687 } | 4879 } |
4688 [_filterWhere](test, removeMatching) { | 4880 [_filterWhere](test, removeMatching) { |
| 4881 dart.as(test, dart.functionType(core.bool, [E])); |
4689 let cell = this[_first]; | 4882 let cell = this[_first]; |
4690 while (cell != null) { | 4883 while (cell != null) { |
4691 let element = dart.as(cell[_element], E); | 4884 let element = dart.as(cell[_element], E); |
4692 let next = cell[_next]; | 4885 let next = cell[_next]; |
4693 let modifications = this[_modifications]; | 4886 let modifications = this[_modifications]; |
4694 let shouldRemove = removeMatching == test(element); | 4887 let shouldRemove = removeMatching == test(element); |
4695 if (modifications != this[_modifications]) { | 4888 if (modifications != this[_modifications]) { |
4696 throw new core.ConcurrentModificationError(this); | 4889 throw new core.ConcurrentModificationError(this); |
4697 } | 4890 } |
4698 if (shouldRemove) | 4891 if (shouldRemove) |
4699 this.remove(element); | 4892 this.remove(element); |
4700 cell = next; | 4893 cell = next; |
4701 } | 4894 } |
4702 } | 4895 } |
4703 clear() { | 4896 clear() { |
4704 if (dart.notNull(this[_length]) > 0) { | 4897 if (dart.notNull(this[_length]) > 0) { |
4705 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; | 4898 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
4706 this[_length] = 0; | 4899 this[_length] = 0; |
4707 this[_modified](); | 4900 this[_modified](); |
4708 } | 4901 } |
4709 } | 4902 } |
4710 [_addHashTableEntry](table, element) { | 4903 [_addHashTableEntry](table, element) { |
| 4904 dart.as(element, E); |
4711 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked
HashSetCell); | 4905 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked
HashSetCell); |
4712 if (cell != null) | 4906 if (cell != null) |
4713 return false; | 4907 return false; |
4714 _LinkedHashSet._setTableEntry(table, element, this[_newLinkedCell](eleme
nt)); | 4908 _LinkedHashSet._setTableEntry(table, element, this[_newLinkedCell](eleme
nt)); |
4715 return true; | 4909 return true; |
4716 } | 4910 } |
4717 [_removeHashTableEntry](table, element) { | 4911 [_removeHashTableEntry](table, element) { |
4718 if (table == null) | 4912 if (table == null) |
4719 return false; | 4913 return false; |
4720 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked
HashSetCell); | 4914 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked
HashSetCell); |
4721 if (cell == null) | 4915 if (cell == null) |
4722 return false; | 4916 return false; |
4723 this[_unlinkCell](cell); | 4917 this[_unlinkCell](cell); |
4724 _LinkedHashSet._deleteTableEntry(table, element); | 4918 _LinkedHashSet._deleteTableEntry(table, element); |
4725 return true; | 4919 return true; |
4726 } | 4920 } |
4727 [_modified]() { | 4921 [_modified]() { |
4728 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; | 4922 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; |
4729 } | 4923 } |
4730 [_newLinkedCell](element) { | 4924 [_newLinkedCell](element) { |
| 4925 dart.as(element, E); |
4731 let cell = new LinkedHashSetCell(element); | 4926 let cell = new LinkedHashSetCell(element); |
4732 if (this[_first] == null) { | 4927 if (this[_first] == null) { |
4733 this[_first] = this[_last] = cell; | 4928 this[_first] = this[_last] = cell; |
4734 } else { | 4929 } else { |
4735 let last = this[_last]; | 4930 let last = this[_last]; |
4736 cell[_previous] = last; | 4931 cell[_previous] = last; |
4737 this[_last] = last[_next] = cell; | 4932 this[_last] = last[_next] = cell; |
4738 } | 4933 } |
4739 this[_length] = dart.notNull(this[_length]) + 1; | 4934 this[_length] = dart.notNull(this[_length]) + 1; |
4740 this[_modified](); | 4935 this[_modified](); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4846 let cell = dart.as(bucket[i], LinkedHashSetCell); | 5041 let cell = dart.as(bucket[i], LinkedHashSetCell); |
4847 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) | 5042 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) |
4848 return i; | 5043 return i; |
4849 } | 5044 } |
4850 return -1; | 5045 return -1; |
4851 } | 5046 } |
4852 [_computeHashCode](element) { | 5047 [_computeHashCode](element) { |
4853 return this[_hasher](dart.as(element, E)) & 0x3ffffff; | 5048 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
4854 } | 5049 } |
4855 add(element) { | 5050 add(element) { |
| 5051 dart.as(element, E); |
4856 return super[_add](element); | 5052 return super[_add](element); |
4857 } | 5053 } |
4858 [core.$contains](object) { | 5054 [core.$contains](object) { |
4859 if (!dart.notNull(dart.dcall(this[_validKey], object))) | 5055 if (!dart.notNull(dart.dcall(this[_validKey], object))) |
4860 return false; | 5056 return false; |
4861 return super[_contains](object); | 5057 return super[_contains](object); |
4862 } | 5058 } |
4863 lookup(object) { | 5059 lookup(object) { |
4864 if (!dart.notNull(dart.dcall(this[_validKey], object))) | 5060 if (!dart.notNull(dart.dcall(this[_validKey], object))) |
4865 return null; | 5061 return null; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4983 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; | 5179 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; |
4984 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; | 5180 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; |
4985 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; | 5181 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; |
4986 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; | 5182 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; |
4987 exports.HashSetIterator$ = HashSetIterator$; | 5183 exports.HashSetIterator$ = HashSetIterator$; |
4988 exports.HashSetIterator = HashSetIterator; | 5184 exports.HashSetIterator = HashSetIterator; |
4989 exports.LinkedHashSetCell = LinkedHashSetCell; | 5185 exports.LinkedHashSetCell = LinkedHashSetCell; |
4990 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; | 5186 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; |
4991 exports.LinkedHashSetIterator = LinkedHashSetIterator; | 5187 exports.LinkedHashSetIterator = LinkedHashSetIterator; |
4992 })(collection || (collection = {})); | 5188 })(collection || (collection = {})); |
OLD | NEW |