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

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

Issue 1047023002: use == and != to enable handling null/undefined (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/convert.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 super.UnmodifiableListBase(); 9 super.UnmodifiableListBase();
10 } 10 }
(...skipping 14 matching lines...) Expand all
25 // Function _defaultHashCode: (dynamic) → int 25 // Function _defaultHashCode: (dynamic) → int
26 function _defaultHashCode(a) { 26 function _defaultHashCode(a) {
27 return dart.as(dart.dload(a, 'hashCode'), core.int); 27 return dart.as(dart.dload(a, 'hashCode'), core.int);
28 } 28 }
29 let HashMap$ = dart.generic(function(K, V) { 29 let HashMap$ = dart.generic(function(K, V) {
30 class HashMap extends core.Object { 30 class HashMap extends core.Object {
31 HashMap(opts) { 31 HashMap(opts) {
32 let equals = opts && 'equals' in opts ? opts.equals : null; 32 let equals = opts && 'equals' in opts ? opts.equals : null;
33 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 33 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
34 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 34 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
35 if (isValidKey === null) { 35 if (isValidKey == null) {
36 if (hashCode === null) { 36 if (hashCode == null) {
37 if (equals === null) { 37 if (equals == null) {
38 return new _HashMap(); 38 return new _HashMap();
39 } 39 }
40 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 40 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int");
41 } else { 41 } else {
42 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 42 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
43 return new _IdentityHashMap(); 43 return new _IdentityHashMap();
44 } 44 }
45 if (equals === null) { 45 if (equals == null) {
46 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 46 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool");
47 } 47 }
48 } 48 }
49 } else { 49 } else {
50 if (hashCode === null) { 50 if (hashCode == null) {
51 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 51 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int");
52 } 52 }
53 if (equals === null) { 53 if (equals == null) {
54 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 54 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool");
55 } 55 }
56 } 56 }
57 return new _CustomHashMap(equals, hashCode, isValidKey); 57 return new _CustomHashMap(equals, hashCode, isValidKey);
58 } 58 }
59 identity() { 59 identity() {
60 return new _IdentityHashMap(); 60 return new _IdentityHashMap();
61 } 61 }
62 from(other) { 62 from(other) {
63 let result = new HashMap(); 63 let result = new HashMap();
(...skipping 19 matching lines...) Expand all
83 dart.defineNamedConstructor(HashMap, 'from'); 83 dart.defineNamedConstructor(HashMap, 'from');
84 dart.defineNamedConstructor(HashMap, 'fromIterable'); 84 dart.defineNamedConstructor(HashMap, 'fromIterable');
85 dart.defineNamedConstructor(HashMap, 'fromIterables'); 85 dart.defineNamedConstructor(HashMap, 'fromIterables');
86 return HashMap; 86 return HashMap;
87 }); 87 });
88 let HashMap = HashMap$(dart.dynamic, dart.dynamic); 88 let HashMap = HashMap$(dart.dynamic, dart.dynamic);
89 let _newSet = Symbol('_newSet'); 89 let _newSet = Symbol('_newSet');
90 let SetMixin$ = dart.generic(function(E) { 90 let SetMixin$ = dart.generic(function(E) {
91 class SetMixin extends core.Object { 91 class SetMixin extends core.Object {
92 get isEmpty() { 92 get isEmpty() {
93 return this.length === 0; 93 return this.length == 0;
94 } 94 }
95 get isNotEmpty() { 95 get isNotEmpty() {
96 return this.length !== 0; 96 return this.length != 0;
97 } 97 }
98 clear() { 98 clear() {
99 this.removeAll(this.toList()); 99 this.removeAll(this.toList());
100 } 100 }
101 addAll(elements) { 101 addAll(elements) {
102 for (let element of elements) 102 for (let element of elements)
103 this.add(element); 103 this.add(element);
104 } 104 }
105 removeAll(elements) { 105 removeAll(elements) {
106 for (let element of elements) 106 for (let element of elements)
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 218 }
219 return true; 219 return true;
220 } 220 }
221 join(separator) { 221 join(separator) {
222 if (separator === void 0) 222 if (separator === void 0)
223 separator = ""; 223 separator = "";
224 let iterator = this.iterator; 224 let iterator = this.iterator;
225 if (!dart.notNull(iterator.moveNext())) 225 if (!dart.notNull(iterator.moveNext()))
226 return ""; 226 return "";
227 let buffer = new core.StringBuffer(); 227 let buffer = new core.StringBuffer();
228 if (dart.notNull(separator === null) || dart.notNull(dart.equals(separat or, ""))) { 228 if (dart.notNull(separator == null) || dart.notNull(separator == "")) {
229 do { 229 do {
230 buffer.write(`${iterator.current}`); 230 buffer.write(`${iterator.current}`);
231 } while (iterator.moveNext()); 231 } while (iterator.moveNext());
232 } else { 232 } else {
233 buffer.write(`${iterator.current}`); 233 buffer.write(`${iterator.current}`);
234 while (iterator.moveNext()) { 234 while (iterator.moveNext()) {
235 buffer.write(separator); 235 buffer.write(separator);
236 buffer.write(`${iterator.current}`); 236 buffer.write(`${iterator.current}`);
237 } 237 }
238 } 238 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 result = dart.as(it.current, E); 274 result = dart.as(it.current, E);
275 } while (it.moveNext()); 275 } while (it.moveNext());
276 return result; 276 return result;
277 } 277 }
278 firstWhere(test, opts) { 278 firstWhere(test, opts) {
279 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 279 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
280 for (let element of this) { 280 for (let element of this) {
281 if (test(element)) 281 if (test(element))
282 return element; 282 return element;
283 } 283 }
284 if (orElse !== null) 284 if (orElse != null)
285 return orElse(); 285 return orElse();
286 throw _internal.IterableElementError.noElement(); 286 throw _internal.IterableElementError.noElement();
287 } 287 }
288 lastWhere(test, opts) { 288 lastWhere(test, opts) {
289 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 289 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
290 let result = null; 290 let result = null;
291 let foundMatching = false; 291 let foundMatching = false;
292 for (let element of this) { 292 for (let element of this) {
293 if (test(element)) { 293 if (test(element)) {
294 result = element; 294 result = element;
295 foundMatching = true; 295 foundMatching = true;
296 } 296 }
297 } 297 }
298 if (foundMatching) 298 if (foundMatching)
299 return result; 299 return result;
300 if (orElse !== null) 300 if (orElse != null)
301 return orElse(); 301 return orElse();
302 throw _internal.IterableElementError.noElement(); 302 throw _internal.IterableElementError.noElement();
303 } 303 }
304 singleWhere(test) { 304 singleWhere(test) {
305 let result = null; 305 let result = null;
306 let foundMatching = false; 306 let foundMatching = false;
307 for (let element of this) { 307 for (let element of this) {
308 if (test(element)) { 308 if (test(element)) {
309 if (foundMatching) { 309 if (foundMatching) {
310 throw _internal.IterableElementError.tooMany(); 310 throw _internal.IterableElementError.tooMany();
311 } 311 }
312 result = element; 312 result = element;
313 foundMatching = true; 313 foundMatching = true;
314 } 314 }
315 } 315 }
316 if (foundMatching) 316 if (foundMatching)
317 return result; 317 return result;
318 throw _internal.IterableElementError.noElement(); 318 throw _internal.IterableElementError.noElement();
319 } 319 }
320 elementAt(index) { 320 elementAt(index) {
321 if (!(typeof index == 'number')) 321 if (!(typeof index == 'number'))
322 throw new core.ArgumentError.notNull("index"); 322 throw new core.ArgumentError.notNull("index");
323 core.RangeError.checkNotNegative(index, "index"); 323 core.RangeError.checkNotNegative(index, "index");
324 let elementIndex = 0; 324 let elementIndex = 0;
325 for (let element of this) { 325 for (let element of this) {
326 if (index === elementIndex) 326 if (index == elementIndex)
327 return element; 327 return element;
328 elementIndex = dart.notNull(elementIndex) + 1; 328 elementIndex = dart.notNull(elementIndex) + 1;
329 } 329 }
330 throw new core.RangeError.index(index, this, "index", null, elementIndex ); 330 throw new core.RangeError.index(index, this, "index", null, elementIndex );
331 } 331 }
332 } 332 }
333 return SetMixin; 333 return SetMixin;
334 }); 334 });
335 let SetMixin = SetMixin$(dart.dynamic); 335 let SetMixin = SetMixin$(dart.dynamic);
336 let SetBase$ = dart.generic(function(E) { 336 let SetBase$ = dart.generic(function(E) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 369 }
370 return _HashSetBase; 370 return _HashSetBase;
371 }); 371 });
372 let _HashSetBase = _HashSetBase$(dart.dynamic); 372 let _HashSetBase = _HashSetBase$(dart.dynamic);
373 let HashSet$ = dart.generic(function(E) { 373 let HashSet$ = dart.generic(function(E) {
374 class HashSet extends core.Object { 374 class HashSet extends core.Object {
375 HashSet(opts) { 375 HashSet(opts) {
376 let equals = opts && 'equals' in opts ? opts.equals : null; 376 let equals = opts && 'equals' in opts ? opts.equals : null;
377 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 377 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
378 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 378 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
379 if (isValidKey === null) { 379 if (isValidKey == null) {
380 if (hashCode === null) { 380 if (hashCode == null) {
381 if (equals === null) { 381 if (equals == null) {
382 return new _HashSet(); 382 return new _HashSet();
383 } 383 }
384 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 384 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int");
385 } else { 385 } else {
386 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 386 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
387 return new _IdentityHashSet(); 387 return new _IdentityHashSet();
388 } 388 }
389 if (equals === null) { 389 if (equals == null) {
390 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 390 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool");
391 } 391 }
392 } 392 }
393 } else { 393 } else {
394 if (hashCode === null) { 394 if (hashCode == null) {
395 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 395 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int");
396 } 396 }
397 if (equals === null) { 397 if (equals == null) {
398 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 398 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool");
399 } 399 }
400 } 400 }
401 return new _CustomHashSet(equals, hashCode, isValidKey); 401 return new _CustomHashSet(equals, hashCode, isValidKey);
402 } 402 }
403 identity() { 403 identity() {
404 return new _IdentityHashSet(); 404 return new _IdentityHashSet();
405 } 405 }
406 from(elements) { 406 from(elements) {
407 let result = new HashSet(); 407 let result = new HashSet();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 } 461 }
462 return true; 462 return true;
463 } 463 }
464 join(separator) { 464 join(separator) {
465 if (separator === void 0) 465 if (separator === void 0)
466 separator = ""; 466 separator = "";
467 let iterator = this.iterator; 467 let iterator = this.iterator;
468 if (!dart.notNull(iterator.moveNext())) 468 if (!dart.notNull(iterator.moveNext()))
469 return ""; 469 return "";
470 let buffer = new core.StringBuffer(); 470 let buffer = new core.StringBuffer();
471 if (dart.notNull(separator === null) || dart.notNull(dart.equals(separat or, ""))) { 471 if (dart.notNull(separator == null) || dart.notNull(separator == "")) {
472 do { 472 do {
473 buffer.write(`${iterator.current}`); 473 buffer.write(`${iterator.current}`);
474 } while (iterator.moveNext()); 474 } while (iterator.moveNext());
475 } else { 475 } else {
476 buffer.write(`${iterator.current}`); 476 buffer.write(`${iterator.current}`);
477 while (iterator.moveNext()) { 477 while (iterator.moveNext()) {
478 buffer.write(separator); 478 buffer.write(separator);
479 buffer.write(`${iterator.current}`); 479 buffer.write(`${iterator.current}`);
480 } 480 }
481 } 481 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 if (it.moveNext()) 548 if (it.moveNext())
549 throw _internal.IterableElementError.tooMany(); 549 throw _internal.IterableElementError.tooMany();
550 return result; 550 return result;
551 } 551 }
552 firstWhere(test, opts) { 552 firstWhere(test, opts) {
553 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 553 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
554 for (let element of this) { 554 for (let element of this) {
555 if (test(element)) 555 if (test(element))
556 return element; 556 return element;
557 } 557 }
558 if (orElse !== null) 558 if (orElse != null)
559 return orElse(); 559 return orElse();
560 throw _internal.IterableElementError.noElement(); 560 throw _internal.IterableElementError.noElement();
561 } 561 }
562 lastWhere(test, opts) { 562 lastWhere(test, opts) {
563 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 563 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
564 let result = null; 564 let result = null;
565 let foundMatching = false; 565 let foundMatching = false;
566 for (let element of this) { 566 for (let element of this) {
567 if (test(element)) { 567 if (test(element)) {
568 result = element; 568 result = element;
569 foundMatching = true; 569 foundMatching = true;
570 } 570 }
571 } 571 }
572 if (foundMatching) 572 if (foundMatching)
573 return result; 573 return result;
574 if (orElse !== null) 574 if (orElse != null)
575 return orElse(); 575 return orElse();
576 throw _internal.IterableElementError.noElement(); 576 throw _internal.IterableElementError.noElement();
577 } 577 }
578 singleWhere(test) { 578 singleWhere(test) {
579 let result = null; 579 let result = null;
580 let foundMatching = false; 580 let foundMatching = false;
581 for (let element of this) { 581 for (let element of this) {
582 if (test(element)) { 582 if (test(element)) {
583 if (foundMatching) { 583 if (foundMatching) {
584 throw _internal.IterableElementError.tooMany(); 584 throw _internal.IterableElementError.tooMany();
585 } 585 }
586 result = element; 586 result = element;
587 foundMatching = true; 587 foundMatching = true;
588 } 588 }
589 } 589 }
590 if (foundMatching) 590 if (foundMatching)
591 return result; 591 return result;
592 throw _internal.IterableElementError.noElement(); 592 throw _internal.IterableElementError.noElement();
593 } 593 }
594 elementAt(index) { 594 elementAt(index) {
595 if (!(typeof index == 'number')) 595 if (!(typeof index == 'number'))
596 throw new core.ArgumentError.notNull("index"); 596 throw new core.ArgumentError.notNull("index");
597 core.RangeError.checkNotNegative(index, "index"); 597 core.RangeError.checkNotNegative(index, "index");
598 let elementIndex = 0; 598 let elementIndex = 0;
599 for (let element of this) { 599 for (let element of this) {
600 if (index === elementIndex) 600 if (index == elementIndex)
601 return element; 601 return element;
602 elementIndex = dart.notNull(elementIndex) + 1; 602 elementIndex = dart.notNull(elementIndex) + 1;
603 } 603 }
604 throw new core.RangeError.index(index, this, "index", null, elementIndex ); 604 throw new core.RangeError.index(index, this, "index", null, elementIndex );
605 } 605 }
606 toString() { 606 toString() {
607 return IterableBase.iterableToShortString(this, '(', ')'); 607 return IterableBase.iterableToShortString(this, '(', ')');
608 } 608 }
609 } 609 }
610 return IterableMixin; 610 return IterableMixin;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 } 661 }
662 return true; 662 return true;
663 } 663 }
664 join(separator) { 664 join(separator) {
665 if (separator === void 0) 665 if (separator === void 0)
666 separator = ""; 666 separator = "";
667 let iterator = this.iterator; 667 let iterator = this.iterator;
668 if (!dart.notNull(iterator.moveNext())) 668 if (!dart.notNull(iterator.moveNext()))
669 return ""; 669 return "";
670 let buffer = new core.StringBuffer(); 670 let buffer = new core.StringBuffer();
671 if (dart.notNull(separator === null) || dart.notNull(dart.equals(separat or, ""))) { 671 if (dart.notNull(separator == null) || dart.notNull(separator == "")) {
672 do { 672 do {
673 buffer.write(`${iterator.current}`); 673 buffer.write(`${iterator.current}`);
674 } while (iterator.moveNext()); 674 } while (iterator.moveNext());
675 } else { 675 } else {
676 buffer.write(`${iterator.current}`); 676 buffer.write(`${iterator.current}`);
677 while (iterator.moveNext()) { 677 while (iterator.moveNext()) {
678 buffer.write(separator); 678 buffer.write(separator);
679 buffer.write(`${iterator.current}`); 679 buffer.write(`${iterator.current}`);
680 } 680 }
681 } 681 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 if (it.moveNext()) 748 if (it.moveNext())
749 throw _internal.IterableElementError.tooMany(); 749 throw _internal.IterableElementError.tooMany();
750 return result; 750 return result;
751 } 751 }
752 firstWhere(test, opts) { 752 firstWhere(test, opts) {
753 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 753 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
754 for (let element of this) { 754 for (let element of this) {
755 if (test(element)) 755 if (test(element))
756 return element; 756 return element;
757 } 757 }
758 if (orElse !== null) 758 if (orElse != null)
759 return orElse(); 759 return orElse();
760 throw _internal.IterableElementError.noElement(); 760 throw _internal.IterableElementError.noElement();
761 } 761 }
762 lastWhere(test, opts) { 762 lastWhere(test, opts) {
763 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 763 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
764 let result = null; 764 let result = null;
765 let foundMatching = false; 765 let foundMatching = false;
766 for (let element of this) { 766 for (let element of this) {
767 if (test(element)) { 767 if (test(element)) {
768 result = element; 768 result = element;
769 foundMatching = true; 769 foundMatching = true;
770 } 770 }
771 } 771 }
772 if (foundMatching) 772 if (foundMatching)
773 return result; 773 return result;
774 if (orElse !== null) 774 if (orElse != null)
775 return orElse(); 775 return orElse();
776 throw _internal.IterableElementError.noElement(); 776 throw _internal.IterableElementError.noElement();
777 } 777 }
778 singleWhere(test) { 778 singleWhere(test) {
779 let result = null; 779 let result = null;
780 let foundMatching = false; 780 let foundMatching = false;
781 for (let element of this) { 781 for (let element of this) {
782 if (test(element)) { 782 if (test(element)) {
783 if (foundMatching) { 783 if (foundMatching) {
784 throw _internal.IterableElementError.tooMany(); 784 throw _internal.IterableElementError.tooMany();
785 } 785 }
786 result = element; 786 result = element;
787 foundMatching = true; 787 foundMatching = true;
788 } 788 }
789 } 789 }
790 if (foundMatching) 790 if (foundMatching)
791 return result; 791 return result;
792 throw _internal.IterableElementError.noElement(); 792 throw _internal.IterableElementError.noElement();
793 } 793 }
794 elementAt(index) { 794 elementAt(index) {
795 if (!(typeof index == 'number')) 795 if (!(typeof index == 'number'))
796 throw new core.ArgumentError.notNull("index"); 796 throw new core.ArgumentError.notNull("index");
797 core.RangeError.checkNotNegative(index, "index"); 797 core.RangeError.checkNotNegative(index, "index");
798 let elementIndex = 0; 798 let elementIndex = 0;
799 for (let element of this) { 799 for (let element of this) {
800 if (index === elementIndex) 800 if (index == elementIndex)
801 return element; 801 return element;
802 elementIndex = dart.notNull(elementIndex) + 1; 802 elementIndex = dart.notNull(elementIndex) + 1;
803 } 803 }
804 throw new core.RangeError.index(index, this, "index", null, elementIndex ); 804 throw new core.RangeError.index(index, this, "index", null, elementIndex );
805 } 805 }
806 toString() { 806 toString() {
807 return IterableBase.iterableToShortString(this, '(', ')'); 807 return IterableBase.iterableToShortString(this, '(', ')');
808 } 808 }
809 static iterableToShortString(iterable, leftDelimiter, rightDelimiter) { 809 static iterableToShortString(iterable, leftDelimiter, rightDelimiter) {
810 if (leftDelimiter === void 0) 810 if (leftDelimiter === void 0)
811 leftDelimiter = '('; 811 leftDelimiter = '(';
812 if (rightDelimiter === void 0) 812 if (rightDelimiter === void 0)
813 rightDelimiter = ')'; 813 rightDelimiter = ')';
814 if (IterableBase[_isToStringVisiting](iterable)) { 814 if (IterableBase[_isToStringVisiting](iterable)) {
815 if (dart.notNull(dart.equals(leftDelimiter, "(")) && dart.notNull(dart .equals(rightDelimiter, ")"))) { 815 if (dart.notNull(leftDelimiter == "(") && dart.notNull(rightDelimiter == ")")) {
816 return "(...)"; 816 return "(...)";
817 } 817 }
818 return `${leftDelimiter}...${rightDelimiter}`; 818 return `${leftDelimiter}...${rightDelimiter}`;
819 } 819 }
820 let parts = new core.List.from([]); 820 let parts = new core.List.from([]);
821 IterableBase[_toStringVisiting].add(iterable); 821 IterableBase[_toStringVisiting].add(iterable);
822 try { 822 try {
823 IterableBase[_iterablePartsToStrings](iterable, parts); 823 IterableBase[_iterablePartsToStrings](iterable, parts);
824 } finally { 824 } finally {
825 dart.assert(core.identical(IterableBase[_toStringVisiting].last, itera ble)); 825 dart.assert(core.identical(IterableBase[_toStringVisiting].last, itera ble));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 length = dart.notNull(ultimateString.length) + dart.notNull(penultim ateString.length) + 2 * dart.notNull(OVERHEAD); 917 length = dart.notNull(ultimateString.length) + dart.notNull(penultim ateString.length) + 2 * dart.notNull(OVERHEAD);
918 } 918 }
919 } 919 }
920 let elision = null; 920 let elision = null;
921 if (dart.notNull(count) > dart.notNull(parts.length) + dart.notNull(TAIL _COUNT)) { 921 if (dart.notNull(count) > dart.notNull(parts.length) + dart.notNull(TAIL _COUNT)) {
922 elision = "..."; 922 elision = "...";
923 length = dart.notNull(ELLIPSIS_SIZE) + dart.notNull(OVERHEAD); 923 length = dart.notNull(ELLIPSIS_SIZE) + dart.notNull(OVERHEAD);
924 } 924 }
925 while (dart.notNull(length) > dart.notNull(LENGTH_LIMIT) && dart.notNull (parts.length) > dart.notNull(HEAD_COUNT)) { 925 while (dart.notNull(length) > dart.notNull(LENGTH_LIMIT) && dart.notNull (parts.length) > dart.notNull(HEAD_COUNT)) {
926 length = dart.as(dart.dbinary(dart.dload(parts.removeLast(), 'length') , '+', OVERHEAD), core.int); 926 length = dart.as(dart.dbinary(dart.dload(parts.removeLast(), 'length') , '+', OVERHEAD), core.int);
927 if (elision === null) { 927 if (elision == null) {
928 elision = "..."; 928 elision = "...";
929 length = dart.notNull(ELLIPSIS_SIZE) + dart.notNull(OVERHEAD); 929 length = dart.notNull(ELLIPSIS_SIZE) + dart.notNull(OVERHEAD);
930 } 930 }
931 } 931 }
932 if (elision !== null) { 932 if (elision != null) {
933 parts.add(elision); 933 parts.add(elision);
934 } 934 }
935 parts.add(penultimateString); 935 parts.add(penultimateString);
936 parts.add(ultimateString); 936 parts.add(ultimateString);
937 } 937 }
938 } 938 }
939 dart.defineLazyProperties(IterableBase, { 939 dart.defineLazyProperties(IterableBase, {
940 get _toStringVisiting() { 940 get _toStringVisiting() {
941 return new core.List.from([]); 941 return new core.List.from([]);
942 } 942 }
943 }); 943 });
944 return IterableBase; 944 return IterableBase;
945 }); 945 });
946 let IterableBase = IterableBase$(dart.dynamic); 946 let IterableBase = IterableBase$(dart.dynamic);
947 let _iterator = Symbol('_iterator'); 947 let _iterator = Symbol('_iterator');
948 let _NOT_MOVED_YET = Symbol('_NOT_MOVED_YET'); 948 let _NOT_MOVED_YET = Symbol('_NOT_MOVED_YET');
949 let _state = Symbol('_state'); 949 let _state = Symbol('_state');
950 let _move = Symbol('_move'); 950 let _move = Symbol('_move');
951 let _HAS_NEXT_AND_NEXT_IN_CURRENT = Symbol('_HAS_NEXT_AND_NEXT_IN_CURRENT'); 951 let _HAS_NEXT_AND_NEXT_IN_CURRENT = Symbol('_HAS_NEXT_AND_NEXT_IN_CURRENT');
952 let _NO_NEXT = Symbol('_NO_NEXT'); 952 let _NO_NEXT = Symbol('_NO_NEXT');
953 let HasNextIterator$ = dart.generic(function(E) { 953 let HasNextIterator$ = dart.generic(function(E) {
954 class HasNextIterator extends core.Object { 954 class HasNextIterator extends core.Object {
955 HasNextIterator(iterator$) { 955 HasNextIterator(iterator$) {
956 this[_iterator] = iterator$; 956 this[_iterator] = iterator$;
957 this[_state] = HasNextIterator[_NOT_MOVED_YET]; 957 this[_state] = HasNextIterator[_NOT_MOVED_YET];
958 } 958 }
959 get hasNext() { 959 get hasNext() {
960 if (this[_state] === HasNextIterator[_NOT_MOVED_YET]) 960 if (this[_state] == HasNextIterator[_NOT_MOVED_YET])
961 this[_move](); 961 this[_move]();
962 return this[_state] === HasNextIterator[_HAS_NEXT_AND_NEXT_IN_CURRENT]; 962 return this[_state] == HasNextIterator[_HAS_NEXT_AND_NEXT_IN_CURRENT];
963 } 963 }
964 next() { 964 next() {
965 if (!dart.notNull(this.hasNext)) 965 if (!dart.notNull(this.hasNext))
966 throw new core.StateError("No more elements"); 966 throw new core.StateError("No more elements");
967 dart.assert(this[_state] === HasNextIterator[_HAS_NEXT_AND_NEXT_IN_CURRE NT]); 967 dart.assert(this[_state] == HasNextIterator[_HAS_NEXT_AND_NEXT_IN_CURREN T]);
968 let result = dart.as(this[_iterator].current, E); 968 let result = dart.as(this[_iterator].current, E);
969 this[_move](); 969 this[_move]();
970 return result; 970 return result;
971 } 971 }
972 [_move]() { 972 [_move]() {
973 if (this[_iterator].moveNext()) { 973 if (this[_iterator].moveNext()) {
974 this[_state] = HasNextIterator[_HAS_NEXT_AND_NEXT_IN_CURRENT]; 974 this[_state] = HasNextIterator[_HAS_NEXT_AND_NEXT_IN_CURRENT];
975 } else { 975 } else {
976 this[_state] = HasNextIterator[_NO_NEXT]; 976 this[_state] = HasNextIterator[_NO_NEXT];
977 } 977 }
978 } 978 }
979 } 979 }
980 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; 980 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0;
981 HasNextIterator._NO_NEXT = 1; 981 HasNextIterator._NO_NEXT = 1;
982 HasNextIterator._NOT_MOVED_YET = 2; 982 HasNextIterator._NOT_MOVED_YET = 2;
983 return HasNextIterator; 983 return HasNextIterator;
984 }); 984 });
985 let HasNextIterator = HasNextIterator$(dart.dynamic); 985 let HasNextIterator = HasNextIterator$(dart.dynamic);
986 let _literal = Symbol('_literal'); 986 let _literal = Symbol('_literal');
987 let _empty = Symbol('_empty'); 987 let _empty = Symbol('_empty');
988 let LinkedHashMap$ = dart.generic(function(K, V) { 988 let LinkedHashMap$ = dart.generic(function(K, V) {
989 class LinkedHashMap extends core.Object { 989 class LinkedHashMap extends core.Object {
990 LinkedHashMap(opts) { 990 LinkedHashMap(opts) {
991 let equals = opts && 'equals' in opts ? opts.equals : null; 991 let equals = opts && 'equals' in opts ? opts.equals : null;
992 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 992 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
993 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 993 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
994 if (isValidKey === null) { 994 if (isValidKey == null) {
995 if (hashCode === null) { 995 if (hashCode == null) {
996 if (equals === null) { 996 if (equals == null) {
997 return new _LinkedHashMap(); 997 return new _LinkedHashMap();
998 } 998 }
999 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 999 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int");
1000 } else { 1000 } else {
1001 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1001 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
1002 return new _LinkedIdentityHashMap(); 1002 return new _LinkedIdentityHashMap();
1003 } 1003 }
1004 if (equals === null) { 1004 if (equals == null) {
1005 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 1005 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool");
1006 } 1006 }
1007 } 1007 }
1008 } else { 1008 } else {
1009 if (hashCode === null) { 1009 if (hashCode == null) {
1010 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 1010 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int");
1011 } 1011 }
1012 if (equals === null) { 1012 if (equals == null) {
1013 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 1013 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool");
1014 } 1014 }
1015 } 1015 }
1016 return new _LinkedCustomHashMap(equals, hashCode, isValidKey); 1016 return new _LinkedCustomHashMap(equals, hashCode, isValidKey);
1017 } 1017 }
1018 identity() { 1018 identity() {
1019 return new _LinkedIdentityHashMap(); 1019 return new _LinkedIdentityHashMap();
1020 } 1020 }
1021 from(other) { 1021 from(other) {
1022 let result = new LinkedHashMap(); 1022 let result = new LinkedHashMap();
(...skipping 29 matching lines...) Expand all
1052 dart.defineNamedConstructor(LinkedHashMap, _empty); 1052 dart.defineNamedConstructor(LinkedHashMap, _empty);
1053 return LinkedHashMap; 1053 return LinkedHashMap;
1054 }); 1054 });
1055 let LinkedHashMap = LinkedHashMap$(dart.dynamic, dart.dynamic); 1055 let LinkedHashMap = LinkedHashMap$(dart.dynamic, dart.dynamic);
1056 let LinkedHashSet$ = dart.generic(function(E) { 1056 let LinkedHashSet$ = dart.generic(function(E) {
1057 class LinkedHashSet extends core.Object { 1057 class LinkedHashSet extends core.Object {
1058 LinkedHashSet(opts) { 1058 LinkedHashSet(opts) {
1059 let equals = opts && 'equals' in opts ? opts.equals : null; 1059 let equals = opts && 'equals' in opts ? opts.equals : null;
1060 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 1060 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
1061 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 1061 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
1062 if (isValidKey === null) { 1062 if (isValidKey == null) {
1063 if (hashCode === null) { 1063 if (hashCode == null) {
1064 if (equals === null) { 1064 if (equals == null) {
1065 return new _LinkedHashSet(); 1065 return new _LinkedHashSet();
1066 } 1066 }
1067 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 1067 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int");
1068 } else { 1068 } else {
1069 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1069 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
1070 return new _LinkedIdentityHashSet(); 1070 return new _LinkedIdentityHashSet();
1071 } 1071 }
1072 if (equals === null) { 1072 if (equals == null) {
1073 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 1073 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool");
1074 } 1074 }
1075 } 1075 }
1076 } else { 1076 } else {
1077 if (hashCode === null) { 1077 if (hashCode == null) {
1078 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 1078 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int");
1079 } 1079 }
1080 if (equals === null) { 1080 if (equals == null) {
1081 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 1081 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool");
1082 } 1082 }
1083 } 1083 }
1084 return new _LinkedCustomHashSet(equals, hashCode, isValidKey); 1084 return new _LinkedCustomHashSet(equals, hashCode, isValidKey);
1085 } 1085 }
1086 identity() { 1086 identity() {
1087 return new _LinkedIdentityHashSet(); 1087 return new _LinkedIdentityHashSet();
1088 } 1088 }
1089 from(elements) { 1089 from(elements) {
1090 let result = new LinkedHashSet(); 1090 let result = new LinkedHashSet();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 if (!dart.notNull(core.identical(this[_previous], this[_next]))) { 1167 if (!dart.notNull(core.identical(this[_previous], this[_next]))) {
1168 throw new core.StateError('Too many elements'); 1168 throw new core.StateError('Too many elements');
1169 } 1169 }
1170 return dart.as(this[_next], E); 1170 return dart.as(this[_next], E);
1171 } 1171 }
1172 forEach(action) { 1172 forEach(action) {
1173 let modificationCount = this[_modificationCount]; 1173 let modificationCount = this[_modificationCount];
1174 let current = this[_next]; 1174 let current = this[_next];
1175 while (!dart.notNull(core.identical(current, this))) { 1175 while (!dart.notNull(core.identical(current, this))) {
1176 action(dart.as(current, E)); 1176 action(dart.as(current, E));
1177 if (modificationCount !== this[_modificationCount]) { 1177 if (modificationCount != this[_modificationCount]) {
1178 throw new core.ConcurrentModificationError(this); 1178 throw new core.ConcurrentModificationError(this);
1179 } 1179 }
1180 current = current[_next]; 1180 current = current[_next];
1181 } 1181 }
1182 } 1182 }
1183 get isEmpty() { 1183 get isEmpty() {
1184 return this[_length] === 0; 1184 return this[_length] == 0;
1185 } 1185 }
1186 [_insertAfter](entry, newEntry) { 1186 [_insertAfter](entry, newEntry) {
1187 if (newEntry.list !== null) { 1187 if (newEntry.list != null) {
1188 throw new core.StateError('LinkedListEntry is already in a LinkedList' ); 1188 throw new core.StateError('LinkedListEntry is already in a LinkedList' );
1189 } 1189 }
1190 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 1190 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
1191 newEntry[_list] = this; 1191 newEntry[_list] = this;
1192 let predecessor = entry; 1192 let predecessor = entry;
1193 let successor = entry[_next]; 1193 let successor = entry[_next];
1194 successor[_previous] = newEntry; 1194 successor[_previous] = newEntry;
1195 newEntry[_previous] = predecessor; 1195 newEntry[_previous] = predecessor;
1196 newEntry[_next] = successor; 1196 newEntry[_next] = successor;
1197 predecessor[_next] = newEntry; 1197 predecessor[_next] = newEntry;
(...skipping 20 matching lines...) Expand all
1218 this[_current] = null; 1218 this[_current] = null;
1219 } 1219 }
1220 get current() { 1220 get current() {
1221 return this[_current]; 1221 return this[_current];
1222 } 1222 }
1223 moveNext() { 1223 moveNext() {
1224 if (core.identical(this[_next], this[_list])) { 1224 if (core.identical(this[_next], this[_list])) {
1225 this[_current] = null; 1225 this[_current] = null;
1226 return false; 1226 return false;
1227 } 1227 }
1228 if (this[_modificationCount] !== this[_list][_modificationCount]) { 1228 if (this[_modificationCount] != this[_list][_modificationCount]) {
1229 throw new core.ConcurrentModificationError(this); 1229 throw new core.ConcurrentModificationError(this);
1230 } 1230 }
1231 this[_current] = dart.as(this[_next], E); 1231 this[_current] = dart.as(this[_next], E);
1232 this[_next] = this[_next][_next]; 1232 this[_next] = this[_next][_next];
1233 return true; 1233 return true;
1234 } 1234 }
1235 } 1235 }
1236 return _LinkedListIterator; 1236 return _LinkedListIterator;
1237 }); 1237 });
1238 let _LinkedListIterator = _LinkedListIterator$(dart.dynamic); 1238 let _LinkedListIterator = _LinkedListIterator$(dart.dynamic);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 get iterator() { 1282 get iterator() {
1283 return new _internal.ListIterator(this); 1283 return new _internal.ListIterator(this);
1284 } 1284 }
1285 elementAt(index) { 1285 elementAt(index) {
1286 return this.get(index); 1286 return this.get(index);
1287 } 1287 }
1288 forEach(action) { 1288 forEach(action) {
1289 let length = this.length; 1289 let length = this.length;
1290 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1290 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1291 action(this.get(i)); 1291 action(this.get(i));
1292 if (length !== this.length) { 1292 if (length != this.length) {
1293 throw new core.ConcurrentModificationError(this); 1293 throw new core.ConcurrentModificationError(this);
1294 } 1294 }
1295 } 1295 }
1296 } 1296 }
1297 get isEmpty() { 1297 get isEmpty() {
1298 return this.length === 0; 1298 return this.length == 0;
1299 } 1299 }
1300 get isNotEmpty() { 1300 get isNotEmpty() {
1301 return !dart.notNull(this.isEmpty); 1301 return !dart.notNull(this.isEmpty);
1302 } 1302 }
1303 get first() { 1303 get first() {
1304 if (this.length === 0) 1304 if (this.length == 0)
1305 throw _internal.IterableElementError.noElement(); 1305 throw _internal.IterableElementError.noElement();
1306 return this.get(0); 1306 return this.get(0);
1307 } 1307 }
1308 get last() { 1308 get last() {
1309 if (this.length === 0) 1309 if (this.length == 0)
1310 throw _internal.IterableElementError.noElement(); 1310 throw _internal.IterableElementError.noElement();
1311 return this.get(dart.notNull(this.length) - 1); 1311 return this.get(dart.notNull(this.length) - 1);
1312 } 1312 }
1313 get single() { 1313 get single() {
1314 if (this.length === 0) 1314 if (this.length == 0)
1315 throw _internal.IterableElementError.noElement(); 1315 throw _internal.IterableElementError.noElement();
1316 if (dart.notNull(this.length) > 1) 1316 if (dart.notNull(this.length) > 1)
1317 throw _internal.IterableElementError.tooMany(); 1317 throw _internal.IterableElementError.tooMany();
1318 return this.get(0); 1318 return this.get(0);
1319 } 1319 }
1320 contains(element) { 1320 contains(element) {
1321 let length = this.length; 1321 let length = this.length;
1322 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) { 1322 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no tNull(i) + 1) {
1323 if (dart.equals(this.get(i), element)) 1323 if (dart.equals(this.get(i), element))
1324 return true; 1324 return true;
1325 if (length !== this.length) { 1325 if (length != this.length) {
1326 throw new core.ConcurrentModificationError(this); 1326 throw new core.ConcurrentModificationError(this);
1327 } 1327 }
1328 } 1328 }
1329 return false; 1329 return false;
1330 } 1330 }
1331 every(test) { 1331 every(test) {
1332 let length = this.length; 1332 let length = this.length;
1333 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1333 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1334 if (!dart.notNull(test(this.get(i)))) 1334 if (!dart.notNull(test(this.get(i))))
1335 return false; 1335 return false;
1336 if (length !== this.length) { 1336 if (length != this.length) {
1337 throw new core.ConcurrentModificationError(this); 1337 throw new core.ConcurrentModificationError(this);
1338 } 1338 }
1339 } 1339 }
1340 return true; 1340 return true;
1341 } 1341 }
1342 any(test) { 1342 any(test) {
1343 let length = this.length; 1343 let length = this.length;
1344 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1344 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1345 if (test(this.get(i))) 1345 if (test(this.get(i)))
1346 return true; 1346 return true;
1347 if (length !== this.length) { 1347 if (length != this.length) {
1348 throw new core.ConcurrentModificationError(this); 1348 throw new core.ConcurrentModificationError(this);
1349 } 1349 }
1350 } 1350 }
1351 return false; 1351 return false;
1352 } 1352 }
1353 firstWhere(test, opts) { 1353 firstWhere(test, opts) {
1354 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 1354 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
1355 let length = this.length; 1355 let length = this.length;
1356 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1356 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1357 let element = this.get(i); 1357 let element = this.get(i);
1358 if (test(element)) 1358 if (test(element))
1359 return element; 1359 return element;
1360 if (length !== this.length) { 1360 if (length != this.length) {
1361 throw new core.ConcurrentModificationError(this); 1361 throw new core.ConcurrentModificationError(this);
1362 } 1362 }
1363 } 1363 }
1364 if (orElse !== null) 1364 if (orElse != null)
1365 return orElse(); 1365 return orElse();
1366 throw _internal.IterableElementError.noElement(); 1366 throw _internal.IterableElementError.noElement();
1367 } 1367 }
1368 lastWhere(test, opts) { 1368 lastWhere(test, opts) {
1369 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 1369 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
1370 let length = this.length; 1370 let length = this.length;
1371 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no tNull(i) - 1) { 1371 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no tNull(i) - 1) {
1372 let element = this.get(i); 1372 let element = this.get(i);
1373 if (test(element)) 1373 if (test(element))
1374 return element; 1374 return element;
1375 if (length !== this.length) { 1375 if (length != this.length) {
1376 throw new core.ConcurrentModificationError(this); 1376 throw new core.ConcurrentModificationError(this);
1377 } 1377 }
1378 } 1378 }
1379 if (orElse !== null) 1379 if (orElse != null)
1380 return orElse(); 1380 return orElse();
1381 throw _internal.IterableElementError.noElement(); 1381 throw _internal.IterableElementError.noElement();
1382 } 1382 }
1383 singleWhere(test) { 1383 singleWhere(test) {
1384 let length = this.length; 1384 let length = this.length;
1385 let match = null; 1385 let match = null;
1386 let matchFound = false; 1386 let matchFound = false;
1387 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1387 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1388 let element = this.get(i); 1388 let element = this.get(i);
1389 if (test(element)) { 1389 if (test(element)) {
1390 if (matchFound) { 1390 if (matchFound) {
1391 throw _internal.IterableElementError.tooMany(); 1391 throw _internal.IterableElementError.tooMany();
1392 } 1392 }
1393 matchFound = true; 1393 matchFound = true;
1394 match = element; 1394 match = element;
1395 } 1395 }
1396 if (length !== this.length) { 1396 if (length != this.length) {
1397 throw new core.ConcurrentModificationError(this); 1397 throw new core.ConcurrentModificationError(this);
1398 } 1398 }
1399 } 1399 }
1400 if (matchFound) 1400 if (matchFound)
1401 return match; 1401 return match;
1402 throw _internal.IterableElementError.noElement(); 1402 throw _internal.IterableElementError.noElement();
1403 } 1403 }
1404 join(separator) { 1404 join(separator) {
1405 if (separator === void 0) 1405 if (separator === void 0)
1406 separator = ""; 1406 separator = "";
1407 if (this.length === 0) 1407 if (this.length == 0)
1408 return ""; 1408 return "";
1409 let buffer = new core.StringBuffer(); 1409 let buffer = new core.StringBuffer();
1410 buffer.writeAll(this, separator); 1410 buffer.writeAll(this, separator);
1411 return buffer.toString(); 1411 return buffer.toString();
1412 } 1412 }
1413 where(test) { 1413 where(test) {
1414 return new _internal.WhereIterable(this, test); 1414 return new _internal.WhereIterable(this, test);
1415 } 1415 }
1416 map(f) { 1416 map(f) {
1417 return new _internal.MappedListIterable(this, f); 1417 return new _internal.MappedListIterable(this, f);
1418 } 1418 }
1419 expand(f) { 1419 expand(f) {
1420 return new _internal.ExpandIterable(this, f); 1420 return new _internal.ExpandIterable(this, f);
1421 } 1421 }
1422 reduce(combine) { 1422 reduce(combine) {
1423 let length = this.length; 1423 let length = this.length;
1424 if (length === 0) 1424 if (length == 0)
1425 throw _internal.IterableElementError.noElement(); 1425 throw _internal.IterableElementError.noElement();
1426 let value = this.get(0); 1426 let value = this.get(0);
1427 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1427 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1428 value = combine(value, this.get(i)); 1428 value = combine(value, this.get(i));
1429 if (length !== this.length) { 1429 if (length != this.length) {
1430 throw new core.ConcurrentModificationError(this); 1430 throw new core.ConcurrentModificationError(this);
1431 } 1431 }
1432 } 1432 }
1433 return value; 1433 return value;
1434 } 1434 }
1435 fold(initialValue, combine) { 1435 fold(initialValue, combine) {
1436 let value = initialValue; 1436 let value = initialValue;
1437 let length = this.length; 1437 let length = this.length;
1438 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1438 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1439 value = dart.dinvokef(combine, value, this.get(i)); 1439 value = dart.dinvokef(combine, value, this.get(i));
1440 if (length !== this.length) { 1440 if (length != this.length) {
1441 throw new core.ConcurrentModificationError(this); 1441 throw new core.ConcurrentModificationError(this);
1442 } 1442 }
1443 } 1443 }
1444 return value; 1444 return value;
1445 } 1445 }
1446 skip(count) { 1446 skip(count) {
1447 return new _internal.SubListIterable(this, count, null); 1447 return new _internal.SubListIterable(this, count, null);
1448 } 1448 }
1449 skipWhile(test) { 1449 skipWhile(test) {
1450 return new _internal.SkipWhileIterable(this, test); 1450 return new _internal.SkipWhileIterable(this, test);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 ListMixin[_filter](this, test, false); 1500 ListMixin[_filter](this, test, false);
1501 } 1501 }
1502 retainWhere(test) { 1502 retainWhere(test) {
1503 ListMixin[_filter](this, test, true); 1503 ListMixin[_filter](this, test, true);
1504 } 1504 }
1505 static [_filter](source, test, retainMatching) { 1505 static [_filter](source, test, retainMatching) {
1506 let retained = new core.List.from([]); 1506 let retained = new core.List.from([]);
1507 let length = source.length; 1507 let length = source.length;
1508 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1508 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1509 let element = source.get(i); 1509 let element = source.get(i);
1510 if (dart.dinvokef(test, element) === retainMatching) { 1510 if (dart.dinvokef(test, element) == retainMatching) {
1511 retained.add(element); 1511 retained.add(element);
1512 } 1512 }
1513 if (length !== source.length) { 1513 if (length != source.length) {
1514 throw new core.ConcurrentModificationError(source); 1514 throw new core.ConcurrentModificationError(source);
1515 } 1515 }
1516 } 1516 }
1517 if (retained.length !== source.length) { 1517 if (retained.length != source.length) {
1518 source.setRange(0, retained.length, retained); 1518 source.setRange(0, retained.length, retained);
1519 source.length = retained.length; 1519 source.length = retained.length;
1520 } 1520 }
1521 } 1521 }
1522 clear() { 1522 clear() {
1523 this.length = 0; 1523 this.length = 0;
1524 } 1524 }
1525 removeLast() { 1525 removeLast() {
1526 if (this.length === 0) { 1526 if (this.length == 0) {
1527 throw _internal.IterableElementError.noElement(); 1527 throw _internal.IterableElementError.noElement();
1528 } 1528 }
1529 let result = this.get(dart.notNull(this.length) - 1); 1529 let result = this.get(dart.notNull(this.length) - 1);
1530 this.length = dart.notNull(this.length) - 1; 1530 this.length = dart.notNull(this.length) - 1;
1531 return result; 1531 return result;
1532 } 1532 }
1533 sort(compare) { 1533 sort(compare) {
1534 if (compare === void 0) 1534 if (compare === void 0)
1535 compare = null; 1535 compare = null;
1536 if (compare === null) { 1536 if (compare == null) {
1537 let defaultCompare = core.Comparable.compare; 1537 let defaultCompare = core.Comparable.compare;
1538 compare = defaultCompare; 1538 compare = defaultCompare;
1539 } 1539 }
1540 _internal.Sort.sort(this, compare); 1540 _internal.Sort.sort(this, compare);
1541 } 1541 }
1542 shuffle(random) { 1542 shuffle(random) {
1543 if (random === void 0) 1543 if (random === void 0)
1544 random = null; 1544 random = null;
1545 if (random === null) 1545 if (random == null)
1546 random = new math.Random(); 1546 random = new math.Random();
1547 let length = this.length; 1547 let length = this.length;
1548 while (dart.notNull(length) > 1) { 1548 while (dart.notNull(length) > 1) {
1549 let pos = random.nextInt(length); 1549 let pos = random.nextInt(length);
1550 length = 1; 1550 length = 1;
1551 let tmp = this.get(length); 1551 let tmp = this.get(length);
1552 this.set(length, this.get(pos)); 1552 this.set(length, this.get(pos));
1553 this.set(pos, tmp); 1553 this.set(pos, tmp);
1554 } 1554 }
1555 } 1555 }
1556 asMap() { 1556 asMap() {
1557 return new _internal.ListMapView(this); 1557 return new _internal.ListMapView(this);
1558 } 1558 }
1559 sublist(start, end) { 1559 sublist(start, end) {
1560 if (end === void 0) 1560 if (end === void 0)
1561 end = null; 1561 end = null;
1562 let listLength = this.length; 1562 let listLength = this.length;
1563 if (end === null) 1563 if (end == null)
1564 end = listLength; 1564 end = listLength;
1565 core.RangeError.checkValidRange(start, end, listLength); 1565 core.RangeError.checkValidRange(start, end, listLength);
1566 let length = dart.notNull(end) - dart.notNull(start); 1566 let length = dart.notNull(end) - dart.notNull(start);
1567 let result = new core.List(); 1567 let result = new core.List();
1568 result.length = length; 1568 result.length = length;
1569 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1569 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1570 result.set(i, this.get(dart.notNull(start) + dart.notNull(i))); 1570 result.set(i, this.get(dart.notNull(start) + dart.notNull(i)));
1571 } 1571 }
1572 return result; 1572 return result;
1573 } 1573 }
(...skipping 13 matching lines...) Expand all
1587 core.RangeError.checkValidRange(start, end, this.length); 1587 core.RangeError.checkValidRange(start, end, this.length);
1588 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) { 1588 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) {
1589 this.set(i, fill); 1589 this.set(i, fill);
1590 } 1590 }
1591 } 1591 }
1592 setRange(start, end, iterable, skipCount) { 1592 setRange(start, end, iterable, skipCount) {
1593 if (skipCount === void 0) 1593 if (skipCount === void 0)
1594 skipCount = 0; 1594 skipCount = 0;
1595 core.RangeError.checkValidRange(start, end, this.length); 1595 core.RangeError.checkValidRange(start, end, this.length);
1596 let length = dart.notNull(end) - dart.notNull(start); 1596 let length = dart.notNull(end) - dart.notNull(start);
1597 if (length === 0) 1597 if (length == 0)
1598 return; 1598 return;
1599 core.RangeError.checkNotNegative(skipCount, "skipCount"); 1599 core.RangeError.checkNotNegative(skipCount, "skipCount");
1600 let otherList = null; 1600 let otherList = null;
1601 let otherStart = null; 1601 let otherStart = null;
1602 if (dart.is(iterable, core.List)) { 1602 if (dart.is(iterable, core.List)) {
1603 otherList = dart.as(iterable, core.List); 1603 otherList = dart.as(iterable, core.List);
1604 otherStart = skipCount; 1604 otherStart = skipCount;
1605 } else { 1605 } else {
1606 otherList = iterable.skip(skipCount).toList({growable: false}); 1606 otherList = iterable.skip(skipCount).toList({growable: false});
1607 otherStart = 0; 1607 otherStart = 0;
(...skipping 16 matching lines...) Expand all
1624 if (!dart.is(newContents, _internal.EfficientLength)) { 1624 if (!dart.is(newContents, _internal.EfficientLength)) {
1625 newContents = newContents.toList(); 1625 newContents = newContents.toList();
1626 } 1626 }
1627 let removeLength = dart.notNull(end) - dart.notNull(start); 1627 let removeLength = dart.notNull(end) - dart.notNull(start);
1628 let insertLength = newContents.length; 1628 let insertLength = newContents.length;
1629 if (dart.notNull(removeLength) >= dart.notNull(insertLength)) { 1629 if (dart.notNull(removeLength) >= dart.notNull(insertLength)) {
1630 let delta = dart.notNull(removeLength) - dart.notNull(insertLength); 1630 let delta = dart.notNull(removeLength) - dart.notNull(insertLength);
1631 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); 1631 let insertEnd = dart.notNull(start) + dart.notNull(insertLength);
1632 let newLength = dart.notNull(this.length) - dart.notNull(delta); 1632 let newLength = dart.notNull(this.length) - dart.notNull(delta);
1633 this.setRange(start, insertEnd, newContents); 1633 this.setRange(start, insertEnd, newContents);
1634 if (delta !== 0) { 1634 if (delta != 0) {
1635 this.setRange(insertEnd, newLength, this, end); 1635 this.setRange(insertEnd, newLength, this, end);
1636 this.length = newLength; 1636 this.length = newLength;
1637 } 1637 }
1638 } else { 1638 } else {
1639 let delta = dart.notNull(insertLength) - dart.notNull(removeLength); 1639 let delta = dart.notNull(insertLength) - dart.notNull(removeLength);
1640 let newLength = dart.notNull(this.length) + dart.notNull(delta); 1640 let newLength = dart.notNull(this.length) + dart.notNull(delta);
1641 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); 1641 let insertEnd = dart.notNull(start) + dart.notNull(insertLength);
1642 this.length = newLength; 1642 this.length = newLength;
1643 this.setRange(insertEnd, newLength, this, end); 1643 this.setRange(insertEnd, newLength, this, end);
1644 this.setRange(start, insertEnd, newContents); 1644 this.setRange(start, insertEnd, newContents);
(...skipping 11 matching lines...) Expand all
1656 for (let i = startIndex; dart.notNull(i) < dart.notNull(this.length); i = dart.notNull(i) + 1) { 1656 for (let i = startIndex; dart.notNull(i) < dart.notNull(this.length); i = dart.notNull(i) + 1) {
1657 if (dart.equals(this.get(i), element)) { 1657 if (dart.equals(this.get(i), element)) {
1658 return i; 1658 return i;
1659 } 1659 }
1660 } 1660 }
1661 return -1; 1661 return -1;
1662 } 1662 }
1663 lastIndexOf(element, startIndex) { 1663 lastIndexOf(element, startIndex) {
1664 if (startIndex === void 0) 1664 if (startIndex === void 0)
1665 startIndex = null; 1665 startIndex = null;
1666 if (startIndex === null) { 1666 if (startIndex == null) {
1667 startIndex = dart.notNull(this.length) - 1; 1667 startIndex = dart.notNull(this.length) - 1;
1668 } else { 1668 } else {
1669 if (dart.notNull(startIndex) < 0) { 1669 if (dart.notNull(startIndex) < 0) {
1670 return -1; 1670 return -1;
1671 } 1671 }
1672 if (dart.notNull(startIndex) >= dart.notNull(this.length)) { 1672 if (dart.notNull(startIndex) >= dart.notNull(this.length)) {
1673 startIndex = dart.notNull(this.length) - 1; 1673 startIndex = dart.notNull(this.length) - 1;
1674 } 1674 }
1675 } 1675 }
1676 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) { 1676 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
1677 if (dart.equals(this.get(i), element)) { 1677 if (dart.equals(this.get(i), element)) {
1678 return i; 1678 return i;
1679 } 1679 }
1680 } 1680 }
1681 return -1; 1681 return -1;
1682 } 1682 }
1683 insert(index, element) { 1683 insert(index, element) {
1684 core.RangeError.checkValueInInterval(index, 0, this.length, "index"); 1684 core.RangeError.checkValueInInterval(index, 0, this.length, "index");
1685 if (index === this.length) { 1685 if (index == this.length) {
1686 this.add(element); 1686 this.add(element);
1687 return; 1687 return;
1688 } 1688 }
1689 if (!(typeof index == 'number')) 1689 if (!(typeof index == 'number'))
1690 throw new core.ArgumentError(index); 1690 throw new core.ArgumentError(index);
1691 this.length = dart.notNull(this.length) + 1; 1691 this.length = dart.notNull(this.length) + 1;
1692 this.setRange(dart.notNull(index) + 1, this.length, this, index); 1692 this.setRange(dart.notNull(index) + 1, this.length, this, index);
1693 this.set(index, element); 1693 this.set(index, element);
1694 } 1694 }
1695 removeAt(index) { 1695 removeAt(index) {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2003 } finally { 2003 } finally {
2004 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m)); 2004 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m));
2005 IterableBase[_toStringVisiting].removeLast(); 2005 IterableBase[_toStringVisiting].removeLast();
2006 } 2006 }
2007 return result.toString(); 2007 return result.toString();
2008 } 2008 }
2009 static [_id](x) { 2009 static [_id](x) {
2010 return x; 2010 return x;
2011 } 2011 }
2012 static [_fillMapWithMappedIterable](map, iterable, key, value) { 2012 static [_fillMapWithMappedIterable](map, iterable, key, value) {
2013 if (key === null) 2013 if (key == null)
2014 key = Maps[_id]; 2014 key = Maps[_id];
2015 if (value === null) 2015 if (value == null)
2016 value = Maps[_id]; 2016 value = Maps[_id];
2017 for (let element of iterable) { 2017 for (let element of iterable) {
2018 map.set(dart.dinvokef(key, element), dart.dinvokef(value, element)); 2018 map.set(dart.dinvokef(key, element), dart.dinvokef(value, element));
2019 } 2019 }
2020 } 2020 }
2021 static [_fillMapWithIterables](map, keys, values) { 2021 static [_fillMapWithIterables](map, keys, values) {
2022 let keyIterator = keys.iterator; 2022 let keyIterator = keys.iterator;
2023 let valueIterator = values.iterator; 2023 let valueIterator = values.iterator;
2024 let hasNextKey = keyIterator.moveNext(); 2024 let hasNextKey = keyIterator.moveNext();
2025 let hasNextValue = valueIterator.moveNext(); 2025 let hasNextValue = valueIterator.moveNext();
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2279 let ListQueue$ = dart.generic(function(E) { 2279 let ListQueue$ = dart.generic(function(E) {
2280 class ListQueue extends IterableBase$(E) { 2280 class ListQueue extends IterableBase$(E) {
2281 ListQueue(initialCapacity) { 2281 ListQueue(initialCapacity) {
2282 if (initialCapacity === void 0) 2282 if (initialCapacity === void 0)
2283 initialCapacity = null; 2283 initialCapacity = null;
2284 this[_head] = 0; 2284 this[_head] = 0;
2285 this[_tail] = 0; 2285 this[_tail] = 0;
2286 this[_table] = null; 2286 this[_table] = null;
2287 this[_modificationCount] = 0; 2287 this[_modificationCount] = 0;
2288 super.IterableBase(); 2288 super.IterableBase();
2289 if (initialCapacity === null || dart.notNull(initialCapacity) < dart.not Null(ListQueue[_INITIAL_CAPACITY])) { 2289 if (initialCapacity == null || dart.notNull(initialCapacity) < dart.notN ull(ListQueue[_INITIAL_CAPACITY])) {
2290 initialCapacity = ListQueue[_INITIAL_CAPACITY]; 2290 initialCapacity = ListQueue[_INITIAL_CAPACITY];
2291 } else if (!dart.notNull(ListQueue[_isPowerOf2](initialCapacity))) { 2291 } else if (!dart.notNull(ListQueue[_isPowerOf2](initialCapacity))) {
2292 initialCapacity = ListQueue[_nextPowerOf2](initialCapacity); 2292 initialCapacity = ListQueue[_nextPowerOf2](initialCapacity);
2293 } 2293 }
2294 dart.assert(ListQueue[_isPowerOf2](initialCapacity)); 2294 dart.assert(ListQueue[_isPowerOf2](initialCapacity));
2295 this[_table] = new core.List(initialCapacity); 2295 this[_table] = new core.List(initialCapacity);
2296 } 2296 }
2297 from(elements) { 2297 from(elements) {
2298 if (dart.is(elements, core.List)) { 2298 if (dart.is(elements, core.List)) {
2299 let length = elements.length; 2299 let length = elements.length;
(...skipping 13 matching lines...) Expand all
2313 result.addLast(element); 2313 result.addLast(element);
2314 } 2314 }
2315 return result; 2315 return result;
2316 } 2316 }
2317 } 2317 }
2318 get iterator() { 2318 get iterator() {
2319 return new _ListQueueIterator(this); 2319 return new _ListQueueIterator(this);
2320 } 2320 }
2321 forEach(action) { 2321 forEach(action) {
2322 let modificationCount = this[_modificationCount]; 2322 let modificationCount = this[_modificationCount];
2323 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d art.notNull(this[_table].length) - 1) { 2323 for (let i = this[_head]; i != this[_tail]; i = dart.notNull(i) + 1 & da rt.notNull(this[_table].length) - 1) {
2324 action(this[_table].get(i)); 2324 action(this[_table].get(i));
2325 this[_checkModification](modificationCount); 2325 this[_checkModification](modificationCount);
2326 } 2326 }
2327 } 2327 }
2328 get isEmpty() { 2328 get isEmpty() {
2329 return this[_head] === this[_tail]; 2329 return this[_head] == this[_tail];
2330 } 2330 }
2331 get length() { 2331 get length() {
2332 return dart.notNull(this[_tail]) - dart.notNull(this[_head]) & dart.notN ull(this[_table].length) - 1; 2332 return dart.notNull(this[_tail]) - dart.notNull(this[_head]) & dart.notN ull(this[_table].length) - 1;
2333 } 2333 }
2334 get first() { 2334 get first() {
2335 if (this[_head] === this[_tail]) 2335 if (this[_head] == this[_tail])
2336 throw _internal.IterableElementError.noElement(); 2336 throw _internal.IterableElementError.noElement();
2337 return this[_table].get(this[_head]); 2337 return this[_table].get(this[_head]);
2338 } 2338 }
2339 get last() { 2339 get last() {
2340 if (this[_head] === this[_tail]) 2340 if (this[_head] == this[_tail])
2341 throw _internal.IterableElementError.noElement(); 2341 throw _internal.IterableElementError.noElement();
2342 return this[_table].get(dart.notNull(this[_tail]) - 1 & dart.notNull(thi s[_table].length) - 1); 2342 return this[_table].get(dart.notNull(this[_tail]) - 1 & dart.notNull(thi s[_table].length) - 1);
2343 } 2343 }
2344 get single() { 2344 get single() {
2345 if (this[_head] === this[_tail]) 2345 if (this[_head] == this[_tail])
2346 throw _internal.IterableElementError.noElement(); 2346 throw _internal.IterableElementError.noElement();
2347 if (dart.notNull(this.length) > 1) 2347 if (dart.notNull(this.length) > 1)
2348 throw _internal.IterableElementError.tooMany(); 2348 throw _internal.IterableElementError.tooMany();
2349 return this[_table].get(this[_head]); 2349 return this[_table].get(this[_head]);
2350 } 2350 }
2351 elementAt(index) { 2351 elementAt(index) {
2352 core.RangeError.checkValidIndex(index, this); 2352 core.RangeError.checkValidIndex(index, this);
2353 return this[_table].get(dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table].length) - 1); 2353 return this[_table].get(dart.notNull(this[_head]) + dart.notNull(index) & dart.notNull(this[_table].length) - 1);
2354 } 2354 }
2355 toList(opts) { 2355 toList(opts) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 this[_tail] = preSpace; 2390 this[_tail] = preSpace;
2391 } 2391 }
2392 } 2392 }
2393 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2393 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2394 } else { 2394 } else {
2395 for (let element of elements) 2395 for (let element of elements)
2396 this[_add](element); 2396 this[_add](element);
2397 } 2397 }
2398 } 2398 }
2399 remove(object) { 2399 remove(object) {
2400 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d art.notNull(this[_table].length) - 1) { 2400 for (let i = this[_head]; i != this[_tail]; i = dart.notNull(i) + 1 & da rt.notNull(this[_table].length) - 1) {
2401 let element = this[_table].get(i); 2401 let element = this[_table].get(i);
2402 if (dart.equals(element, object)) { 2402 if (dart.equals(element, object)) {
2403 this[_remove](i); 2403 this[_remove](i);
2404 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2404 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2405 return true; 2405 return true;
2406 } 2406 }
2407 } 2407 }
2408 return false; 2408 return false;
2409 } 2409 }
2410 [_filterWhere](test, removeMatching) { 2410 [_filterWhere](test, removeMatching) {
2411 let index = this[_head]; 2411 let index = this[_head];
2412 let modificationCount = this[_modificationCount]; 2412 let modificationCount = this[_modificationCount];
2413 let i = this[_head]; 2413 let i = this[_head];
2414 while (i !== this[_tail]) { 2414 while (i != this[_tail]) {
2415 let element = this[_table].get(i); 2415 let element = this[_table].get(i);
2416 let remove = core.identical(removeMatching, test(element)); 2416 let remove = core.identical(removeMatching, test(element));
2417 this[_checkModification](modificationCount); 2417 this[_checkModification](modificationCount);
2418 if (remove) { 2418 if (remove) {
2419 i = this[_remove](i); 2419 i = this[_remove](i);
2420 modificationCount = this[_modificationCount] = dart.notNull(this[_mo dificationCount]) + 1; 2420 modificationCount = this[_modificationCount] = dart.notNull(this[_mo dificationCount]) + 1;
2421 } else { 2421 } else {
2422 i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1; 2422 i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1;
2423 } 2423 }
2424 } 2424 }
2425 } 2425 }
2426 removeWhere(test) { 2426 removeWhere(test) {
2427 this[_filterWhere](test, true); 2427 this[_filterWhere](test, true);
2428 } 2428 }
2429 retainWhere(test) { 2429 retainWhere(test) {
2430 this[_filterWhere](test, false); 2430 this[_filterWhere](test, false);
2431 } 2431 }
2432 clear() { 2432 clear() {
2433 if (this[_head] !== this[_tail]) { 2433 if (this[_head] != this[_tail]) {
2434 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1) { 2434 for (let i = this[_head]; i != this[_tail]; i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1) {
2435 this[_table].set(i, null); 2435 this[_table].set(i, null);
2436 } 2436 }
2437 this[_head] = this[_tail] = 0; 2437 this[_head] = this[_tail] = 0;
2438 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2438 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2439 } 2439 }
2440 } 2440 }
2441 toString() { 2441 toString() {
2442 return IterableBase.iterableToFullString(this, "{", "}"); 2442 return IterableBase.iterableToFullString(this, "{", "}");
2443 } 2443 }
2444 addLast(element) { 2444 addLast(element) {
2445 this[_add](element); 2445 this[_add](element);
2446 } 2446 }
2447 addFirst(element) { 2447 addFirst(element) {
2448 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table]. length) - 1; 2448 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table]. length) - 1;
2449 this[_table].set(this[_head], element); 2449 this[_table].set(this[_head], element);
2450 if (this[_head] === this[_tail]) 2450 if (this[_head] == this[_tail])
2451 this[_grow](); 2451 this[_grow]();
2452 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2452 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2453 } 2453 }
2454 removeFirst() { 2454 removeFirst() {
2455 if (this[_head] === this[_tail]) 2455 if (this[_head] == this[_tail])
2456 throw _internal.IterableElementError.noElement(); 2456 throw _internal.IterableElementError.noElement();
2457 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2457 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2458 let result = this[_table].get(this[_head]); 2458 let result = this[_table].get(this[_head]);
2459 this[_table].set(this[_head], null); 2459 this[_table].set(this[_head], null);
2460 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(this[_table]. length) - 1; 2460 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(this[_table]. length) - 1;
2461 return result; 2461 return result;
2462 } 2462 }
2463 removeLast() { 2463 removeLast() {
2464 if (this[_head] === this[_tail]) 2464 if (this[_head] == this[_tail])
2465 throw _internal.IterableElementError.noElement(); 2465 throw _internal.IterableElementError.noElement();
2466 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2466 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2467 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table]. length) - 1; 2467 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table]. length) - 1;
2468 let result = this[_table].get(this[_tail]); 2468 let result = this[_table].get(this[_tail]);
2469 this[_table].set(this[_tail], null); 2469 this[_table].set(this[_tail], null);
2470 return result; 2470 return result;
2471 } 2471 }
2472 static [_isPowerOf2](number) { 2472 static [_isPowerOf2](number) {
2473 return (dart.notNull(number) & dart.notNull(number) - 1) === 0; 2473 return (dart.notNull(number) & dart.notNull(number) - 1) == 0;
2474 } 2474 }
2475 static [_nextPowerOf2](number) { 2475 static [_nextPowerOf2](number) {
2476 dart.assert(dart.notNull(number) > 0); 2476 dart.assert(dart.notNull(number) > 0);
2477 number = (dart.notNull(number) << 1) - 1; 2477 number = (dart.notNull(number) << 1) - 1;
2478 for (;;) { 2478 for (;;) {
2479 let nextNumber = dart.notNull(number) & dart.notNull(number) - 1; 2479 let nextNumber = dart.notNull(number) & dart.notNull(number) - 1;
2480 if (nextNumber === 0) 2480 if (nextNumber == 0)
2481 return number; 2481 return number;
2482 number = nextNumber; 2482 number = nextNumber;
2483 } 2483 }
2484 } 2484 }
2485 [_checkModification](expectedModificationCount) { 2485 [_checkModification](expectedModificationCount) {
2486 if (expectedModificationCount !== this[_modificationCount]) { 2486 if (expectedModificationCount != this[_modificationCount]) {
2487 throw new core.ConcurrentModificationError(this); 2487 throw new core.ConcurrentModificationError(this);
2488 } 2488 }
2489 } 2489 }
2490 [_add](element) { 2490 [_add](element) {
2491 this[_table].set(this[_tail], element); 2491 this[_table].set(this[_tail], element);
2492 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table]. length) - 1; 2492 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table]. length) - 1;
2493 if (this[_head] === this[_tail]) 2493 if (this[_head] == this[_tail])
2494 this[_grow](); 2494 this[_grow]();
2495 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2495 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2496 } 2496 }
2497 [_remove](offset) { 2497 [_remove](offset) {
2498 let mask = dart.notNull(this[_table].length) - 1; 2498 let mask = dart.notNull(this[_table].length) - 1;
2499 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d art.notNull(mask); 2499 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d art.notNull(mask);
2500 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar t.notNull(mask); 2500 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar t.notNull(mask);
2501 if (dart.notNull(startDistance) < dart.notNull(endDistance)) { 2501 if (dart.notNull(startDistance) < dart.notNull(endDistance)) {
2502 let i = offset; 2502 let i = offset;
2503 while (i !== this[_head]) { 2503 while (i != this[_head]) {
2504 let prevOffset = dart.notNull(i) - 1 & dart.notNull(mask); 2504 let prevOffset = dart.notNull(i) - 1 & dart.notNull(mask);
2505 this[_table].set(i, this[_table].get(prevOffset)); 2505 this[_table].set(i, this[_table].get(prevOffset));
2506 i = prevOffset; 2506 i = prevOffset;
2507 } 2507 }
2508 this[_table].set(this[_head], null); 2508 this[_table].set(this[_head], null);
2509 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(mask); 2509 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(mask);
2510 return dart.notNull(offset) + 1 & dart.notNull(mask); 2510 return dart.notNull(offset) + 1 & dart.notNull(mask);
2511 } else { 2511 } else {
2512 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(mask); 2512 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(mask);
2513 let i = offset; 2513 let i = offset;
2514 while (i !== this[_tail]) { 2514 while (i != this[_tail]) {
2515 let nextOffset = dart.notNull(i) + 1 & dart.notNull(mask); 2515 let nextOffset = dart.notNull(i) + 1 & dart.notNull(mask);
2516 this[_table].set(i, this[_table].get(nextOffset)); 2516 this[_table].set(i, this[_table].get(nextOffset));
2517 i = nextOffset; 2517 i = nextOffset;
2518 } 2518 }
2519 this[_table].set(this[_tail], null); 2519 this[_table].set(this[_tail], null);
2520 return offset; 2520 return offset;
2521 } 2521 }
2522 } 2522 }
2523 [_grow]() { 2523 [_grow]() {
2524 let newTable = new core.List(dart.notNull(this[_table].length) * 2); 2524 let newTable = new core.List(dart.notNull(this[_table].length) * 2);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 this[_end] = queue[_tail]; 2567 this[_end] = queue[_tail];
2568 this[_modificationCount] = queue[_modificationCount]; 2568 this[_modificationCount] = queue[_modificationCount];
2569 this[_position] = queue[_head]; 2569 this[_position] = queue[_head];
2570 this[_current] = null; 2570 this[_current] = null;
2571 } 2571 }
2572 get current() { 2572 get current() {
2573 return this[_current]; 2573 return this[_current];
2574 } 2574 }
2575 moveNext() { 2575 moveNext() {
2576 this[_queue]._checkModification(this[_modificationCount]); 2576 this[_queue]._checkModification(this[_modificationCount]);
2577 if (this[_position] === this[_end]) { 2577 if (this[_position] == this[_end]) {
2578 this[_current] = null; 2578 this[_current] = null;
2579 return false; 2579 return false;
2580 } 2580 }
2581 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E); 2581 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E);
2582 this[_position] = dart.notNull(this[_position]) + 1 & dart.notNull(this[ _queue][_table].length) - 1; 2582 this[_position] = dart.notNull(this[_position]) + 1 & dart.notNull(this[ _queue][_table].length) - 1;
2583 return true; 2583 return true;
2584 } 2584 }
2585 } 2585 }
2586 return _ListQueueIterator; 2586 return _ListQueueIterator;
2587 }); 2587 });
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 let _SplayTree$ = dart.generic(function(K) { 2622 let _SplayTree$ = dart.generic(function(K) {
2623 class _SplayTree extends core.Object { 2623 class _SplayTree extends core.Object {
2624 _SplayTree() { 2624 _SplayTree() {
2625 this[_dummy] = new _SplayTreeNode(null); 2625 this[_dummy] = new _SplayTreeNode(null);
2626 this[_root] = null; 2626 this[_root] = null;
2627 this[_count] = 0; 2627 this[_count] = 0;
2628 this[_modificationCount] = 0; 2628 this[_modificationCount] = 0;
2629 this[_splayCount] = 0; 2629 this[_splayCount] = 0;
2630 } 2630 }
2631 [_splay](key) { 2631 [_splay](key) {
2632 if (this[_root] === null) 2632 if (this[_root] == null)
2633 return -1; 2633 return -1;
2634 let left = this[_dummy]; 2634 let left = this[_dummy];
2635 let right = this[_dummy]; 2635 let right = this[_dummy];
2636 let current = this[_root]; 2636 let current = this[_root];
2637 let comp = null; 2637 let comp = null;
2638 while (true) { 2638 while (true) {
2639 comp = this[_compare](current.key, key); 2639 comp = this[_compare](current.key, key);
2640 if (dart.notNull(comp) > 0) { 2640 if (dart.notNull(comp) > 0) {
2641 if (current.left === null) 2641 if (current.left == null)
2642 break; 2642 break;
2643 comp = this[_compare](current.left.key, key); 2643 comp = this[_compare](current.left.key, key);
2644 if (dart.notNull(comp) > 0) { 2644 if (dart.notNull(comp) > 0) {
2645 let tmp = current.left; 2645 let tmp = current.left;
2646 current.left = tmp.right; 2646 current.left = tmp.right;
2647 tmp.right = current; 2647 tmp.right = current;
2648 current = tmp; 2648 current = tmp;
2649 if (current.left === null) 2649 if (current.left == null)
2650 break; 2650 break;
2651 } 2651 }
2652 right.left = current; 2652 right.left = current;
2653 right = current; 2653 right = current;
2654 current = current.left; 2654 current = current.left;
2655 } else if (dart.notNull(comp) < 0) { 2655 } else if (dart.notNull(comp) < 0) {
2656 if (current.right === null) 2656 if (current.right == null)
2657 break; 2657 break;
2658 comp = this[_compare](current.right.key, key); 2658 comp = this[_compare](current.right.key, key);
2659 if (dart.notNull(comp) < 0) { 2659 if (dart.notNull(comp) < 0) {
2660 let tmp = current.right; 2660 let tmp = current.right;
2661 current.right = tmp.left; 2661 current.right = tmp.left;
2662 tmp.left = current; 2662 tmp.left = current;
2663 current = tmp; 2663 current = tmp;
2664 if (current.right === null) 2664 if (current.right == null)
2665 break; 2665 break;
2666 } 2666 }
2667 left.right = current; 2667 left.right = current;
2668 left = current; 2668 left = current;
2669 current = current.right; 2669 current = current.right;
2670 } else { 2670 } else {
2671 break; 2671 break;
2672 } 2672 }
2673 } 2673 }
2674 left.right = current.left; 2674 left.right = current.left;
2675 right.left = current.right; 2675 right.left = current.right;
2676 current.left = this[_dummy].right; 2676 current.left = this[_dummy].right;
2677 current.right = this[_dummy].left; 2677 current.right = this[_dummy].left;
2678 this[_root] = current; 2678 this[_root] = current;
2679 this[_dummy].right = null; 2679 this[_dummy].right = null;
2680 this[_dummy].left = null; 2680 this[_dummy].left = null;
2681 this[_splayCount] = dart.notNull(this[_splayCount]) + 1; 2681 this[_splayCount] = dart.notNull(this[_splayCount]) + 1;
2682 return comp; 2682 return comp;
2683 } 2683 }
2684 [_splayMin](node) { 2684 [_splayMin](node) {
2685 let current = node; 2685 let current = node;
2686 while (current.left !== null) { 2686 while (current.left != null) {
2687 let left = current.left; 2687 let left = current.left;
2688 current.left = left.right; 2688 current.left = left.right;
2689 left.right = current; 2689 left.right = current;
2690 current = left; 2690 current = left;
2691 } 2691 }
2692 return dart.as(current, _SplayTreeNode$(K)); 2692 return dart.as(current, _SplayTreeNode$(K));
2693 } 2693 }
2694 [_splayMax](node) { 2694 [_splayMax](node) {
2695 let current = node; 2695 let current = node;
2696 while (current.right !== null) { 2696 while (current.right != null) {
2697 let right = current.right; 2697 let right = current.right;
2698 current.right = right.left; 2698 current.right = right.left;
2699 right.left = current; 2699 right.left = current;
2700 current = right; 2700 current = right;
2701 } 2701 }
2702 return dart.as(current, _SplayTreeNode$(K)); 2702 return dart.as(current, _SplayTreeNode$(K));
2703 } 2703 }
2704 [_remove](key) { 2704 [_remove](key) {
2705 if (this[_root] === null) 2705 if (this[_root] == null)
2706 return null; 2706 return null;
2707 let comp = this[_splay](key); 2707 let comp = this[_splay](key);
2708 if (comp !== 0) 2708 if (comp != 0)
2709 return null; 2709 return null;
2710 let result = this[_root]; 2710 let result = this[_root];
2711 this[_count] = dart.notNull(this[_count]) - 1; 2711 this[_count] = dart.notNull(this[_count]) - 1;
2712 if (this[_root].left === null) { 2712 if (this[_root].left == null) {
2713 this[_root] = this[_root].right; 2713 this[_root] = this[_root].right;
2714 } else { 2714 } else {
2715 let right = this[_root].right; 2715 let right = this[_root].right;
2716 this[_root] = this[_splayMax](this[_root].left); 2716 this[_root] = this[_splayMax](this[_root].left);
2717 this[_root].right = right; 2717 this[_root].right = right;
2718 } 2718 }
2719 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2719 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2720 return result; 2720 return result;
2721 } 2721 }
2722 [_addNewRoot](node, comp) { 2722 [_addNewRoot](node, comp) {
2723 this[_count] = dart.notNull(this[_count]) + 1; 2723 this[_count] = dart.notNull(this[_count]) + 1;
2724 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2724 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2725 if (this[_root] === null) { 2725 if (this[_root] == null) {
2726 this[_root] = node; 2726 this[_root] = node;
2727 return; 2727 return;
2728 } 2728 }
2729 if (dart.notNull(comp) < 0) { 2729 if (dart.notNull(comp) < 0) {
2730 node.left = this[_root]; 2730 node.left = this[_root];
2731 node.right = this[_root].right; 2731 node.right = this[_root].right;
2732 this[_root].right = null; 2732 this[_root].right = null;
2733 } else { 2733 } else {
2734 node.right = this[_root]; 2734 node.right = this[_root];
2735 node.left = this[_root].left; 2735 node.left = this[_root].left;
2736 this[_root].left = null; 2736 this[_root].left = null;
2737 } 2737 }
2738 this[_root] = node; 2738 this[_root] = node;
2739 } 2739 }
2740 get [_first]() { 2740 get [_first]() {
2741 if (this[_root] === null) 2741 if (this[_root] == null)
2742 return null; 2742 return null;
2743 this[_root] = this[_splayMin](this[_root]); 2743 this[_root] = this[_splayMin](this[_root]);
2744 return this[_root]; 2744 return this[_root];
2745 } 2745 }
2746 get [_last]() { 2746 get [_last]() {
2747 if (this[_root] === null) 2747 if (this[_root] == null)
2748 return null; 2748 return null;
2749 this[_root] = this[_splayMax](this[_root]); 2749 this[_root] = this[_splayMax](this[_root]);
2750 return this[_root]; 2750 return this[_root];
2751 } 2751 }
2752 [_clear]() { 2752 [_clear]() {
2753 this[_root] = null; 2753 this[_root] = null;
2754 this[_count] = 0; 2754 this[_count] = 0;
2755 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2755 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2756 } 2756 }
2757 } 2757 }
(...skipping 12 matching lines...) Expand all
2770 let _comparator = Symbol('_comparator'); 2770 let _comparator = Symbol('_comparator');
2771 let _validKey = Symbol('_validKey'); 2771 let _validKey = Symbol('_validKey');
2772 let _internal$ = Symbol('_internal'); 2772 let _internal$ = Symbol('_internal');
2773 let SplayTreeMap$ = dart.generic(function(K, V) { 2773 let SplayTreeMap$ = dart.generic(function(K, V) {
2774 class SplayTreeMap extends _SplayTree$(K) { 2774 class SplayTreeMap extends _SplayTree$(K) {
2775 SplayTreeMap(compare, isValidKey) { 2775 SplayTreeMap(compare, isValidKey) {
2776 if (compare === void 0) 2776 if (compare === void 0)
2777 compare = null; 2777 compare = null;
2778 if (isValidKey === void 0) 2778 if (isValidKey === void 0)
2779 isValidKey = null; 2779 isValidKey = null;
2780 this[_comparator] = dart.as(compare === null ? core.Comparable.compare : compare, core.Comparator); 2780 this[_comparator] = dart.as(compare == null ? core.Comparable.compare : compare, core.Comparator);
2781 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart .is(v, K), _Predicate); 2781 this[_validKey] = dart.as(isValidKey != null ? isValidKey : (v) => dart. is(v, K), _Predicate);
2782 super._SplayTree(); 2782 super._SplayTree();
2783 } 2783 }
2784 from(other, compare, isValidKey) { 2784 from(other, compare, isValidKey) {
2785 if (compare === void 0) 2785 if (compare === void 0)
2786 compare = null; 2786 compare = null;
2787 if (isValidKey === void 0) 2787 if (isValidKey === void 0)
2788 isValidKey = null; 2788 isValidKey = null;
2789 let result = new SplayTreeMap(); 2789 let result = new SplayTreeMap();
2790 other.forEach((k, v) => { 2790 other.forEach((k, v) => {
2791 result.set(k, dart.as(v, V)); 2791 result.set(k, dart.as(v, V));
(...skipping 20 matching lines...) Expand all
2812 } 2812 }
2813 [_compare](key1, key2) { 2813 [_compare](key1, key2) {
2814 return this[_comparator](key1, key2); 2814 return this[_comparator](key1, key2);
2815 } 2815 }
2816 [_internal$]() { 2816 [_internal$]() {
2817 this[_comparator] = null; 2817 this[_comparator] = null;
2818 this[_validKey] = null; 2818 this[_validKey] = null;
2819 super._SplayTree(); 2819 super._SplayTree();
2820 } 2820 }
2821 get(key) { 2821 get(key) {
2822 if (key === null) 2822 if (key == null)
2823 throw new core.ArgumentError(key); 2823 throw new core.ArgumentError(key);
2824 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 2824 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
2825 return null; 2825 return null;
2826 if (this[_root] !== null) { 2826 if (this[_root] != null) {
2827 let comp = this[_splay](dart.as(key, K)); 2827 let comp = this[_splay](dart.as(key, K));
2828 if (comp === 0) { 2828 if (comp == 0) {
2829 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); 2829 let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
2830 return dart.as(mapRoot.value, V); 2830 return dart.as(mapRoot.value, V);
2831 } 2831 }
2832 } 2832 }
2833 return null; 2833 return null;
2834 } 2834 }
2835 remove(key) { 2835 remove(key) {
2836 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 2836 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
2837 return null; 2837 return null;
2838 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode) ; 2838 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode) ;
2839 if (mapRoot !== null) 2839 if (mapRoot != null)
2840 return dart.as(mapRoot.value, V); 2840 return dart.as(mapRoot.value, V);
2841 return null; 2841 return null;
2842 } 2842 }
2843 set(key, value) { 2843 set(key, value) {
2844 if (key === null) 2844 if (key == null)
2845 throw new core.ArgumentError(key); 2845 throw new core.ArgumentError(key);
2846 let comp = this[_splay](key); 2846 let comp = this[_splay](key);
2847 if (comp === 0) { 2847 if (comp == 0) {
2848 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); 2848 let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
2849 mapRoot.value = value; 2849 mapRoot.value = value;
2850 return; 2850 return;
2851 } 2851 }
2852 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN ode$(K)), comp); 2852 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN ode$(K)), comp);
2853 } 2853 }
2854 putIfAbsent(key, ifAbsent) { 2854 putIfAbsent(key, ifAbsent) {
2855 if (key === null) 2855 if (key == null)
2856 throw new core.ArgumentError(key); 2856 throw new core.ArgumentError(key);
2857 let comp = this[_splay](key); 2857 let comp = this[_splay](key);
2858 if (comp === 0) { 2858 if (comp == 0) {
2859 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); 2859 let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
2860 return dart.as(mapRoot.value, V); 2860 return dart.as(mapRoot.value, V);
2861 } 2861 }
2862 let modificationCount = this[_modificationCount]; 2862 let modificationCount = this[_modificationCount];
2863 let splayCount = this[_splayCount]; 2863 let splayCount = this[_splayCount];
2864 let value = ifAbsent(); 2864 let value = ifAbsent();
2865 if (modificationCount !== this[_modificationCount]) { 2865 if (modificationCount != this[_modificationCount]) {
2866 throw new core.ConcurrentModificationError(this); 2866 throw new core.ConcurrentModificationError(this);
2867 } 2867 }
2868 if (splayCount !== this[_splayCount]) { 2868 if (splayCount != this[_splayCount]) {
2869 comp = this[_splay](key); 2869 comp = this[_splay](key);
2870 dart.assert(comp !== 0); 2870 dart.assert(comp != 0);
2871 } 2871 }
2872 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN ode$(K)), comp); 2872 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN ode$(K)), comp);
2873 return value; 2873 return value;
2874 } 2874 }
2875 addAll(other) { 2875 addAll(other) {
2876 other.forEach(((key, value) => { 2876 other.forEach(((key, value) => {
2877 this.set(key, value); 2877 this.set(key, value);
2878 }).bind(this)); 2878 }).bind(this));
2879 } 2879 }
2880 get isEmpty() { 2880 get isEmpty() {
2881 return this[_root] === null; 2881 return this[_root] == null;
2882 } 2882 }
2883 get isNotEmpty() { 2883 get isNotEmpty() {
2884 return !dart.notNull(this.isEmpty); 2884 return !dart.notNull(this.isEmpty);
2885 } 2885 }
2886 forEach(f) { 2886 forEach(f) {
2887 let nodes = new _SplayTreeNodeIterator(this); 2887 let nodes = new _SplayTreeNodeIterator(this);
2888 while (nodes.moveNext()) { 2888 while (nodes.moveNext()) {
2889 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V)); 2889 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V));
2890 f(node.key, node.value); 2890 f(node.key, node.value);
2891 } 2891 }
2892 } 2892 }
2893 get length() { 2893 get length() {
2894 return this[_count]; 2894 return this[_count];
2895 } 2895 }
2896 clear() { 2896 clear() {
2897 this[_clear](); 2897 this[_clear]();
2898 } 2898 }
2899 containsKey(key) { 2899 containsKey(key) {
2900 return dart.notNull(dart.dinvokef(this[_validKey], key)) && this[_splay] (dart.as(key, K)) === 0; 2900 return dart.notNull(dart.dinvokef(this[_validKey], key)) && this[_splay] (dart.as(key, K)) == 0;
2901 } 2901 }
2902 containsValue(value) { 2902 containsValue(value) {
2903 let found = false; 2903 let found = false;
2904 let initialSplayCount = this[_splayCount]; 2904 let initialSplayCount = this[_splayCount];
2905 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool 2905 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool
2906 function visit(node) { 2906 function visit(node) {
2907 while (node !== null) { 2907 while (node != null) {
2908 if (dart.equals(node.value, value)) 2908 if (dart.equals(node.value, value))
2909 return true; 2909 return true;
2910 if (initialSplayCount !== this[_splayCount]) { 2910 if (initialSplayCount != this[_splayCount]) {
2911 throw new core.ConcurrentModificationError(this); 2911 throw new core.ConcurrentModificationError(this);
2912 } 2912 }
2913 if (dart.notNull(node.right !== null) && dart.notNull(visit(dart.as( node.right, _SplayTreeMapNode)))) 2913 if (dart.notNull(node.right != null) && dart.notNull(visit(dart.as(n ode.right, _SplayTreeMapNode))))
2914 return true; 2914 return true;
2915 node = dart.as(node.left, _SplayTreeMapNode); 2915 node = dart.as(node.left, _SplayTreeMapNode);
2916 } 2916 }
2917 return false; 2917 return false;
2918 } 2918 }
2919 return visit(dart.as(this[_root], _SplayTreeMapNode)); 2919 return visit(dart.as(this[_root], _SplayTreeMapNode));
2920 } 2920 }
2921 get keys() { 2921 get keys() {
2922 return new _SplayTreeKeyIterable(this); 2922 return new _SplayTreeKeyIterable(this);
2923 } 2923 }
2924 get values() { 2924 get values() {
2925 return new _SplayTreeValueIterable(this); 2925 return new _SplayTreeValueIterable(this);
2926 } 2926 }
2927 toString() { 2927 toString() {
2928 return Maps.mapToString(this); 2928 return Maps.mapToString(this);
2929 } 2929 }
2930 firstKey() { 2930 firstKey() {
2931 if (this[_root] === null) 2931 if (this[_root] == null)
2932 return null; 2932 return null;
2933 return dart.as(this[_first].key, K); 2933 return dart.as(this[_first].key, K);
2934 } 2934 }
2935 lastKey() { 2935 lastKey() {
2936 if (this[_root] === null) 2936 if (this[_root] == null)
2937 return null; 2937 return null;
2938 return dart.as(this[_last].key, K); 2938 return dart.as(this[_last].key, K);
2939 } 2939 }
2940 lastKeyBefore(key) { 2940 lastKeyBefore(key) {
2941 if (key === null) 2941 if (key == null)
2942 throw new core.ArgumentError(key); 2942 throw new core.ArgumentError(key);
2943 if (this[_root] === null) 2943 if (this[_root] == null)
2944 return null; 2944 return null;
2945 let comp = this[_splay](key); 2945 let comp = this[_splay](key);
2946 if (dart.notNull(comp) < 0) 2946 if (dart.notNull(comp) < 0)
2947 return this[_root].key; 2947 return this[_root].key;
2948 let node = this[_root].left; 2948 let node = this[_root].left;
2949 if (node === null) 2949 if (node == null)
2950 return null; 2950 return null;
2951 while (node.right !== null) { 2951 while (node.right != null) {
2952 node = node.right; 2952 node = node.right;
2953 } 2953 }
2954 return node.key; 2954 return node.key;
2955 } 2955 }
2956 firstKeyAfter(key) { 2956 firstKeyAfter(key) {
2957 if (key === null) 2957 if (key == null)
2958 throw new core.ArgumentError(key); 2958 throw new core.ArgumentError(key);
2959 if (this[_root] === null) 2959 if (this[_root] == null)
2960 return null; 2960 return null;
2961 let comp = this[_splay](key); 2961 let comp = this[_splay](key);
2962 if (dart.notNull(comp) > 0) 2962 if (dart.notNull(comp) > 0)
2963 return this[_root].key; 2963 return this[_root].key;
2964 let node = this[_root].right; 2964 let node = this[_root].right;
2965 if (node === null) 2965 if (node == null)
2966 return null; 2966 return null;
2967 while (node.left !== null) { 2967 while (node.left != null) {
2968 node = node.left; 2968 node = node.left;
2969 } 2969 }
2970 return node.key; 2970 return node.key;
2971 } 2971 }
2972 } 2972 }
2973 dart.defineNamedConstructor(SplayTreeMap, 'from'); 2973 dart.defineNamedConstructor(SplayTreeMap, 'from');
2974 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); 2974 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable');
2975 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); 2975 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables');
2976 dart.defineNamedConstructor(SplayTreeMap, _internal$); 2976 dart.defineNamedConstructor(SplayTreeMap, _internal$);
2977 return SplayTreeMap; 2977 return SplayTreeMap;
(...skipping 14 matching lines...) Expand all
2992 this[_splayCount] = tree[_splayCount]; 2992 this[_splayCount] = tree[_splayCount];
2993 this[_currentNode] = null; 2993 this[_currentNode] = null;
2994 this[_findLeftMostDescendent](tree[_root]); 2994 this[_findLeftMostDescendent](tree[_root]);
2995 } 2995 }
2996 startAt(tree, startKey) { 2996 startAt(tree, startKey) {
2997 this[_workList] = new core.List$(_SplayTreeNode).from([]); 2997 this[_workList] = new core.List$(_SplayTreeNode).from([]);
2998 this[_tree] = tree; 2998 this[_tree] = tree;
2999 this[_modificationCount] = tree[_modificationCount]; 2999 this[_modificationCount] = tree[_modificationCount];
3000 this[_splayCount] = null; 3000 this[_splayCount] = null;
3001 this[_currentNode] = null; 3001 this[_currentNode] = null;
3002 if (tree[_root] === null) 3002 if (tree[_root] == null)
3003 return; 3003 return;
3004 let compare = tree._splay(startKey); 3004 let compare = tree._splay(startKey);
3005 this[_splayCount] = tree[_splayCount]; 3005 this[_splayCount] = tree[_splayCount];
3006 if (dart.notNull(compare) < 0) { 3006 if (dart.notNull(compare) < 0) {
3007 this[_findLeftMostDescendent](tree[_root].right); 3007 this[_findLeftMostDescendent](tree[_root].right);
3008 } else { 3008 } else {
3009 this[_workList].add(tree[_root]); 3009 this[_workList].add(tree[_root]);
3010 } 3010 }
3011 } 3011 }
3012 get current() { 3012 get current() {
3013 if (this[_currentNode] === null) 3013 if (this[_currentNode] == null)
3014 return null; 3014 return null;
3015 return this[_getValue](this[_currentNode]); 3015 return this[_getValue](this[_currentNode]);
3016 } 3016 }
3017 [_findLeftMostDescendent](node) { 3017 [_findLeftMostDescendent](node) {
3018 while (node !== null) { 3018 while (node != null) {
3019 this[_workList].add(node); 3019 this[_workList].add(node);
3020 node = node.left; 3020 node = node.left;
3021 } 3021 }
3022 } 3022 }
3023 [_rebuildWorkList](currentNode) { 3023 [_rebuildWorkList](currentNode) {
3024 dart.assert(!dart.notNull(this[_workList].isEmpty)); 3024 dart.assert(!dart.notNull(this[_workList].isEmpty));
3025 this[_workList].clear(); 3025 this[_workList].clear();
3026 if (currentNode === null) { 3026 if (currentNode == null) {
3027 this[_findLeftMostDescendent](this[_tree][_root]); 3027 this[_findLeftMostDescendent](this[_tree][_root]);
3028 } else { 3028 } else {
3029 this[_tree]._splay(currentNode.key); 3029 this[_tree]._splay(currentNode.key);
3030 this[_findLeftMostDescendent](this[_tree][_root].right); 3030 this[_findLeftMostDescendent](this[_tree][_root].right);
3031 dart.assert(!dart.notNull(this[_workList].isEmpty)); 3031 dart.assert(!dart.notNull(this[_workList].isEmpty));
3032 } 3032 }
3033 } 3033 }
3034 moveNext() { 3034 moveNext() {
3035 if (this[_modificationCount] !== this[_tree][_modificationCount]) { 3035 if (this[_modificationCount] != this[_tree][_modificationCount]) {
3036 throw new core.ConcurrentModificationError(this[_tree]); 3036 throw new core.ConcurrentModificationError(this[_tree]);
3037 } 3037 }
3038 if (this[_workList].isEmpty) { 3038 if (this[_workList].isEmpty) {
3039 this[_currentNode] = null; 3039 this[_currentNode] = null;
3040 return false; 3040 return false;
3041 } 3041 }
3042 if (this[_tree][_splayCount] !== this[_splayCount] && dart.notNull(this[ _currentNode] !== null)) { 3042 if (this[_tree][_splayCount] != this[_splayCount] && dart.notNull(this[_ currentNode] != null)) {
3043 this[_rebuildWorkList](this[_currentNode]); 3043 this[_rebuildWorkList](this[_currentNode]);
3044 } 3044 }
3045 this[_currentNode] = this[_workList].removeLast(); 3045 this[_currentNode] = this[_workList].removeLast();
3046 this[_findLeftMostDescendent](this[_currentNode].right); 3046 this[_findLeftMostDescendent](this[_currentNode].right);
3047 return true; 3047 return true;
3048 } 3048 }
3049 } 3049 }
3050 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); 3050 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt');
3051 return _SplayTreeIterator; 3051 return _SplayTreeIterator;
3052 }); 3052 });
3053 let _SplayTreeIterator = _SplayTreeIterator$(dart.dynamic); 3053 let _SplayTreeIterator = _SplayTreeIterator$(dart.dynamic);
3054 let _SplayTreeKeyIterable$ = dart.generic(function(K) { 3054 let _SplayTreeKeyIterable$ = dart.generic(function(K) {
3055 class _SplayTreeKeyIterable extends IterableBase$(K) { 3055 class _SplayTreeKeyIterable extends IterableBase$(K) {
3056 _SplayTreeKeyIterable(tree$) { 3056 _SplayTreeKeyIterable(tree$) {
3057 this[_tree] = tree$; 3057 this[_tree] = tree$;
3058 super.IterableBase(); 3058 super.IterableBase();
3059 } 3059 }
3060 get length() { 3060 get length() {
3061 return this[_tree][_count]; 3061 return this[_tree][_count];
3062 } 3062 }
3063 get isEmpty() { 3063 get isEmpty() {
3064 return this[_tree][_count] === 0; 3064 return this[_tree][_count] == 0;
3065 } 3065 }
3066 get iterator() { 3066 get iterator() {
3067 return new _SplayTreeKeyIterator(this[_tree]); 3067 return new _SplayTreeKeyIterator(this[_tree]);
3068 } 3068 }
3069 toSet() { 3069 toSet() {
3070 let setOrMap = this[_tree]; 3070 let setOrMap = this[_tree];
3071 let set = new SplayTreeSet(dart.as(setOrMap[_comparator], dart.throw_("U nimplemented type (K, K) → int")), dart.as(setOrMap[_validKey], dart.throw_("Uni mplemented type (dynamic) → bool"))); 3071 let set = new SplayTreeSet(dart.as(setOrMap[_comparator], dart.throw_("U nimplemented type (K, K) → int")), dart.as(setOrMap[_validKey], dart.throw_("Uni mplemented type (dynamic) → bool")));
3072 set[_count] = this[_tree][_count]; 3072 set[_count] = this[_tree][_count];
3073 set[_root] = set._copyNode(this[_tree][_root]); 3073 set[_root] = set._copyNode(this[_tree][_root]);
3074 return set; 3074 return set;
3075 } 3075 }
3076 } 3076 }
3077 return _SplayTreeKeyIterable; 3077 return _SplayTreeKeyIterable;
3078 }); 3078 });
3079 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dart.dynamic); 3079 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dart.dynamic);
3080 let _SplayTreeValueIterable$ = dart.generic(function(K, V) { 3080 let _SplayTreeValueIterable$ = dart.generic(function(K, V) {
3081 class _SplayTreeValueIterable extends IterableBase$(V) { 3081 class _SplayTreeValueIterable extends IterableBase$(V) {
3082 _SplayTreeValueIterable(map$) { 3082 _SplayTreeValueIterable(map$) {
3083 this[_map] = map$; 3083 this[_map] = map$;
3084 super.IterableBase(); 3084 super.IterableBase();
3085 } 3085 }
3086 get length() { 3086 get length() {
3087 return this[_map][_count]; 3087 return this[_map][_count];
3088 } 3088 }
3089 get isEmpty() { 3089 get isEmpty() {
3090 return this[_map][_count] === 0; 3090 return this[_map][_count] == 0;
3091 } 3091 }
3092 get iterator() { 3092 get iterator() {
3093 return new _SplayTreeValueIterator(this[_map]); 3093 return new _SplayTreeValueIterator(this[_map]);
3094 } 3094 }
3095 } 3095 }
3096 return _SplayTreeValueIterable; 3096 return _SplayTreeValueIterable;
3097 }); 3097 });
3098 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dart.dynamic, dart.dyna mic); 3098 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dart.dynamic, dart.dyna mic);
3099 let _SplayTreeKeyIterator$ = dart.generic(function(K) { 3099 let _SplayTreeKeyIterator$ = dart.generic(function(K) {
3100 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) { 3100 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
3138 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dart.dynamic); 3138 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dart.dynamic);
3139 let _clone = Symbol('_clone'); 3139 let _clone = Symbol('_clone');
3140 let _copyNode = Symbol('_copyNode'); 3140 let _copyNode = Symbol('_copyNode');
3141 let SplayTreeSet$ = dart.generic(function(E) { 3141 let SplayTreeSet$ = dart.generic(function(E) {
3142 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set Mixin$(E)) { 3142 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set Mixin$(E)) {
3143 SplayTreeSet(compare, isValidKey) { 3143 SplayTreeSet(compare, isValidKey) {
3144 if (compare === void 0) 3144 if (compare === void 0)
3145 compare = null; 3145 compare = null;
3146 if (isValidKey === void 0) 3146 if (isValidKey === void 0)
3147 isValidKey = null; 3147 isValidKey = null;
3148 this[_comparator] = dart.as(compare === null ? core.Comparable.compare : compare, core.Comparator); 3148 this[_comparator] = dart.as(compare == null ? core.Comparable.compare : compare, core.Comparator);
3149 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart .is(v, E), _Predicate); 3149 this[_validKey] = dart.as(isValidKey != null ? isValidKey : (v) => dart. is(v, E), _Predicate);
3150 super._SplayTree(); 3150 super._SplayTree();
3151 } 3151 }
3152 from(elements, compare, isValidKey) { 3152 from(elements, compare, isValidKey) {
3153 if (compare === void 0) 3153 if (compare === void 0)
3154 compare = null; 3154 compare = null;
3155 if (isValidKey === void 0) 3155 if (isValidKey === void 0)
3156 isValidKey = null; 3156 isValidKey = null;
3157 let result = new SplayTreeSet(compare, isValidKey); 3157 let result = new SplayTreeSet(compare, isValidKey);
3158 for (let element of elements) { 3158 for (let element of elements) {
3159 result.add(element); 3159 result.add(element);
3160 } 3160 }
3161 return result; 3161 return result;
3162 } 3162 }
3163 [_compare](e1, e2) { 3163 [_compare](e1, e2) {
3164 return dart.dinvokef(this[_comparator], e1, e2); 3164 return dart.dinvokef(this[_comparator], e1, e2);
3165 } 3165 }
3166 get iterator() { 3166 get iterator() {
3167 return new _SplayTreeKeyIterator(this); 3167 return new _SplayTreeKeyIterator(this);
3168 } 3168 }
3169 get length() { 3169 get length() {
3170 return this[_count]; 3170 return this[_count];
3171 } 3171 }
3172 get isEmpty() { 3172 get isEmpty() {
3173 return this[_root] === null; 3173 return this[_root] == null;
3174 } 3174 }
3175 get isNotEmpty() { 3175 get isNotEmpty() {
3176 return this[_root] !== null; 3176 return this[_root] != null;
3177 } 3177 }
3178 get first() { 3178 get first() {
3179 if (this[_count] === 0) 3179 if (this[_count] == 0)
3180 throw _internal.IterableElementError.noElement(); 3180 throw _internal.IterableElementError.noElement();
3181 return dart.as(this[_first].key, E); 3181 return dart.as(this[_first].key, E);
3182 } 3182 }
3183 get last() { 3183 get last() {
3184 if (this[_count] === 0) 3184 if (this[_count] == 0)
3185 throw _internal.IterableElementError.noElement(); 3185 throw _internal.IterableElementError.noElement();
3186 return dart.as(this[_last].key, E); 3186 return dart.as(this[_last].key, E);
3187 } 3187 }
3188 get single() { 3188 get single() {
3189 if (this[_count] === 0) 3189 if (this[_count] == 0)
3190 throw _internal.IterableElementError.noElement(); 3190 throw _internal.IterableElementError.noElement();
3191 if (dart.notNull(this[_count]) > 1) 3191 if (dart.notNull(this[_count]) > 1)
3192 throw _internal.IterableElementError.tooMany(); 3192 throw _internal.IterableElementError.tooMany();
3193 return this[_root].key; 3193 return this[_root].key;
3194 } 3194 }
3195 contains(object) { 3195 contains(object) {
3196 return dart.notNull(dart.dinvokef(this[_validKey], object)) && this[_spl ay](dart.as(object, E)) === 0; 3196 return dart.notNull(dart.dinvokef(this[_validKey], object)) && this[_spl ay](dart.as(object, E)) == 0;
3197 } 3197 }
3198 add(element) { 3198 add(element) {
3199 let compare = this[_splay](element); 3199 let compare = this[_splay](element);
3200 if (compare === 0) 3200 if (compare == 0)
3201 return false; 3201 return false;
3202 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E )), compare); 3202 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E )), compare);
3203 return true; 3203 return true;
3204 } 3204 }
3205 remove(object) { 3205 remove(object) {
3206 if (!dart.notNull(dart.dinvokef(this[_validKey], object))) 3206 if (!dart.notNull(dart.dinvokef(this[_validKey], object)))
3207 return false; 3207 return false;
3208 return this[_remove](dart.as(object, E)) !== null; 3208 return this[_remove](dart.as(object, E)) != null;
3209 } 3209 }
3210 addAll(elements) { 3210 addAll(elements) {
3211 for (let element of elements) { 3211 for (let element of elements) {
3212 let compare = this[_splay](element); 3212 let compare = this[_splay](element);
3213 if (compare !== 0) { 3213 if (compare != 0) {
3214 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNod e$(E)), compare); 3214 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNod e$(E)), compare);
3215 } 3215 }
3216 } 3216 }
3217 } 3217 }
3218 removeAll(elements) { 3218 removeAll(elements) {
3219 for (let element of elements) { 3219 for (let element of elements) {
3220 if (dart.dinvokef(this[_validKey], element)) 3220 if (dart.dinvokef(this[_validKey], element))
3221 this[_remove](dart.as(element, E)); 3221 this[_remove](dart.as(element, E));
3222 } 3222 }
3223 } 3223 }
3224 retainAll(elements) { 3224 retainAll(elements) {
3225 let retainSet = new SplayTreeSet(dart.closureWrap(this[_comparator], "(E , E) → int"), this[_validKey]); 3225 let retainSet = new SplayTreeSet(dart.closureWrap(this[_comparator], "(E , E) → int"), this[_validKey]);
3226 let modificationCount = this[_modificationCount]; 3226 let modificationCount = this[_modificationCount];
3227 for (let object of elements) { 3227 for (let object of elements) {
3228 if (modificationCount !== this[_modificationCount]) { 3228 if (modificationCount != this[_modificationCount]) {
3229 throw new core.ConcurrentModificationError(this); 3229 throw new core.ConcurrentModificationError(this);
3230 } 3230 }
3231 if (dart.notNull(dart.dinvokef(this[_validKey], object)) && this[_spla y](dart.as(object, E)) === 0) 3231 if (dart.notNull(dart.dinvokef(this[_validKey], object)) && this[_spla y](dart.as(object, E)) == 0)
3232 retainSet.add(this[_root].key); 3232 retainSet.add(this[_root].key);
3233 } 3233 }
3234 if (retainSet[_count] !== this[_count]) { 3234 if (retainSet[_count] != this[_count]) {
3235 this[_root] = retainSet[_root]; 3235 this[_root] = retainSet[_root];
3236 this[_count] = retainSet[_count]; 3236 this[_count] = retainSet[_count];
3237 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 3237 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
3238 } 3238 }
3239 } 3239 }
3240 lookup(object) { 3240 lookup(object) {
3241 if (!dart.notNull(dart.dinvokef(this[_validKey], object))) 3241 if (!dart.notNull(dart.dinvokef(this[_validKey], object)))
3242 return null; 3242 return null;
3243 let comp = this[_splay](dart.as(object, E)); 3243 let comp = this[_splay](dart.as(object, E));
3244 if (comp !== 0) 3244 if (comp != 0)
3245 return null; 3245 return null;
3246 return this[_root].key; 3246 return this[_root].key;
3247 } 3247 }
3248 intersection(other) { 3248 intersection(other) {
3249 let result = new SplayTreeSet(dart.closureWrap(this[_comparator], "(E, E ) → int"), this[_validKey]); 3249 let result = new SplayTreeSet(dart.closureWrap(this[_comparator], "(E, E ) → int"), this[_validKey]);
3250 for (let element of this) { 3250 for (let element of this) {
3251 if (other.contains(element)) 3251 if (other.contains(element))
3252 result.add(element); 3252 result.add(element);
3253 } 3253 }
3254 return result; 3254 return result;
(...skipping 12 matching lines...) Expand all
3267 return _; 3267 return _;
3268 }).bind(this)(this[_clone]()); 3268 }).bind(this)(this[_clone]());
3269 } 3269 }
3270 [_clone]() { 3270 [_clone]() {
3271 let set = new SplayTreeSet(dart.closureWrap(this[_comparator], "(E, E) → int"), this[_validKey]); 3271 let set = new SplayTreeSet(dart.closureWrap(this[_comparator], "(E, E) → int"), this[_validKey]);
3272 set[_count] = this[_count]; 3272 set[_count] = this[_count];
3273 set[_root] = this[_copyNode](this[_root]); 3273 set[_root] = this[_copyNode](this[_root]);
3274 return set; 3274 return set;
3275 } 3275 }
3276 [_copyNode](node) { 3276 [_copyNode](node) {
3277 if (node === null) 3277 if (node == null)
3278 return null; 3278 return null;
3279 return ((_) => { 3279 return ((_) => {
3280 _.left = this[_copyNode](node.left); 3280 _.left = this[_copyNode](node.left);
3281 _.right = this[_copyNode](node.right); 3281 _.right = this[_copyNode](node.right);
3282 return _; 3282 return _;
3283 }).bind(this)(new _SplayTreeNode(node.key)); 3283 }).bind(this)(new _SplayTreeNode(node.key));
3284 } 3284 }
3285 clear() { 3285 clear() {
3286 this[_clear](); 3286 this[_clear]();
3287 } 3287 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 this[_length] = 0; 3321 this[_length] = 0;
3322 this[_strings] = null; 3322 this[_strings] = null;
3323 this[_nums] = null; 3323 this[_nums] = null;
3324 this[_rest] = null; 3324 this[_rest] = null;
3325 this[_keys] = null; 3325 this[_keys] = null;
3326 } 3326 }
3327 get length() { 3327 get length() {
3328 return this[_length]; 3328 return this[_length];
3329 } 3329 }
3330 get isEmpty() { 3330 get isEmpty() {
3331 return this[_length] === 0; 3331 return this[_length] == 0;
3332 } 3332 }
3333 get isNotEmpty() { 3333 get isNotEmpty() {
3334 return !dart.notNull(this.isEmpty); 3334 return !dart.notNull(this.isEmpty);
3335 } 3335 }
3336 get keys() { 3336 get keys() {
3337 return new HashMapKeyIterable(this); 3337 return new HashMapKeyIterable(this);
3338 } 3338 }
3339 get values() { 3339 get values() {
3340 return new _internal.MappedIterable(this.keys, dart.closureWrap(((each) => this.get(each)).bind(this), "(K) → V")); 3340 return new _internal.MappedIterable(this.keys, dart.closureWrap(((each) => this.get(each)).bind(this), "(K) → V"));
3341 } 3341 }
3342 containsKey(key) { 3342 containsKey(key) {
3343 if (_HashMap[_isStringKey](key)) { 3343 if (_HashMap[_isStringKey](key)) {
3344 let strings = this[_strings]; 3344 let strings = this[_strings];
3345 return strings === null ? false : _HashMap[_hasTableEntry](strings, ke y); 3345 return strings == null ? false : _HashMap[_hasTableEntry](strings, key );
3346 } else if (_HashMap[_isNumericKey](key)) { 3346 } else if (_HashMap[_isNumericKey](key)) {
3347 let nums = this[_nums]; 3347 let nums = this[_nums];
3348 return nums === null ? false : _HashMap[_hasTableEntry](nums, key); 3348 return nums == null ? false : _HashMap[_hasTableEntry](nums, key);
3349 } else { 3349 } else {
3350 return this[_containsKey](key); 3350 return this[_containsKey](key);
3351 } 3351 }
3352 } 3352 }
3353 [_containsKey](key) { 3353 [_containsKey](key) {
3354 let rest = this[_rest]; 3354 let rest = this[_rest];
3355 if (rest === null) 3355 if (rest == null)
3356 return false; 3356 return false;
3357 let bucket = this[_getBucket](rest, key); 3357 let bucket = this[_getBucket](rest, key);
3358 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; 3358 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
3359 } 3359 }
3360 containsValue(value) { 3360 containsValue(value) {
3361 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v alue)).bind(this)); 3361 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v alue)).bind(this));
3362 } 3362 }
3363 addAll(other) { 3363 addAll(other) {
3364 other.forEach(((key, value) => { 3364 other.forEach(((key, value) => {
3365 this.set(key, value); 3365 this.set(key, value);
3366 }).bind(this)); 3366 }).bind(this));
3367 } 3367 }
3368 get(key) { 3368 get(key) {
3369 if (_HashMap[_isStringKey](key)) { 3369 if (_HashMap[_isStringKey](key)) {
3370 let strings = this[_strings]; 3370 let strings = this[_strings];
3371 return dart.as(strings === null ? null : _HashMap[_getTableEntry](stri ngs, key), V); 3371 return dart.as(strings == null ? null : _HashMap[_getTableEntry](strin gs, key), V);
3372 } else if (_HashMap[_isNumericKey](key)) { 3372 } else if (_HashMap[_isNumericKey](key)) {
3373 let nums = this[_nums]; 3373 let nums = this[_nums];
3374 return dart.as(nums === null ? null : _HashMap[_getTableEntry](nums, k ey), V); 3374 return dart.as(nums == null ? null : _HashMap[_getTableEntry](nums, ke y), V);
3375 } else { 3375 } else {
3376 return this[_get](key); 3376 return this[_get](key);
3377 } 3377 }
3378 } 3378 }
3379 [_get](key) { 3379 [_get](key) {
3380 let rest = this[_rest]; 3380 let rest = this[_rest];
3381 if (rest === null) 3381 if (rest == null)
3382 return null; 3382 return null;
3383 let bucket = this[_getBucket](rest, key); 3383 let bucket = this[_getBucket](rest, key);
3384 let index = this[_findBucketIndex](bucket, key); 3384 let index = this[_findBucketIndex](bucket, key);
3385 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde x) + 1], V); 3385 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde x) + 1], V);
3386 } 3386 }
3387 set(key, value) { 3387 set(key, value) {
3388 if (_HashMap[_isStringKey](key)) { 3388 if (_HashMap[_isStringKey](key)) {
3389 let strings = this[_strings]; 3389 let strings = this[_strings];
3390 if (strings === null) 3390 if (strings == null)
3391 this[_strings] = strings = _HashMap[_newHashTable](); 3391 this[_strings] = strings = _HashMap[_newHashTable]();
3392 this[_addHashTableEntry](strings, key, value); 3392 this[_addHashTableEntry](strings, key, value);
3393 } else if (_HashMap[_isNumericKey](key)) { 3393 } else if (_HashMap[_isNumericKey](key)) {
3394 let nums = this[_nums]; 3394 let nums = this[_nums];
3395 if (nums === null) 3395 if (nums == null)
3396 this[_nums] = nums = _HashMap[_newHashTable](); 3396 this[_nums] = nums = _HashMap[_newHashTable]();
3397 this[_addHashTableEntry](nums, key, value); 3397 this[_addHashTableEntry](nums, key, value);
3398 } else { 3398 } else {
3399 this[_set](key, value); 3399 this[_set](key, value);
3400 } 3400 }
3401 } 3401 }
3402 [_set](key, value) { 3402 [_set](key, value) {
3403 let rest = this[_rest]; 3403 let rest = this[_rest];
3404 if (rest === null) 3404 if (rest == null)
3405 this[_rest] = rest = _HashMap[_newHashTable](); 3405 this[_rest] = rest = _HashMap[_newHashTable]();
3406 let hash = this[_computeHashCode](key); 3406 let hash = this[_computeHashCode](key);
3407 let bucket = rest[hash]; 3407 let bucket = rest[hash];
3408 if (bucket === null) { 3408 if (bucket == null) {
3409 _HashMap[_setTableEntry](rest, hash, [key, value]); 3409 _HashMap[_setTableEntry](rest, hash, [key, value]);
3410 this[_length] = dart.notNull(this[_length]) + 1; 3410 this[_length] = dart.notNull(this[_length]) + 1;
3411 this[_keys] = null; 3411 this[_keys] = null;
3412 } else { 3412 } else {
3413 let index = this[_findBucketIndex](bucket, key); 3413 let index = this[_findBucketIndex](bucket, key);
3414 if (dart.notNull(index) >= 0) { 3414 if (dart.notNull(index) >= 0) {
3415 bucket[dart.notNull(index) + 1] = value; 3415 bucket[dart.notNull(index) + 1] = value;
3416 } else { 3416 } else {
3417 bucket.push(key, value); 3417 bucket.push(key, value);
3418 this[_length] = dart.notNull(this[_length]) + 1; 3418 this[_length] = dart.notNull(this[_length]) + 1;
(...skipping 12 matching lines...) Expand all
3431 if (_HashMap[_isStringKey](key)) { 3431 if (_HashMap[_isStringKey](key)) {
3432 return this[_removeHashTableEntry](this[_strings], key); 3432 return this[_removeHashTableEntry](this[_strings], key);
3433 } else if (_HashMap[_isNumericKey](key)) { 3433 } else if (_HashMap[_isNumericKey](key)) {
3434 return this[_removeHashTableEntry](this[_nums], key); 3434 return this[_removeHashTableEntry](this[_nums], key);
3435 } else { 3435 } else {
3436 return this[_remove](key); 3436 return this[_remove](key);
3437 } 3437 }
3438 } 3438 }
3439 [_remove](key) { 3439 [_remove](key) {
3440 let rest = this[_rest]; 3440 let rest = this[_rest];
3441 if (rest === null) 3441 if (rest == null)
3442 return null; 3442 return null;
3443 let bucket = this[_getBucket](rest, key); 3443 let bucket = this[_getBucket](rest, key);
3444 let index = this[_findBucketIndex](bucket, key); 3444 let index = this[_findBucketIndex](bucket, key);
3445 if (dart.notNull(index) < 0) 3445 if (dart.notNull(index) < 0)
3446 return null; 3446 return null;
3447 this[_length] = dart.notNull(this[_length]) - 1; 3447 this[_length] = dart.notNull(this[_length]) - 1;
3448 this[_keys] = null; 3448 this[_keys] = null;
3449 return dart.as(bucket.splice(index, 2)[1], V); 3449 return dart.as(bucket.splice(index, 2)[1], V);
3450 } 3450 }
3451 clear() { 3451 clear() {
3452 if (dart.notNull(this[_length]) > 0) { 3452 if (dart.notNull(this[_length]) > 0) {
3453 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; 3453 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null;
3454 this[_length] = 0; 3454 this[_length] = 0;
3455 } 3455 }
3456 } 3456 }
3457 forEach(action) { 3457 forEach(action) {
3458 let keys = this[_computeKeys](); 3458 let keys = this[_computeKeys]();
3459 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len gth); i = dart.notNull(i) + 1) { 3459 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len gth); i = dart.notNull(i) + 1) {
3460 let key = keys[i]; 3460 let key = keys[i];
3461 action(dart.as(key, K), this.get(key)); 3461 action(dart.as(key, K), this.get(key));
3462 if (keys !== this[_keys]) { 3462 if (keys !== this[_keys]) {
3463 throw new core.ConcurrentModificationError(this); 3463 throw new core.ConcurrentModificationError(this);
3464 } 3464 }
3465 } 3465 }
3466 } 3466 }
3467 [_computeKeys]() { 3467 [_computeKeys]() {
3468 if (this[_keys] !== null) 3468 if (this[_keys] != null)
3469 return this[_keys]; 3469 return this[_keys];
3470 let result = new core.List(this[_length]); 3470 let result = new core.List(this[_length]);
3471 let index = 0; 3471 let index = 0;
3472 let strings = this[_strings]; 3472 let strings = this[_strings];
3473 if (strings !== null) { 3473 if (strings != null) {
3474 let names = Object.getOwnPropertyNames(strings); 3474 let names = Object.getOwnPropertyNames(strings);
3475 let entries = names.length; 3475 let entries = names.length;
3476 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) { 3476 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) {
3477 let key = names[i]; 3477 let key = names[i];
3478 result[index] = key; 3478 result[index] = key;
3479 index = dart.notNull(index) + 1; 3479 index = dart.notNull(index) + 1;
3480 } 3480 }
3481 } 3481 }
3482 let nums = this[_nums]; 3482 let nums = this[_nums];
3483 if (nums !== null) { 3483 if (nums != null) {
3484 let names = Object.getOwnPropertyNames(nums); 3484 let names = Object.getOwnPropertyNames(nums);
3485 let entries = names.length; 3485 let entries = names.length;
3486 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) { 3486 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) {
3487 let key = +names[i]; 3487 let key = +names[i];
3488 result[index] = key; 3488 result[index] = key;
3489 index = dart.notNull(index) + 1; 3489 index = dart.notNull(index) + 1;
3490 } 3490 }
3491 } 3491 }
3492 let rest = this[_rest]; 3492 let rest = this[_rest];
3493 if (rest !== null) { 3493 if (rest != null) {
3494 let names = Object.getOwnPropertyNames(rest); 3494 let names = Object.getOwnPropertyNames(rest);
3495 let entries = names.length; 3495 let entries = names.length;
3496 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) { 3496 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) {
3497 let key = names[i]; 3497 let key = names[i];
3498 let bucket = rest[key]; 3498 let bucket = rest[key];
3499 let length = bucket.length; 3499 let length = bucket.length;
3500 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { 3500 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
3501 let key = bucket[i]; 3501 let key = bucket[i];
3502 result[index] = key; 3502 result[index] = key;
3503 index = dart.notNull(index) + 1; 3503 index = dart.notNull(index) + 1;
3504 } 3504 }
3505 } 3505 }
3506 } 3506 }
3507 dart.assert(index === this[_length]); 3507 dart.assert(index == this[_length]);
3508 return this[_keys] = result; 3508 return this[_keys] = result;
3509 } 3509 }
3510 [_addHashTableEntry](table, key, value) { 3510 [_addHashTableEntry](table, key, value) {
3511 if (!dart.notNull(_HashMap[_hasTableEntry](table, key))) { 3511 if (!dart.notNull(_HashMap[_hasTableEntry](table, key))) {
3512 this[_length] = dart.notNull(this[_length]) + 1; 3512 this[_length] = dart.notNull(this[_length]) + 1;
3513 this[_keys] = null; 3513 this[_keys] = null;
3514 } 3514 }
3515 _HashMap[_setTableEntry](table, key, value); 3515 _HashMap[_setTableEntry](table, key, value);
3516 } 3516 }
3517 [_removeHashTableEntry](table, key) { 3517 [_removeHashTableEntry](table, key) {
3518 if (dart.notNull(table !== null) && dart.notNull(_HashMap[_hasTableEntry ](table, key))) { 3518 if (dart.notNull(table != null) && dart.notNull(_HashMap[_hasTableEntry] (table, key))) {
3519 let value = dart.as(_HashMap[_getTableEntry](table, key), V); 3519 let value = dart.as(_HashMap[_getTableEntry](table, key), V);
3520 _HashMap[_deleteTableEntry](table, key); 3520 _HashMap[_deleteTableEntry](table, key);
3521 this[_length] = dart.notNull(this[_length]) - 1; 3521 this[_length] = dart.notNull(this[_length]) - 1;
3522 this[_keys] = null; 3522 this[_keys] = null;
3523 return value; 3523 return value;
3524 } else { 3524 } else {
3525 return null; 3525 return null;
3526 } 3526 }
3527 } 3527 }
3528 static [_isStringKey](key) { 3528 static [_isStringKey](key) {
3529 return dart.notNull(typeof key == 'string') && dart.notNull(!dart.equals (key, '__proto__')); 3529 return dart.notNull(typeof key == 'string') && dart.notNull(!dart.equals (key, '__proto__'));
3530 } 3530 }
3531 static [_isNumericKey](key) { 3531 static [_isNumericKey](key) {
3532 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key ; 3532 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key ;
3533 } 3533 }
3534 [_computeHashCode](key) { 3534 [_computeHashCode](key) {
3535 return dart.dload(key, 'hashCode') & 0x3ffffff; 3535 return dart.dload(key, 'hashCode') & 0x3ffffff;
3536 } 3536 }
3537 static [_hasTableEntry](table, key) { 3537 static [_hasTableEntry](table, key) {
3538 let entry = table[key]; 3538 let entry = table[key];
3539 return entry !== null; 3539 return entry != null;
3540 } 3540 }
3541 static [_getTableEntry](table, key) { 3541 static [_getTableEntry](table, key) {
3542 let entry = table[key]; 3542 let entry = table[key];
3543 return entry === table ? null : entry; 3543 return entry === table ? null : entry;
3544 } 3544 }
3545 static [_setTableEntry](table, key, value) { 3545 static [_setTableEntry](table, key, value) {
3546 if (value === null) { 3546 if (value == null) {
3547 table[key] = table; 3547 table[key] = table;
3548 } else { 3548 } else {
3549 table[key] = value; 3549 table[key] = value;
3550 } 3550 }
3551 } 3551 }
3552 static [_deleteTableEntry](table, key) { 3552 static [_deleteTableEntry](table, key) {
3553 delete table[key]; 3553 delete table[key];
3554 } 3554 }
3555 [_getBucket](table, key) { 3555 [_getBucket](table, key) {
3556 let hash = this[_computeHashCode](key); 3556 let hash = this[_computeHashCode](key);
3557 return dart.as(table[hash], core.List); 3557 return dart.as(table[hash], core.List);
3558 } 3558 }
3559 [_findBucketIndex](bucket, key) { 3559 [_findBucketIndex](bucket, key) {
3560 if (bucket === null) 3560 if (bucket == null)
3561 return -1; 3561 return -1;
3562 let length = bucket.length; 3562 let length = bucket.length;
3563 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { 3563 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
3564 if (dart.equals(bucket[i], key)) 3564 if (dart.equals(bucket[i], key))
3565 return i; 3565 return i;
3566 } 3566 }
3567 return -1; 3567 return -1;
3568 } 3568 }
3569 static [_newHashTable]() { 3569 static [_newHashTable]() {
3570 let table = Object.create(null); 3570 let table = Object.create(null);
3571 let temporaryKey = '<non-identifier-key>'; 3571 let temporaryKey = '<non-identifier-key>';
3572 _HashMap[_setTableEntry](table, temporaryKey, table); 3572 _HashMap[_setTableEntry](table, temporaryKey, table);
3573 _HashMap[_deleteTableEntry](table, temporaryKey); 3573 _HashMap[_deleteTableEntry](table, temporaryKey);
3574 return table; 3574 return table;
3575 } 3575 }
3576 } 3576 }
3577 return _HashMap; 3577 return _HashMap;
3578 }); 3578 });
3579 let _HashMap = _HashMap$(dart.dynamic, dart.dynamic); 3579 let _HashMap = _HashMap$(dart.dynamic, dart.dynamic);
3580 let _IdentityHashMap$ = dart.generic(function(K, V) { 3580 let _IdentityHashMap$ = dart.generic(function(K, V) {
3581 class _IdentityHashMap extends _HashMap$(K, V) { 3581 class _IdentityHashMap extends _HashMap$(K, V) {
3582 [_computeHashCode](key) { 3582 [_computeHashCode](key) {
3583 return core.identityHashCode(key) & 0x3ffffff; 3583 return core.identityHashCode(key) & 0x3ffffff;
3584 } 3584 }
3585 [_findBucketIndex](bucket, key) { 3585 [_findBucketIndex](bucket, key) {
3586 if (bucket === null) 3586 if (bucket == null)
3587 return -1; 3587 return -1;
3588 let length = bucket.length; 3588 let length = bucket.length;
3589 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { 3589 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
3590 if (core.identical(bucket[i], key)) 3590 if (core.identical(bucket[i], key))
3591 return i; 3591 return i;
3592 } 3592 }
3593 return -1; 3593 return -1;
3594 } 3594 }
3595 } 3595 }
3596 return _IdentityHashMap; 3596 return _IdentityHashMap;
3597 }); 3597 });
3598 let _IdentityHashMap = _IdentityHashMap$(dart.dynamic, dart.dynamic); 3598 let _IdentityHashMap = _IdentityHashMap$(dart.dynamic, dart.dynamic);
3599 let _equals = Symbol('_equals'); 3599 let _equals = Symbol('_equals');
3600 let _hashCode = Symbol('_hashCode'); 3600 let _hashCode = Symbol('_hashCode');
3601 let _CustomHashMap$ = dart.generic(function(K, V) { 3601 let _CustomHashMap$ = dart.generic(function(K, V) {
3602 class _CustomHashMap extends _HashMap$(K, V) { 3602 class _CustomHashMap extends _HashMap$(K, V) {
3603 _CustomHashMap(equals$, hashCode$, validKey) { 3603 _CustomHashMap(equals$, hashCode$, validKey) {
3604 this[_equals] = equals$; 3604 this[_equals] = equals$;
3605 this[_hashCode] = hashCode$; 3605 this[_hashCode] = hashCode$;
3606 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is( v, K), _Predicate); 3606 this[_validKey] = dart.as(validKey != null ? validKey : (v) => dart.is(v , K), _Predicate);
3607 super._HashMap(); 3607 super._HashMap();
3608 } 3608 }
3609 get(key) { 3609 get(key) {
3610 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 3610 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
3611 return null; 3611 return null;
3612 return super._get(key); 3612 return super._get(key);
3613 } 3613 }
3614 set(key, value) { 3614 set(key, value) {
3615 super._set(key, value); 3615 super._set(key, value);
3616 } 3616 }
3617 containsKey(key) { 3617 containsKey(key) {
3618 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 3618 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
3619 return false; 3619 return false;
3620 return super._containsKey(key); 3620 return super._containsKey(key);
3621 } 3621 }
3622 remove(key) { 3622 remove(key) {
3623 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 3623 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
3624 return null; 3624 return null;
3625 return super._remove(key); 3625 return super._remove(key);
3626 } 3626 }
3627 [_computeHashCode](key) { 3627 [_computeHashCode](key) {
3628 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; 3628 return this[_hashCode](dart.as(key, K)) & 0x3ffffff;
3629 } 3629 }
3630 [_findBucketIndex](bucket, key) { 3630 [_findBucketIndex](bucket, key) {
3631 if (bucket === null) 3631 if (bucket == null)
3632 return -1; 3632 return -1;
3633 let length = bucket.length; 3633 let length = bucket.length;
3634 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { 3634 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) {
3635 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K))) 3635 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K)))
3636 return i; 3636 return i;
3637 } 3637 }
3638 return -1; 3638 return -1;
3639 } 3639 }
3640 toString() { 3640 toString() {
3641 return Maps.mapToString(this); 3641 return Maps.mapToString(this);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
3719 this[_nums] = null; 3719 this[_nums] = null;
3720 this[_rest] = null; 3720 this[_rest] = null;
3721 this[_first] = null; 3721 this[_first] = null;
3722 this[_last] = null; 3722 this[_last] = null;
3723 this[_modifications] = 0; 3723 this[_modifications] = 0;
3724 } 3724 }
3725 get length() { 3725 get length() {
3726 return this[_length]; 3726 return this[_length];
3727 } 3727 }
3728 get isEmpty() { 3728 get isEmpty() {
3729 return this[_length] === 0; 3729 return this[_length] == 0;
3730 } 3730 }
3731 get isNotEmpty() { 3731 get isNotEmpty() {
3732 return !dart.notNull(this.isEmpty); 3732 return !dart.notNull(this.isEmpty);
3733 } 3733 }
3734 get keys() { 3734 get keys() {
3735 return new LinkedHashMapKeyIterable(this); 3735 return new LinkedHashMapKeyIterable(this);
3736 } 3736 }
3737 get values() { 3737 get values() {
3738 return new _internal.MappedIterable(this.keys, dart.closureWrap(((each) => this.get(each)).bind(this), "(K) → V")); 3738 return new _internal.MappedIterable(this.keys, dart.closureWrap(((each) => this.get(each)).bind(this), "(K) → V"));
3739 } 3739 }
3740 containsKey(key) { 3740 containsKey(key) {
3741 if (_LinkedHashMap[_isStringKey](key)) { 3741 if (_LinkedHashMap[_isStringKey](key)) {
3742 let strings = this[_strings]; 3742 let strings = this[_strings];
3743 if (strings === null) 3743 if (strings == null)
3744 return false; 3744 return false;
3745 let cell = dart.as(_LinkedHashMap[_getTableEntry](strings, key), Linke dHashMapCell); 3745 let cell = dart.as(_LinkedHashMap[_getTableEntry](strings, key), Linke dHashMapCell);
3746 return cell !== null; 3746 return cell != null;
3747 } else if (_LinkedHashMap[_isNumericKey](key)) { 3747 } else if (_LinkedHashMap[_isNumericKey](key)) {
3748 let nums = this[_nums]; 3748 let nums = this[_nums];
3749 if (nums === null) 3749 if (nums == null)
3750 return false; 3750 return false;
3751 let cell = dart.as(_LinkedHashMap[_getTableEntry](nums, key), LinkedHa shMapCell); 3751 let cell = dart.as(_LinkedHashMap[_getTableEntry](nums, key), LinkedHa shMapCell);
3752 return cell !== null; 3752 return cell != null;
3753 } else { 3753 } else {
3754 return this[_containsKey](key); 3754 return this[_containsKey](key);
3755 } 3755 }
3756 } 3756 }
3757 [_containsKey](key) { 3757 [_containsKey](key) {
3758 let rest = this[_rest]; 3758 let rest = this[_rest];
3759 if (rest === null) 3759 if (rest == null)
3760 return false; 3760 return false;
3761 let bucket = this[_getBucket](rest, key); 3761 let bucket = this[_getBucket](rest, key);
3762 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; 3762 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
3763 } 3763 }
3764 containsValue(value) { 3764 containsValue(value) {
3765 return this.keys.any(dart.closureWrap(((each) => dart.equals(this.get(ea ch), value)).bind(this), "(K) → bool")); 3765 return this.keys.any(dart.closureWrap(((each) => dart.equals(this.get(ea ch), value)).bind(this), "(K) → bool"));
3766 } 3766 }
3767 addAll(other) { 3767 addAll(other) {
3768 other.forEach(((key, value) => { 3768 other.forEach(((key, value) => {
3769 this.set(key, value); 3769 this.set(key, value);
3770 }).bind(this)); 3770 }).bind(this));
3771 } 3771 }
3772 get(key) { 3772 get(key) {
3773 if (_LinkedHashMap[_isStringKey](key)) { 3773 if (_LinkedHashMap[_isStringKey](key)) {
3774 let strings = this[_strings]; 3774 let strings = this[_strings];
3775 if (strings === null) 3775 if (strings == null)
3776 return null; 3776 return null;
3777 let cell = dart.as(_LinkedHashMap[_getTableEntry](strings, key), Linke dHashMapCell); 3777 let cell = dart.as(_LinkedHashMap[_getTableEntry](strings, key), Linke dHashMapCell);
3778 return dart.as(cell === null ? null : cell[_value], V); 3778 return dart.as(cell == null ? null : cell[_value], V);
3779 } else if (_LinkedHashMap[_isNumericKey](key)) { 3779 } else if (_LinkedHashMap[_isNumericKey](key)) {
3780 let nums = this[_nums]; 3780 let nums = this[_nums];
3781 if (nums === null) 3781 if (nums == null)
3782 return null; 3782 return null;
3783 let cell = dart.as(_LinkedHashMap[_getTableEntry](nums, key), LinkedHa shMapCell); 3783 let cell = dart.as(_LinkedHashMap[_getTableEntry](nums, key), LinkedHa shMapCell);
3784 return dart.as(cell === null ? null : cell[_value], V); 3784 return dart.as(cell == null ? null : cell[_value], V);
3785 } else { 3785 } else {
3786 return this[_get](key); 3786 return this[_get](key);
3787 } 3787 }
3788 } 3788 }
3789 [_get](key) { 3789 [_get](key) {
3790 let rest = this[_rest]; 3790 let rest = this[_rest];
3791 if (rest === null) 3791 if (rest == null)
3792 return null; 3792 return null;
3793 let bucket = this[_getBucket](rest, key); 3793 let bucket = this[_getBucket](rest, key);
3794 let index = this[_findBucketIndex](bucket, key); 3794 let index = this[_findBucketIndex](bucket, key);
3795 if (dart.notNull(index) < 0) 3795 if (dart.notNull(index) < 0)
3796 return null; 3796 return null;
3797 let cell = dart.as(bucket[index], LinkedHashMapCell); 3797 let cell = dart.as(bucket[index], LinkedHashMapCell);
3798 return dart.as(cell[_value], V); 3798 return dart.as(cell[_value], V);
3799 } 3799 }
3800 set(key, value) { 3800 set(key, value) {
3801 if (_LinkedHashMap[_isStringKey](key)) { 3801 if (_LinkedHashMap[_isStringKey](key)) {
3802 let strings = this[_strings]; 3802 let strings = this[_strings];
3803 if (strings === null) 3803 if (strings == null)
3804 this[_strings] = strings = _LinkedHashMap[_newHashTable](); 3804 this[_strings] = strings = _LinkedHashMap[_newHashTable]();
3805 this[_addHashTableEntry](strings, key, value); 3805 this[_addHashTableEntry](strings, key, value);
3806 } else if (_LinkedHashMap[_isNumericKey](key)) { 3806 } else if (_LinkedHashMap[_isNumericKey](key)) {
3807 let nums = this[_nums]; 3807 let nums = this[_nums];
3808 if (nums === null) 3808 if (nums == null)
3809 this[_nums] = nums = _LinkedHashMap[_newHashTable](); 3809 this[_nums] = nums = _LinkedHashMap[_newHashTable]();
3810 this[_addHashTableEntry](nums, key, value); 3810 this[_addHashTableEntry](nums, key, value);
3811 } else { 3811 } else {
3812 this[_set](key, value); 3812 this[_set](key, value);
3813 } 3813 }
3814 } 3814 }
3815 [_set](key, value) { 3815 [_set](key, value) {
3816 let rest = this[_rest]; 3816 let rest = this[_rest];
3817 if (rest === null) 3817 if (rest == null)
3818 this[_rest] = rest = _LinkedHashMap[_newHashTable](); 3818 this[_rest] = rest = _LinkedHashMap[_newHashTable]();
3819 let hash = this[_computeHashCode](key); 3819 let hash = this[_computeHashCode](key);
3820 let bucket = rest[hash]; 3820 let bucket = rest[hash];
3821 if (bucket === null) { 3821 if (bucket == null) {
3822 let cell = this[_newLinkedCell](key, value); 3822 let cell = this[_newLinkedCell](key, value);
3823 _LinkedHashMap[_setTableEntry](rest, hash, [cell]); 3823 _LinkedHashMap[_setTableEntry](rest, hash, [cell]);
3824 } else { 3824 } else {
3825 let index = this[_findBucketIndex](bucket, key); 3825 let index = this[_findBucketIndex](bucket, key);
3826 if (dart.notNull(index) >= 0) { 3826 if (dart.notNull(index) >= 0) {
3827 let cell = dart.as(bucket[index], LinkedHashMapCell); 3827 let cell = dart.as(bucket[index], LinkedHashMapCell);
3828 cell[_value] = value; 3828 cell[_value] = value;
3829 } else { 3829 } else {
3830 let cell = this[_newLinkedCell](key, value); 3830 let cell = this[_newLinkedCell](key, value);
3831 bucket.push(cell); 3831 bucket.push(cell);
(...skipping 11 matching lines...) Expand all
3843 if (_LinkedHashMap[_isStringKey](key)) { 3843 if (_LinkedHashMap[_isStringKey](key)) {
3844 return this[_removeHashTableEntry](this[_strings], key); 3844 return this[_removeHashTableEntry](this[_strings], key);
3845 } else if (_LinkedHashMap[_isNumericKey](key)) { 3845 } else if (_LinkedHashMap[_isNumericKey](key)) {
3846 return this[_removeHashTableEntry](this[_nums], key); 3846 return this[_removeHashTableEntry](this[_nums], key);
3847 } else { 3847 } else {
3848 return this[_remove](key); 3848 return this[_remove](key);
3849 } 3849 }
3850 } 3850 }
3851 [_remove](key) { 3851 [_remove](key) {
3852 let rest = this[_rest]; 3852 let rest = this[_rest];
3853 if (rest === null) 3853 if (rest == null)
3854 return null; 3854 return null;
3855 let bucket = this[_getBucket](rest, key); 3855 let bucket = this[_getBucket](rest, key);
3856 let index = this[_findBucketIndex](bucket, key); 3856 let index = this[_findBucketIndex](bucket, key);
3857 if (dart.notNull(index) < 0) 3857 if (dart.notNull(index) < 0)
3858 return null; 3858 return null;
3859 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); 3859 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell);
3860 this[_unlinkCell](cell); 3860 this[_unlinkCell](cell);
3861 return dart.as(cell[_value], V); 3861 return dart.as(cell[_value], V);
3862 } 3862 }
3863 clear() { 3863 clear() {
3864 if (dart.notNull(this[_length]) > 0) { 3864 if (dart.notNull(this[_length]) > 0) {
3865 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null; 3865 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null;
3866 this[_length] = 0; 3866 this[_length] = 0;
3867 this[_modified](); 3867 this[_modified]();
3868 } 3868 }
3869 } 3869 }
3870 forEach(action) { 3870 forEach(action) {
3871 let cell = this[_first]; 3871 let cell = this[_first];
3872 let modifications = this[_modifications]; 3872 let modifications = this[_modifications];
3873 while (cell !== null) { 3873 while (cell != null) {
3874 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); 3874 action(dart.as(cell[_key], K), dart.as(cell[_value], V));
3875 if (modifications !== this[_modifications]) { 3875 if (modifications != this[_modifications]) {
3876 throw new core.ConcurrentModificationError(this); 3876 throw new core.ConcurrentModificationError(this);
3877 } 3877 }
3878 cell = cell[_next]; 3878 cell = cell[_next];
3879 } 3879 }
3880 } 3880 }
3881 [_addHashTableEntry](table, key, value) { 3881 [_addHashTableEntry](table, key, value) {
3882 let cell = dart.as(_LinkedHashMap[_getTableEntry](table, key), LinkedHas hMapCell); 3882 let cell = dart.as(_LinkedHashMap[_getTableEntry](table, key), LinkedHas hMapCell);
3883 if (cell === null) { 3883 if (cell == null) {
3884 _LinkedHashMap[_setTableEntry](table, key, this[_newLinkedCell](key, v alue)); 3884 _LinkedHashMap[_setTableEntry](table, key, this[_newLinkedCell](key, v alue));
3885 } else { 3885 } else {
3886 cell[_value] = value; 3886 cell[_value] = value;
3887 } 3887 }
3888 } 3888 }
3889 [_removeHashTableEntry](table, key) { 3889 [_removeHashTableEntry](table, key) {
3890 if (table === null) 3890 if (table == null)
3891 return null; 3891 return null;
3892 let cell = dart.as(_LinkedHashMap[_getTableEntry](table, key), LinkedHas hMapCell); 3892 let cell = dart.as(_LinkedHashMap[_getTableEntry](table, key), LinkedHas hMapCell);
3893 if (cell === null) 3893 if (cell == null)
3894 return null; 3894 return null;
3895 this[_unlinkCell](cell); 3895 this[_unlinkCell](cell);
3896 _LinkedHashMap[_deleteTableEntry](table, key); 3896 _LinkedHashMap[_deleteTableEntry](table, key);
3897 return dart.as(cell[_value], V); 3897 return dart.as(cell[_value], V);
3898 } 3898 }
3899 [_modified]() { 3899 [_modified]() {
3900 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ; 3900 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ;
3901 } 3901 }
3902 [_newLinkedCell](key, value) { 3902 [_newLinkedCell](key, value) {
3903 let cell = new LinkedHashMapCell(key, value); 3903 let cell = new LinkedHashMapCell(key, value);
3904 if (this[_first] === null) { 3904 if (this[_first] == null) {
3905 this[_first] = this[_last] = cell; 3905 this[_first] = this[_last] = cell;
3906 } else { 3906 } else {
3907 let last = this[_last]; 3907 let last = this[_last];
3908 cell[_previous] = last; 3908 cell[_previous] = last;
3909 this[_last] = last[_next] = cell; 3909 this[_last] = last[_next] = cell;
3910 } 3910 }
3911 this[_length] = dart.notNull(this[_length]) + 1; 3911 this[_length] = dart.notNull(this[_length]) + 1;
3912 this[_modified](); 3912 this[_modified]();
3913 return cell; 3913 return cell;
3914 } 3914 }
3915 [_unlinkCell](cell) { 3915 [_unlinkCell](cell) {
3916 let previous = cell[_previous]; 3916 let previous = cell[_previous];
3917 let next = cell[_next]; 3917 let next = cell[_next];
3918 if (previous === null) { 3918 if (previous == null) {
3919 dart.assert(dart.equals(cell, this[_first])); 3919 dart.assert(dart.equals(cell, this[_first]));
3920 this[_first] = next; 3920 this[_first] = next;
3921 } else { 3921 } else {
3922 previous[_next] = next; 3922 previous[_next] = next;
3923 } 3923 }
3924 if (next === null) { 3924 if (next == null) {
3925 dart.assert(dart.equals(cell, this[_last])); 3925 dart.assert(dart.equals(cell, this[_last]));
3926 this[_last] = previous; 3926 this[_last] = previous;
3927 } else { 3927 } else {
3928 next[_previous] = previous; 3928 next[_previous] = previous;
3929 } 3929 }
3930 this[_length] = dart.notNull(this[_length]) - 1; 3930 this[_length] = dart.notNull(this[_length]) - 1;
3931 this[_modified](); 3931 this[_modified]();
3932 } 3932 }
3933 static [_isStringKey](key) { 3933 static [_isStringKey](key) {
3934 return dart.notNull(typeof key == 'string') && dart.notNull(!dart.equals (key, '__proto__')); 3934 return dart.notNull(typeof key == 'string') && dart.notNull(!dart.equals (key, '__proto__'));
3935 } 3935 }
3936 static [_isNumericKey](key) { 3936 static [_isNumericKey](key) {
3937 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key ; 3937 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key ;
3938 } 3938 }
3939 [_computeHashCode](key) { 3939 [_computeHashCode](key) {
3940 return dart.dload(key, 'hashCode') & 0x3ffffff; 3940 return dart.dload(key, 'hashCode') & 0x3ffffff;
3941 } 3941 }
3942 static [_getTableEntry](table, key) { 3942 static [_getTableEntry](table, key) {
3943 return table[key]; 3943 return table[key];
3944 } 3944 }
3945 static [_setTableEntry](table, key, value) { 3945 static [_setTableEntry](table, key, value) {
3946 dart.assert(value !== null); 3946 dart.assert(value != null);
3947 table[key] = value; 3947 table[key] = value;
3948 } 3948 }
3949 static [_deleteTableEntry](table, key) { 3949 static [_deleteTableEntry](table, key) {
3950 delete table[key]; 3950 delete table[key];
3951 } 3951 }
3952 [_getBucket](table, key) { 3952 [_getBucket](table, key) {
3953 let hash = this[_computeHashCode](key); 3953 let hash = this[_computeHashCode](key);
3954 return dart.as(table[hash], core.List); 3954 return dart.as(table[hash], core.List);
3955 } 3955 }
3956 [_findBucketIndex](bucket, key) { 3956 [_findBucketIndex](bucket, key) {
3957 if (bucket === null) 3957 if (bucket == null)
3958 return -1; 3958 return -1;
3959 let length = bucket.length; 3959 let length = bucket.length;
3960 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 3960 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
3961 let cell = dart.as(bucket[i], LinkedHashMapCell); 3961 let cell = dart.as(bucket[i], LinkedHashMapCell);
3962 if (dart.equals(cell[_key], key)) 3962 if (dart.equals(cell[_key], key))
3963 return i; 3963 return i;
3964 } 3964 }
3965 return -1; 3965 return -1;
3966 } 3966 }
3967 static [_newHashTable]() { 3967 static [_newHashTable]() {
3968 let table = Object.create(null); 3968 let table = Object.create(null);
3969 let temporaryKey = '<non-identifier-key>'; 3969 let temporaryKey = '<non-identifier-key>';
3970 _LinkedHashMap[_setTableEntry](table, temporaryKey, table); 3970 _LinkedHashMap[_setTableEntry](table, temporaryKey, table);
3971 _LinkedHashMap[_deleteTableEntry](table, temporaryKey); 3971 _LinkedHashMap[_deleteTableEntry](table, temporaryKey);
3972 return table; 3972 return table;
3973 } 3973 }
3974 toString() { 3974 toString() {
3975 return Maps.mapToString(this); 3975 return Maps.mapToString(this);
3976 } 3976 }
3977 } 3977 }
3978 return _LinkedHashMap; 3978 return _LinkedHashMap;
3979 }); 3979 });
3980 let _LinkedHashMap = _LinkedHashMap$(dart.dynamic, dart.dynamic); 3980 let _LinkedHashMap = _LinkedHashMap$(dart.dynamic, dart.dynamic);
3981 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { 3981 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) {
3982 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { 3982 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) {
3983 [_computeHashCode](key) { 3983 [_computeHashCode](key) {
3984 return core.identityHashCode(key) & 0x3ffffff; 3984 return core.identityHashCode(key) & 0x3ffffff;
3985 } 3985 }
3986 [_findBucketIndex](bucket, key) { 3986 [_findBucketIndex](bucket, key) {
3987 if (bucket === null) 3987 if (bucket == null)
3988 return -1; 3988 return -1;
3989 let length = bucket.length; 3989 let length = bucket.length;
3990 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 3990 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
3991 let cell = dart.as(bucket[i], LinkedHashMapCell); 3991 let cell = dart.as(bucket[i], LinkedHashMapCell);
3992 if (core.identical(cell[_key], key)) 3992 if (core.identical(cell[_key], key))
3993 return i; 3993 return i;
3994 } 3994 }
3995 return -1; 3995 return -1;
3996 } 3996 }
3997 } 3997 }
3998 return _LinkedIdentityHashMap; 3998 return _LinkedIdentityHashMap;
3999 }); 3999 });
4000 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dart.dynamic, dart.dynami c); 4000 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dart.dynamic, dart.dynami c);
4001 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { 4001 let _LinkedCustomHashMap$ = dart.generic(function(K, V) {
4002 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { 4002 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) {
4003 _LinkedCustomHashMap(equals$, hashCode$, validKey) { 4003 _LinkedCustomHashMap(equals$, hashCode$, validKey) {
4004 this[_equals] = equals$; 4004 this[_equals] = equals$;
4005 this[_hashCode] = hashCode$; 4005 this[_hashCode] = hashCode$;
4006 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is( v, K), _Predicate); 4006 this[_validKey] = dart.as(validKey != null ? validKey : (v) => dart.is(v , K), _Predicate);
4007 super._LinkedHashMap(); 4007 super._LinkedHashMap();
4008 } 4008 }
4009 get(key) { 4009 get(key) {
4010 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 4010 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
4011 return null; 4011 return null;
4012 return super._get(key); 4012 return super._get(key);
4013 } 4013 }
4014 set(key, value) { 4014 set(key, value) {
4015 super._set(key, value); 4015 super._set(key, value);
4016 } 4016 }
4017 containsKey(key) { 4017 containsKey(key) {
4018 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 4018 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
4019 return false; 4019 return false;
4020 return super._containsKey(key); 4020 return super._containsKey(key);
4021 } 4021 }
4022 remove(key) { 4022 remove(key) {
4023 if (!dart.notNull(dart.dinvokef(this[_validKey], key))) 4023 if (!dart.notNull(dart.dinvokef(this[_validKey], key)))
4024 return null; 4024 return null;
4025 return super._remove(key); 4025 return super._remove(key);
4026 } 4026 }
4027 [_computeHashCode](key) { 4027 [_computeHashCode](key) {
4028 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; 4028 return this[_hashCode](dart.as(key, K)) & 0x3ffffff;
4029 } 4029 }
4030 [_findBucketIndex](bucket, key) { 4030 [_findBucketIndex](bucket, key) {
4031 if (bucket === null) 4031 if (bucket == null)
4032 return -1; 4032 return -1;
4033 let length = bucket.length; 4033 let length = bucket.length;
4034 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4034 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4035 let cell = dart.as(bucket[i], LinkedHashMapCell); 4035 let cell = dart.as(bucket[i], LinkedHashMapCell);
4036 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K))) 4036 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K)))
4037 return i; 4037 return i;
4038 } 4038 }
4039 return -1; 4039 return -1;
4040 } 4040 }
4041 } 4041 }
(...skipping 22 matching lines...) Expand all
4064 } 4064 }
4065 get iterator() { 4065 get iterator() {
4066 return new LinkedHashMapKeyIterator(this[_map], dart.as(dart.dload(this[ _map], '_modifications'), core.int)); 4066 return new LinkedHashMapKeyIterator(this[_map], dart.as(dart.dload(this[ _map], '_modifications'), core.int));
4067 } 4067 }
4068 contains(element) { 4068 contains(element) {
4069 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo ol); 4069 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo ol);
4070 } 4070 }
4071 forEach(f) { 4071 forEach(f) {
4072 let cell = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell); 4072 let cell = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell);
4073 let modifications = dart.as(dart.dload(this[_map], '_modifications'), co re.int); 4073 let modifications = dart.as(dart.dload(this[_map], '_modifications'), co re.int);
4074 while (cell !== null) { 4074 while (cell != null) {
4075 f(dart.as(cell[_key], E)); 4075 f(dart.as(cell[_key], E));
4076 if (modifications !== dart.dload(this[_map], '_modifications')) { 4076 if (!dart.equals(modifications, dart.dload(this[_map], '_modifications '))) {
4077 throw new core.ConcurrentModificationError(this[_map]); 4077 throw new core.ConcurrentModificationError(this[_map]);
4078 } 4078 }
4079 cell = cell[_next]; 4079 cell = cell[_next];
4080 } 4080 }
4081 } 4081 }
4082 } 4082 }
4083 return LinkedHashMapKeyIterable; 4083 return LinkedHashMapKeyIterable;
4084 }); 4084 });
4085 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dart.dynamic); 4085 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dart.dynamic);
4086 let _cell = Symbol('_cell'); 4086 let _cell = Symbol('_cell');
4087 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { 4087 let LinkedHashMapKeyIterator$ = dart.generic(function(E) {
4088 class LinkedHashMapKeyIterator extends core.Object { 4088 class LinkedHashMapKeyIterator extends core.Object {
4089 LinkedHashMapKeyIterator(map$, modifications$) { 4089 LinkedHashMapKeyIterator(map$, modifications$) {
4090 this[_map] = map$; 4090 this[_map] = map$;
4091 this[_modifications] = modifications$; 4091 this[_modifications] = modifications$;
4092 this[_cell] = null; 4092 this[_cell] = null;
4093 this[_current] = null; 4093 this[_current] = null;
4094 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel l); 4094 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel l);
4095 } 4095 }
4096 get current() { 4096 get current() {
4097 return this[_current]; 4097 return this[_current];
4098 } 4098 }
4099 moveNext() { 4099 moveNext() {
4100 if (this[_modifications] !== dart.dload(this[_map], '_modifications')) { 4100 if (!dart.equals(this[_modifications], dart.dload(this[_map], '_modifica tions'))) {
4101 throw new core.ConcurrentModificationError(this[_map]); 4101 throw new core.ConcurrentModificationError(this[_map]);
4102 } else if (this[_cell] === null) { 4102 } else if (this[_cell] == null) {
4103 this[_current] = null; 4103 this[_current] = null;
4104 return false; 4104 return false;
4105 } else { 4105 } else {
4106 this[_current] = dart.as(this[_cell][_key], E); 4106 this[_current] = dart.as(this[_cell][_key], E);
4107 this[_cell] = this[_cell][_next]; 4107 this[_cell] = this[_cell][_next];
4108 return true; 4108 return true;
4109 } 4109 }
4110 } 4110 }
4111 } 4111 }
4112 return LinkedHashMapKeyIterator; 4112 return LinkedHashMapKeyIterator;
(...skipping 18 matching lines...) Expand all
4131 [_newSet]() { 4131 [_newSet]() {
4132 return new _HashSet(); 4132 return new _HashSet();
4133 } 4133 }
4134 get iterator() { 4134 get iterator() {
4135 return new HashSetIterator(this, this[_computeElements]()); 4135 return new HashSetIterator(this, this[_computeElements]());
4136 } 4136 }
4137 get length() { 4137 get length() {
4138 return this[_length]; 4138 return this[_length];
4139 } 4139 }
4140 get isEmpty() { 4140 get isEmpty() {
4141 return this[_length] === 0; 4141 return this[_length] == 0;
4142 } 4142 }
4143 get isNotEmpty() { 4143 get isNotEmpty() {
4144 return !dart.notNull(this.isEmpty); 4144 return !dart.notNull(this.isEmpty);
4145 } 4145 }
4146 contains(object) { 4146 contains(object) {
4147 if (_HashSet[_isStringElement](object)) { 4147 if (_HashSet[_isStringElement](object)) {
4148 let strings = this[_strings]; 4148 let strings = this[_strings];
4149 return strings === null ? false : _HashSet[_hasTableEntry](strings, ob ject); 4149 return strings == null ? false : _HashSet[_hasTableEntry](strings, obj ect);
4150 } else if (_HashSet[_isNumericElement](object)) { 4150 } else if (_HashSet[_isNumericElement](object)) {
4151 let nums = this[_nums]; 4151 let nums = this[_nums];
4152 return nums === null ? false : _HashSet[_hasTableEntry](nums, object); 4152 return nums == null ? false : _HashSet[_hasTableEntry](nums, object);
4153 } else { 4153 } else {
4154 return this[_contains](object); 4154 return this[_contains](object);
4155 } 4155 }
4156 } 4156 }
4157 [_contains](object) { 4157 [_contains](object) {
4158 let rest = this[_rest]; 4158 let rest = this[_rest];
4159 if (rest === null) 4159 if (rest == null)
4160 return false; 4160 return false;
4161 let bucket = this[_getBucket](rest, object); 4161 let bucket = this[_getBucket](rest, object);
4162 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0; 4162 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0;
4163 } 4163 }
4164 lookup(object) { 4164 lookup(object) {
4165 if (dart.notNull(_HashSet[_isStringElement](object)) || dart.notNull(_Ha shSet[_isNumericElement](object))) { 4165 if (dart.notNull(_HashSet[_isStringElement](object)) || dart.notNull(_Ha shSet[_isNumericElement](object))) {
4166 return dart.as(this.contains(object) ? object : null, E); 4166 return dart.as(this.contains(object) ? object : null, E);
4167 } 4167 }
4168 return this[_lookup](object); 4168 return this[_lookup](object);
4169 } 4169 }
4170 [_lookup](object) { 4170 [_lookup](object) {
4171 let rest = this[_rest]; 4171 let rest = this[_rest];
4172 if (rest === null) 4172 if (rest == null)
4173 return null; 4173 return null;
4174 let bucket = this[_getBucket](rest, object); 4174 let bucket = this[_getBucket](rest, object);
4175 let index = this[_findBucketIndex](bucket, object); 4175 let index = this[_findBucketIndex](bucket, object);
4176 if (dart.notNull(index) < 0) 4176 if (dart.notNull(index) < 0)
4177 return null; 4177 return null;
4178 return dart.as(bucket.get(index), E); 4178 return dart.as(bucket.get(index), E);
4179 } 4179 }
4180 add(element) { 4180 add(element) {
4181 if (_HashSet[_isStringElement](element)) { 4181 if (_HashSet[_isStringElement](element)) {
4182 let strings = this[_strings]; 4182 let strings = this[_strings];
4183 if (strings === null) 4183 if (strings == null)
4184 this[_strings] = strings = _HashSet[_newHashTable](); 4184 this[_strings] = strings = _HashSet[_newHashTable]();
4185 return this[_addHashTableEntry](strings, element); 4185 return this[_addHashTableEntry](strings, element);
4186 } else if (_HashSet[_isNumericElement](element)) { 4186 } else if (_HashSet[_isNumericElement](element)) {
4187 let nums = this[_nums]; 4187 let nums = this[_nums];
4188 if (nums === null) 4188 if (nums == null)
4189 this[_nums] = nums = _HashSet[_newHashTable](); 4189 this[_nums] = nums = _HashSet[_newHashTable]();
4190 return this[_addHashTableEntry](nums, element); 4190 return this[_addHashTableEntry](nums, element);
4191 } else { 4191 } else {
4192 return this[_add](element); 4192 return this[_add](element);
4193 } 4193 }
4194 } 4194 }
4195 [_add](element) { 4195 [_add](element) {
4196 let rest = this[_rest]; 4196 let rest = this[_rest];
4197 if (rest === null) 4197 if (rest == null)
4198 this[_rest] = rest = _HashSet[_newHashTable](); 4198 this[_rest] = rest = _HashSet[_newHashTable]();
4199 let hash = this[_computeHashCode](element); 4199 let hash = this[_computeHashCode](element);
4200 let bucket = rest[hash]; 4200 let bucket = rest[hash];
4201 if (bucket === null) { 4201 if (bucket == null) {
4202 _HashSet[_setTableEntry](rest, hash, [element]); 4202 _HashSet[_setTableEntry](rest, hash, [element]);
4203 } else { 4203 } else {
4204 let index = this[_findBucketIndex](bucket, element); 4204 let index = this[_findBucketIndex](bucket, element);
4205 if (dart.notNull(index) >= 0) 4205 if (dart.notNull(index) >= 0)
4206 return false; 4206 return false;
4207 bucket.push(element); 4207 bucket.push(element);
4208 } 4208 }
4209 this[_length] = dart.notNull(this[_length]) + 1; 4209 this[_length] = dart.notNull(this[_length]) + 1;
4210 this[_elements] = null; 4210 this[_elements] = null;
4211 return true; 4211 return true;
4212 } 4212 }
4213 addAll(objects) { 4213 addAll(objects) {
4214 for (let each of objects) { 4214 for (let each of objects) {
4215 this.add(each); 4215 this.add(each);
4216 } 4216 }
4217 } 4217 }
4218 remove(object) { 4218 remove(object) {
4219 if (_HashSet[_isStringElement](object)) { 4219 if (_HashSet[_isStringElement](object)) {
4220 return this[_removeHashTableEntry](this[_strings], object); 4220 return this[_removeHashTableEntry](this[_strings], object);
4221 } else if (_HashSet[_isNumericElement](object)) { 4221 } else if (_HashSet[_isNumericElement](object)) {
4222 return this[_removeHashTableEntry](this[_nums], object); 4222 return this[_removeHashTableEntry](this[_nums], object);
4223 } else { 4223 } else {
4224 return this[_remove](object); 4224 return this[_remove](object);
4225 } 4225 }
4226 } 4226 }
4227 [_remove](object) { 4227 [_remove](object) {
4228 let rest = this[_rest]; 4228 let rest = this[_rest];
4229 if (rest === null) 4229 if (rest == null)
4230 return false; 4230 return false;
4231 let bucket = this[_getBucket](rest, object); 4231 let bucket = this[_getBucket](rest, object);
4232 let index = this[_findBucketIndex](bucket, object); 4232 let index = this[_findBucketIndex](bucket, object);
4233 if (dart.notNull(index) < 0) 4233 if (dart.notNull(index) < 0)
4234 return false; 4234 return false;
4235 this[_length] = dart.notNull(this[_length]) - 1; 4235 this[_length] = dart.notNull(this[_length]) - 1;
4236 this[_elements] = null; 4236 this[_elements] = null;
4237 bucket.splice(index, 1); 4237 bucket.splice(index, 1);
4238 return true; 4238 return true;
4239 } 4239 }
4240 clear() { 4240 clear() {
4241 if (dart.notNull(this[_length]) > 0) { 4241 if (dart.notNull(this[_length]) > 0) {
4242 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null; 4242 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null;
4243 this[_length] = 0; 4243 this[_length] = 0;
4244 } 4244 }
4245 } 4245 }
4246 [_computeElements]() { 4246 [_computeElements]() {
4247 if (this[_elements] !== null) 4247 if (this[_elements] != null)
4248 return this[_elements]; 4248 return this[_elements];
4249 let result = new core.List(this[_length]); 4249 let result = new core.List(this[_length]);
4250 let index = 0; 4250 let index = 0;
4251 let strings = this[_strings]; 4251 let strings = this[_strings];
4252 if (strings !== null) { 4252 if (strings != null) {
4253 let names = Object.getOwnPropertyNames(strings); 4253 let names = Object.getOwnPropertyNames(strings);
4254 let entries = names.length; 4254 let entries = names.length;
4255 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) { 4255 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) {
4256 let element = names[i]; 4256 let element = names[i];
4257 result[index] = element; 4257 result[index] = element;
4258 index = dart.notNull(index) + 1; 4258 index = dart.notNull(index) + 1;
4259 } 4259 }
4260 } 4260 }
4261 let nums = this[_nums]; 4261 let nums = this[_nums];
4262 if (nums !== null) { 4262 if (nums != null) {
4263 let names = Object.getOwnPropertyNames(nums); 4263 let names = Object.getOwnPropertyNames(nums);
4264 let entries = names.length; 4264 let entries = names.length;
4265 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) { 4265 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) {
4266 let element = +names[i]; 4266 let element = +names[i];
4267 result[index] = element; 4267 result[index] = element;
4268 index = dart.notNull(index) + 1; 4268 index = dart.notNull(index) + 1;
4269 } 4269 }
4270 } 4270 }
4271 let rest = this[_rest]; 4271 let rest = this[_rest];
4272 if (rest !== null) { 4272 if (rest != null) {
4273 let names = Object.getOwnPropertyNames(rest); 4273 let names = Object.getOwnPropertyNames(rest);
4274 let entries = names.length; 4274 let entries = names.length;
4275 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) { 4275 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN ull(i) + 1) {
4276 let entry = names[i]; 4276 let entry = names[i];
4277 let bucket = rest[entry]; 4277 let bucket = rest[entry];
4278 let length = bucket.length; 4278 let length = bucket.length;
4279 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not Null(i) + 1) { 4279 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not Null(i) + 1) {
4280 result[index] = bucket[i]; 4280 result[index] = bucket[i];
4281 index = dart.notNull(index) + 1; 4281 index = dart.notNull(index) + 1;
4282 } 4282 }
4283 } 4283 }
4284 } 4284 }
4285 dart.assert(index === this[_length]); 4285 dart.assert(index == this[_length]);
4286 return this[_elements] = result; 4286 return this[_elements] = result;
4287 } 4287 }
4288 [_addHashTableEntry](table, element) { 4288 [_addHashTableEntry](table, element) {
4289 if (_HashSet[_hasTableEntry](table, element)) 4289 if (_HashSet[_hasTableEntry](table, element))
4290 return false; 4290 return false;
4291 _HashSet[_setTableEntry](table, element, 0); 4291 _HashSet[_setTableEntry](table, element, 0);
4292 this[_length] = dart.notNull(this[_length]) + 1; 4292 this[_length] = dart.notNull(this[_length]) + 1;
4293 this[_elements] = null; 4293 this[_elements] = null;
4294 return true; 4294 return true;
4295 } 4295 }
4296 [_removeHashTableEntry](table, element) { 4296 [_removeHashTableEntry](table, element) {
4297 if (dart.notNull(table !== null) && dart.notNull(_HashSet[_hasTableEntry ](table, element))) { 4297 if (dart.notNull(table != null) && dart.notNull(_HashSet[_hasTableEntry] (table, element))) {
4298 _HashSet[_deleteTableEntry](table, element); 4298 _HashSet[_deleteTableEntry](table, element);
4299 this[_length] = dart.notNull(this[_length]) - 1; 4299 this[_length] = dart.notNull(this[_length]) - 1;
4300 this[_elements] = null; 4300 this[_elements] = null;
4301 return true; 4301 return true;
4302 } else { 4302 } else {
4303 return false; 4303 return false;
4304 } 4304 }
4305 } 4305 }
4306 static [_isStringElement](element) { 4306 static [_isStringElement](element) {
4307 return dart.notNull(typeof element == 'string') && dart.notNull(!dart.eq uals(element, '__proto__')); 4307 return dart.notNull(typeof element == 'string') && dart.notNull(!dart.eq uals(element, '__proto__'));
4308 } 4308 }
4309 static [_isNumericElement](element) { 4309 static [_isNumericElement](element) {
4310 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element; 4310 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element;
4311 } 4311 }
4312 [_computeHashCode](element) { 4312 [_computeHashCode](element) {
4313 return dart.dload(element, 'hashCode') & 0x3ffffff; 4313 return dart.dload(element, 'hashCode') & 0x3ffffff;
4314 } 4314 }
4315 static [_hasTableEntry](table, key) { 4315 static [_hasTableEntry](table, key) {
4316 let entry = table[key]; 4316 let entry = table[key];
4317 return entry !== null; 4317 return entry != null;
4318 } 4318 }
4319 static [_setTableEntry](table, key, value) { 4319 static [_setTableEntry](table, key, value) {
4320 dart.assert(value !== null); 4320 dart.assert(value != null);
4321 table[key] = value; 4321 table[key] = value;
4322 } 4322 }
4323 static [_deleteTableEntry](table, key) { 4323 static [_deleteTableEntry](table, key) {
4324 delete table[key]; 4324 delete table[key];
4325 } 4325 }
4326 [_getBucket](table, element) { 4326 [_getBucket](table, element) {
4327 let hash = this[_computeHashCode](element); 4327 let hash = this[_computeHashCode](element);
4328 return dart.as(table[hash], core.List); 4328 return dart.as(table[hash], core.List);
4329 } 4329 }
4330 [_findBucketIndex](bucket, element) { 4330 [_findBucketIndex](bucket, element) {
4331 if (bucket === null) 4331 if (bucket == null)
4332 return -1; 4332 return -1;
4333 let length = bucket.length; 4333 let length = bucket.length;
4334 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4334 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4335 if (dart.equals(bucket[i], element)) 4335 if (dart.equals(bucket[i], element))
4336 return i; 4336 return i;
4337 } 4337 }
4338 return -1; 4338 return -1;
4339 } 4339 }
4340 static [_newHashTable]() { 4340 static [_newHashTable]() {
4341 let table = Object.create(null); 4341 let table = Object.create(null);
4342 let temporaryKey = '<non-identifier-key>'; 4342 let temporaryKey = '<non-identifier-key>';
4343 _HashSet[_setTableEntry](table, temporaryKey, table); 4343 _HashSet[_setTableEntry](table, temporaryKey, table);
4344 _HashSet[_deleteTableEntry](table, temporaryKey); 4344 _HashSet[_deleteTableEntry](table, temporaryKey);
4345 return table; 4345 return table;
4346 } 4346 }
4347 } 4347 }
4348 return _HashSet; 4348 return _HashSet;
4349 }); 4349 });
4350 let _HashSet = _HashSet$(dart.dynamic); 4350 let _HashSet = _HashSet$(dart.dynamic);
4351 let _IdentityHashSet$ = dart.generic(function(E) { 4351 let _IdentityHashSet$ = dart.generic(function(E) {
4352 class _IdentityHashSet extends _HashSet$(E) { 4352 class _IdentityHashSet extends _HashSet$(E) {
4353 [_newSet]() { 4353 [_newSet]() {
4354 return new _IdentityHashSet(); 4354 return new _IdentityHashSet();
4355 } 4355 }
4356 [_computeHashCode](key) { 4356 [_computeHashCode](key) {
4357 return core.identityHashCode(key) & 0x3ffffff; 4357 return core.identityHashCode(key) & 0x3ffffff;
4358 } 4358 }
4359 [_findBucketIndex](bucket, element) { 4359 [_findBucketIndex](bucket, element) {
4360 if (bucket === null) 4360 if (bucket == null)
4361 return -1; 4361 return -1;
4362 let length = bucket.length; 4362 let length = bucket.length;
4363 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4363 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4364 if (core.identical(bucket[i], element)) 4364 if (core.identical(bucket[i], element))
4365 return i; 4365 return i;
4366 } 4366 }
4367 return -1; 4367 return -1;
4368 } 4368 }
4369 } 4369 }
4370 return _IdentityHashSet; 4370 return _IdentityHashSet;
4371 }); 4371 });
4372 let _IdentityHashSet = _IdentityHashSet$(dart.dynamic); 4372 let _IdentityHashSet = _IdentityHashSet$(dart.dynamic);
4373 let _equality = Symbol('_equality'); 4373 let _equality = Symbol('_equality');
4374 let _hasher = Symbol('_hasher'); 4374 let _hasher = Symbol('_hasher');
4375 let _CustomHashSet$ = dart.generic(function(E) { 4375 let _CustomHashSet$ = dart.generic(function(E) {
4376 class _CustomHashSet extends _HashSet$(E) { 4376 class _CustomHashSet extends _HashSet$(E) {
4377 _CustomHashSet(equality, hasher, validKey) { 4377 _CustomHashSet(equality, hasher, validKey) {
4378 this[_equality] = equality; 4378 this[_equality] = equality;
4379 this[_hasher] = hasher; 4379 this[_hasher] = hasher;
4380 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is( x, E), _Predicate); 4380 this[_validKey] = dart.as(validKey != null ? validKey : (x) => dart.is(x , E), _Predicate);
4381 super._HashSet(); 4381 super._HashSet();
4382 } 4382 }
4383 [_newSet]() { 4383 [_newSet]() {
4384 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey ]); 4384 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey ]);
4385 } 4385 }
4386 [_findBucketIndex](bucket, element) { 4386 [_findBucketIndex](bucket, element) {
4387 if (bucket === null) 4387 if (bucket == null)
4388 return -1; 4388 return -1;
4389 let length = bucket.length; 4389 let length = bucket.length;
4390 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4390 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4391 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) 4391 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E)))
4392 return i; 4392 return i;
4393 } 4393 }
4394 return -1; 4394 return -1;
4395 } 4395 }
4396 [_computeHashCode](element) { 4396 [_computeHashCode](element) {
4397 return this[_hasher](dart.as(element, E)) & 0x3ffffff; 4397 return this[_hasher](dart.as(element, E)) & 0x3ffffff;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4466 [_unsupported](operation) { 4466 [_unsupported](operation) {
4467 throw `LinkedHashSet: unsupported ${operation}`; 4467 throw `LinkedHashSet: unsupported ${operation}`;
4468 } 4468 }
4469 get iterator() { 4469 get iterator() {
4470 return dart.as(new LinkedHashSetIterator(this, this[_modifications]), co re.Iterator$(E)); 4470 return dart.as(new LinkedHashSetIterator(this, this[_modifications]), co re.Iterator$(E));
4471 } 4471 }
4472 get length() { 4472 get length() {
4473 return this[_length]; 4473 return this[_length];
4474 } 4474 }
4475 get isEmpty() { 4475 get isEmpty() {
4476 return this[_length] === 0; 4476 return this[_length] == 0;
4477 } 4477 }
4478 get isNotEmpty() { 4478 get isNotEmpty() {
4479 return !dart.notNull(this.isEmpty); 4479 return !dart.notNull(this.isEmpty);
4480 } 4480 }
4481 contains(object) { 4481 contains(object) {
4482 if (_LinkedHashSet[_isStringElement](object)) { 4482 if (_LinkedHashSet[_isStringElement](object)) {
4483 let strings = this[_strings]; 4483 let strings = this[_strings];
4484 if (strings === null) 4484 if (strings == null)
4485 return false; 4485 return false;
4486 let cell = dart.as(_LinkedHashSet[_getTableEntry](strings, object), Li nkedHashSetCell); 4486 let cell = dart.as(_LinkedHashSet[_getTableEntry](strings, object), Li nkedHashSetCell);
4487 return cell !== null; 4487 return cell != null;
4488 } else if (_LinkedHashSet[_isNumericElement](object)) { 4488 } else if (_LinkedHashSet[_isNumericElement](object)) {
4489 let nums = this[_nums]; 4489 let nums = this[_nums];
4490 if (nums === null) 4490 if (nums == null)
4491 return false; 4491 return false;
4492 let cell = dart.as(_LinkedHashSet[_getTableEntry](nums, object), Linke dHashSetCell); 4492 let cell = dart.as(_LinkedHashSet[_getTableEntry](nums, object), Linke dHashSetCell);
4493 return cell !== null; 4493 return cell != null;
4494 } else { 4494 } else {
4495 return this[_contains](object); 4495 return this[_contains](object);
4496 } 4496 }
4497 } 4497 }
4498 [_contains](object) { 4498 [_contains](object) {
4499 let rest = this[_rest]; 4499 let rest = this[_rest];
4500 if (rest === null) 4500 if (rest == null)
4501 return false; 4501 return false;
4502 let bucket = this[_getBucket](rest, object); 4502 let bucket = this[_getBucket](rest, object);
4503 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0; 4503 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0;
4504 } 4504 }
4505 lookup(object) { 4505 lookup(object) {
4506 if (dart.notNull(_LinkedHashSet[_isStringElement](object)) || dart.notNu ll(_LinkedHashSet[_isNumericElement](object))) { 4506 if (dart.notNull(_LinkedHashSet[_isStringElement](object)) || dart.notNu ll(_LinkedHashSet[_isNumericElement](object))) {
4507 return dart.as(this.contains(object) ? object : null, E); 4507 return dart.as(this.contains(object) ? object : null, E);
4508 } else { 4508 } else {
4509 return this[_lookup](object); 4509 return this[_lookup](object);
4510 } 4510 }
4511 } 4511 }
4512 [_lookup](object) { 4512 [_lookup](object) {
4513 let rest = this[_rest]; 4513 let rest = this[_rest];
4514 if (rest === null) 4514 if (rest == null)
4515 return null; 4515 return null;
4516 let bucket = this[_getBucket](rest, object); 4516 let bucket = this[_getBucket](rest, object);
4517 let index = this[_findBucketIndex](bucket, object); 4517 let index = this[_findBucketIndex](bucket, object);
4518 if (dart.notNull(index) < 0) 4518 if (dart.notNull(index) < 0)
4519 return null; 4519 return null;
4520 return dart.as(dart.dload(bucket.get(index), '_element'), E); 4520 return dart.as(dart.dload(bucket.get(index), '_element'), E);
4521 } 4521 }
4522 forEach(action) { 4522 forEach(action) {
4523 let cell = this[_first]; 4523 let cell = this[_first];
4524 let modifications = this[_modifications]; 4524 let modifications = this[_modifications];
4525 while (cell !== null) { 4525 while (cell != null) {
4526 action(dart.as(cell[_element], E)); 4526 action(dart.as(cell[_element], E));
4527 if (modifications !== this[_modifications]) { 4527 if (modifications != this[_modifications]) {
4528 throw new core.ConcurrentModificationError(this); 4528 throw new core.ConcurrentModificationError(this);
4529 } 4529 }
4530 cell = cell[_next]; 4530 cell = cell[_next];
4531 } 4531 }
4532 } 4532 }
4533 get first() { 4533 get first() {
4534 if (this[_first] === null) 4534 if (this[_first] == null)
4535 throw new core.StateError("No elements"); 4535 throw new core.StateError("No elements");
4536 return dart.as(this[_first][_element], E); 4536 return dart.as(this[_first][_element], E);
4537 } 4537 }
4538 get last() { 4538 get last() {
4539 if (this[_last] === null) 4539 if (this[_last] == null)
4540 throw new core.StateError("No elements"); 4540 throw new core.StateError("No elements");
4541 return dart.as(this[_last][_element], E); 4541 return dart.as(this[_last][_element], E);
4542 } 4542 }
4543 add(element) { 4543 add(element) {
4544 if (_LinkedHashSet[_isStringElement](element)) { 4544 if (_LinkedHashSet[_isStringElement](element)) {
4545 let strings = this[_strings]; 4545 let strings = this[_strings];
4546 if (strings === null) 4546 if (strings == null)
4547 this[_strings] = strings = _LinkedHashSet[_newHashTable](); 4547 this[_strings] = strings = _LinkedHashSet[_newHashTable]();
4548 return this[_addHashTableEntry](strings, element); 4548 return this[_addHashTableEntry](strings, element);
4549 } else if (_LinkedHashSet[_isNumericElement](element)) { 4549 } else if (_LinkedHashSet[_isNumericElement](element)) {
4550 let nums = this[_nums]; 4550 let nums = this[_nums];
4551 if (nums === null) 4551 if (nums == null)
4552 this[_nums] = nums = _LinkedHashSet[_newHashTable](); 4552 this[_nums] = nums = _LinkedHashSet[_newHashTable]();
4553 return this[_addHashTableEntry](nums, element); 4553 return this[_addHashTableEntry](nums, element);
4554 } else { 4554 } else {
4555 return this[_add](element); 4555 return this[_add](element);
4556 } 4556 }
4557 } 4557 }
4558 [_add](element) { 4558 [_add](element) {
4559 let rest = this[_rest]; 4559 let rest = this[_rest];
4560 if (rest === null) 4560 if (rest == null)
4561 this[_rest] = rest = _LinkedHashSet[_newHashTable](); 4561 this[_rest] = rest = _LinkedHashSet[_newHashTable]();
4562 let hash = this[_computeHashCode](element); 4562 let hash = this[_computeHashCode](element);
4563 let bucket = rest[hash]; 4563 let bucket = rest[hash];
4564 if (bucket === null) { 4564 if (bucket == null) {
4565 let cell = this[_newLinkedCell](element); 4565 let cell = this[_newLinkedCell](element);
4566 _LinkedHashSet[_setTableEntry](rest, hash, [cell]); 4566 _LinkedHashSet[_setTableEntry](rest, hash, [cell]);
4567 } else { 4567 } else {
4568 let index = this[_findBucketIndex](bucket, element); 4568 let index = this[_findBucketIndex](bucket, element);
4569 if (dart.notNull(index) >= 0) 4569 if (dart.notNull(index) >= 0)
4570 return false; 4570 return false;
4571 let cell = this[_newLinkedCell](element); 4571 let cell = this[_newLinkedCell](element);
4572 bucket.push(cell); 4572 bucket.push(cell);
4573 } 4573 }
4574 return true; 4574 return true;
4575 } 4575 }
4576 remove(object) { 4576 remove(object) {
4577 if (_LinkedHashSet[_isStringElement](object)) { 4577 if (_LinkedHashSet[_isStringElement](object)) {
4578 return this[_removeHashTableEntry](this[_strings], object); 4578 return this[_removeHashTableEntry](this[_strings], object);
4579 } else if (_LinkedHashSet[_isNumericElement](object)) { 4579 } else if (_LinkedHashSet[_isNumericElement](object)) {
4580 return this[_removeHashTableEntry](this[_nums], object); 4580 return this[_removeHashTableEntry](this[_nums], object);
4581 } else { 4581 } else {
4582 return this[_remove](object); 4582 return this[_remove](object);
4583 } 4583 }
4584 } 4584 }
4585 [_remove](object) { 4585 [_remove](object) {
4586 let rest = this[_rest]; 4586 let rest = this[_rest];
4587 if (rest === null) 4587 if (rest == null)
4588 return false; 4588 return false;
4589 let bucket = this[_getBucket](rest, object); 4589 let bucket = this[_getBucket](rest, object);
4590 let index = this[_findBucketIndex](bucket, object); 4590 let index = this[_findBucketIndex](bucket, object);
4591 if (dart.notNull(index) < 0) 4591 if (dart.notNull(index) < 0)
4592 return false; 4592 return false;
4593 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); 4593 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell);
4594 this[_unlinkCell](cell); 4594 this[_unlinkCell](cell);
4595 return true; 4595 return true;
4596 } 4596 }
4597 removeWhere(test) { 4597 removeWhere(test) {
4598 this[_filterWhere](test, true); 4598 this[_filterWhere](test, true);
4599 } 4599 }
4600 retainWhere(test) { 4600 retainWhere(test) {
4601 this[_filterWhere](test, false); 4601 this[_filterWhere](test, false);
4602 } 4602 }
4603 [_filterWhere](test, removeMatching) { 4603 [_filterWhere](test, removeMatching) {
4604 let cell = this[_first]; 4604 let cell = this[_first];
4605 while (cell !== null) { 4605 while (cell != null) {
4606 let element = dart.as(cell[_element], E); 4606 let element = dart.as(cell[_element], E);
4607 let next = cell[_next]; 4607 let next = cell[_next];
4608 let modifications = this[_modifications]; 4608 let modifications = this[_modifications];
4609 let shouldRemove = removeMatching === test(element); 4609 let shouldRemove = removeMatching == test(element);
4610 if (modifications !== this[_modifications]) { 4610 if (modifications != this[_modifications]) {
4611 throw new core.ConcurrentModificationError(this); 4611 throw new core.ConcurrentModificationError(this);
4612 } 4612 }
4613 if (shouldRemove) 4613 if (shouldRemove)
4614 this.remove(element); 4614 this.remove(element);
4615 cell = next; 4615 cell = next;
4616 } 4616 }
4617 } 4617 }
4618 clear() { 4618 clear() {
4619 if (dart.notNull(this[_length]) > 0) { 4619 if (dart.notNull(this[_length]) > 0) {
4620 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null; 4620 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null;
4621 this[_length] = 0; 4621 this[_length] = 0;
4622 this[_modified](); 4622 this[_modified]();
4623 } 4623 }
4624 } 4624 }
4625 [_addHashTableEntry](table, element) { 4625 [_addHashTableEntry](table, element) {
4626 let cell = dart.as(_LinkedHashSet[_getTableEntry](table, element), Linke dHashSetCell); 4626 let cell = dart.as(_LinkedHashSet[_getTableEntry](table, element), Linke dHashSetCell);
4627 if (cell !== null) 4627 if (cell != null)
4628 return false; 4628 return false;
4629 _LinkedHashSet[_setTableEntry](table, element, this[_newLinkedCell](elem ent)); 4629 _LinkedHashSet[_setTableEntry](table, element, this[_newLinkedCell](elem ent));
4630 return true; 4630 return true;
4631 } 4631 }
4632 [_removeHashTableEntry](table, element) { 4632 [_removeHashTableEntry](table, element) {
4633 if (table === null) 4633 if (table == null)
4634 return false; 4634 return false;
4635 let cell = dart.as(_LinkedHashSet[_getTableEntry](table, element), Linke dHashSetCell); 4635 let cell = dart.as(_LinkedHashSet[_getTableEntry](table, element), Linke dHashSetCell);
4636 if (cell === null) 4636 if (cell == null)
4637 return false; 4637 return false;
4638 this[_unlinkCell](cell); 4638 this[_unlinkCell](cell);
4639 _LinkedHashSet[_deleteTableEntry](table, element); 4639 _LinkedHashSet[_deleteTableEntry](table, element);
4640 return true; 4640 return true;
4641 } 4641 }
4642 [_modified]() { 4642 [_modified]() {
4643 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ; 4643 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ;
4644 } 4644 }
4645 [_newLinkedCell](element) { 4645 [_newLinkedCell](element) {
4646 let cell = new LinkedHashSetCell(element); 4646 let cell = new LinkedHashSetCell(element);
4647 if (this[_first] === null) { 4647 if (this[_first] == null) {
4648 this[_first] = this[_last] = cell; 4648 this[_first] = this[_last] = cell;
4649 } else { 4649 } else {
4650 let last = this[_last]; 4650 let last = this[_last];
4651 cell[_previous] = last; 4651 cell[_previous] = last;
4652 this[_last] = last[_next] = cell; 4652 this[_last] = last[_next] = cell;
4653 } 4653 }
4654 this[_length] = dart.notNull(this[_length]) + 1; 4654 this[_length] = dart.notNull(this[_length]) + 1;
4655 this[_modified](); 4655 this[_modified]();
4656 return cell; 4656 return cell;
4657 } 4657 }
4658 [_unlinkCell](cell) { 4658 [_unlinkCell](cell) {
4659 let previous = cell[_previous]; 4659 let previous = cell[_previous];
4660 let next = cell[_next]; 4660 let next = cell[_next];
4661 if (previous === null) { 4661 if (previous == null) {
4662 dart.assert(dart.equals(cell, this[_first])); 4662 dart.assert(dart.equals(cell, this[_first]));
4663 this[_first] = next; 4663 this[_first] = next;
4664 } else { 4664 } else {
4665 previous[_next] = next; 4665 previous[_next] = next;
4666 } 4666 }
4667 if (next === null) { 4667 if (next == null) {
4668 dart.assert(dart.equals(cell, this[_last])); 4668 dart.assert(dart.equals(cell, this[_last]));
4669 this[_last] = previous; 4669 this[_last] = previous;
4670 } else { 4670 } else {
4671 next[_previous] = previous; 4671 next[_previous] = previous;
4672 } 4672 }
4673 this[_length] = dart.notNull(this[_length]) - 1; 4673 this[_length] = dart.notNull(this[_length]) - 1;
4674 this[_modified](); 4674 this[_modified]();
4675 } 4675 }
4676 static [_isStringElement](element) { 4676 static [_isStringElement](element) {
4677 return dart.notNull(typeof element == 'string') && dart.notNull(!dart.eq uals(element, '__proto__')); 4677 return dart.notNull(typeof element == 'string') && dart.notNull(!dart.eq uals(element, '__proto__'));
4678 } 4678 }
4679 static [_isNumericElement](element) { 4679 static [_isNumericElement](element) {
4680 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element; 4680 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff) === element;
4681 } 4681 }
4682 [_computeHashCode](element) { 4682 [_computeHashCode](element) {
4683 return dart.dload(element, 'hashCode') & 0x3ffffff; 4683 return dart.dload(element, 'hashCode') & 0x3ffffff;
4684 } 4684 }
4685 static [_getTableEntry](table, key) { 4685 static [_getTableEntry](table, key) {
4686 return table[key]; 4686 return table[key];
4687 } 4687 }
4688 static [_setTableEntry](table, key, value) { 4688 static [_setTableEntry](table, key, value) {
4689 dart.assert(value !== null); 4689 dart.assert(value != null);
4690 table[key] = value; 4690 table[key] = value;
4691 } 4691 }
4692 static [_deleteTableEntry](table, key) { 4692 static [_deleteTableEntry](table, key) {
4693 delete table[key]; 4693 delete table[key];
4694 } 4694 }
4695 [_getBucket](table, element) { 4695 [_getBucket](table, element) {
4696 let hash = this[_computeHashCode](element); 4696 let hash = this[_computeHashCode](element);
4697 return dart.as(table[hash], core.List); 4697 return dart.as(table[hash], core.List);
4698 } 4698 }
4699 [_findBucketIndex](bucket, element) { 4699 [_findBucketIndex](bucket, element) {
4700 if (bucket === null) 4700 if (bucket == null)
4701 return -1; 4701 return -1;
4702 let length = bucket.length; 4702 let length = bucket.length;
4703 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4703 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4704 let cell = dart.as(bucket[i], LinkedHashSetCell); 4704 let cell = dart.as(bucket[i], LinkedHashSetCell);
4705 if (dart.equals(cell[_element], element)) 4705 if (dart.equals(cell[_element], element))
4706 return i; 4706 return i;
4707 } 4707 }
4708 return -1; 4708 return -1;
4709 } 4709 }
4710 static [_newHashTable]() { 4710 static [_newHashTable]() {
4711 let table = Object.create(null); 4711 let table = Object.create(null);
4712 let temporaryKey = '<non-identifier-key>'; 4712 let temporaryKey = '<non-identifier-key>';
4713 _LinkedHashSet[_setTableEntry](table, temporaryKey, table); 4713 _LinkedHashSet[_setTableEntry](table, temporaryKey, table);
4714 _LinkedHashSet[_deleteTableEntry](table, temporaryKey); 4714 _LinkedHashSet[_deleteTableEntry](table, temporaryKey);
4715 return table; 4715 return table;
4716 } 4716 }
4717 } 4717 }
4718 return _LinkedHashSet; 4718 return _LinkedHashSet;
4719 }); 4719 });
4720 let _LinkedHashSet = _LinkedHashSet$(dart.dynamic); 4720 let _LinkedHashSet = _LinkedHashSet$(dart.dynamic);
4721 let _LinkedIdentityHashSet$ = dart.generic(function(E) { 4721 let _LinkedIdentityHashSet$ = dart.generic(function(E) {
4722 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { 4722 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) {
4723 [_newSet]() { 4723 [_newSet]() {
4724 return new _LinkedIdentityHashSet(); 4724 return new _LinkedIdentityHashSet();
4725 } 4725 }
4726 [_computeHashCode](key) { 4726 [_computeHashCode](key) {
4727 return core.identityHashCode(key) & 0x3ffffff; 4727 return core.identityHashCode(key) & 0x3ffffff;
4728 } 4728 }
4729 [_findBucketIndex](bucket, element) { 4729 [_findBucketIndex](bucket, element) {
4730 if (bucket === null) 4730 if (bucket == null)
4731 return -1; 4731 return -1;
4732 let length = bucket.length; 4732 let length = bucket.length;
4733 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4733 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4734 let cell = dart.as(bucket[i], LinkedHashSetCell); 4734 let cell = dart.as(bucket[i], LinkedHashSetCell);
4735 if (core.identical(cell[_element], element)) 4735 if (core.identical(cell[_element], element))
4736 return i; 4736 return i;
4737 } 4737 }
4738 return -1; 4738 return -1;
4739 } 4739 }
4740 } 4740 }
4741 return _LinkedIdentityHashSet; 4741 return _LinkedIdentityHashSet;
4742 }); 4742 });
4743 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dart.dynamic); 4743 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dart.dynamic);
4744 let _LinkedCustomHashSet$ = dart.generic(function(E) { 4744 let _LinkedCustomHashSet$ = dart.generic(function(E) {
4745 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { 4745 class _LinkedCustomHashSet extends _LinkedHashSet$(E) {
4746 _LinkedCustomHashSet(equality, hasher, validKey) { 4746 _LinkedCustomHashSet(equality, hasher, validKey) {
4747 this[_equality] = equality; 4747 this[_equality] = equality;
4748 this[_hasher] = hasher; 4748 this[_hasher] = hasher;
4749 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is( x, E), _Predicate); 4749 this[_validKey] = dart.as(validKey != null ? validKey : (x) => dart.is(x , E), _Predicate);
4750 super._LinkedHashSet(); 4750 super._LinkedHashSet();
4751 } 4751 }
4752 [_newSet]() { 4752 [_newSet]() {
4753 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va lidKey]); 4753 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va lidKey]);
4754 } 4754 }
4755 [_findBucketIndex](bucket, element) { 4755 [_findBucketIndex](bucket, element) {
4756 if (bucket === null) 4756 if (bucket == null)
4757 return -1; 4757 return -1;
4758 let length = bucket.length; 4758 let length = bucket.length;
4759 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4759 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4760 let cell = dart.as(bucket[i], LinkedHashSetCell); 4760 let cell = dart.as(bucket[i], LinkedHashSetCell);
4761 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) 4761 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E)))
4762 return i; 4762 return i;
4763 } 4763 }
4764 return -1; 4764 return -1;
4765 } 4765 }
4766 [_computeHashCode](element) { 4766 [_computeHashCode](element) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
4815 this[_set] = set$; 4815 this[_set] = set$;
4816 this[_modifications] = modifications$; 4816 this[_modifications] = modifications$;
4817 this[_cell] = null; 4817 this[_cell] = null;
4818 this[_current] = null; 4818 this[_current] = null;
4819 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel l); 4819 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel l);
4820 } 4820 }
4821 get current() { 4821 get current() {
4822 return this[_current]; 4822 return this[_current];
4823 } 4823 }
4824 moveNext() { 4824 moveNext() {
4825 if (this[_modifications] !== dart.dload(this[_set], '_modifications')) { 4825 if (!dart.equals(this[_modifications], dart.dload(this[_set], '_modifica tions'))) {
4826 throw new core.ConcurrentModificationError(this[_set]); 4826 throw new core.ConcurrentModificationError(this[_set]);
4827 } else if (this[_cell] === null) { 4827 } else if (this[_cell] == null) {
4828 this[_current] = null; 4828 this[_current] = null;
4829 return false; 4829 return false;
4830 } else { 4830 } else {
4831 this[_current] = dart.as(this[_cell][_element], E); 4831 this[_current] = dart.as(this[_cell][_element], E);
4832 this[_cell] = this[_cell][_next]; 4832 this[_cell] = this[_cell][_next];
4833 return true; 4833 return true;
4834 } 4834 }
4835 } 4835 }
4836 } 4836 }
4837 return LinkedHashSetIterator; 4837 return LinkedHashSetIterator;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
4895 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; 4895 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable;
4896 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; 4896 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$;
4897 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; 4897 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator;
4898 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; 4898 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$;
4899 exports.HashSetIterator = HashSetIterator; 4899 exports.HashSetIterator = HashSetIterator;
4900 exports.HashSetIterator$ = HashSetIterator$; 4900 exports.HashSetIterator$ = HashSetIterator$;
4901 exports.LinkedHashSetCell = LinkedHashSetCell; 4901 exports.LinkedHashSetCell = LinkedHashSetCell;
4902 exports.LinkedHashSetIterator = LinkedHashSetIterator; 4902 exports.LinkedHashSetIterator = LinkedHashSetIterator;
4903 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; 4903 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
4904 })(collection || (collection = {})); 4904 })(collection || (collection = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/convert.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698