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

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

Issue 1117793002: add checks needed for covariant generics, and List<E> (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 var collection; 1 var collection;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 let _source = Symbol('_source'); 4 let _source = Symbol('_source');
5 let UnmodifiableListView$ = dart.generic(function(E) { 5 let UnmodifiableListView$ = dart.generic(function(E) {
6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { 6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) {
7 UnmodifiableListView(source) { 7 UnmodifiableListView(source) {
8 this[_source] = source; 8 this[_source] = source;
9 } 9 }
10 get [core.$length]() { 10 get [core.$length]() {
(...skipping 21 matching lines...) Expand all
32 let _Equality = _Equality$(); 32 let _Equality = _Equality$();
33 let _Hasher$ = dart.generic(function(K) { 33 let _Hasher$ = dart.generic(function(K) {
34 let _Hasher = dart.typedef('_Hasher', () => dart.functionType(core.int, [K]) ); 34 let _Hasher = dart.typedef('_Hasher', () => dart.functionType(core.int, [K]) );
35 return _Hasher; 35 return _Hasher;
36 }); 36 });
37 let _Hasher = _Hasher$(); 37 let _Hasher = _Hasher$();
38 let HashMap$ = dart.generic(function(K, V) { 38 let HashMap$ = dart.generic(function(K, V) {
39 class HashMap extends core.Object { 39 class HashMap extends core.Object {
40 HashMap(opts) { 40 HashMap(opts) {
41 let equals = opts && 'equals' in opts ? opts.equals : null; 41 let equals = opts && 'equals' in opts ? opts.equals : null;
42 dart.as(equals, dart.functionType(core.bool, [K, K]));
vsm 2015/04/30 14:00:51 We shouldn't need runtime checks on constructor pa
Jennifer Messerly 2015/05/01 20:43:04 fixed
42 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 43 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
44 dart.as(hashCode, dart.functionType(core.int, [K]));
43 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 45 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
46 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
44 if (isValidKey == null) { 47 if (isValidKey == null) {
45 if (hashCode == null) { 48 if (hashCode == null) {
46 if (equals == null) { 49 if (equals == null) {
47 return new (_HashMap$(K, V))(); 50 return new (_HashMap$(K, V))();
48 } 51 }
49 hashCode = dart.as(_defaultHashCode, __CastType0); 52 hashCode = dart.as(_defaultHashCode, __CastType0);
50 } else { 53 } else {
51 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 54 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
52 return new (_IdentityHashMap$(K, V))(); 55 return new (_IdentityHashMap$(K, V))();
53 } 56 }
(...skipping 16 matching lines...) Expand all
70 } 73 }
71 from(other) { 74 from(other) {
72 let result = new (HashMap$(K, V))(); 75 let result = new (HashMap$(K, V))();
73 other.forEach((k, v) => { 76 other.forEach((k, v) => {
74 result.set(k, dart.as(v, V)); 77 result.set(k, dart.as(v, V));
75 }); 78 });
76 return result; 79 return result;
77 } 80 }
78 fromIterable(iterable, opts) { 81 fromIterable(iterable, opts) {
79 let key = opts && 'key' in opts ? opts.key : null; 82 let key = opts && 'key' in opts ? opts.key : null;
83 dart.as(key, dart.functionType(K, [dart.dynamic]));
80 let value = opts && 'value' in opts ? opts.value : null; 84 let value = opts && 'value' in opts ? opts.value : null;
85 dart.as(value, dart.functionType(V, [dart.dynamic]));
81 let map = new (HashMap$(K, V))(); 86 let map = new (HashMap$(K, V))();
82 Maps._fillMapWithMappedIterable(map, iterable, key, value); 87 Maps._fillMapWithMappedIterable(map, iterable, key, value);
83 return map; 88 return map;
84 } 89 }
85 fromIterables(keys, values) { 90 fromIterables(keys, values) {
86 let map = new (HashMap$(K, V))(); 91 let map = new (HashMap$(K, V))();
87 Maps._fillMapWithIterables(map, keys, values); 92 Maps._fillMapWithIterables(map, keys, values);
88 return map; 93 return map;
89 } 94 }
90 } 95 }
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 if (!dart.notNull(it.moveNext())) { 298 if (!dart.notNull(it.moveNext())) {
294 throw _internal.IterableElementError.noElement(); 299 throw _internal.IterableElementError.noElement();
295 } 300 }
296 let result = null; 301 let result = null;
297 do { 302 do {
298 result = dart.as(it.current, E); 303 result = dart.as(it.current, E);
299 } while (it.moveNext()); 304 } while (it.moveNext());
300 return result; 305 return result;
301 } 306 }
302 [core.$firstWhere](test, opts) { 307 [core.$firstWhere](test, opts) {
308 dart.as(test, dart.functionType(core.bool, [E]));
303 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 309 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
310 dart.as(orElse, dart.functionType(E, []));
304 for (let element of this) { 311 for (let element of this) {
305 if (test(element)) 312 if (test(element))
306 return element; 313 return element;
307 } 314 }
308 if (orElse != null) 315 if (orElse != null)
309 return orElse(); 316 return orElse();
310 throw _internal.IterableElementError.noElement(); 317 throw _internal.IterableElementError.noElement();
311 } 318 }
312 [core.$lastWhere](test, opts) { 319 [core.$lastWhere](test, opts) {
320 dart.as(test, dart.functionType(core.bool, [E]));
313 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 321 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
322 dart.as(orElse, dart.functionType(E, []));
314 let result = null; 323 let result = null;
315 let foundMatching = false; 324 let foundMatching = false;
316 for (let element of this) { 325 for (let element of this) {
317 if (test(element)) { 326 if (test(element)) {
318 result = element; 327 result = element;
319 foundMatching = true; 328 foundMatching = true;
320 } 329 }
321 } 330 }
322 if (foundMatching) 331 if (foundMatching)
323 return result; 332 return result;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 }).bind(this)(); 402 }).bind(this)();
394 } 403 }
395 } 404 }
396 return _HashSetBase; 405 return _HashSetBase;
397 }); 406 });
398 let _HashSetBase = _HashSetBase$(); 407 let _HashSetBase = _HashSetBase$();
399 let HashSet$ = dart.generic(function(E) { 408 let HashSet$ = dart.generic(function(E) {
400 class HashSet extends core.Object { 409 class HashSet extends core.Object {
401 HashSet(opts) { 410 HashSet(opts) {
402 let equals = opts && 'equals' in opts ? opts.equals : null; 411 let equals = opts && 'equals' in opts ? opts.equals : null;
412 dart.as(equals, dart.functionType(core.bool, [E, E]));
403 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 413 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
414 dart.as(hashCode, dart.functionType(core.int, [E]));
404 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 415 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
416 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
405 if (isValidKey == null) { 417 if (isValidKey == null) {
406 if (hashCode == null) { 418 if (hashCode == null) {
407 if (equals == null) { 419 if (equals == null) {
408 return new (_HashSet$(E))(); 420 return new (_HashSet$(E))();
409 } 421 }
410 hashCode = dart.as(_defaultHashCode, __CastType5); 422 hashCode = dart.as(_defaultHashCode, __CastType5);
411 } else { 423 } else {
412 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 424 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
413 return new (_IdentityHashSet$(E))(); 425 return new (_IdentityHashSet$(E))();
414 } 426 }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 get [core.$single]() { 592 get [core.$single]() {
581 let it = this[core.$iterator]; 593 let it = this[core.$iterator];
582 if (!dart.notNull(it.moveNext())) 594 if (!dart.notNull(it.moveNext()))
583 throw _internal.IterableElementError.noElement(); 595 throw _internal.IterableElementError.noElement();
584 let result = dart.as(it.current, E); 596 let result = dart.as(it.current, E);
585 if (it.moveNext()) 597 if (it.moveNext())
586 throw _internal.IterableElementError.tooMany(); 598 throw _internal.IterableElementError.tooMany();
587 return result; 599 return result;
588 } 600 }
589 [core.$firstWhere](test, opts) { 601 [core.$firstWhere](test, opts) {
602 dart.as(test, dart.functionType(core.bool, [E]));
590 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 603 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
604 dart.as(orElse, dart.functionType(E, []));
591 for (let element of this) { 605 for (let element of this) {
592 if (test(element)) 606 if (test(element))
593 return element; 607 return element;
594 } 608 }
595 if (orElse != null) 609 if (orElse != null)
596 return orElse(); 610 return orElse();
597 throw _internal.IterableElementError.noElement(); 611 throw _internal.IterableElementError.noElement();
598 } 612 }
599 [core.$lastWhere](test, opts) { 613 [core.$lastWhere](test, opts) {
614 dart.as(test, dart.functionType(core.bool, [E]));
600 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 615 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
616 dart.as(orElse, dart.functionType(E, []));
601 let result = null; 617 let result = null;
602 let foundMatching = false; 618 let foundMatching = false;
603 for (let element of this) { 619 for (let element of this) {
604 if (test(element)) { 620 if (test(element)) {
605 result = element; 621 result = element;
606 foundMatching = true; 622 foundMatching = true;
607 } 623 }
608 } 624 }
609 if (foundMatching) 625 if (foundMatching)
610 return result; 626 return result;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 get [core.$single]() { 794 get [core.$single]() {
779 let it = this[core.$iterator]; 795 let it = this[core.$iterator];
780 if (!dart.notNull(it.moveNext())) 796 if (!dart.notNull(it.moveNext()))
781 throw _internal.IterableElementError.noElement(); 797 throw _internal.IterableElementError.noElement();
782 let result = dart.as(it.current, E); 798 let result = dart.as(it.current, E);
783 if (it.moveNext()) 799 if (it.moveNext())
784 throw _internal.IterableElementError.tooMany(); 800 throw _internal.IterableElementError.tooMany();
785 return result; 801 return result;
786 } 802 }
787 [core.$firstWhere](test, opts) { 803 [core.$firstWhere](test, opts) {
804 dart.as(test, dart.functionType(core.bool, [E]));
788 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 805 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
806 dart.as(orElse, dart.functionType(E, []));
789 for (let element of this) { 807 for (let element of this) {
790 if (test(element)) 808 if (test(element))
791 return element; 809 return element;
792 } 810 }
793 if (orElse != null) 811 if (orElse != null)
794 return orElse(); 812 return orElse();
795 throw _internal.IterableElementError.noElement(); 813 throw _internal.IterableElementError.noElement();
796 } 814 }
797 [core.$lastWhere](test, opts) { 815 [core.$lastWhere](test, opts) {
816 dart.as(test, dart.functionType(core.bool, [E]));
798 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 817 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
818 dart.as(orElse, dart.functionType(E, []));
799 let result = null; 819 let result = null;
800 let foundMatching = false; 820 let foundMatching = false;
801 for (let element of this) { 821 for (let element of this) {
802 if (test(element)) { 822 if (test(element)) {
803 result = element; 823 result = element;
804 foundMatching = true; 824 foundMatching = true;
805 } 825 }
806 } 826 }
807 if (foundMatching) 827 if (foundMatching)
808 return result; 828 return result;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; 1034 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0;
1015 HasNextIterator._NO_NEXT = 1; 1035 HasNextIterator._NO_NEXT = 1;
1016 HasNextIterator._NOT_MOVED_YET = 2; 1036 HasNextIterator._NOT_MOVED_YET = 2;
1017 return HasNextIterator; 1037 return HasNextIterator;
1018 }); 1038 });
1019 let HasNextIterator = HasNextIterator$(); 1039 let HasNextIterator = HasNextIterator$();
1020 let LinkedHashMap$ = dart.generic(function(K, V) { 1040 let LinkedHashMap$ = dart.generic(function(K, V) {
1021 class LinkedHashMap extends core.Object { 1041 class LinkedHashMap extends core.Object {
1022 LinkedHashMap(opts) { 1042 LinkedHashMap(opts) {
1023 let equals = opts && 'equals' in opts ? opts.equals : null; 1043 let equals = opts && 'equals' in opts ? opts.equals : null;
1044 dart.as(equals, dart.functionType(core.bool, [K, K]));
1024 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 1045 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
1046 dart.as(hashCode, dart.functionType(core.int, [K]));
1025 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 1047 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
1048 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
1026 if (isValidKey == null) { 1049 if (isValidKey == null) {
1027 if (hashCode == null) { 1050 if (hashCode == null) {
1028 if (equals == null) { 1051 if (equals == null) {
1029 return new (_LinkedHashMap$(K, V))(); 1052 return new (_LinkedHashMap$(K, V))();
1030 } 1053 }
1031 hashCode = dart.as(_defaultHashCode, __CastType10); 1054 hashCode = dart.as(_defaultHashCode, __CastType10);
1032 } else { 1055 } else {
1033 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1056 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
1034 return new (_LinkedIdentityHashMap$(K, V))(); 1057 return new (_LinkedIdentityHashMap$(K, V))();
1035 } 1058 }
(...skipping 16 matching lines...) Expand all
1052 } 1075 }
1053 from(other) { 1076 from(other) {
1054 let result = new (LinkedHashMap$(K, V))(); 1077 let result = new (LinkedHashMap$(K, V))();
1055 other.forEach((k, v) => { 1078 other.forEach((k, v) => {
1056 result.set(k, dart.as(v, V)); 1079 result.set(k, dart.as(v, V));
1057 }); 1080 });
1058 return result; 1081 return result;
1059 } 1082 }
1060 fromIterable(iterable, opts) { 1083 fromIterable(iterable, opts) {
1061 let key = opts && 'key' in opts ? opts.key : null; 1084 let key = opts && 'key' in opts ? opts.key : null;
1085 dart.as(key, dart.functionType(K, [dart.dynamic]));
1062 let value = opts && 'value' in opts ? opts.value : null; 1086 let value = opts && 'value' in opts ? opts.value : null;
1087 dart.as(value, dart.functionType(V, [dart.dynamic]));
1063 let map = new (LinkedHashMap$(K, V))(); 1088 let map = new (LinkedHashMap$(K, V))();
1064 Maps._fillMapWithMappedIterable(map, iterable, key, value); 1089 Maps._fillMapWithMappedIterable(map, iterable, key, value);
1065 return map; 1090 return map;
1066 } 1091 }
1067 fromIterables(keys, values) { 1092 fromIterables(keys, values) {
1068 let map = new (LinkedHashMap$(K, V))(); 1093 let map = new (LinkedHashMap$(K, V))();
1069 Maps._fillMapWithIterables(map, keys, values); 1094 Maps._fillMapWithIterables(map, keys, values);
1070 return map; 1095 return map;
1071 } 1096 }
1072 _literal(keyValuePairs) { 1097 _literal(keyValuePairs) {
(...skipping 20 matching lines...) Expand all
1093 let __CastType10 = __CastType10$(); 1118 let __CastType10 = __CastType10$();
1094 let __CastType12$ = dart.generic(function(K) { 1119 let __CastType12$ = dart.generic(function(K) {
1095 let __CastType12 = dart.typedef('__CastType12', () => dart.functionType(core .bool, [K, K])); 1120 let __CastType12 = dart.typedef('__CastType12', () => dart.functionType(core .bool, [K, K]));
1096 return __CastType12; 1121 return __CastType12;
1097 }); 1122 });
1098 let __CastType12 = __CastType12$(); 1123 let __CastType12 = __CastType12$();
1099 let LinkedHashSet$ = dart.generic(function(E) { 1124 let LinkedHashSet$ = dart.generic(function(E) {
1100 class LinkedHashSet extends core.Object { 1125 class LinkedHashSet extends core.Object {
1101 LinkedHashSet(opts) { 1126 LinkedHashSet(opts) {
1102 let equals = opts && 'equals' in opts ? opts.equals : null; 1127 let equals = opts && 'equals' in opts ? opts.equals : null;
1128 dart.as(equals, dart.functionType(core.bool, [E, E]));
1103 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 1129 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
1130 dart.as(hashCode, dart.functionType(core.int, [E]));
1104 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 1131 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
1132 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
1105 if (isValidKey == null) { 1133 if (isValidKey == null) {
1106 if (hashCode == null) { 1134 if (hashCode == null) {
1107 if (equals == null) { 1135 if (equals == null) {
1108 return new (_LinkedHashSet$(E))(); 1136 return new (_LinkedHashSet$(E))();
1109 } 1137 }
1110 hashCode = dart.as(_defaultHashCode, __CastType15); 1138 hashCode = dart.as(_defaultHashCode, __CastType15);
1111 } else { 1139 } else {
1112 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1140 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
1113 return new (_LinkedIdentityHashSet$(E))(); 1141 return new (_LinkedIdentityHashSet$(E))();
1114 } 1142 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 class LinkedList extends IterableBase$(E) { 1192 class LinkedList extends IterableBase$(E) {
1165 LinkedList() { 1193 LinkedList() {
1166 this[_modificationCount] = 0; 1194 this[_modificationCount] = 0;
1167 this[_length] = 0; 1195 this[_length] = 0;
1168 this[_next] = null; 1196 this[_next] = null;
1169 this[_previous] = null; 1197 this[_previous] = null;
1170 super.IterableBase(); 1198 super.IterableBase();
1171 this[_next] = this[_previous] = this; 1199 this[_next] = this[_previous] = this;
1172 } 1200 }
1173 addFirst(entry) { 1201 addFirst(entry) {
1202 dart.as(entry, E);
1174 this[_insertAfter](this, entry); 1203 this[_insertAfter](this, entry);
1175 } 1204 }
1176 add(entry) { 1205 add(entry) {
1206 dart.as(entry, E);
1177 this[_insertAfter](this[_previous], entry); 1207 this[_insertAfter](this[_previous], entry);
1178 } 1208 }
1179 addAll(entries) { 1209 addAll(entries) {
1180 entries[core.$forEach]((entry => this[_insertAfter](this[_previous], dar t.as(entry, E))).bind(this)); 1210 entries[core.$forEach]((entry => this[_insertAfter](this[_previous], dar t.as(entry, E))).bind(this));
1181 } 1211 }
1182 remove(entry) { 1212 remove(entry) {
1213 dart.as(entry, E);
1183 if (!dart.equals(entry[_list], this)) 1214 if (!dart.equals(entry[_list], this))
1184 return false; 1215 return false;
1185 this[_unlink](entry); 1216 this[_unlink](entry);
1186 return true; 1217 return true;
1187 } 1218 }
1188 get [core.$iterator]() { 1219 get [core.$iterator]() {
1189 return new (_LinkedListIterator$(E))(this); 1220 return new (_LinkedListIterator$(E))(this);
1190 } 1221 }
1191 get [core.$length]() { 1222 get [core.$length]() {
1192 return this[_length]; 1223 return this[_length];
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 if (modificationCount != this[_modificationCount]) { 1262 if (modificationCount != this[_modificationCount]) {
1232 throw new core.ConcurrentModificationError(this); 1263 throw new core.ConcurrentModificationError(this);
1233 } 1264 }
1234 current = current[_next]; 1265 current = current[_next];
1235 } 1266 }
1236 } 1267 }
1237 get [core.$isEmpty]() { 1268 get [core.$isEmpty]() {
1238 return this[_length] == 0; 1269 return this[_length] == 0;
1239 } 1270 }
1240 [_insertAfter](entry, newEntry) { 1271 [_insertAfter](entry, newEntry) {
1272 dart.as(newEntry, E);
1241 if (newEntry.list != null) { 1273 if (newEntry.list != null) {
1242 throw new core.StateError('LinkedListEntry is already in a LinkedList' ); 1274 throw new core.StateError('LinkedListEntry is already in a LinkedList' );
1243 } 1275 }
1244 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 1276 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
1245 newEntry[_list] = this; 1277 newEntry[_list] = this;
1246 let predecessor = entry; 1278 let predecessor = entry;
1247 let successor = entry[_next]; 1279 let successor = entry[_next];
1248 successor[_previous] = newEntry; 1280 successor[_previous] = newEntry;
1249 newEntry[_previous] = predecessor; 1281 newEntry[_previous] = predecessor;
1250 newEntry[_next] = successor; 1282 newEntry[_next] = successor;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 return null; 1348 return null;
1317 let result = dart.as(this[_next], E); 1349 let result = dart.as(this[_next], E);
1318 return result; 1350 return result;
1319 } 1351 }
1320 get previous() { 1352 get previous() {
1321 if (core.identical(this[_previous], this[_list])) 1353 if (core.identical(this[_previous], this[_list]))
1322 return null; 1354 return null;
1323 return dart.as(this[_previous], E); 1355 return dart.as(this[_previous], E);
1324 } 1356 }
1325 insertAfter(entry) { 1357 insertAfter(entry) {
1358 dart.as(entry, E);
1326 this[_list][_insertAfter](this, entry); 1359 this[_list][_insertAfter](this, entry);
1327 } 1360 }
1328 insertBefore(entry) { 1361 insertBefore(entry) {
1362 dart.as(entry, E);
1329 this[_list][_insertAfter](this[_previous], entry); 1363 this[_list][_insertAfter](this[_previous], entry);
1330 } 1364 }
1331 } 1365 }
1332 LinkedListEntry[dart.implements] = () => [_LinkedListLink]; 1366 LinkedListEntry[dart.implements] = () => [_LinkedListLink];
1333 return LinkedListEntry; 1367 return LinkedListEntry;
1334 }); 1368 });
1335 let LinkedListEntry = LinkedListEntry$(); 1369 let LinkedListEntry = LinkedListEntry$();
1336 let ListMixin$ = dart.generic(function(E) { 1370 let ListMixin$ = dart.generic(function(E) {
1337 class ListMixin extends core.Object { 1371 class ListMixin extends core.Object {
1338 get [core.$iterator]() { 1372 get [core.$iterator]() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1434 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1401 if (test(this[core.$get](i))) 1435 if (test(this[core.$get](i)))
1402 return true; 1436 return true;
1403 if (length != this[core.$length]) { 1437 if (length != this[core.$length]) {
1404 throw new core.ConcurrentModificationError(this); 1438 throw new core.ConcurrentModificationError(this);
1405 } 1439 }
1406 } 1440 }
1407 return false; 1441 return false;
1408 } 1442 }
1409 [core.$firstWhere](test, opts) { 1443 [core.$firstWhere](test, opts) {
1444 dart.as(test, dart.functionType(core.bool, [E]));
1410 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 1445 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
1446 dart.as(orElse, dart.functionType(E, []));
1411 let length = this[core.$length]; 1447 let length = this[core.$length];
1412 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 1448 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
1413 let element = this[core.$get](i); 1449 let element = this[core.$get](i);
1414 if (test(element)) 1450 if (test(element))
1415 return element; 1451 return element;
1416 if (length != this[core.$length]) { 1452 if (length != this[core.$length]) {
1417 throw new core.ConcurrentModificationError(this); 1453 throw new core.ConcurrentModificationError(this);
1418 } 1454 }
1419 } 1455 }
1420 if (orElse != null) 1456 if (orElse != null)
1421 return orElse(); 1457 return orElse();
1422 throw _internal.IterableElementError.noElement(); 1458 throw _internal.IterableElementError.noElement();
1423 } 1459 }
1424 [core.$lastWhere](test, opts) { 1460 [core.$lastWhere](test, opts) {
1461 dart.as(test, dart.functionType(core.bool, [E]));
1425 let orElse = opts && 'orElse' in opts ? opts.orElse : null; 1462 let orElse = opts && 'orElse' in opts ? opts.orElse : null;
1463 dart.as(orElse, dart.functionType(E, []));
1426 let length = this[core.$length]; 1464 let length = this[core.$length];
1427 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no tNull(i) - 1) { 1465 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no tNull(i) - 1) {
1428 let element = this[core.$get](i); 1466 let element = this[core.$get](i);
1429 if (test(element)) 1467 if (test(element))
1430 return element; 1468 return element;
1431 if (length != this[core.$length]) { 1469 if (length != this[core.$length]) {
1432 throw new core.ConcurrentModificationError(this); 1470 throw new core.ConcurrentModificationError(this);
1433 } 1471 }
1434 } 1472 }
1435 if (orElse != null) 1473 if (orElse != null)
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 return result; 1564 return result;
1527 } 1565 }
1528 [core.$toSet]() { 1566 [core.$toSet]() {
1529 let result = new (core.Set$(E))(); 1567 let result = new (core.Set$(E))();
1530 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i = dart.notNull(i) + 1) { 1568 for (let i = 0; dart.notNull(i) < dart.notNull(this[core.$length]); i = dart.notNull(i) + 1) {
1531 result.add(this[core.$get](i)); 1569 result.add(this[core.$get](i));
1532 } 1570 }
1533 return result; 1571 return result;
1534 } 1572 }
1535 [core.$add](element) { 1573 [core.$add](element) {
1574 dart.as(element, E);
1536 this[core.$set]((() => { 1575 this[core.$set]((() => {
1537 let o = this, x = o[core.$length]; 1576 let o = this, x = o[core.$length];
1538 o[core.$length] = dart.notNull(x) + 1; 1577 o[core.$length] = dart.notNull(x) + 1;
1539 return x; 1578 return x;
1540 }).bind(this)(), element); 1579 }).bind(this)(), element);
1541 } 1580 }
1542 [core.$addAll](iterable) { 1581 [core.$addAll](iterable) {
1543 for (let element of iterable) { 1582 for (let element of iterable) {
1544 this[core.$set]((() => { 1583 this[core.$set]((() => {
1545 let o = this, x = o[core.$length]; 1584 let o = this, x = o[core.$length];
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 if (this[core.$length] == 0) { 1628 if (this[core.$length] == 0) {
1590 throw _internal.IterableElementError.noElement(); 1629 throw _internal.IterableElementError.noElement();
1591 } 1630 }
1592 let result = this[core.$get](dart.notNull(this[core.$length]) - 1); 1631 let result = this[core.$get](dart.notNull(this[core.$length]) - 1);
1593 this[core.$length] = dart.notNull(this[core.$length]) - 1; 1632 this[core.$length] = dart.notNull(this[core.$length]) - 1;
1594 return result; 1633 return result;
1595 } 1634 }
1596 [core.$sort](compare) { 1635 [core.$sort](compare) {
1597 if (compare === void 0) 1636 if (compare === void 0)
1598 compare = null; 1637 compare = null;
1638 dart.as(compare, dart.functionType(core.int, [E, E]));
1599 if (compare == null) { 1639 if (compare == null) {
1600 let defaultCompare = dart.bind(core.Comparable, 'compare'); 1640 let defaultCompare = dart.bind(core.Comparable, 'compare');
1601 compare = defaultCompare; 1641 compare = defaultCompare;
1602 } 1642 }
1603 _internal.Sort.sort(this, compare); 1643 _internal.Sort.sort(this, compare);
1604 } 1644 }
1605 [core.$shuffle](random) { 1645 [core.$shuffle](random) {
1606 if (random === void 0) 1646 if (random === void 0)
1607 random = null; 1647 random = null;
1608 if (random == null) 1648 if (random == null)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 [core.$removeRange](start, end) { 1681 [core.$removeRange](start, end) {
1642 core.RangeError.checkValidRange(start, end, this[core.$length]); 1682 core.RangeError.checkValidRange(start, end, this[core.$length]);
1643 let length = dart.notNull(end) - dart.notNull(start); 1683 let length = dart.notNull(end) - dart.notNull(start);
1644 this[core.$setRange](start, dart.notNull(this[core.$length]) - dart.notN ull(length), this, end); 1684 this[core.$setRange](start, dart.notNull(this[core.$length]) - dart.notN ull(length), this, end);
1645 let o = this; 1685 let o = this;
1646 o[core.$length] = dart.notNull(o[core.$length]) - dart.notNull(length); 1686 o[core.$length] = dart.notNull(o[core.$length]) - dart.notNull(length);
1647 } 1687 }
1648 [core.$fillRange](start, end, fill) { 1688 [core.$fillRange](start, end, fill) {
1649 if (fill === void 0) 1689 if (fill === void 0)
1650 fill = null; 1690 fill = null;
1691 dart.as(fill, E);
1651 core.RangeError.checkValidRange(start, end, this[core.$length]); 1692 core.RangeError.checkValidRange(start, end, this[core.$length]);
1652 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) { 1693 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul l(i) + 1) {
1653 this[core.$set](i, fill); 1694 this[core.$set](i, fill);
1654 } 1695 }
1655 } 1696 }
1656 [core.$setRange](start, end, iterable, skipCount) { 1697 [core.$setRange](start, end, iterable, skipCount) {
1698 dart.as(iterable, core.Iterable$(E));
1657 if (skipCount === void 0) 1699 if (skipCount === void 0)
1658 skipCount = 0; 1700 skipCount = 0;
1659 core.RangeError.checkValidRange(start, end, this[core.$length]); 1701 core.RangeError.checkValidRange(start, end, this[core.$length]);
1660 let length = dart.notNull(end) - dart.notNull(start); 1702 let length = dart.notNull(end) - dart.notNull(start);
1661 if (length == 0) 1703 if (length == 0)
1662 return; 1704 return;
1663 core.RangeError.checkNotNegative(skipCount, "skipCount"); 1705 core.RangeError.checkNotNegative(skipCount, "skipCount");
1664 let otherList = null; 1706 let otherList = null;
1665 let otherStart = null; 1707 let otherStart = null;
1666 if (dart.is(iterable, core.List)) { 1708 if (dart.is(iterable, core.List)) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 } 1780 }
1739 } 1781 }
1740 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) { 1782 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1) {
1741 if (dart.equals(this[core.$get](i), element)) { 1783 if (dart.equals(this[core.$get](i), element)) {
1742 return i; 1784 return i;
1743 } 1785 }
1744 } 1786 }
1745 return -1; 1787 return -1;
1746 } 1788 }
1747 [core.$insert](index, element) { 1789 [core.$insert](index, element) {
1790 dart.as(element, E);
1748 core.RangeError.checkValueInInterval(index, 0, this[core.$length], "inde x"); 1791 core.RangeError.checkValueInInterval(index, 0, this[core.$length], "inde x");
1749 if (index == this[core.$length]) { 1792 if (index == this[core.$length]) {
1750 this[core.$add](element); 1793 this[core.$add](element);
1751 return; 1794 return;
1752 } 1795 }
1753 if (!(typeof index == 'number')) 1796 if (!(typeof index == 'number'))
1754 throw new core.ArgumentError(index); 1797 throw new core.ArgumentError(index);
1755 let o = this; 1798 let o = this;
1756 o[core.$length] = dart.notNull(o[core.$length]) + 1; 1799 o[core.$length] = dart.notNull(o[core.$length]) + 1;
1757 this[core.$setRange](dart.notNull(index) + 1, this[core.$length], this, index); 1800 this[core.$setRange](dart.notNull(index) + 1, this[core.$length], this, index);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 for (let key of this.keys) { 1856 for (let key of this.keys) {
1814 action(key, this.get(key)); 1857 action(key, this.get(key));
1815 } 1858 }
1816 } 1859 }
1817 addAll(other) { 1860 addAll(other) {
1818 for (let key of other.keys) { 1861 for (let key of other.keys) {
1819 this.set(key, other.get(key)); 1862 this.set(key, other.get(key));
1820 } 1863 }
1821 } 1864 }
1822 containsValue(value) { 1865 containsValue(value) {
1866 dart.as(value, V);
1823 for (let key of this.keys) { 1867 for (let key of this.keys) {
1824 if (dart.equals(this.get(key), value)) 1868 if (dart.equals(this.get(key), value))
1825 return true; 1869 return true;
1826 } 1870 }
1827 return false; 1871 return false;
1828 } 1872 }
1829 putIfAbsent(key, ifAbsent) { 1873 putIfAbsent(key, ifAbsent) {
1874 dart.as(key, K);
1875 dart.as(ifAbsent, dart.functionType(V, []));
1830 if (this.keys[core.$contains](key)) { 1876 if (this.keys[core.$contains](key)) {
1831 return this.get(key); 1877 return this.get(key);
1832 } 1878 }
1833 return this.set(key, ifAbsent()); 1879 return this.set(key, ifAbsent());
1834 } 1880 }
1835 containsKey(key) { 1881 containsKey(key) {
1836 return this.keys[core.$contains](key); 1882 return this.keys[core.$contains](key);
1837 } 1883 }
1838 get length() { 1884 get length() {
1839 return this.keys[core.$length]; 1885 return this.keys[core.$length];
(...skipping 16 matching lines...) Expand all
1856 }); 1902 });
1857 let MapMixin = MapMixin$(); 1903 let MapMixin = MapMixin$();
1858 let MapBase$ = dart.generic(function(K, V) { 1904 let MapBase$ = dart.generic(function(K, V) {
1859 class MapBase extends dart.mixin(core.Object, MapMixin$(K, V)) {} 1905 class MapBase extends dart.mixin(core.Object, MapMixin$(K, V)) {}
1860 return MapBase; 1906 return MapBase;
1861 }); 1907 });
1862 let MapBase = MapBase$(); 1908 let MapBase = MapBase$();
1863 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { 1909 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) {
1864 class _UnmodifiableMapMixin extends core.Object { 1910 class _UnmodifiableMapMixin extends core.Object {
1865 set(key, value) { 1911 set(key, value) {
1912 dart.as(key, K);
1913 dart.as(value, V);
1866 throw new core.UnsupportedError("Cannot modify unmodifiable map"); 1914 throw new core.UnsupportedError("Cannot modify unmodifiable map");
1867 } 1915 }
1868 addAll(other) { 1916 addAll(other) {
1869 throw new core.UnsupportedError("Cannot modify unmodifiable map"); 1917 throw new core.UnsupportedError("Cannot modify unmodifiable map");
1870 } 1918 }
1871 clear() { 1919 clear() {
1872 throw new core.UnsupportedError("Cannot modify unmodifiable map"); 1920 throw new core.UnsupportedError("Cannot modify unmodifiable map");
1873 } 1921 }
1874 remove(key) { 1922 remove(key) {
1875 throw new core.UnsupportedError("Cannot modify unmodifiable map"); 1923 throw new core.UnsupportedError("Cannot modify unmodifiable map");
1876 } 1924 }
1877 putIfAbsent(key, ifAbsent) { 1925 putIfAbsent(key, ifAbsent) {
1926 dart.as(key, K);
1927 dart.as(ifAbsent, dart.functionType(V, []));
1878 throw new core.UnsupportedError("Cannot modify unmodifiable map"); 1928 throw new core.UnsupportedError("Cannot modify unmodifiable map");
1879 } 1929 }
1880 } 1930 }
1881 _UnmodifiableMapMixin[dart.implements] = () => [core.Map$(K, V)]; 1931 _UnmodifiableMapMixin[dart.implements] = () => [core.Map$(K, V)];
1882 return _UnmodifiableMapMixin; 1932 return _UnmodifiableMapMixin;
1883 }); 1933 });
1884 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(); 1934 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$();
1885 let UnmodifiableMapBase$ = dart.generic(function(K, V) { 1935 let UnmodifiableMapBase$ = dart.generic(function(K, V) {
1886 class UnmodifiableMapBase extends dart.mixin(MapBase$(K, V), _UnmodifiableMa pMixin$(K, V)) {} 1936 class UnmodifiableMapBase extends dart.mixin(MapBase$(K, V), _UnmodifiableMa pMixin$(K, V)) {}
1887 return UnmodifiableMapBase; 1937 return UnmodifiableMapBase;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 let _MapBaseValueIterator = _MapBaseValueIterator$(); 1996 let _MapBaseValueIterator = _MapBaseValueIterator$();
1947 let MapView$ = dart.generic(function(K, V) { 1997 let MapView$ = dart.generic(function(K, V) {
1948 class MapView extends core.Object { 1998 class MapView extends core.Object {
1949 MapView(map) { 1999 MapView(map) {
1950 this[_map] = map; 2000 this[_map] = map;
1951 } 2001 }
1952 get(key) { 2002 get(key) {
1953 return this[_map].get(key); 2003 return this[_map].get(key);
1954 } 2004 }
1955 set(key, value) { 2005 set(key, value) {
2006 dart.as(key, K);
2007 dart.as(value, V);
1956 this[_map].set(key, value); 2008 this[_map].set(key, value);
1957 } 2009 }
1958 addAll(other) { 2010 addAll(other) {
1959 this[_map].addAll(other); 2011 this[_map].addAll(other);
1960 } 2012 }
1961 clear() { 2013 clear() {
1962 this[_map].clear(); 2014 this[_map].clear();
1963 } 2015 }
1964 putIfAbsent(key, ifAbsent) { 2016 putIfAbsent(key, ifAbsent) {
2017 dart.as(key, K);
2018 dart.as(ifAbsent, dart.functionType(V, []));
1965 return this[_map].putIfAbsent(key, ifAbsent); 2019 return this[_map].putIfAbsent(key, ifAbsent);
1966 } 2020 }
1967 containsKey(key) { 2021 containsKey(key) {
1968 return this[_map].containsKey(key); 2022 return this[_map].containsKey(key);
1969 } 2023 }
1970 containsValue(value) { 2024 containsValue(value) {
1971 return this[_map].containsValue(value); 2025 return this[_map].containsValue(value);
1972 } 2026 }
1973 forEach(action) { 2027 forEach(action) {
1974 this[_map].forEach(action); 2028 this[_map].forEach(action);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 dart.defineNamedConstructor(Queue, 'from'); 2170 dart.defineNamedConstructor(Queue, 'from');
2117 return Queue; 2171 return Queue;
2118 }); 2172 });
2119 let Queue = Queue$(); 2173 let Queue = Queue$();
2120 let _element = Symbol('_element'); 2174 let _element = Symbol('_element');
2121 let _link = Symbol('_link'); 2175 let _link = Symbol('_link');
2122 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry'); 2176 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry');
2123 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { 2177 let DoubleLinkedQueueEntry$ = dart.generic(function(E) {
2124 class DoubleLinkedQueueEntry extends core.Object { 2178 class DoubleLinkedQueueEntry extends core.Object {
2125 DoubleLinkedQueueEntry(e) { 2179 DoubleLinkedQueueEntry(e) {
2180 dart.as(e, E);
2126 this[_element] = e; 2181 this[_element] = e;
2127 this[_previous] = null; 2182 this[_previous] = null;
2128 this[_next] = null; 2183 this[_next] = null;
2129 } 2184 }
2130 [_link](previous, next) { 2185 [_link](previous, next) {
2131 this[_next] = next; 2186 this[_next] = next;
2132 this[_previous] = previous; 2187 this[_previous] = previous;
2133 previous[_next] = this; 2188 previous[_next] = this;
2134 next[_previous] = this; 2189 next[_previous] = this;
2135 } 2190 }
2136 append(e) { 2191 append(e) {
2192 dart.as(e, E);
2137 new (DoubleLinkedQueueEntry$(E))(e)[_link](this, this[_next]); 2193 new (DoubleLinkedQueueEntry$(E))(e)[_link](this, this[_next]);
2138 } 2194 }
2139 prepend(e) { 2195 prepend(e) {
2196 dart.as(e, E);
2140 new (DoubleLinkedQueueEntry$(E))(e)[_link](this[_previous], this); 2197 new (DoubleLinkedQueueEntry$(E))(e)[_link](this[_previous], this);
2141 } 2198 }
2142 remove() { 2199 remove() {
2143 this[_previous][_next] = this[_next]; 2200 this[_previous][_next] = this[_next];
2144 this[_next][_previous] = this[_previous]; 2201 this[_next][_previous] = this[_previous];
2145 this[_next] = null; 2202 this[_next] = null;
2146 this[_previous] = null; 2203 this[_previous] = null;
2147 return this[_element]; 2204 return this[_element];
2148 } 2205 }
2149 [_asNonSentinelEntry]() { 2206 [_asNonSentinelEntry]() {
2150 return this; 2207 return this;
2151 } 2208 }
2152 previousEntry() { 2209 previousEntry() {
2153 return this[_previous][_asNonSentinelEntry](); 2210 return this[_previous][_asNonSentinelEntry]();
2154 } 2211 }
2155 nextEntry() { 2212 nextEntry() {
2156 return this[_next][_asNonSentinelEntry](); 2213 return this[_next][_asNonSentinelEntry]();
2157 } 2214 }
2158 get element() { 2215 get element() {
2159 return this[_element]; 2216 return this[_element];
2160 } 2217 }
2161 set element(e) { 2218 set element(e) {
2219 dart.as(e, E);
2162 this[_element] = e; 2220 this[_element] = e;
2163 } 2221 }
2164 } 2222 }
2165 return DoubleLinkedQueueEntry; 2223 return DoubleLinkedQueueEntry;
2166 }); 2224 });
2167 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(); 2225 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$();
2168 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { 2226 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) {
2169 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { 2227 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) {
2170 _DoubleLinkedQueueEntrySentinel() { 2228 _DoubleLinkedQueueEntrySentinel() {
2171 super.DoubleLinkedQueueEntry(null); 2229 super.DoubleLinkedQueueEntry(null);
2172 this[_link](this, this); 2230 this[_link](this, this);
2173 } 2231 }
2174 remove() { 2232 remove() {
2175 throw _internal.IterableElementError.noElement(); 2233 throw _internal.IterableElementError.noElement();
2176 } 2234 }
2177 [_asNonSentinelEntry]() { 2235 [_asNonSentinelEntry]() {
2178 return null; 2236 return null;
2179 } 2237 }
2180 set element(e) { 2238 set element(e) {
2239 dart.as(e, E);
2181 dart.assert(false); 2240 dart.assert(false);
2182 } 2241 }
2183 get element() { 2242 get element() {
2184 throw _internal.IterableElementError.noElement(); 2243 throw _internal.IterableElementError.noElement();
2185 } 2244 }
2186 } 2245 }
2187 return _DoubleLinkedQueueEntrySentinel; 2246 return _DoubleLinkedQueueEntrySentinel;
2188 }); 2247 });
2189 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(); 2248 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$();
2190 let _sentinel = Symbol('_sentinel'); 2249 let _sentinel = Symbol('_sentinel');
(...skipping 11 matching lines...) Expand all
2202 let list = new (DoubleLinkedQueue$(E))(); 2261 let list = new (DoubleLinkedQueue$(E))();
2203 for (let e of dart.as(elements, core.Iterable$(E))) { 2262 for (let e of dart.as(elements, core.Iterable$(E))) {
2204 list.addLast(e); 2263 list.addLast(e);
2205 } 2264 }
2206 return dart.as(list, DoubleLinkedQueue$(E)); 2265 return dart.as(list, DoubleLinkedQueue$(E));
2207 } 2266 }
2208 get [core.$length]() { 2267 get [core.$length]() {
2209 return this[_elementCount]; 2268 return this[_elementCount];
2210 } 2269 }
2211 addLast(value) { 2270 addLast(value) {
2271 dart.as(value, E);
2212 this[_sentinel].prepend(value); 2272 this[_sentinel].prepend(value);
2213 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; 2273 this[_elementCount] = dart.notNull(this[_elementCount]) + 1;
2214 } 2274 }
2215 addFirst(value) { 2275 addFirst(value) {
2276 dart.as(value, E);
2216 this[_sentinel].append(value); 2277 this[_sentinel].append(value);
2217 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; 2278 this[_elementCount] = dart.notNull(this[_elementCount]) + 1;
2218 } 2279 }
2219 add(value) { 2280 add(value) {
2281 dart.as(value, E);
2220 this[_sentinel].prepend(value); 2282 this[_sentinel].prepend(value);
2221 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; 2283 this[_elementCount] = dart.notNull(this[_elementCount]) + 1;
2222 } 2284 }
2223 addAll(iterable) { 2285 addAll(iterable) {
2224 for (let value of iterable) { 2286 for (let value of iterable) {
2225 this[_sentinel].prepend(value); 2287 this[_sentinel].prepend(value);
2226 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; 2288 this[_elementCount] = dart.notNull(this[_elementCount]) + 1;
2227 } 2289 }
2228 } 2290 }
2229 removeLast() { 2291 removeLast() {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 if (growable) { 2491 if (growable) {
2430 list = new (core.List$(E))(); 2492 list = new (core.List$(E))();
2431 list[core.$length] = this[core.$length]; 2493 list[core.$length] = this[core.$length];
2432 } else { 2494 } else {
2433 list = new (core.List$(E))(this[core.$length]); 2495 list = new (core.List$(E))(this[core.$length]);
2434 } 2496 }
2435 this[_writeToList](list); 2497 this[_writeToList](list);
2436 return list; 2498 return list;
2437 } 2499 }
2438 add(element) { 2500 add(element) {
2501 dart.as(element, E);
2439 this[_add](element); 2502 this[_add](element);
2440 } 2503 }
2441 addAll(elements) { 2504 addAll(elements) {
2442 if (dart.is(elements, core.List)) { 2505 if (dart.is(elements, core.List)) {
2443 let list = dart.as(elements, core.List); 2506 let list = dart.as(elements, core.List);
2444 let addCount = list[core.$length]; 2507 let addCount = list[core.$length];
2445 let length = this[core.$length]; 2508 let length = this[core.$length];
2446 if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this [_table][core.$length])) { 2509 if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this [_table][core.$length])) {
2447 this[_preGrow](dart.notNull(length) + dart.notNull(addCount)); 2510 this[_preGrow](dart.notNull(length) + dart.notNull(addCount));
2448 this[_table][core.$setRange](length, dart.notNull(length) + dart.not Null(addCount), dart.as(list, core.Iterable$(E)), 0); 2511 this[_table][core.$setRange](length, dart.notNull(length) + dart.not Null(addCount), dart.as(list, core.Iterable$(E)), 0);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2504 this[_table][core.$set](i, null); 2567 this[_table][core.$set](i, null);
2505 } 2568 }
2506 this[_head] = this[_tail] = 0; 2569 this[_head] = this[_tail] = 0;
2507 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2570 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2508 } 2571 }
2509 } 2572 }
2510 toString() { 2573 toString() {
2511 return IterableBase.iterableToFullString(this, "{", "}"); 2574 return IterableBase.iterableToFullString(this, "{", "}");
2512 } 2575 }
2513 addLast(element) { 2576 addLast(element) {
2577 dart.as(element, E);
2514 this[_add](element); 2578 this[_add](element);
2515 } 2579 }
2516 addFirst(element) { 2580 addFirst(element) {
2581 dart.as(element, E);
2517 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][ core.$length]) - 1; 2582 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table][ core.$length]) - 1;
2518 this[_table][core.$set](this[_head], element); 2583 this[_table][core.$set](this[_head], element);
2519 if (this[_head] == this[_tail]) 2584 if (this[_head] == this[_tail])
2520 this[_grow](); 2585 this[_grow]();
2521 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2586 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2522 } 2587 }
2523 removeFirst() { 2588 removeFirst() {
2524 if (this[_head] == this[_tail]) 2589 if (this[_head] == this[_tail])
2525 throw _internal.IterableElementError.noElement(); 2590 throw _internal.IterableElementError.noElement();
2526 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2591 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
(...skipping 23 matching lines...) Expand all
2550 return number; 2615 return number;
2551 number = nextNumber; 2616 number = nextNumber;
2552 } 2617 }
2553 } 2618 }
2554 [_checkModification](expectedModificationCount) { 2619 [_checkModification](expectedModificationCount) {
2555 if (expectedModificationCount != this[_modificationCount]) { 2620 if (expectedModificationCount != this[_modificationCount]) {
2556 throw new core.ConcurrentModificationError(this); 2621 throw new core.ConcurrentModificationError(this);
2557 } 2622 }
2558 } 2623 }
2559 [_add](element) { 2624 [_add](element) {
2625 dart.as(element, E);
2560 this[_table][core.$set](this[_tail], element); 2626 this[_table][core.$set](this[_tail], element);
2561 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][ core.$length]) - 1; 2627 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table][ core.$length]) - 1;
2562 if (this[_head] == this[_tail]) 2628 if (this[_head] == this[_tail])
2563 this[_grow](); 2629 this[_grow]();
2564 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 2630 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
2565 } 2631 }
2566 [_remove](offset) { 2632 [_remove](offset) {
2567 let mask = dart.notNull(this[_table][core.$length]) - 1; 2633 let mask = dart.notNull(this[_table][core.$length]) - 1;
2568 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d art.notNull(mask); 2634 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d art.notNull(mask);
2569 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar t.notNull(mask); 2635 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar t.notNull(mask);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 }); 2724 });
2659 let _ListQueueIterator = _ListQueueIterator$(); 2725 let _ListQueueIterator = _ListQueueIterator$();
2660 let _Predicate$ = dart.generic(function(T) { 2726 let _Predicate$ = dart.generic(function(T) {
2661 let _Predicate = dart.typedef('_Predicate', () => dart.functionType(core.boo l, [T])); 2727 let _Predicate = dart.typedef('_Predicate', () => dart.functionType(core.boo l, [T]));
2662 return _Predicate; 2728 return _Predicate;
2663 }); 2729 });
2664 let _Predicate = _Predicate$(); 2730 let _Predicate = _Predicate$();
2665 let _SplayTreeNode$ = dart.generic(function(K) { 2731 let _SplayTreeNode$ = dart.generic(function(K) {
2666 class _SplayTreeNode extends core.Object { 2732 class _SplayTreeNode extends core.Object {
2667 _SplayTreeNode(key) { 2733 _SplayTreeNode(key) {
2734 dart.as(key, K);
2668 this.key = key; 2735 this.key = key;
2669 this.left = null; 2736 this.left = null;
2670 this.right = null; 2737 this.right = null;
2671 } 2738 }
2672 } 2739 }
2673 return _SplayTreeNode; 2740 return _SplayTreeNode;
2674 }); 2741 });
2675 let _SplayTreeNode = _SplayTreeNode$(); 2742 let _SplayTreeNode = _SplayTreeNode$();
2676 let _SplayTreeMapNode$ = dart.generic(function(K, V) { 2743 let _SplayTreeMapNode$ = dart.generic(function(K, V) {
2677 class _SplayTreeMapNode extends _SplayTreeNode$(K) { 2744 class _SplayTreeMapNode extends _SplayTreeNode$(K) {
2678 _SplayTreeMapNode(key, value) { 2745 _SplayTreeMapNode(key, value) {
2746 dart.as(key, K);
2747 dart.as(value, V);
2679 this.value = value; 2748 this.value = value;
2680 super._SplayTreeNode(key); 2749 super._SplayTreeNode(key);
2681 } 2750 }
2682 } 2751 }
2683 return _SplayTreeMapNode; 2752 return _SplayTreeMapNode;
2684 }); 2753 });
2685 let _SplayTreeMapNode = _SplayTreeMapNode$(); 2754 let _SplayTreeMapNode = _SplayTreeMapNode$();
2686 let _dummy = Symbol('_dummy'); 2755 let _dummy = Symbol('_dummy');
2687 let _root = Symbol('_root'); 2756 let _root = Symbol('_root');
2688 let _count = Symbol('_count'); 2757 let _count = Symbol('_count');
2689 let _splayCount = Symbol('_splayCount'); 2758 let _splayCount = Symbol('_splayCount');
2690 let _splay = Symbol('_splay'); 2759 let _splay = Symbol('_splay');
2691 let _compare = Symbol('_compare'); 2760 let _compare = Symbol('_compare');
2692 let _splayMin = Symbol('_splayMin'); 2761 let _splayMin = Symbol('_splayMin');
2693 let _splayMax = Symbol('_splayMax'); 2762 let _splayMax = Symbol('_splayMax');
2694 let _addNewRoot = Symbol('_addNewRoot'); 2763 let _addNewRoot = Symbol('_addNewRoot');
2695 let _first = Symbol('_first'); 2764 let _first = Symbol('_first');
2696 let _last = Symbol('_last'); 2765 let _last = Symbol('_last');
2697 let _clear = Symbol('_clear'); 2766 let _clear = Symbol('_clear');
2698 let _SplayTree$ = dart.generic(function(K) { 2767 let _SplayTree$ = dart.generic(function(K) {
2699 class _SplayTree extends core.Object { 2768 class _SplayTree extends core.Object {
2700 _SplayTree() { 2769 _SplayTree() {
2701 this[_dummy] = new (_SplayTreeNode$(K))(null); 2770 this[_dummy] = new (_SplayTreeNode$(K))(null);
2702 this[_root] = null; 2771 this[_root] = null;
2703 this[_count] = 0; 2772 this[_count] = 0;
2704 this[_modificationCount] = 0; 2773 this[_modificationCount] = 0;
2705 this[_splayCount] = 0; 2774 this[_splayCount] = 0;
2706 } 2775 }
2707 [_splay](key) { 2776 [_splay](key) {
2777 dart.as(key, K);
2708 if (this[_root] == null) 2778 if (this[_root] == null)
2709 return -1; 2779 return -1;
2710 let left = this[_dummy]; 2780 let left = this[_dummy];
2711 let right = this[_dummy]; 2781 let right = this[_dummy];
2712 let current = this[_root]; 2782 let current = this[_root];
2713 let comp = null; 2783 let comp = null;
2714 while (true) { 2784 while (true) {
2715 comp = this[_compare](current.key, key); 2785 comp = this[_compare](current.key, key);
2716 if (dart.notNull(comp) > 0) { 2786 if (dart.notNull(comp) > 0) {
2717 if (current.left == null) 2787 if (current.left == null)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2771 let current = node; 2841 let current = node;
2772 while (current.right != null) { 2842 while (current.right != null) {
2773 let right = current.right; 2843 let right = current.right;
2774 current.right = right.left; 2844 current.right = right.left;
2775 right.left = current; 2845 right.left = current;
2776 current = right; 2846 current = right;
2777 } 2847 }
2778 return dart.as(current, _SplayTreeNode$(K)); 2848 return dart.as(current, _SplayTreeNode$(K));
2779 } 2849 }
2780 [_remove](key) { 2850 [_remove](key) {
2851 dart.as(key, K);
2781 if (this[_root] == null) 2852 if (this[_root] == null)
2782 return null; 2853 return null;
2783 let comp = this[_splay](key); 2854 let comp = this[_splay](key);
2784 if (comp != 0) 2855 if (comp != 0)
2785 return null; 2856 return null;
2786 let result = this[_root]; 2857 let result = this[_root];
2787 this[_count] = dart.notNull(this[_count]) - 1; 2858 this[_count] = dart.notNull(this[_count]) - 1;
2788 if (this[_root].left == null) { 2859 if (this[_root].left == null) {
2789 this[_root] = this[_root].right; 2860 this[_root] = this[_root].right;
2790 } else { 2861 } else {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2843 return _TypeTest; 2914 return _TypeTest;
2844 }); 2915 });
2845 let _TypeTest = _TypeTest$(); 2916 let _TypeTest = _TypeTest$();
2846 let _comparator = Symbol('_comparator'); 2917 let _comparator = Symbol('_comparator');
2847 let _validKey = Symbol('_validKey'); 2918 let _validKey = Symbol('_validKey');
2848 let SplayTreeMap$ = dart.generic(function(K, V) { 2919 let SplayTreeMap$ = dart.generic(function(K, V) {
2849 class SplayTreeMap extends _SplayTree$(K) { 2920 class SplayTreeMap extends _SplayTree$(K) {
2850 SplayTreeMap(compare, isValidKey) { 2921 SplayTreeMap(compare, isValidKey) {
2851 if (compare === void 0) 2922 if (compare === void 0)
2852 compare = null; 2923 compare = null;
2924 dart.as(compare, dart.functionType(core.int, [K, K]));
2853 if (isValidKey === void 0) 2925 if (isValidKey === void 0)
2854 isValidKey = null; 2926 isValidKey = null;
2927 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
2855 this[_comparator] = dart.as(compare == null ? dart.bind(core.Comparable, 'compare') : compare, core.Comparator$(K)); 2928 this[_comparator] = dart.as(compare == null ? dart.bind(core.Comparable, 'compare') : compare, core.Comparator$(K));
2856 this[_validKey] = dart.as(isValidKey != null ? isValidKey : v => dart.is (v, K), _Predicate); 2929 this[_validKey] = dart.as(isValidKey != null ? isValidKey : v => dart.is (v, K), _Predicate);
2857 super._SplayTree(); 2930 super._SplayTree();
2858 } 2931 }
2859 from(other, compare, isValidKey) { 2932 from(other, compare, isValidKey) {
2860 if (compare === void 0) 2933 if (compare === void 0)
2861 compare = null; 2934 compare = null;
2935 dart.as(compare, dart.functionType(core.int, [K, K]));
2862 if (isValidKey === void 0) 2936 if (isValidKey === void 0)
2863 isValidKey = null; 2937 isValidKey = null;
2938 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
2864 let result = new (SplayTreeMap$(K, V))(); 2939 let result = new (SplayTreeMap$(K, V))();
2865 other.forEach((k, v) => { 2940 other.forEach((k, v) => {
2866 result.set(k, dart.as(v, V)); 2941 result.set(k, dart.as(v, V));
2867 }); 2942 });
2868 return result; 2943 return result;
2869 } 2944 }
2870 fromIterable(iterable, opts) { 2945 fromIterable(iterable, opts) {
2871 let key = opts && 'key' in opts ? opts.key : null; 2946 let key = opts && 'key' in opts ? opts.key : null;
2947 dart.as(key, dart.functionType(K, [dart.dynamic]));
2872 let value = opts && 'value' in opts ? opts.value : null; 2948 let value = opts && 'value' in opts ? opts.value : null;
2949 dart.as(value, dart.functionType(V, [dart.dynamic]));
2873 let compare = opts && 'compare' in opts ? opts.compare : null; 2950 let compare = opts && 'compare' in opts ? opts.compare : null;
2951 dart.as(compare, dart.functionType(core.int, [K, K]));
2874 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 2952 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
2953 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
2875 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); 2954 let map = new (SplayTreeMap$(K, V))(compare, isValidKey);
2876 Maps._fillMapWithMappedIterable(map, iterable, key, value); 2955 Maps._fillMapWithMappedIterable(map, iterable, key, value);
2877 return map; 2956 return map;
2878 } 2957 }
2879 fromIterables(keys, values, compare, isValidKey) { 2958 fromIterables(keys, values, compare, isValidKey) {
2959 dart.as(keys, core.Iterable$(K));
2960 dart.as(values, core.Iterable$(V));
2880 if (compare === void 0) 2961 if (compare === void 0)
2881 compare = null; 2962 compare = null;
2963 dart.as(compare, dart.functionType(core.int, [K, K]));
2882 if (isValidKey === void 0) 2964 if (isValidKey === void 0)
2883 isValidKey = null; 2965 isValidKey = null;
2966 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
2884 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); 2967 let map = new (SplayTreeMap$(K, V))(compare, isValidKey);
2885 Maps._fillMapWithIterables(map, keys, values); 2968 Maps._fillMapWithIterables(map, keys, values);
2886 return map; 2969 return map;
2887 } 2970 }
2888 [_compare](key1, key2) { 2971 [_compare](key1, key2) {
2972 dart.as(key1, K);
2973 dart.as(key2, K);
2889 return this[_comparator](key1, key2); 2974 return this[_comparator](key1, key2);
2890 } 2975 }
2891 _internal() { 2976 _internal() {
2892 this[_comparator] = null; 2977 this[_comparator] = null;
2893 this[_validKey] = null; 2978 this[_validKey] = null;
2894 super._SplayTree(); 2979 super._SplayTree();
2895 } 2980 }
2896 get(key) { 2981 get(key) {
2897 if (key == null) 2982 if (key == null)
2898 throw new core.ArgumentError(key); 2983 throw new core.ArgumentError(key);
(...skipping 10 matching lines...) Expand all
2909 } 2994 }
2910 remove(key) { 2995 remove(key) {
2911 if (!dart.notNull(dart.dcall(this[_validKey], key))) 2996 if (!dart.notNull(dart.dcall(this[_validKey], key)))
2912 return null; 2997 return null;
2913 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode) ; 2998 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode) ;
2914 if (mapRoot != null) 2999 if (mapRoot != null)
2915 return dart.as(mapRoot.value, V); 3000 return dart.as(mapRoot.value, V);
2916 return null; 3001 return null;
2917 } 3002 }
2918 set(key, value) { 3003 set(key, value) {
3004 dart.as(key, K);
3005 dart.as(value, V);
2919 if (key == null) 3006 if (key == null)
2920 throw new core.ArgumentError(key); 3007 throw new core.ArgumentError(key);
2921 let comp = this[_splay](key); 3008 let comp = this[_splay](key);
2922 if (comp == 0) { 3009 if (comp == 0) {
2923 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); 3010 let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
2924 mapRoot.value = value; 3011 mapRoot.value = value;
2925 return; 3012 return;
2926 } 3013 }
2927 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value), comp); 3014 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value), comp);
2928 } 3015 }
2929 putIfAbsent(key, ifAbsent) { 3016 putIfAbsent(key, ifAbsent) {
3017 dart.as(key, K);
3018 dart.as(ifAbsent, dart.functionType(V, []));
2930 if (key == null) 3019 if (key == null)
2931 throw new core.ArgumentError(key); 3020 throw new core.ArgumentError(key);
2932 let comp = this[_splay](key); 3021 let comp = this[_splay](key);
2933 if (comp == 0) { 3022 if (comp == 0) {
2934 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); 3023 let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
2935 return dart.as(mapRoot.value, V); 3024 return dart.as(mapRoot.value, V);
2936 } 3025 }
2937 let modificationCount = this[_modificationCount]; 3026 let modificationCount = this[_modificationCount];
2938 let splayCount = this[_splayCount]; 3027 let splayCount = this[_splayCount];
2939 let value = ifAbsent(); 3028 let value = ifAbsent();
2940 if (modificationCount != this[_modificationCount]) { 3029 if (modificationCount != this[_modificationCount]) {
2941 throw new core.ConcurrentModificationError(this); 3030 throw new core.ConcurrentModificationError(this);
2942 } 3031 }
2943 if (splayCount != this[_splayCount]) { 3032 if (splayCount != this[_splayCount]) {
2944 comp = this[_splay](key); 3033 comp = this[_splay](key);
2945 dart.assert(comp != 0); 3034 dart.assert(comp != 0);
2946 } 3035 }
2947 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value), comp); 3036 this[_addNewRoot](new (_SplayTreeMapNode$(K, dart.dynamic))(key, value), comp);
2948 return value; 3037 return value;
2949 } 3038 }
2950 addAll(other) { 3039 addAll(other) {
2951 other.forEach(((key, value) => { 3040 other.forEach(((key, value) => {
3041 dart.as(key, K);
3042 dart.as(value, V);
2952 this.set(key, value); 3043 this.set(key, value);
2953 }).bind(this)); 3044 }).bind(this));
2954 } 3045 }
2955 get isEmpty() { 3046 get isEmpty() {
2956 return this[_root] == null; 3047 return this[_root] == null;
2957 } 3048 }
2958 get isNotEmpty() { 3049 get isNotEmpty() {
2959 return !dart.notNull(this.isEmpty); 3050 return !dart.notNull(this.isEmpty);
2960 } 3051 }
2961 forEach(f) { 3052 forEach(f) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3006 if (this[_root] == null) 3097 if (this[_root] == null)
3007 return null; 3098 return null;
3008 return dart.as(this[_first].key, K); 3099 return dart.as(this[_first].key, K);
3009 } 3100 }
3010 lastKey() { 3101 lastKey() {
3011 if (this[_root] == null) 3102 if (this[_root] == null)
3012 return null; 3103 return null;
3013 return dart.as(this[_last].key, K); 3104 return dart.as(this[_last].key, K);
3014 } 3105 }
3015 lastKeyBefore(key) { 3106 lastKeyBefore(key) {
3107 dart.as(key, K);
3016 if (key == null) 3108 if (key == null)
3017 throw new core.ArgumentError(key); 3109 throw new core.ArgumentError(key);
3018 if (this[_root] == null) 3110 if (this[_root] == null)
3019 return null; 3111 return null;
3020 let comp = this[_splay](key); 3112 let comp = this[_splay](key);
3021 if (dart.notNull(comp) < 0) 3113 if (dart.notNull(comp) < 0)
3022 return this[_root].key; 3114 return this[_root].key;
3023 let node = this[_root].left; 3115 let node = this[_root].left;
3024 if (node == null) 3116 if (node == null)
3025 return null; 3117 return null;
3026 while (node.right != null) { 3118 while (node.right != null) {
3027 node = node.right; 3119 node = node.right;
3028 } 3120 }
3029 return node.key; 3121 return node.key;
3030 } 3122 }
3031 firstKeyAfter(key) { 3123 firstKeyAfter(key) {
3124 dart.as(key, K);
3032 if (key == null) 3125 if (key == null)
3033 throw new core.ArgumentError(key); 3126 throw new core.ArgumentError(key);
3034 if (this[_root] == null) 3127 if (this[_root] == null)
3035 return null; 3128 return null;
3036 let comp = this[_splay](key); 3129 let comp = this[_splay](key);
3037 if (dart.notNull(comp) > 0) 3130 if (dart.notNull(comp) > 0)
3038 return this[_root].key; 3131 return this[_root].key;
3039 let node = this[_root].right; 3132 let node = this[_root].right;
3040 if (node == null) 3133 if (node == null)
3041 return null; 3134 return null;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3215 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt'); 3308 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt');
3216 return _SplayTreeNodeIterator; 3309 return _SplayTreeNodeIterator;
3217 }); 3310 });
3218 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(); 3311 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$();
3219 let _clone = Symbol('_clone'); 3312 let _clone = Symbol('_clone');
3220 let SplayTreeSet$ = dart.generic(function(E) { 3313 let SplayTreeSet$ = dart.generic(function(E) {
3221 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set Mixin$(E)) { 3314 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set Mixin$(E)) {
3222 SplayTreeSet(compare, isValidKey) { 3315 SplayTreeSet(compare, isValidKey) {
3223 if (compare === void 0) 3316 if (compare === void 0)
3224 compare = null; 3317 compare = null;
3318 dart.as(compare, dart.functionType(core.int, [E, E]));
3225 if (isValidKey === void 0) 3319 if (isValidKey === void 0)
3226 isValidKey = null; 3320 isValidKey = null;
3321 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
3227 this[_comparator] = dart.as(compare == null ? dart.bind(core.Comparable, 'compare') : compare, core.Comparator); 3322 this[_comparator] = dart.as(compare == null ? dart.bind(core.Comparable, 'compare') : compare, core.Comparator);
3228 this[_validKey] = dart.as(isValidKey != null ? isValidKey : v => dart.is (v, E), _Predicate); 3323 this[_validKey] = dart.as(isValidKey != null ? isValidKey : v => dart.is (v, E), _Predicate);
3229 super._SplayTree(); 3324 super._SplayTree();
3230 } 3325 }
3231 from(elements, compare, isValidKey) { 3326 from(elements, compare, isValidKey) {
3232 if (compare === void 0) 3327 if (compare === void 0)
3233 compare = null; 3328 compare = null;
3329 dart.as(compare, dart.functionType(core.int, [E, E]));
3234 if (isValidKey === void 0) 3330 if (isValidKey === void 0)
3235 isValidKey = null; 3331 isValidKey = null;
3332 dart.as(isValidKey, dart.functionType(core.bool, [dart.dynamic]));
3236 let result = new (SplayTreeSet$(E))(compare, isValidKey); 3333 let result = new (SplayTreeSet$(E))(compare, isValidKey);
3237 for (let element of dart.as(elements, core.Iterable$(E))) { 3334 for (let element of dart.as(elements, core.Iterable$(E))) {
3238 result.add(element); 3335 result.add(element);
3239 } 3336 }
3240 return result; 3337 return result;
3241 } 3338 }
3242 [_compare](e1, e2) { 3339 [_compare](e1, e2) {
3340 dart.as(e1, E);
3341 dart.as(e2, E);
3243 return dart.dcall(this[_comparator], e1, e2); 3342 return dart.dcall(this[_comparator], e1, e2);
3244 } 3343 }
3245 get [core.$iterator]() { 3344 get [core.$iterator]() {
3246 return new (_SplayTreeKeyIterator$(E))(this); 3345 return new (_SplayTreeKeyIterator$(E))(this);
3247 } 3346 }
3248 get [core.$length]() { 3347 get [core.$length]() {
3249 return this[_count]; 3348 return this[_count];
3250 } 3349 }
3251 get [core.$isEmpty]() { 3350 get [core.$isEmpty]() {
3252 return this[_root] == null; 3351 return this[_root] == null;
(...skipping 15 matching lines...) Expand all
3268 if (this[_count] == 0) 3367 if (this[_count] == 0)
3269 throw _internal.IterableElementError.noElement(); 3368 throw _internal.IterableElementError.noElement();
3270 if (dart.notNull(this[_count]) > 1) 3369 if (dart.notNull(this[_count]) > 1)
3271 throw _internal.IterableElementError.tooMany(); 3370 throw _internal.IterableElementError.tooMany();
3272 return this[_root].key; 3371 return this[_root].key;
3273 } 3372 }
3274 [core.$contains](object) { 3373 [core.$contains](object) {
3275 return dart.notNull(dart.dcall(this[_validKey], object)) && this[_splay] (dart.as(object, E)) == 0; 3374 return dart.notNull(dart.dcall(this[_validKey], object)) && this[_splay] (dart.as(object, E)) == 0;
3276 } 3375 }
3277 add(element) { 3376 add(element) {
3377 dart.as(element, E);
3278 let compare = this[_splay](element); 3378 let compare = this[_splay](element);
3279 if (compare == 0) 3379 if (compare == 0)
3280 return false; 3380 return false;
3281 this[_addNewRoot](new (_SplayTreeNode$(E))(element), compare); 3381 this[_addNewRoot](new (_SplayTreeNode$(E))(element), compare);
3282 return true; 3382 return true;
3283 } 3383 }
3284 remove(object) { 3384 remove(object) {
3285 if (!dart.notNull(dart.dcall(this[_validKey], object))) 3385 if (!dart.notNull(dart.dcall(this[_validKey], object)))
3286 return false; 3386 return false;
3287 return this[_remove](dart.as(object, E)) != null; 3387 return this[_remove](dart.as(object, E)) != null;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 if (rest == null) 3536 if (rest == null)
3437 return false; 3537 return false;
3438 let bucket = this[_getBucket](rest, key); 3538 let bucket = this[_getBucket](rest, key);
3439 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; 3539 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
3440 } 3540 }
3441 containsValue(value) { 3541 containsValue(value) {
3442 return this[_computeKeys]()[core.$any]((each => dart.equals(this.get(eac h), value)).bind(this)); 3542 return this[_computeKeys]()[core.$any]((each => dart.equals(this.get(eac h), value)).bind(this));
3443 } 3543 }
3444 addAll(other) { 3544 addAll(other) {
3445 other.forEach(((key, value) => { 3545 other.forEach(((key, value) => {
3546 dart.as(key, K);
3547 dart.as(value, V);
3446 this.set(key, value); 3548 this.set(key, value);
3447 }).bind(this)); 3549 }).bind(this));
3448 } 3550 }
3449 get(key) { 3551 get(key) {
3450 if (_HashMap._isStringKey(key)) { 3552 if (_HashMap._isStringKey(key)) {
3451 let strings = this[_strings]; 3553 let strings = this[_strings];
3452 return dart.as(strings == null ? null : _HashMap._getTableEntry(string s, key), V); 3554 return dart.as(strings == null ? null : _HashMap._getTableEntry(string s, key), V);
3453 } else if (_HashMap._isNumericKey(key)) { 3555 } else if (_HashMap._isNumericKey(key)) {
3454 let nums = this[_nums]; 3556 let nums = this[_nums];
3455 return dart.as(nums == null ? null : _HashMap._getTableEntry(nums, key ), V); 3557 return dart.as(nums == null ? null : _HashMap._getTableEntry(nums, key ), V);
3456 } else { 3558 } else {
3457 return this[_get](key); 3559 return this[_get](key);
3458 } 3560 }
3459 } 3561 }
3460 [_get](key) { 3562 [_get](key) {
3461 let rest = this[_rest]; 3563 let rest = this[_rest];
3462 if (rest == null) 3564 if (rest == null)
3463 return null; 3565 return null;
3464 let bucket = this[_getBucket](rest, key); 3566 let bucket = this[_getBucket](rest, key);
3465 let index = this[_findBucketIndex](bucket, key); 3567 let index = this[_findBucketIndex](bucket, key);
3466 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde x) + 1], V); 3568 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde x) + 1], V);
3467 } 3569 }
3468 set(key, value) { 3570 set(key, value) {
3571 dart.as(key, K);
3572 dart.as(value, V);
3469 if (_HashMap._isStringKey(key)) { 3573 if (_HashMap._isStringKey(key)) {
3470 let strings = this[_strings]; 3574 let strings = this[_strings];
3471 if (strings == null) 3575 if (strings == null)
3472 this[_strings] = strings = _HashMap._newHashTable(); 3576 this[_strings] = strings = _HashMap._newHashTable();
3473 this[_addHashTableEntry](strings, key, value); 3577 this[_addHashTableEntry](strings, key, value);
3474 } else if (_HashMap._isNumericKey(key)) { 3578 } else if (_HashMap._isNumericKey(key)) {
3475 let nums = this[_nums]; 3579 let nums = this[_nums];
3476 if (nums == null) 3580 if (nums == null)
3477 this[_nums] = nums = _HashMap._newHashTable(); 3581 this[_nums] = nums = _HashMap._newHashTable();
3478 this[_addHashTableEntry](nums, key, value); 3582 this[_addHashTableEntry](nums, key, value);
3479 } else { 3583 } else {
3480 this[_set](key, value); 3584 this[_set](key, value);
3481 } 3585 }
3482 } 3586 }
3483 [_set](key, value) { 3587 [_set](key, value) {
3588 dart.as(key, K);
3589 dart.as(value, V);
3484 let rest = this[_rest]; 3590 let rest = this[_rest];
3485 if (rest == null) 3591 if (rest == null)
3486 this[_rest] = rest = _HashMap._newHashTable(); 3592 this[_rest] = rest = _HashMap._newHashTable();
3487 let hash = this[_computeHashCode](key); 3593 let hash = this[_computeHashCode](key);
3488 let bucket = rest[hash]; 3594 let bucket = rest[hash];
3489 if (bucket == null) { 3595 if (bucket == null) {
3490 _HashMap._setTableEntry(rest, hash, [key, value]); 3596 _HashMap._setTableEntry(rest, hash, [key, value]);
3491 this[_length] = dart.notNull(this[_length]) + 1; 3597 this[_length] = dart.notNull(this[_length]) + 1;
3492 this[_keys] = null; 3598 this[_keys] = null;
3493 } else { 3599 } else {
3494 let index = this[_findBucketIndex](bucket, key); 3600 let index = this[_findBucketIndex](bucket, key);
3495 if (dart.notNull(index) >= 0) { 3601 if (dart.notNull(index) >= 0) {
3496 bucket[dart.notNull(index) + 1] = value; 3602 bucket[dart.notNull(index) + 1] = value;
3497 } else { 3603 } else {
3498 bucket.push(key, value); 3604 bucket.push(key, value);
3499 this[_length] = dart.notNull(this[_length]) + 1; 3605 this[_length] = dart.notNull(this[_length]) + 1;
3500 this[_keys] = null; 3606 this[_keys] = null;
3501 } 3607 }
3502 } 3608 }
3503 } 3609 }
3504 putIfAbsent(key, ifAbsent) { 3610 putIfAbsent(key, ifAbsent) {
3611 dart.as(key, K);
3612 dart.as(ifAbsent, dart.functionType(V, []));
3505 if (this.containsKey(key)) 3613 if (this.containsKey(key))
3506 return this.get(key); 3614 return this.get(key);
3507 let value = ifAbsent(); 3615 let value = ifAbsent();
3508 this.set(key, value); 3616 this.set(key, value);
3509 return value; 3617 return value;
3510 } 3618 }
3511 remove(key) { 3619 remove(key) {
3512 if (_HashMap._isStringKey(key)) { 3620 if (_HashMap._isStringKey(key)) {
3513 return this[_removeHashTableEntry](this[_strings], key); 3621 return this[_removeHashTableEntry](this[_strings], key);
3514 } else if (_HashMap._isNumericKey(key)) { 3622 } else if (_HashMap._isNumericKey(key)) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
3582 let key = bucket[i]; 3690 let key = bucket[i];
3583 result[index] = key; 3691 result[index] = key;
3584 index = dart.notNull(index) + 1; 3692 index = dart.notNull(index) + 1;
3585 } 3693 }
3586 } 3694 }
3587 } 3695 }
3588 dart.assert(index == this[_length]); 3696 dart.assert(index == this[_length]);
3589 return this[_keys] = result; 3697 return this[_keys] = result;
3590 } 3698 }
3591 [_addHashTableEntry](table, key, value) { 3699 [_addHashTableEntry](table, key, value) {
3700 dart.as(key, K);
3701 dart.as(value, V);
3592 if (!dart.notNull(_HashMap._hasTableEntry(table, key))) { 3702 if (!dart.notNull(_HashMap._hasTableEntry(table, key))) {
3593 this[_length] = dart.notNull(this[_length]) + 1; 3703 this[_length] = dart.notNull(this[_length]) + 1;
3594 this[_keys] = null; 3704 this[_keys] = null;
3595 } 3705 }
3596 _HashMap._setTableEntry(table, key, value); 3706 _HashMap._setTableEntry(table, key, value);
3597 } 3707 }
3598 [_removeHashTableEntry](table, key) { 3708 [_removeHashTableEntry](table, key) {
3599 if (dart.notNull(table != null) && dart.notNull(_HashMap._hasTableEntry( table, key))) { 3709 if (dart.notNull(table != null) && dart.notNull(_HashMap._hasTableEntry( table, key))) {
3600 let value = dart.as(_HashMap._getTableEntry(table, key), V); 3710 let value = dart.as(_HashMap._getTableEntry(table, key), V);
3601 _HashMap._deleteTableEntry(table, key); 3711 _HashMap._deleteTableEntry(table, key);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
3687 this[_hashCode] = hashCode; 3797 this[_hashCode] = hashCode;
3688 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v, K), _Predicate); 3798 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v, K), _Predicate);
3689 super._HashMap(); 3799 super._HashMap();
3690 } 3800 }
3691 get(key) { 3801 get(key) {
3692 if (!dart.notNull(dart.dcall(this[_validKey], key))) 3802 if (!dart.notNull(dart.dcall(this[_validKey], key)))
3693 return null; 3803 return null;
3694 return super[_get](key); 3804 return super[_get](key);
3695 } 3805 }
3696 set(key, value) { 3806 set(key, value) {
3807 dart.as(key, K);
3808 dart.as(value, V);
3697 super[_set](key, value); 3809 super[_set](key, value);
3698 } 3810 }
3699 containsKey(key) { 3811 containsKey(key) {
3700 if (!dart.notNull(dart.dcall(this[_validKey], key))) 3812 if (!dart.notNull(dart.dcall(this[_validKey], key)))
3701 return false; 3813 return false;
3702 return super[_containsKey](key); 3814 return super[_containsKey](key);
3703 } 3815 }
3704 remove(key) { 3816 remove(key) {
3705 if (!dart.notNull(dart.dcall(this[_validKey], key))) 3817 if (!dart.notNull(dart.dcall(this[_validKey], key)))
3706 return null; 3818 return null;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
3843 if (rest == null) 3955 if (rest == null)
3844 return false; 3956 return false;
3845 let bucket = this[_getBucket](rest, key); 3957 let bucket = this[_getBucket](rest, key);
3846 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; 3958 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
3847 } 3959 }
3848 containsValue(value) { 3960 containsValue(value) {
3849 return this.keys[core.$any]((each => dart.equals(this.get(each), value)) .bind(this)); 3961 return this.keys[core.$any]((each => dart.equals(this.get(each), value)) .bind(this));
3850 } 3962 }
3851 addAll(other) { 3963 addAll(other) {
3852 other.forEach(((key, value) => { 3964 other.forEach(((key, value) => {
3965 dart.as(key, K);
3966 dart.as(value, V);
3853 this.set(key, value); 3967 this.set(key, value);
3854 }).bind(this)); 3968 }).bind(this));
3855 } 3969 }
3856 get(key) { 3970 get(key) {
3857 if (_LinkedHashMap._isStringKey(key)) { 3971 if (_LinkedHashMap._isStringKey(key)) {
3858 let strings = this[_strings]; 3972 let strings = this[_strings];
3859 if (strings == null) 3973 if (strings == null)
3860 return null; 3974 return null;
3861 let cell = dart.as(_LinkedHashMap._getTableEntry(strings, key), Linked HashMapCell); 3975 let cell = dart.as(_LinkedHashMap._getTableEntry(strings, key), Linked HashMapCell);
3862 return dart.as(cell == null ? null : cell[_value], V); 3976 return dart.as(cell == null ? null : cell[_value], V);
(...skipping 12 matching lines...) Expand all
3875 if (rest == null) 3989 if (rest == null)
3876 return null; 3990 return null;
3877 let bucket = this[_getBucket](rest, key); 3991 let bucket = this[_getBucket](rest, key);
3878 let index = this[_findBucketIndex](bucket, key); 3992 let index = this[_findBucketIndex](bucket, key);
3879 if (dart.notNull(index) < 0) 3993 if (dart.notNull(index) < 0)
3880 return null; 3994 return null;
3881 let cell = dart.as(bucket[index], LinkedHashMapCell); 3995 let cell = dart.as(bucket[index], LinkedHashMapCell);
3882 return dart.as(cell[_value], V); 3996 return dart.as(cell[_value], V);
3883 } 3997 }
3884 set(key, value) { 3998 set(key, value) {
3999 dart.as(key, K);
4000 dart.as(value, V);
3885 if (_LinkedHashMap._isStringKey(key)) { 4001 if (_LinkedHashMap._isStringKey(key)) {
3886 let strings = this[_strings]; 4002 let strings = this[_strings];
3887 if (strings == null) 4003 if (strings == null)
3888 this[_strings] = strings = _LinkedHashMap._newHashTable(); 4004 this[_strings] = strings = _LinkedHashMap._newHashTable();
3889 this[_addHashTableEntry](strings, key, value); 4005 this[_addHashTableEntry](strings, key, value);
3890 } else if (_LinkedHashMap._isNumericKey(key)) { 4006 } else if (_LinkedHashMap._isNumericKey(key)) {
3891 let nums = this[_nums]; 4007 let nums = this[_nums];
3892 if (nums == null) 4008 if (nums == null)
3893 this[_nums] = nums = _LinkedHashMap._newHashTable(); 4009 this[_nums] = nums = _LinkedHashMap._newHashTable();
3894 this[_addHashTableEntry](nums, key, value); 4010 this[_addHashTableEntry](nums, key, value);
3895 } else { 4011 } else {
3896 this[_set](key, value); 4012 this[_set](key, value);
3897 } 4013 }
3898 } 4014 }
3899 [_set](key, value) { 4015 [_set](key, value) {
4016 dart.as(key, K);
4017 dart.as(value, V);
3900 let rest = this[_rest]; 4018 let rest = this[_rest];
3901 if (rest == null) 4019 if (rest == null)
3902 this[_rest] = rest = _LinkedHashMap._newHashTable(); 4020 this[_rest] = rest = _LinkedHashMap._newHashTable();
3903 let hash = this[_computeHashCode](key); 4021 let hash = this[_computeHashCode](key);
3904 let bucket = rest[hash]; 4022 let bucket = rest[hash];
3905 if (bucket == null) { 4023 if (bucket == null) {
3906 let cell = this[_newLinkedCell](key, value); 4024 let cell = this[_newLinkedCell](key, value);
3907 _LinkedHashMap._setTableEntry(rest, hash, [cell]); 4025 _LinkedHashMap._setTableEntry(rest, hash, [cell]);
3908 } else { 4026 } else {
3909 let index = this[_findBucketIndex](bucket, key); 4027 let index = this[_findBucketIndex](bucket, key);
3910 if (dart.notNull(index) >= 0) { 4028 if (dart.notNull(index) >= 0) {
3911 let cell = dart.as(bucket[index], LinkedHashMapCell); 4029 let cell = dart.as(bucket[index], LinkedHashMapCell);
3912 cell[_value] = value; 4030 cell[_value] = value;
3913 } else { 4031 } else {
3914 let cell = this[_newLinkedCell](key, value); 4032 let cell = this[_newLinkedCell](key, value);
3915 bucket.push(cell); 4033 bucket.push(cell);
3916 } 4034 }
3917 } 4035 }
3918 } 4036 }
3919 putIfAbsent(key, ifAbsent) { 4037 putIfAbsent(key, ifAbsent) {
4038 dart.as(key, K);
4039 dart.as(ifAbsent, dart.functionType(V, []));
3920 if (this.containsKey(key)) 4040 if (this.containsKey(key))
3921 return this.get(key); 4041 return this.get(key);
3922 let value = ifAbsent(); 4042 let value = ifAbsent();
3923 this.set(key, value); 4043 this.set(key, value);
3924 return value; 4044 return value;
3925 } 4045 }
3926 remove(key) { 4046 remove(key) {
3927 if (_LinkedHashMap._isStringKey(key)) { 4047 if (_LinkedHashMap._isStringKey(key)) {
3928 return this[_removeHashTableEntry](this[_strings], key); 4048 return this[_removeHashTableEntry](this[_strings], key);
3929 } else if (_LinkedHashMap._isNumericKey(key)) { 4049 } else if (_LinkedHashMap._isNumericKey(key)) {
(...skipping 26 matching lines...) Expand all
3956 let modifications = this[_modifications]; 4076 let modifications = this[_modifications];
3957 while (cell != null) { 4077 while (cell != null) {
3958 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); 4078 action(dart.as(cell[_key], K), dart.as(cell[_value], V));
3959 if (modifications != this[_modifications]) { 4079 if (modifications != this[_modifications]) {
3960 throw new core.ConcurrentModificationError(this); 4080 throw new core.ConcurrentModificationError(this);
3961 } 4081 }
3962 cell = cell[_next]; 4082 cell = cell[_next];
3963 } 4083 }
3964 } 4084 }
3965 [_addHashTableEntry](table, key, value) { 4085 [_addHashTableEntry](table, key, value) {
4086 dart.as(key, K);
4087 dart.as(value, V);
3966 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash MapCell); 4088 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash MapCell);
3967 if (cell == null) { 4089 if (cell == null) {
3968 _LinkedHashMap._setTableEntry(table, key, this[_newLinkedCell](key, va lue)); 4090 _LinkedHashMap._setTableEntry(table, key, this[_newLinkedCell](key, va lue));
3969 } else { 4091 } else {
3970 cell[_value] = value; 4092 cell[_value] = value;
3971 } 4093 }
3972 } 4094 }
3973 [_removeHashTableEntry](table, key) { 4095 [_removeHashTableEntry](table, key) {
3974 if (table == null) 4096 if (table == null)
3975 return null; 4097 return null;
3976 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash MapCell); 4098 let cell = dart.as(_LinkedHashMap._getTableEntry(table, key), LinkedHash MapCell);
3977 if (cell == null) 4099 if (cell == null)
3978 return null; 4100 return null;
3979 this[_unlinkCell](cell); 4101 this[_unlinkCell](cell);
3980 _LinkedHashMap._deleteTableEntry(table, key); 4102 _LinkedHashMap._deleteTableEntry(table, key);
3981 return dart.as(cell[_value], V); 4103 return dart.as(cell[_value], V);
3982 } 4104 }
3983 [_modified]() { 4105 [_modified]() {
3984 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ; 4106 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ;
3985 } 4107 }
3986 [_newLinkedCell](key, value) { 4108 [_newLinkedCell](key, value) {
4109 dart.as(key, K);
4110 dart.as(value, V);
3987 let cell = new LinkedHashMapCell(key, value); 4111 let cell = new LinkedHashMapCell(key, value);
3988 if (this[_first] == null) { 4112 if (this[_first] == null) {
3989 this[_first] = this[_last] = cell; 4113 this[_first] = this[_last] = cell;
3990 } else { 4114 } else {
3991 let last = this[_last]; 4115 let last = this[_last];
3992 cell[_previous] = last; 4116 cell[_previous] = last;
3993 this[_last] = last[_next] = cell; 4117 this[_last] = last[_next] = cell;
3994 } 4118 }
3995 this[_length] = dart.notNull(this[_length]) + 1; 4119 this[_length] = dart.notNull(this[_length]) + 1;
3996 this[_modified](); 4120 this[_modified]();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
4090 this[_hashCode] = hashCode; 4214 this[_hashCode] = hashCode;
4091 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v, K), _Predicate); 4215 this[_validKey] = dart.as(validKey != null ? validKey : v => dart.is(v, K), _Predicate);
4092 super._LinkedHashMap(); 4216 super._LinkedHashMap();
4093 } 4217 }
4094 get(key) { 4218 get(key) {
4095 if (!dart.notNull(dart.dcall(this[_validKey], key))) 4219 if (!dart.notNull(dart.dcall(this[_validKey], key)))
4096 return null; 4220 return null;
4097 return super[_get](key); 4221 return super[_get](key);
4098 } 4222 }
4099 set(key, value) { 4223 set(key, value) {
4224 dart.as(key, K);
4225 dart.as(value, V);
4100 super[_set](key, value); 4226 super[_set](key, value);
4101 } 4227 }
4102 containsKey(key) { 4228 containsKey(key) {
4103 if (!dart.notNull(dart.dcall(this[_validKey], key))) 4229 if (!dart.notNull(dart.dcall(this[_validKey], key)))
4104 return false; 4230 return false;
4105 return super[_containsKey](key); 4231 return super[_containsKey](key);
4106 } 4232 }
4107 remove(key) { 4233 remove(key) {
4108 if (!dart.notNull(dart.dcall(this[_validKey], key))) 4234 if (!dart.notNull(dart.dcall(this[_validKey], key)))
4109 return null; 4235 return null;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
4255 let rest = this[_rest]; 4381 let rest = this[_rest];
4256 if (rest == null) 4382 if (rest == null)
4257 return null; 4383 return null;
4258 let bucket = this[_getBucket](rest, object); 4384 let bucket = this[_getBucket](rest, object);
4259 let index = this[_findBucketIndex](bucket, object); 4385 let index = this[_findBucketIndex](bucket, object);
4260 if (dart.notNull(index) < 0) 4386 if (dart.notNull(index) < 0)
4261 return null; 4387 return null;
4262 return dart.as(bucket[core.$get](index), E); 4388 return dart.as(bucket[core.$get](index), E);
4263 } 4389 }
4264 add(element) { 4390 add(element) {
4391 dart.as(element, E);
4265 if (_HashSet._isStringElement(element)) { 4392 if (_HashSet._isStringElement(element)) {
4266 let strings = this[_strings]; 4393 let strings = this[_strings];
4267 if (strings == null) 4394 if (strings == null)
4268 this[_strings] = strings = _HashSet._newHashTable(); 4395 this[_strings] = strings = _HashSet._newHashTable();
4269 return this[_addHashTableEntry](strings, element); 4396 return this[_addHashTableEntry](strings, element);
4270 } else if (_HashSet._isNumericElement(element)) { 4397 } else if (_HashSet._isNumericElement(element)) {
4271 let nums = this[_nums]; 4398 let nums = this[_nums];
4272 if (nums == null) 4399 if (nums == null)
4273 this[_nums] = nums = _HashSet._newHashTable(); 4400 this[_nums] = nums = _HashSet._newHashTable();
4274 return this[_addHashTableEntry](nums, element); 4401 return this[_addHashTableEntry](nums, element);
4275 } else { 4402 } else {
4276 return this[_add](element); 4403 return this[_add](element);
4277 } 4404 }
4278 } 4405 }
4279 [_add](element) { 4406 [_add](element) {
4407 dart.as(element, E);
4280 let rest = this[_rest]; 4408 let rest = this[_rest];
4281 if (rest == null) 4409 if (rest == null)
4282 this[_rest] = rest = _HashSet._newHashTable(); 4410 this[_rest] = rest = _HashSet._newHashTable();
4283 let hash = this[_computeHashCode](element); 4411 let hash = this[_computeHashCode](element);
4284 let bucket = rest[hash]; 4412 let bucket = rest[hash];
4285 if (bucket == null) { 4413 if (bucket == null) {
4286 _HashSet._setTableEntry(rest, hash, [element]); 4414 _HashSet._setTableEntry(rest, hash, [element]);
4287 } else { 4415 } else {
4288 let index = this[_findBucketIndex](bucket, element); 4416 let index = this[_findBucketIndex](bucket, element);
4289 if (dart.notNull(index) >= 0) 4417 if (dart.notNull(index) >= 0)
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
4363 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not Null(i) + 1) { 4491 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not Null(i) + 1) {
4364 result[index] = bucket[i]; 4492 result[index] = bucket[i];
4365 index = dart.notNull(index) + 1; 4493 index = dart.notNull(index) + 1;
4366 } 4494 }
4367 } 4495 }
4368 } 4496 }
4369 dart.assert(index == this[_length]); 4497 dart.assert(index == this[_length]);
4370 return this[_elements] = result; 4498 return this[_elements] = result;
4371 } 4499 }
4372 [_addHashTableEntry](table, element) { 4500 [_addHashTableEntry](table, element) {
4501 dart.as(element, E);
4373 if (_HashSet._hasTableEntry(table, element)) 4502 if (_HashSet._hasTableEntry(table, element))
4374 return false; 4503 return false;
4375 _HashSet._setTableEntry(table, element, 0); 4504 _HashSet._setTableEntry(table, element, 0);
4376 this[_length] = dart.notNull(this[_length]) + 1; 4505 this[_length] = dart.notNull(this[_length]) + 1;
4377 this[_elements] = null; 4506 this[_elements] = null;
4378 return true; 4507 return true;
4379 } 4508 }
4380 [_removeHashTableEntry](table, element) { 4509 [_removeHashTableEntry](table, element) {
4381 if (dart.notNull(table != null) && dart.notNull(_HashSet._hasTableEntry( table, element))) { 4510 if (dart.notNull(table != null) && dart.notNull(_HashSet._hasTableEntry( table, element))) {
4382 _HashSet._deleteTableEntry(table, element); 4511 _HashSet._deleteTableEntry(table, element);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
4475 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) { 4604 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull (i) + 1) {
4476 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) 4605 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E)))
4477 return i; 4606 return i;
4478 } 4607 }
4479 return -1; 4608 return -1;
4480 } 4609 }
4481 [_computeHashCode](element) { 4610 [_computeHashCode](element) {
4482 return this[_hasher](dart.as(element, E)) & 0x3ffffff; 4611 return this[_hasher](dart.as(element, E)) & 0x3ffffff;
4483 } 4612 }
4484 add(object) { 4613 add(object) {
4614 dart.as(object, E);
4485 return super[_add](object); 4615 return super[_add](object);
4486 } 4616 }
4487 [core.$contains](object) { 4617 [core.$contains](object) {
4488 if (!dart.notNull(dart.dcall(this[_validKey], object))) 4618 if (!dart.notNull(dart.dcall(this[_validKey], object)))
4489 return false; 4619 return false;
4490 return super[_contains](object); 4620 return super[_contains](object);
4491 } 4621 }
4492 lookup(object) { 4622 lookup(object) {
4493 if (!dart.notNull(dart.dcall(this[_validKey], object))) 4623 if (!dart.notNull(dart.dcall(this[_validKey], object)))
4494 return null; 4624 return null;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
4619 if (this[_first] == null) 4749 if (this[_first] == null)
4620 throw new core.StateError("No elements"); 4750 throw new core.StateError("No elements");
4621 return dart.as(this[_first][_element], E); 4751 return dart.as(this[_first][_element], E);
4622 } 4752 }
4623 get [core.$last]() { 4753 get [core.$last]() {
4624 if (this[_last] == null) 4754 if (this[_last] == null)
4625 throw new core.StateError("No elements"); 4755 throw new core.StateError("No elements");
4626 return dart.as(this[_last][_element], E); 4756 return dart.as(this[_last][_element], E);
4627 } 4757 }
4628 add(element) { 4758 add(element) {
4759 dart.as(element, E);
4629 if (_LinkedHashSet._isStringElement(element)) { 4760 if (_LinkedHashSet._isStringElement(element)) {
4630 let strings = this[_strings]; 4761 let strings = this[_strings];
4631 if (strings == null) 4762 if (strings == null)
4632 this[_strings] = strings = _LinkedHashSet._newHashTable(); 4763 this[_strings] = strings = _LinkedHashSet._newHashTable();
4633 return this[_addHashTableEntry](strings, element); 4764 return this[_addHashTableEntry](strings, element);
4634 } else if (_LinkedHashSet._isNumericElement(element)) { 4765 } else if (_LinkedHashSet._isNumericElement(element)) {
4635 let nums = this[_nums]; 4766 let nums = this[_nums];
4636 if (nums == null) 4767 if (nums == null)
4637 this[_nums] = nums = _LinkedHashSet._newHashTable(); 4768 this[_nums] = nums = _LinkedHashSet._newHashTable();
4638 return this[_addHashTableEntry](nums, element); 4769 return this[_addHashTableEntry](nums, element);
4639 } else { 4770 } else {
4640 return this[_add](element); 4771 return this[_add](element);
4641 } 4772 }
4642 } 4773 }
4643 [_add](element) { 4774 [_add](element) {
4775 dart.as(element, E);
4644 let rest = this[_rest]; 4776 let rest = this[_rest];
4645 if (rest == null) 4777 if (rest == null)
4646 this[_rest] = rest = _LinkedHashSet._newHashTable(); 4778 this[_rest] = rest = _LinkedHashSet._newHashTable();
4647 let hash = this[_computeHashCode](element); 4779 let hash = this[_computeHashCode](element);
4648 let bucket = rest[hash]; 4780 let bucket = rest[hash];
4649 if (bucket == null) { 4781 if (bucket == null) {
4650 let cell = this[_newLinkedCell](element); 4782 let cell = this[_newLinkedCell](element);
4651 _LinkedHashSet._setTableEntry(rest, hash, [cell]); 4783 _LinkedHashSet._setTableEntry(rest, hash, [cell]);
4652 } else { 4784 } else {
4653 let index = this[_findBucketIndex](bucket, element); 4785 let index = this[_findBucketIndex](bucket, element);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
4701 } 4833 }
4702 } 4834 }
4703 clear() { 4835 clear() {
4704 if (dart.notNull(this[_length]) > 0) { 4836 if (dart.notNull(this[_length]) > 0) {
4705 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null; 4837 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last ] = null;
4706 this[_length] = 0; 4838 this[_length] = 0;
4707 this[_modified](); 4839 this[_modified]();
4708 } 4840 }
4709 } 4841 }
4710 [_addHashTableEntry](table, element) { 4842 [_addHashTableEntry](table, element) {
4843 dart.as(element, E);
4711 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked HashSetCell); 4844 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked HashSetCell);
4712 if (cell != null) 4845 if (cell != null)
4713 return false; 4846 return false;
4714 _LinkedHashSet._setTableEntry(table, element, this[_newLinkedCell](eleme nt)); 4847 _LinkedHashSet._setTableEntry(table, element, this[_newLinkedCell](eleme nt));
4715 return true; 4848 return true;
4716 } 4849 }
4717 [_removeHashTableEntry](table, element) { 4850 [_removeHashTableEntry](table, element) {
4718 if (table == null) 4851 if (table == null)
4719 return false; 4852 return false;
4720 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked HashSetCell); 4853 let cell = dart.as(_LinkedHashSet._getTableEntry(table, element), Linked HashSetCell);
4721 if (cell == null) 4854 if (cell == null)
4722 return false; 4855 return false;
4723 this[_unlinkCell](cell); 4856 this[_unlinkCell](cell);
4724 _LinkedHashSet._deleteTableEntry(table, element); 4857 _LinkedHashSet._deleteTableEntry(table, element);
4725 return true; 4858 return true;
4726 } 4859 }
4727 [_modified]() { 4860 [_modified]() {
4728 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ; 4861 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863 ;
4729 } 4862 }
4730 [_newLinkedCell](element) { 4863 [_newLinkedCell](element) {
4864 dart.as(element, E);
4731 let cell = new LinkedHashSetCell(element); 4865 let cell = new LinkedHashSetCell(element);
4732 if (this[_first] == null) { 4866 if (this[_first] == null) {
4733 this[_first] = this[_last] = cell; 4867 this[_first] = this[_last] = cell;
4734 } else { 4868 } else {
4735 let last = this[_last]; 4869 let last = this[_last];
4736 cell[_previous] = last; 4870 cell[_previous] = last;
4737 this[_last] = last[_next] = cell; 4871 this[_last] = last[_next] = cell;
4738 } 4872 }
4739 this[_length] = dart.notNull(this[_length]) + 1; 4873 this[_length] = dart.notNull(this[_length]) + 1;
4740 this[_modified](); 4874 this[_modified]();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
4846 let cell = dart.as(bucket[i], LinkedHashSetCell); 4980 let cell = dart.as(bucket[i], LinkedHashSetCell);
4847 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) 4981 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E)))
4848 return i; 4982 return i;
4849 } 4983 }
4850 return -1; 4984 return -1;
4851 } 4985 }
4852 [_computeHashCode](element) { 4986 [_computeHashCode](element) {
4853 return this[_hasher](dart.as(element, E)) & 0x3ffffff; 4987 return this[_hasher](dart.as(element, E)) & 0x3ffffff;
4854 } 4988 }
4855 add(element) { 4989 add(element) {
4990 dart.as(element, E);
4856 return super[_add](element); 4991 return super[_add](element);
4857 } 4992 }
4858 [core.$contains](object) { 4993 [core.$contains](object) {
4859 if (!dart.notNull(dart.dcall(this[_validKey], object))) 4994 if (!dart.notNull(dart.dcall(this[_validKey], object)))
4860 return false; 4995 return false;
4861 return super[_contains](object); 4996 return super[_contains](object);
4862 } 4997 }
4863 lookup(object) { 4998 lookup(object) {
4864 if (!dart.notNull(dart.dcall(this[_validKey], object))) 4999 if (!dart.notNull(dart.dcall(this[_validKey], object)))
4865 return null; 5000 return null;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
4983 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; 5118 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$;
4984 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; 5119 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable;
4985 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; 5120 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$;
4986 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; 5121 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator;
4987 exports.HashSetIterator$ = HashSetIterator$; 5122 exports.HashSetIterator$ = HashSetIterator$;
4988 exports.HashSetIterator = HashSetIterator; 5123 exports.HashSetIterator = HashSetIterator;
4989 exports.LinkedHashSetCell = LinkedHashSetCell; 5124 exports.LinkedHashSetCell = LinkedHashSetCell;
4990 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; 5125 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
4991 exports.LinkedHashSetIterator = LinkedHashSetIterator; 5126 exports.LinkedHashSetIterator = LinkedHashSetIterator;
4992 })(collection || (collection = {})); 5127 })(collection || (collection = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698