OLD | NEW |
1 dart_library.library('dart/collection', null, /* Imports */[ | 1 dart_library.library('dart/collection', null, /* Imports */[ |
2 "dart/_runtime", | 2 "dart/_runtime", |
3 'dart/core' | 3 'dart/core' |
4 ], /* Lazy imports */[ | 4 ], /* Lazy imports */[ |
5 'dart/_internal', | 5 'dart/_internal', |
6 'dart/_js_helper', | 6 'dart/_js_helper', |
7 'dart/math' | 7 'dart/math' |
8 ], function(exports, dart, core, _internal, _js_helper, math) { | 8 ], function(exports, dart, core, _internal, _js_helper, math) { |
9 'use strict'; | 9 'use strict'; |
10 let dartx = dart.dartx; | 10 let dartx = dart.dartx; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return _Equality; | 42 return _Equality; |
43 }); | 43 }); |
44 let _Equality = _Equality$(); | 44 let _Equality = _Equality$(); |
45 const _Hasher$ = dart.generic(function(K) { | 45 const _Hasher$ = dart.generic(function(K) { |
46 const _Hasher = dart.typedef('_Hasher', () => dart.functionType(core.int, [K
])); | 46 const _Hasher = dart.typedef('_Hasher', () => dart.functionType(core.int, [K
])); |
47 return _Hasher; | 47 return _Hasher; |
48 }); | 48 }); |
49 let _Hasher = _Hasher$(); | 49 let _Hasher = _Hasher$(); |
50 const HashMap$ = dart.generic(function(K, V) { | 50 const HashMap$ = dart.generic(function(K, V) { |
51 class HashMap extends core.Object { | 51 class HashMap extends core.Object { |
52 static new(opts) { | 52 static new({equals = null, hashCode = null, isValidKey = null} = {}) { |
53 let equals = opts && 'equals' in opts ? opts.equals : null; | |
54 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; | |
55 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; | |
56 if (isValidKey == null) { | 53 if (isValidKey == null) { |
57 if (hashCode == null) { | 54 if (hashCode == null) { |
58 if (equals == null) { | 55 if (equals == null) { |
59 return new (_HashMap$(K, V))(); | 56 return new (_HashMap$(K, V))(); |
60 } | 57 } |
61 hashCode = _defaultHashCode; | 58 hashCode = _defaultHashCode; |
62 } else { | 59 } else { |
63 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { | 60 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { |
64 return new (_IdentityHashMap$(K, V))(); | 61 return new (_IdentityHashMap$(K, V))(); |
65 } | 62 } |
(...skipping 14 matching lines...) Expand all Loading... |
80 static identity() { | 77 static identity() { |
81 return new (_IdentityHashMap$(K, V))(); | 78 return new (_IdentityHashMap$(K, V))(); |
82 } | 79 } |
83 static from(other) { | 80 static from(other) { |
84 let result = HashMap$(K, V).new(); | 81 let result = HashMap$(K, V).new(); |
85 other.forEach(dart.fn((k, v) => { | 82 other.forEach(dart.fn((k, v) => { |
86 result.set(dart.as(k, K), dart.as(v, V)); | 83 result.set(dart.as(k, K), dart.as(v, V)); |
87 })); | 84 })); |
88 return result; | 85 return result; |
89 } | 86 } |
90 static fromIterable(iterable, opts) { | 87 static fromIterable(iterable, {key = null, value = null} = {}) { |
91 let key = opts && 'key' in opts ? opts.key : null; | |
92 let value = opts && 'value' in opts ? opts.value : null; | |
93 let map = HashMap$(K, V).new(); | 88 let map = HashMap$(K, V).new(); |
94 Maps._fillMapWithMappedIterable(map, iterable, key, value); | 89 Maps._fillMapWithMappedIterable(map, iterable, key, value); |
95 return map; | 90 return map; |
96 } | 91 } |
97 static fromIterables(keys, values) { | 92 static fromIterables(keys, values) { |
98 let map = HashMap$(K, V).new(); | 93 let map = HashMap$(K, V).new(); |
99 Maps._fillMapWithIterables(map, keys, values); | 94 Maps._fillMapWithIterables(map, keys, values); |
100 return map; | 95 return map; |
101 } | 96 } |
102 } | 97 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return result; | 178 return result; |
184 } | 179 } |
185 difference(other) { | 180 difference(other) { |
186 let result = this.toSet(); | 181 let result = this.toSet(); |
187 for (let element of this) { | 182 for (let element of this) { |
188 if (dart.notNull(other.contains(element))) | 183 if (dart.notNull(other.contains(element))) |
189 result.remove(element); | 184 result.remove(element); |
190 } | 185 } |
191 return result; | 186 return result; |
192 } | 187 } |
193 toList(opts) { | 188 toList({growable = true} = {}) { |
194 let growable = opts && 'growable' in opts ? opts.growable : true; | |
195 let result = dart.notNull(growable) ? (() => { | 189 let result = dart.notNull(growable) ? (() => { |
196 let _ = core.List$(E).new(); | 190 let _ = core.List$(E).new(); |
197 _[dartx.length] = this.length; | 191 _[dartx.length] = this.length; |
198 return _; | 192 return _; |
199 }).bind(this)() : core.List$(E).new(this.length); | 193 }).bind(this)() : core.List$(E).new(this.length); |
200 let i = 0; | 194 let i = 0; |
201 for (let element of this) | 195 for (let element of this) |
202 result[dartx.set]((() => { | 196 result[dartx.set]((() => { |
203 let x = i; | 197 let x = i; |
204 i = dart.notNull(x) + 1; | 198 i = dart.notNull(x) + 1; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 let it = this.iterator; | 309 let it = this.iterator; |
316 if (!dart.notNull(it.moveNext())) { | 310 if (!dart.notNull(it.moveNext())) { |
317 dart.throw(_internal.IterableElementError.noElement()); | 311 dart.throw(_internal.IterableElementError.noElement()); |
318 } | 312 } |
319 let result = null; | 313 let result = null; |
320 do { | 314 do { |
321 result = it.current; | 315 result = it.current; |
322 } while (dart.notNull(it.moveNext())); | 316 } while (dart.notNull(it.moveNext())); |
323 return result; | 317 return result; |
324 } | 318 } |
325 firstWhere(test, opts) { | 319 firstWhere(test, {orElse = null} = {}) { |
326 dart.as(test, dart.functionType(core.bool, [E])); | 320 dart.as(test, dart.functionType(core.bool, [E])); |
327 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
328 dart.as(orElse, dart.functionType(E, [])); | 321 dart.as(orElse, dart.functionType(E, [])); |
329 for (let element of this) { | 322 for (let element of this) { |
330 if (dart.notNull(test(element))) | 323 if (dart.notNull(test(element))) |
331 return element; | 324 return element; |
332 } | 325 } |
333 if (orElse != null) | 326 if (orElse != null) |
334 return orElse(); | 327 return orElse(); |
335 dart.throw(_internal.IterableElementError.noElement()); | 328 dart.throw(_internal.IterableElementError.noElement()); |
336 } | 329 } |
337 lastWhere(test, opts) { | 330 lastWhere(test, {orElse = null} = {}) { |
338 dart.as(test, dart.functionType(core.bool, [E])); | 331 dart.as(test, dart.functionType(core.bool, [E])); |
339 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
340 dart.as(orElse, dart.functionType(E, [])); | 332 dart.as(orElse, dart.functionType(E, [])); |
341 let result = null; | 333 let result = null; |
342 let foundMatching = false; | 334 let foundMatching = false; |
343 for (let element of this) { | 335 for (let element of this) { |
344 if (dart.notNull(test(element))) { | 336 if (dart.notNull(test(element))) { |
345 result = element; | 337 result = element; |
346 foundMatching = true; | 338 foundMatching = true; |
347 } | 339 } |
348 } | 340 } |
349 if (dart.notNull(foundMatching)) | 341 if (dart.notNull(foundMatching)) |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 intersection: [core.Set$(E), [core.Set$(core.Object)]], | 481 intersection: [core.Set$(E), [core.Set$(core.Object)]], |
490 toSet: [core.Set$(E), []] | 482 toSet: [core.Set$(E), []] |
491 }) | 483 }) |
492 }); | 484 }); |
493 dart.defineExtensionMembers(_HashSetBase, ['toSet']); | 485 dart.defineExtensionMembers(_HashSetBase, ['toSet']); |
494 return _HashSetBase; | 486 return _HashSetBase; |
495 }); | 487 }); |
496 let _HashSetBase = _HashSetBase$(); | 488 let _HashSetBase = _HashSetBase$(); |
497 const HashSet$ = dart.generic(function(E) { | 489 const HashSet$ = dart.generic(function(E) { |
498 class HashSet extends core.Object { | 490 class HashSet extends core.Object { |
499 static new(opts) { | 491 static new({equals = null, hashCode = null, isValidKey = null} = {}) { |
500 let equals = opts && 'equals' in opts ? opts.equals : null; | |
501 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; | |
502 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; | |
503 if (isValidKey == null) { | 492 if (isValidKey == null) { |
504 if (hashCode == null) { | 493 if (hashCode == null) { |
505 if (equals == null) { | 494 if (equals == null) { |
506 return new (_HashSet$(E))(); | 495 return new (_HashSet$(E))(); |
507 } | 496 } |
508 hashCode = _defaultHashCode; | 497 hashCode = _defaultHashCode; |
509 } else { | 498 } else { |
510 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { | 499 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { |
511 return new (_IdentityHashSet$(E))(); | 500 return new (_IdentityHashSet$(E))(); |
512 } | 501 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 return dart.toString(buffer); | 611 return dart.toString(buffer); |
623 } | 612 } |
624 any(f) { | 613 any(f) { |
625 dart.as(f, dart.functionType(core.bool, [E])); | 614 dart.as(f, dart.functionType(core.bool, [E])); |
626 for (let element of this) { | 615 for (let element of this) { |
627 if (dart.notNull(f(element))) | 616 if (dart.notNull(f(element))) |
628 return true; | 617 return true; |
629 } | 618 } |
630 return false; | 619 return false; |
631 } | 620 } |
632 toList(opts) { | 621 toList({growable = true} = {}) { |
633 let growable = opts && 'growable' in opts ? opts.growable : true; | |
634 return core.List$(E).from(this, {growable: growable}); | 622 return core.List$(E).from(this, {growable: growable}); |
635 } | 623 } |
636 toSet() { | 624 toSet() { |
637 return core.Set$(E).from(this); | 625 return core.Set$(E).from(this); |
638 } | 626 } |
639 get length() { | 627 get length() { |
640 dart.assert(!dart.is(this, _internal.EfficientLength)); | 628 dart.assert(!dart.is(this, _internal.EfficientLength)); |
641 let count = 0; | 629 let count = 0; |
642 let it = this[dartx.iterator]; | 630 let it = this[dartx.iterator]; |
643 while (dart.notNull(it.moveNext())) { | 631 while (dart.notNull(it.moveNext())) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 } | 673 } |
686 get single() { | 674 get single() { |
687 let it = this[dartx.iterator]; | 675 let it = this[dartx.iterator]; |
688 if (!dart.notNull(it.moveNext())) | 676 if (!dart.notNull(it.moveNext())) |
689 dart.throw(_internal.IterableElementError.noElement()); | 677 dart.throw(_internal.IterableElementError.noElement()); |
690 let result = it.current; | 678 let result = it.current; |
691 if (dart.notNull(it.moveNext())) | 679 if (dart.notNull(it.moveNext())) |
692 dart.throw(_internal.IterableElementError.tooMany()); | 680 dart.throw(_internal.IterableElementError.tooMany()); |
693 return result; | 681 return result; |
694 } | 682 } |
695 firstWhere(test, opts) { | 683 firstWhere(test, {orElse = null} = {}) { |
696 dart.as(test, dart.functionType(core.bool, [E])); | 684 dart.as(test, dart.functionType(core.bool, [E])); |
697 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
698 dart.as(orElse, dart.functionType(E, [])); | 685 dart.as(orElse, dart.functionType(E, [])); |
699 for (let element of this) { | 686 for (let element of this) { |
700 if (dart.notNull(test(element))) | 687 if (dart.notNull(test(element))) |
701 return element; | 688 return element; |
702 } | 689 } |
703 if (orElse != null) | 690 if (orElse != null) |
704 return orElse(); | 691 return orElse(); |
705 dart.throw(_internal.IterableElementError.noElement()); | 692 dart.throw(_internal.IterableElementError.noElement()); |
706 } | 693 } |
707 lastWhere(test, opts) { | 694 lastWhere(test, {orElse = null} = {}) { |
708 dart.as(test, dart.functionType(core.bool, [E])); | 695 dart.as(test, dart.functionType(core.bool, [E])); |
709 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
710 dart.as(orElse, dart.functionType(E, [])); | 696 dart.as(orElse, dart.functionType(E, [])); |
711 let result = null; | 697 let result = null; |
712 let foundMatching = false; | 698 let foundMatching = false; |
713 for (let element of this) { | 699 for (let element of this) { |
714 if (dart.notNull(test(element))) { | 700 if (dart.notNull(test(element))) { |
715 result = element; | 701 result = element; |
716 foundMatching = true; | 702 foundMatching = true; |
717 } | 703 } |
718 } | 704 } |
719 if (dart.notNull(foundMatching)) | 705 if (dart.notNull(foundMatching)) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 return dart.toString(buffer); | 876 return dart.toString(buffer); |
891 } | 877 } |
892 any(f) { | 878 any(f) { |
893 dart.as(f, dart.functionType(core.bool, [E])); | 879 dart.as(f, dart.functionType(core.bool, [E])); |
894 for (let element of this) { | 880 for (let element of this) { |
895 if (dart.notNull(f(element))) | 881 if (dart.notNull(f(element))) |
896 return true; | 882 return true; |
897 } | 883 } |
898 return false; | 884 return false; |
899 } | 885 } |
900 toList(opts) { | 886 toList({growable = true} = {}) { |
901 let growable = opts && 'growable' in opts ? opts.growable : true; | |
902 return core.List$(E).from(this, {growable: growable}); | 887 return core.List$(E).from(this, {growable: growable}); |
903 } | 888 } |
904 toSet() { | 889 toSet() { |
905 return core.Set$(E).from(this); | 890 return core.Set$(E).from(this); |
906 } | 891 } |
907 get length() { | 892 get length() { |
908 dart.assert(!dart.is(this, _internal.EfficientLength)); | 893 dart.assert(!dart.is(this, _internal.EfficientLength)); |
909 let count = 0; | 894 let count = 0; |
910 let it = this[dartx.iterator]; | 895 let it = this[dartx.iterator]; |
911 while (dart.notNull(it.moveNext())) { | 896 while (dart.notNull(it.moveNext())) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 } | 938 } |
954 get single() { | 939 get single() { |
955 let it = this[dartx.iterator]; | 940 let it = this[dartx.iterator]; |
956 if (!dart.notNull(it.moveNext())) | 941 if (!dart.notNull(it.moveNext())) |
957 dart.throw(_internal.IterableElementError.noElement()); | 942 dart.throw(_internal.IterableElementError.noElement()); |
958 let result = it.current; | 943 let result = it.current; |
959 if (dart.notNull(it.moveNext())) | 944 if (dart.notNull(it.moveNext())) |
960 dart.throw(_internal.IterableElementError.tooMany()); | 945 dart.throw(_internal.IterableElementError.tooMany()); |
961 return result; | 946 return result; |
962 } | 947 } |
963 firstWhere(test, opts) { | 948 firstWhere(test, {orElse = null} = {}) { |
964 dart.as(test, dart.functionType(core.bool, [E])); | 949 dart.as(test, dart.functionType(core.bool, [E])); |
965 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
966 dart.as(orElse, dart.functionType(E, [])); | 950 dart.as(orElse, dart.functionType(E, [])); |
967 for (let element of this) { | 951 for (let element of this) { |
968 if (dart.notNull(test(element))) | 952 if (dart.notNull(test(element))) |
969 return element; | 953 return element; |
970 } | 954 } |
971 if (orElse != null) | 955 if (orElse != null) |
972 return orElse(); | 956 return orElse(); |
973 dart.throw(_internal.IterableElementError.noElement()); | 957 dart.throw(_internal.IterableElementError.noElement()); |
974 } | 958 } |
975 lastWhere(test, opts) { | 959 lastWhere(test, {orElse = null} = {}) { |
976 dart.as(test, dart.functionType(core.bool, [E])); | 960 dart.as(test, dart.functionType(core.bool, [E])); |
977 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
978 dart.as(orElse, dart.functionType(E, [])); | 961 dart.as(orElse, dart.functionType(E, [])); |
979 let result = null; | 962 let result = null; |
980 let foundMatching = false; | 963 let foundMatching = false; |
981 for (let element of this) { | 964 for (let element of this) { |
982 if (dart.notNull(test(element))) { | 965 if (dart.notNull(test(element))) { |
983 result = element; | 966 result = element; |
984 foundMatching = true; | 967 foundMatching = true; |
985 } | 968 } |
986 } | 969 } |
987 if (dart.notNull(foundMatching)) | 970 if (dart.notNull(foundMatching)) |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 }) | 1246 }) |
1264 }); | 1247 }); |
1265 return HasNextIterator; | 1248 return HasNextIterator; |
1266 }); | 1249 }); |
1267 let HasNextIterator = HasNextIterator$(); | 1250 let HasNextIterator = HasNextIterator$(); |
1268 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; | 1251 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; |
1269 HasNextIterator._NO_NEXT = 1; | 1252 HasNextIterator._NO_NEXT = 1; |
1270 HasNextIterator._NOT_MOVED_YET = 2; | 1253 HasNextIterator._NOT_MOVED_YET = 2; |
1271 const LinkedHashMap$ = dart.generic(function(K, V) { | 1254 const LinkedHashMap$ = dart.generic(function(K, V) { |
1272 class LinkedHashMap extends core.Object { | 1255 class LinkedHashMap extends core.Object { |
1273 static new(opts) { | 1256 static new({equals = null, hashCode = null, isValidKey = null} = {}) { |
1274 let equals = opts && 'equals' in opts ? opts.equals : null; | |
1275 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; | |
1276 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; | |
1277 if (isValidKey == null) { | 1257 if (isValidKey == null) { |
1278 if (hashCode == null) { | 1258 if (hashCode == null) { |
1279 if (equals == null) { | 1259 if (equals == null) { |
1280 return new (_LinkedHashMap$(K, V))(); | 1260 return new (_LinkedHashMap$(K, V))(); |
1281 } | 1261 } |
1282 hashCode = _defaultHashCode; | 1262 hashCode = _defaultHashCode; |
1283 } else { | 1263 } else { |
1284 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { | 1264 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { |
1285 return new (_LinkedIdentityHashMap$(K, V))(); | 1265 return new (_LinkedIdentityHashMap$(K, V))(); |
1286 } | 1266 } |
(...skipping 14 matching lines...) Expand all Loading... |
1301 static identity() { | 1281 static identity() { |
1302 return new (_LinkedIdentityHashMap$(K, V))(); | 1282 return new (_LinkedIdentityHashMap$(K, V))(); |
1303 } | 1283 } |
1304 static from(other) { | 1284 static from(other) { |
1305 let result = LinkedHashMap$(K, V).new(); | 1285 let result = LinkedHashMap$(K, V).new(); |
1306 other.forEach(dart.fn((k, v) => { | 1286 other.forEach(dart.fn((k, v) => { |
1307 result.set(dart.as(k, K), dart.as(v, V)); | 1287 result.set(dart.as(k, K), dart.as(v, V)); |
1308 })); | 1288 })); |
1309 return result; | 1289 return result; |
1310 } | 1290 } |
1311 static fromIterable(iterable, opts) { | 1291 static fromIterable(iterable, {key = null, value = null} = {}) { |
1312 let key = opts && 'key' in opts ? opts.key : null; | |
1313 let value = opts && 'value' in opts ? opts.value : null; | |
1314 let map = LinkedHashMap$(K, V).new(); | 1292 let map = LinkedHashMap$(K, V).new(); |
1315 Maps._fillMapWithMappedIterable(map, iterable, key, value); | 1293 Maps._fillMapWithMappedIterable(map, iterable, key, value); |
1316 return map; | 1294 return map; |
1317 } | 1295 } |
1318 static fromIterables(keys, values) { | 1296 static fromIterables(keys, values) { |
1319 let map = LinkedHashMap$(K, V).new(); | 1297 let map = LinkedHashMap$(K, V).new(); |
1320 Maps._fillMapWithIterables(map, keys, values); | 1298 Maps._fillMapWithIterables(map, keys, values); |
1321 return map; | 1299 return map; |
1322 } | 1300 } |
1323 static _literal(keyValuePairs) { | 1301 static _literal(keyValuePairs) { |
(...skipping 13 matching lines...) Expand all Loading... |
1337 fromIterables: [LinkedHashMap$(K, V), [core.Iterable$(K), core.Iterable$
(V)]], | 1315 fromIterables: [LinkedHashMap$(K, V), [core.Iterable$(K), core.Iterable$
(V)]], |
1338 _literal: [LinkedHashMap$(K, V), [core.List]], | 1316 _literal: [LinkedHashMap$(K, V), [core.List]], |
1339 _empty: [LinkedHashMap$(K, V), []] | 1317 _empty: [LinkedHashMap$(K, V), []] |
1340 }) | 1318 }) |
1341 }); | 1319 }); |
1342 return LinkedHashMap; | 1320 return LinkedHashMap; |
1343 }); | 1321 }); |
1344 let LinkedHashMap = LinkedHashMap$(); | 1322 let LinkedHashMap = LinkedHashMap$(); |
1345 const LinkedHashSet$ = dart.generic(function(E) { | 1323 const LinkedHashSet$ = dart.generic(function(E) { |
1346 class LinkedHashSet extends core.Object { | 1324 class LinkedHashSet extends core.Object { |
1347 static new(opts) { | 1325 static new({equals = null, hashCode = null, isValidKey = null} = {}) { |
1348 let equals = opts && 'equals' in opts ? opts.equals : null; | |
1349 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; | |
1350 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; | |
1351 if (isValidKey == null) { | 1326 if (isValidKey == null) { |
1352 if (hashCode == null) { | 1327 if (hashCode == null) { |
1353 if (equals == null) { | 1328 if (equals == null) { |
1354 return new (_LinkedHashSet$(E))(); | 1329 return new (_LinkedHashSet$(E))(); |
1355 } | 1330 } |
1356 hashCode = _defaultHashCode; | 1331 hashCode = _defaultHashCode; |
1357 } else { | 1332 } else { |
1358 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { | 1333 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) &&
dart.notNull(core.identical(core.identical, equals))) { |
1359 return new (_LinkedIdentityHashSet$(E))(); | 1334 return new (_LinkedIdentityHashSet$(E))(); |
1360 } | 1335 } |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 let length = this.length; | 1666 let length = this.length; |
1692 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1667 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1693 if (dart.notNull(test(this.get(i)))) | 1668 if (dart.notNull(test(this.get(i)))) |
1694 return true; | 1669 return true; |
1695 if (length != this.length) { | 1670 if (length != this.length) { |
1696 dart.throw(new core.ConcurrentModificationError(this)); | 1671 dart.throw(new core.ConcurrentModificationError(this)); |
1697 } | 1672 } |
1698 } | 1673 } |
1699 return false; | 1674 return false; |
1700 } | 1675 } |
1701 firstWhere(test, opts) { | 1676 firstWhere(test, {orElse = null} = {}) { |
1702 dart.as(test, dart.functionType(core.bool, [E])); | 1677 dart.as(test, dart.functionType(core.bool, [E])); |
1703 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
1704 dart.as(orElse, dart.functionType(E, [])); | 1678 dart.as(orElse, dart.functionType(E, [])); |
1705 let length = this.length; | 1679 let length = this.length; |
1706 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1680 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
1707 let element = this.get(i); | 1681 let element = this.get(i); |
1708 if (dart.notNull(test(element))) | 1682 if (dart.notNull(test(element))) |
1709 return element; | 1683 return element; |
1710 if (length != this.length) { | 1684 if (length != this.length) { |
1711 dart.throw(new core.ConcurrentModificationError(this)); | 1685 dart.throw(new core.ConcurrentModificationError(this)); |
1712 } | 1686 } |
1713 } | 1687 } |
1714 if (orElse != null) | 1688 if (orElse != null) |
1715 return orElse(); | 1689 return orElse(); |
1716 dart.throw(_internal.IterableElementError.noElement()); | 1690 dart.throw(_internal.IterableElementError.noElement()); |
1717 } | 1691 } |
1718 lastWhere(test, opts) { | 1692 lastWhere(test, {orElse = null} = {}) { |
1719 dart.as(test, dart.functionType(core.bool, [E])); | 1693 dart.as(test, dart.functionType(core.bool, [E])); |
1720 let orElse = opts && 'orElse' in opts ? opts.orElse : null; | |
1721 dart.as(orElse, dart.functionType(E, [])); | 1694 dart.as(orElse, dart.functionType(E, [])); |
1722 let length = this.length; | 1695 let length = this.length; |
1723 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no
tNull(i) - 1) { | 1696 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no
tNull(i) - 1) { |
1724 let element = this.get(i); | 1697 let element = this.get(i); |
1725 if (dart.notNull(test(element))) | 1698 if (dart.notNull(test(element))) |
1726 return element; | 1699 return element; |
1727 if (length != this.length) { | 1700 if (length != this.length) { |
1728 dart.throw(new core.ConcurrentModificationError(this)); | 1701 dart.throw(new core.ConcurrentModificationError(this)); |
1729 } | 1702 } |
1730 } | 1703 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1808 dart.as(test, dart.functionType(core.bool, [E])); | 1781 dart.as(test, dart.functionType(core.bool, [E])); |
1809 return new (_internal.SkipWhileIterable$(E))(this, test); | 1782 return new (_internal.SkipWhileIterable$(E))(this, test); |
1810 } | 1783 } |
1811 take(count) { | 1784 take(count) { |
1812 return new (_internal.SubListIterable$(E))(this, 0, count); | 1785 return new (_internal.SubListIterable$(E))(this, 0, count); |
1813 } | 1786 } |
1814 takeWhile(test) { | 1787 takeWhile(test) { |
1815 dart.as(test, dart.functionType(core.bool, [E])); | 1788 dart.as(test, dart.functionType(core.bool, [E])); |
1816 return new (_internal.TakeWhileIterable$(E))(this, test); | 1789 return new (_internal.TakeWhileIterable$(E))(this, test); |
1817 } | 1790 } |
1818 toList(opts) { | 1791 toList({growable = true} = {}) { |
1819 let growable = opts && 'growable' in opts ? opts.growable : true; | |
1820 let result = null; | 1792 let result = null; |
1821 if (dart.notNull(growable)) { | 1793 if (dart.notNull(growable)) { |
1822 result = core.List$(E).new(); | 1794 result = core.List$(E).new(); |
1823 result[dartx.length] = this[dartx.length]; | 1795 result[dartx.length] = this[dartx.length]; |
1824 } else { | 1796 } else { |
1825 result = core.List$(E).new(this[dartx.length]); | 1797 result = core.List$(E).new(this[dartx.length]); |
1826 } | 1798 } |
1827 for (let i = 0; dart.notNull(i) < dart.notNull(this[dartx.length]); i =
dart.notNull(i) + 1) { | 1799 for (let i = 0; dart.notNull(i) < dart.notNull(this[dartx.length]); i =
dart.notNull(i) + 1) { |
1828 result[dartx.set](i, this.get(i)); | 1800 result[dartx.set](i, this.get(i)); |
1829 } | 1801 } |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2993 if (this[_head] == this[_tail]) | 2965 if (this[_head] == this[_tail]) |
2994 dart.throw(_internal.IterableElementError.noElement()); | 2966 dart.throw(_internal.IterableElementError.noElement()); |
2995 if (dart.notNull(this.length) > 1) | 2967 if (dart.notNull(this.length) > 1) |
2996 dart.throw(_internal.IterableElementError.tooMany()); | 2968 dart.throw(_internal.IterableElementError.tooMany()); |
2997 return this[_table][dartx.get](this[_head]); | 2969 return this[_table][dartx.get](this[_head]); |
2998 } | 2970 } |
2999 elementAt(index) { | 2971 elementAt(index) { |
3000 core.RangeError.checkValidIndex(index, this); | 2972 core.RangeError.checkValidIndex(index, this); |
3001 return this[_table][dartx.get](dart.notNull(this[_head]) + dart.notNull(
index) & dart.notNull(this[_table][dartx.length]) - 1); | 2973 return this[_table][dartx.get](dart.notNull(this[_head]) + dart.notNull(
index) & dart.notNull(this[_table][dartx.length]) - 1); |
3002 } | 2974 } |
3003 toList(opts) { | 2975 toList({growable = true} = {}) { |
3004 let growable = opts && 'growable' in opts ? opts.growable : true; | |
3005 let list = null; | 2976 let list = null; |
3006 if (dart.notNull(growable)) { | 2977 if (dart.notNull(growable)) { |
3007 list = core.List$(E).new(); | 2978 list = core.List$(E).new(); |
3008 list[dartx.length] = this.length; | 2979 list[dartx.length] = this.length; |
3009 } else { | 2980 } else { |
3010 list = core.List$(E).new(this.length); | 2981 list = core.List$(E).new(this.length); |
3011 } | 2982 } |
3012 this[_writeToList](list); | 2983 this[_writeToList](list); |
3013 return list; | 2984 return list; |
3014 } | 2985 } |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3505 if (compare === void 0) | 3476 if (compare === void 0) |
3506 compare = null; | 3477 compare = null; |
3507 if (isValidKey === void 0) | 3478 if (isValidKey === void 0) |
3508 isValidKey = null; | 3479 isValidKey = null; |
3509 let result = new (SplayTreeMap$(K, V))(); | 3480 let result = new (SplayTreeMap$(K, V))(); |
3510 other.forEach(dart.fn((k, v) => { | 3481 other.forEach(dart.fn((k, v) => { |
3511 result.set(dart.as(k, K), dart.as(v, V)); | 3482 result.set(dart.as(k, K), dart.as(v, V)); |
3512 })); | 3483 })); |
3513 return result; | 3484 return result; |
3514 } | 3485 } |
3515 static fromIterable(iterable, opts) { | 3486 static fromIterable(iterable, {key = null, value = null, compare = null, i
sValidKey = null} = {}) { |
3516 let key = opts && 'key' in opts ? opts.key : null; | |
3517 let value = opts && 'value' in opts ? opts.value : null; | |
3518 let compare = opts && 'compare' in opts ? opts.compare : null; | |
3519 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; | |
3520 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); | 3487 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); |
3521 Maps._fillMapWithMappedIterable(map, iterable, key, value); | 3488 Maps._fillMapWithMappedIterable(map, iterable, key, value); |
3522 return map; | 3489 return map; |
3523 } | 3490 } |
3524 static fromIterables(keys, values, compare, isValidKey) { | 3491 static fromIterables(keys, values, compare, isValidKey) { |
3525 if (compare === void 0) | 3492 if (compare === void 0) |
3526 compare = null; | 3493 compare = null; |
3527 if (isValidKey === void 0) | 3494 if (isValidKey === void 0) |
3528 isValidKey = null; | 3495 isValidKey = null; |
3529 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); | 3496 let map = new (SplayTreeMap$(K, V))(compare, isValidKey); |
(...skipping 2493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6023 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; | 5990 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; |
6024 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; | 5991 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; |
6025 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; | 5992 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; |
6026 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; | 5993 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; |
6027 exports.HashSetIterator$ = HashSetIterator$; | 5994 exports.HashSetIterator$ = HashSetIterator$; |
6028 exports.HashSetIterator = HashSetIterator; | 5995 exports.HashSetIterator = HashSetIterator; |
6029 exports.LinkedHashSetCell = LinkedHashSetCell; | 5996 exports.LinkedHashSetCell = LinkedHashSetCell; |
6030 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; | 5997 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; |
6031 exports.LinkedHashSetIterator = LinkedHashSetIterator; | 5998 exports.LinkedHashSetIterator = LinkedHashSetIterator; |
6032 }); | 5999 }); |
OLD | NEW |