| OLD | NEW |
| 1 var collection; | 1 var collection; |
| 2 (function(exports) { | 2 (function(exports) { |
| 3 'use strict'; | 3 'use strict'; |
| 4 let _source = Symbol('_source'); | 4 let _source = Symbol('_source'); |
| 5 let UnmodifiableListView$ = dart.generic(function(E) { | 5 let UnmodifiableListView$ = dart.generic(function(E) { |
| 6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { | 6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { |
| 7 UnmodifiableListView(source) { | 7 UnmodifiableListView(source) { |
| 8 this[_source] = source; | 8 this[_source] = source; |
| 9 super.UnmodifiableListBase(); | 9 super.UnmodifiableListBase(); |
| 10 } | 10 } |
| 11 get length() { | 11 get length() { |
| 12 return this[_source].length; | 12 return this[_source].length; |
| 13 } | 13 } |
| 14 get(index) { | 14 get(index) { |
| 15 return this[_source].elementAt(index); | 15 return this[_source].elementAt(index); |
| 16 } | 16 } |
| 17 } | 17 } |
| 18 return UnmodifiableListView; | 18 return UnmodifiableListView; |
| 19 }); | 19 }); |
| 20 let UnmodifiableListView = UnmodifiableListView$(dart.dynamic); | 20 dart.defineLazyClassGeneric(exports, 'UnmodifiableListView', {get: Unmodifiabl
eListView$}); |
| 21 // Function _defaultEquals: (dynamic, dynamic) → bool | 21 // Function _defaultEquals: (dynamic, dynamic) → bool |
| 22 function _defaultEquals(a, b) { | 22 function _defaultEquals(a, b) { |
| 23 return dart.equals(a, b); | 23 return dart.equals(a, b); |
| 24 } | 24 } |
| 25 // Function _defaultHashCode: (dynamic) → int | 25 // Function _defaultHashCode: (dynamic) → int |
| 26 function _defaultHashCode(a) { | 26 function _defaultHashCode(a) { |
| 27 return dart.as(dart.dload(a, 'hashCode'), core.int); | 27 return dart.as(dart.dload(a, 'hashCode'), core.int); |
| 28 } | 28 } |
| 29 let HashMap$ = dart.generic(function(K, V) { | 29 let HashMap$ = dart.generic(function(K, V) { |
| 30 class HashMap extends core.Object { | 30 class HashMap extends core.Object { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 dart.defineNamedConstructor(HashMap, 'identity'); | 82 dart.defineNamedConstructor(HashMap, 'identity'); |
| 83 dart.defineNamedConstructor(HashMap, 'from'); | 83 dart.defineNamedConstructor(HashMap, 'from'); |
| 84 dart.defineNamedConstructor(HashMap, 'fromIterable'); | 84 dart.defineNamedConstructor(HashMap, 'fromIterable'); |
| 85 dart.defineNamedConstructor(HashMap, 'fromIterables'); | 85 dart.defineNamedConstructor(HashMap, 'fromIterables'); |
| 86 return HashMap; | 86 return HashMap; |
| 87 }); | 87 }); |
| 88 let HashMap = HashMap$(dart.dynamic, dart.dynamic); | 88 let HashMap = HashMap$(dart.dynamic, dart.dynamic); |
| 89 let _newSet = Symbol('_newSet'); | 89 let _newSet = Symbol('_newSet'); |
| 90 let SetMixin$ = dart.generic(function(E) { |
| 91 class SetMixin extends core.Object { |
| 92 get isEmpty() { |
| 93 return this.length === 0; |
| 94 } |
| 95 get isNotEmpty() { |
| 96 return this.length !== 0; |
| 97 } |
| 98 clear() { |
| 99 this.removeAll(this.toList()); |
| 100 } |
| 101 addAll(elements) { |
| 102 for (let element of elements) |
| 103 this.add(element); |
| 104 } |
| 105 removeAll(elements) { |
| 106 for (let element of elements) |
| 107 this.remove(element); |
| 108 } |
| 109 retainAll(elements) { |
| 110 let toRemove = this.toSet(); |
| 111 for (let o of elements) { |
| 112 toRemove.remove(o); |
| 113 } |
| 114 this.removeAll(toRemove); |
| 115 } |
| 116 removeWhere(test) { |
| 117 let toRemove = new List.from([]); |
| 118 for (let element of this) { |
| 119 if (test(element)) |
| 120 toRemove.add(element); |
| 121 } |
| 122 this.removeAll(dart.as(toRemove, core.Iterable$(core.Object))); |
| 123 } |
| 124 retainWhere(test) { |
| 125 let toRemove = new List.from([]); |
| 126 for (let element of this) { |
| 127 if (!dart.notNull(test(element))) |
| 128 toRemove.add(element); |
| 129 } |
| 130 this.removeAll(dart.as(toRemove, core.Iterable$(core.Object))); |
| 131 } |
| 132 containsAll(other) { |
| 133 for (let o of other) { |
| 134 if (!dart.notNull(this.contains(o))) |
| 135 return false; |
| 136 } |
| 137 return true; |
| 138 } |
| 139 union(other) { |
| 140 return ((_) => { |
| 141 _.addAll(other); |
| 142 return _; |
| 143 }).bind(this)(this.toSet()); |
| 144 } |
| 145 intersection(other) { |
| 146 let result = this.toSet(); |
| 147 for (let element of this) { |
| 148 if (!dart.notNull(other.contains(element))) |
| 149 result.remove(element); |
| 150 } |
| 151 return result; |
| 152 } |
| 153 difference(other) { |
| 154 let result = this.toSet(); |
| 155 for (let element of this) { |
| 156 if (other.contains(element)) |
| 157 result.remove(element); |
| 158 } |
| 159 return result; |
| 160 } |
| 161 toList(opt$) { |
| 162 let growable = opt$.growable === void 0 ? true : opt$.growable; |
| 163 let result = growable ? ((_) => { |
| 164 _.length = this.length; |
| 165 return _; |
| 166 }).bind(this)(new core.List()) : new core.List(this.length); |
| 167 let i = 0; |
| 168 for (let element of this) |
| 169 result.set((($tmp) => i = dart.notNull($tmp) + 1, $tmp)(i), element); |
| 170 return result; |
| 171 } |
| 172 map(f) { |
| 173 return new _internal.EfficientLengthMappedIterable(this, f); |
| 174 } |
| 175 get single() { |
| 176 if (dart.notNull(this.length) > 1) |
| 177 throw _internal.IterableElementError.tooMany(); |
| 178 let it = this.iterator; |
| 179 if (!dart.notNull(it.moveNext())) |
| 180 throw _internal.IterableElementError.noElement(); |
| 181 let result = dart.as(it.current, E); |
| 182 return result; |
| 183 } |
| 184 toString() { |
| 185 return IterableBase.iterableToFullString(this, '{', '}'); |
| 186 } |
| 187 where(f) { |
| 188 return new _internal.WhereIterable(this, f); |
| 189 } |
| 190 expand(f) { |
| 191 return new _internal.ExpandIterable(this, f); |
| 192 } |
| 193 forEach(f) { |
| 194 for (let element of this) |
| 195 f(element); |
| 196 } |
| 197 reduce(combine) { |
| 198 let iterator = this.iterator; |
| 199 if (!dart.notNull(iterator.moveNext())) { |
| 200 throw _internal.IterableElementError.noElement(); |
| 201 } |
| 202 let value = iterator.current; |
| 203 while (iterator.moveNext()) { |
| 204 value = combine(value, iterator.current); |
| 205 } |
| 206 return value; |
| 207 } |
| 208 fold(initialValue, combine) { |
| 209 let value = initialValue; |
| 210 for (let element of this) |
| 211 value = combine(value, element); |
| 212 return value; |
| 213 } |
| 214 every(f) { |
| 215 for (let element of this) { |
| 216 if (!dart.notNull(f(element))) |
| 217 return false; |
| 218 } |
| 219 return true; |
| 220 } |
| 221 join(separator) { |
| 222 if (separator === void 0) |
| 223 separator = ""; |
| 224 let iterator = this.iterator; |
| 225 if (!dart.notNull(iterator.moveNext())) |
| 226 return ""; |
| 227 let buffer = new core.StringBuffer(); |
| 228 if (dart.notNull(separator === null) || dart.notNull(dart.equals(separat
or, ""))) { |
| 229 do { |
| 230 buffer.write(`${iterator.current}`); |
| 231 } while (iterator.moveNext()); |
| 232 } else { |
| 233 buffer.write(`${iterator.current}`); |
| 234 while (iterator.moveNext()) { |
| 235 buffer.write(separator); |
| 236 buffer.write(`${iterator.current}`); |
| 237 } |
| 238 } |
| 239 return buffer.toString(); |
| 240 } |
| 241 any(test) { |
| 242 for (let element of this) { |
| 243 if (test(element)) |
| 244 return true; |
| 245 } |
| 246 return false; |
| 247 } |
| 248 take(n) { |
| 249 return new _internal.TakeIterable(this, n); |
| 250 } |
| 251 takeWhile(test) { |
| 252 return new _internal.TakeWhileIterable(this, test); |
| 253 } |
| 254 skip(n) { |
| 255 return new _internal.SkipIterable(this, n); |
| 256 } |
| 257 skipWhile(test) { |
| 258 return new _internal.SkipWhileIterable(this, test); |
| 259 } |
| 260 get first() { |
| 261 let it = this.iterator; |
| 262 if (!dart.notNull(it.moveNext())) { |
| 263 throw _internal.IterableElementError.noElement(); |
| 264 } |
| 265 return dart.as(it.current, E); |
| 266 } |
| 267 get last() { |
| 268 let it = this.iterator; |
| 269 if (!dart.notNull(it.moveNext())) { |
| 270 throw _internal.IterableElementError.noElement(); |
| 271 } |
| 272 let result = null; |
| 273 do { |
| 274 result = dart.as(it.current, E); |
| 275 } while (it.moveNext()); |
| 276 return result; |
| 277 } |
| 278 firstWhere(test, opt$) { |
| 279 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 280 for (let element of this) { |
| 281 if (test(element)) |
| 282 return element; |
| 283 } |
| 284 if (orElse !== null) |
| 285 return orElse(); |
| 286 throw _internal.IterableElementError.noElement(); |
| 287 } |
| 288 lastWhere(test, opt$) { |
| 289 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 290 let result = null; |
| 291 let foundMatching = false; |
| 292 for (let element of this) { |
| 293 if (test(element)) { |
| 294 result = element; |
| 295 foundMatching = true; |
| 296 } |
| 297 } |
| 298 if (foundMatching) |
| 299 return result; |
| 300 if (orElse !== null) |
| 301 return orElse(); |
| 302 throw _internal.IterableElementError.noElement(); |
| 303 } |
| 304 singleWhere(test) { |
| 305 let result = null; |
| 306 let foundMatching = false; |
| 307 for (let element of this) { |
| 308 if (test(element)) { |
| 309 if (foundMatching) { |
| 310 throw _internal.IterableElementError.tooMany(); |
| 311 } |
| 312 result = element; |
| 313 foundMatching = true; |
| 314 } |
| 315 } |
| 316 if (foundMatching) |
| 317 return result; |
| 318 throw _internal.IterableElementError.noElement(); |
| 319 } |
| 320 elementAt(index) { |
| 321 if (!(typeof index == number)) |
| 322 throw new core.ArgumentError.notNull("index"); |
| 323 core.RangeError.checkNotNegative(index, "index"); |
| 324 let elementIndex = 0; |
| 325 for (let element of this) { |
| 326 if (index === elementIndex) |
| 327 return element; |
| 328 elementIndex = dart.notNull(elementIndex) + 1; |
| 329 } |
| 330 throw new core.RangeError.index(index, this, "index", null, elementIndex
); |
| 331 } |
| 332 } |
| 333 return SetMixin; |
| 334 }); |
| 335 let SetMixin = SetMixin$(dart.dynamic); |
| 336 let SetBase$ = dart.generic(function(E) { |
| 337 class SetBase extends SetMixin$(E) { |
| 338 static setToString(set) { |
| 339 return IterableBase.iterableToFullString(set, '{', '}'); |
| 340 } |
| 341 } |
| 342 return SetBase; |
| 343 }); |
| 344 let SetBase = SetBase$(dart.dynamic); |
| 90 let _HashSetBase$ = dart.generic(function(E) { | 345 let _HashSetBase$ = dart.generic(function(E) { |
| 91 class _HashSetBase extends SetBase$(E) { | 346 class _HashSetBase extends SetBase$(E) { |
| 92 difference(other) { | 347 difference(other) { |
| 93 let result = this[_newSet](); | 348 let result = this[_newSet](); |
| 94 for (let element of this) { | 349 for (let element of this) { |
| 95 if (!dart.notNull(other.contains(element))) | 350 if (!dart.notNull(other.contains(element))) |
| 96 result.add(dart.as(element, E)); | 351 result.add(dart.as(element, E)); |
| 97 } | 352 } |
| 98 return result; | 353 return result; |
| 99 } | 354 } |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 insertAfter(entry) { | 1263 insertAfter(entry) { |
| 1009 this[_list]._insertAfter(this, entry); | 1264 this[_list]._insertAfter(this, entry); |
| 1010 } | 1265 } |
| 1011 insertBefore(entry) { | 1266 insertBefore(entry) { |
| 1012 this[_list]._insertAfter(this[_previous], entry); | 1267 this[_list]._insertAfter(this[_previous], entry); |
| 1013 } | 1268 } |
| 1014 } | 1269 } |
| 1015 return LinkedListEntry; | 1270 return LinkedListEntry; |
| 1016 }); | 1271 }); |
| 1017 let LinkedListEntry = LinkedListEntry$(dart.dynamic); | 1272 let LinkedListEntry = LinkedListEntry$(dart.dynamic); |
| 1018 let ListBase$ = dart.generic(function(E) { | |
| 1019 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { | |
| 1020 static listToString(list) { | |
| 1021 return IterableBase.iterableToFullString(list, '[', ']'); | |
| 1022 } | |
| 1023 } | |
| 1024 return ListBase; | |
| 1025 }); | |
| 1026 let ListBase = ListBase$(dart.dynamic); | |
| 1027 let _filter = Symbol('_filter'); | 1273 let _filter = Symbol('_filter'); |
| 1028 let ListMixin$ = dart.generic(function(E) { | 1274 let ListMixin$ = dart.generic(function(E) { |
| 1029 class ListMixin extends core.Object { | 1275 class ListMixin extends core.Object { |
| 1030 get iterator() { | 1276 get iterator() { |
| 1031 return new _internal.ListIterator(this); | 1277 return new _internal.ListIterator(this); |
| 1032 } | 1278 } |
| 1033 elementAt(index) { | 1279 elementAt(index) { |
| 1034 return this.get(index); | 1280 return this.get(index); |
| 1035 } | 1281 } |
| 1036 forEach(action) { | 1282 forEach(action) { |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 get reversed() { | 1714 get reversed() { |
| 1469 return new _internal.ReversedListIterable(this); | 1715 return new _internal.ReversedListIterable(this); |
| 1470 } | 1716 } |
| 1471 toString() { | 1717 toString() { |
| 1472 return IterableBase.iterableToFullString(this, '[', ']'); | 1718 return IterableBase.iterableToFullString(this, '[', ']'); |
| 1473 } | 1719 } |
| 1474 } | 1720 } |
| 1475 return ListMixin; | 1721 return ListMixin; |
| 1476 }); | 1722 }); |
| 1477 let ListMixin = ListMixin$(dart.dynamic); | 1723 let ListMixin = ListMixin$(dart.dynamic); |
| 1478 let MapBase$ = dart.generic(function(K, V) { | 1724 let ListBase$ = dart.generic(function(E) { |
| 1479 class MapBase extends dart.mixin(MapMixin$(K, V)) { | 1725 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { |
| 1726 static listToString(list) { |
| 1727 return IterableBase.iterableToFullString(list, '[', ']'); |
| 1728 } |
| 1480 } | 1729 } |
| 1481 return MapBase; | 1730 return ListBase; |
| 1482 }); | 1731 }); |
| 1483 let MapBase = MapBase$(dart.dynamic, dart.dynamic); | 1732 let ListBase = ListBase$(dart.dynamic); |
| 1484 let MapMixin$ = dart.generic(function(K, V) { | 1733 let MapMixin$ = dart.generic(function(K, V) { |
| 1485 class MapMixin extends core.Object { | 1734 class MapMixin extends core.Object { |
| 1486 forEach(action) { | 1735 forEach(action) { |
| 1487 for (let key of this.keys) { | 1736 for (let key of this.keys) { |
| 1488 action(key, this.get(key)); | 1737 action(key, this.get(key)); |
| 1489 } | 1738 } |
| 1490 } | 1739 } |
| 1491 addAll(other) { | 1740 addAll(other) { |
| 1492 for (let key of other.keys) { | 1741 for (let key of other.keys) { |
| 1493 this.set(key, other.get(key)); | 1742 this.set(key, other.get(key)); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1521 get values() { | 1770 get values() { |
| 1522 return new _MapBaseValueIterable(this); | 1771 return new _MapBaseValueIterable(this); |
| 1523 } | 1772 } |
| 1524 toString() { | 1773 toString() { |
| 1525 return Maps.mapToString(this); | 1774 return Maps.mapToString(this); |
| 1526 } | 1775 } |
| 1527 } | 1776 } |
| 1528 return MapMixin; | 1777 return MapMixin; |
| 1529 }); | 1778 }); |
| 1530 let MapMixin = MapMixin$(dart.dynamic, dart.dynamic); | 1779 let MapMixin = MapMixin$(dart.dynamic, dart.dynamic); |
| 1780 let MapBase$ = dart.generic(function(K, V) { |
| 1781 class MapBase extends dart.mixin(MapMixin$(K, V)) { |
| 1782 } |
| 1783 return MapBase; |
| 1784 }); |
| 1785 let MapBase = MapBase$(dart.dynamic, dart.dynamic); |
| 1786 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { |
| 1787 class _UnmodifiableMapMixin extends core.Object { |
| 1788 set(key, value) { |
| 1789 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
| 1790 } |
| 1791 addAll(other) { |
| 1792 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
| 1793 } |
| 1794 clear() { |
| 1795 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
| 1796 } |
| 1797 remove(key) { |
| 1798 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
| 1799 } |
| 1800 putIfAbsent(key, ifAbsent) { |
| 1801 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
| 1802 } |
| 1803 } |
| 1804 return _UnmodifiableMapMixin; |
| 1805 }); |
| 1806 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(dart.dynamic, dart.dynamic)
; |
| 1531 let UnmodifiableMapBase$ = dart.generic(function(K, V) { | 1807 let UnmodifiableMapBase$ = dart.generic(function(K, V) { |
| 1532 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { | 1808 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { |
| 1533 } | 1809 } |
| 1534 return UnmodifiableMapBase; | 1810 return UnmodifiableMapBase; |
| 1535 }); | 1811 }); |
| 1536 let UnmodifiableMapBase = UnmodifiableMapBase$(dart.dynamic, dart.dynamic); | 1812 let UnmodifiableMapBase = UnmodifiableMapBase$(dart.dynamic, dart.dynamic); |
| 1537 let _map = Symbol('_map'); | 1813 let _map = Symbol('_map'); |
| 1538 let _MapBaseValueIterable$ = dart.generic(function(V) { | 1814 let _MapBaseValueIterable$ = dart.generic(function(V) { |
| 1539 class _MapBaseValueIterable extends IterableBase$(V) { | 1815 class _MapBaseValueIterable extends IterableBase$(V) { |
| 1540 _MapBaseValueIterable($_map) { | 1816 _MapBaseValueIterable($_map) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 this[_current] = null; | 1858 this[_current] = null; |
| 1583 return false; | 1859 return false; |
| 1584 } | 1860 } |
| 1585 get current() { | 1861 get current() { |
| 1586 return this[_current]; | 1862 return this[_current]; |
| 1587 } | 1863 } |
| 1588 } | 1864 } |
| 1589 return _MapBaseValueIterator; | 1865 return _MapBaseValueIterator; |
| 1590 }); | 1866 }); |
| 1591 let _MapBaseValueIterator = _MapBaseValueIterator$(dart.dynamic); | 1867 let _MapBaseValueIterator = _MapBaseValueIterator$(dart.dynamic); |
| 1592 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { | |
| 1593 class _UnmodifiableMapMixin extends core.Object { | |
| 1594 set(key, value) { | |
| 1595 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 1596 } | |
| 1597 addAll(other) { | |
| 1598 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 1599 } | |
| 1600 clear() { | |
| 1601 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 1602 } | |
| 1603 remove(key) { | |
| 1604 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 1605 } | |
| 1606 putIfAbsent(key, ifAbsent) { | |
| 1607 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 1608 } | |
| 1609 } | |
| 1610 return _UnmodifiableMapMixin; | |
| 1611 }); | |
| 1612 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(dart.dynamic, dart.dynamic)
; | |
| 1613 let MapView$ = dart.generic(function(K, V) { | 1868 let MapView$ = dart.generic(function(K, V) { |
| 1614 class MapView extends core.Object { | 1869 class MapView extends core.Object { |
| 1615 MapView(map) { | 1870 MapView(map) { |
| 1616 this[_map] = map; | 1871 this[_map] = map; |
| 1617 } | 1872 } |
| 1618 get(key) { | 1873 get(key) { |
| 1619 return this[_map].get(key); | 1874 return this[_map].get(key); |
| 1620 } | 1875 } |
| 1621 set(key, value) { | 1876 set(key, value) { |
| 1622 this[_map].set(key, value); | 1877 this[_map].set(key, value); |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2318 return false; | 2573 return false; |
| 2319 } | 2574 } |
| 2320 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E); | 2575 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E); |
| 2321 this[_position] = dart.notNull(this[_position]) + 1 & dart.notNull(this[
_queue][_table].length) - 1; | 2576 this[_position] = dart.notNull(this[_position]) + 1 & dart.notNull(this[
_queue][_table].length) - 1; |
| 2322 return true; | 2577 return true; |
| 2323 } | 2578 } |
| 2324 } | 2579 } |
| 2325 return _ListQueueIterator; | 2580 return _ListQueueIterator; |
| 2326 }); | 2581 }); |
| 2327 let _ListQueueIterator = _ListQueueIterator$(dart.dynamic); | 2582 let _ListQueueIterator = _ListQueueIterator$(dart.dynamic); |
| 2328 let SetMixin$ = dart.generic(function(E) { | |
| 2329 class SetMixin extends core.Object { | |
| 2330 get isEmpty() { | |
| 2331 return this.length === 0; | |
| 2332 } | |
| 2333 get isNotEmpty() { | |
| 2334 return this.length !== 0; | |
| 2335 } | |
| 2336 clear() { | |
| 2337 this.removeAll(this.toList()); | |
| 2338 } | |
| 2339 addAll(elements) { | |
| 2340 for (let element of elements) | |
| 2341 this.add(element); | |
| 2342 } | |
| 2343 removeAll(elements) { | |
| 2344 for (let element of elements) | |
| 2345 this.remove(element); | |
| 2346 } | |
| 2347 retainAll(elements) { | |
| 2348 let toRemove = this.toSet(); | |
| 2349 for (let o of elements) { | |
| 2350 toRemove.remove(o); | |
| 2351 } | |
| 2352 this.removeAll(toRemove); | |
| 2353 } | |
| 2354 removeWhere(test) { | |
| 2355 let toRemove = new List.from([]); | |
| 2356 for (let element of this) { | |
| 2357 if (test(element)) | |
| 2358 toRemove.add(element); | |
| 2359 } | |
| 2360 this.removeAll(dart.as(toRemove, core.Iterable$(core.Object))); | |
| 2361 } | |
| 2362 retainWhere(test) { | |
| 2363 let toRemove = new List.from([]); | |
| 2364 for (let element of this) { | |
| 2365 if (!dart.notNull(test(element))) | |
| 2366 toRemove.add(element); | |
| 2367 } | |
| 2368 this.removeAll(dart.as(toRemove, core.Iterable$(core.Object))); | |
| 2369 } | |
| 2370 containsAll(other) { | |
| 2371 for (let o of other) { | |
| 2372 if (!dart.notNull(this.contains(o))) | |
| 2373 return false; | |
| 2374 } | |
| 2375 return true; | |
| 2376 } | |
| 2377 union(other) { | |
| 2378 return ((_) => { | |
| 2379 _.addAll(other); | |
| 2380 return _; | |
| 2381 }).bind(this)(this.toSet()); | |
| 2382 } | |
| 2383 intersection(other) { | |
| 2384 let result = this.toSet(); | |
| 2385 for (let element of this) { | |
| 2386 if (!dart.notNull(other.contains(element))) | |
| 2387 result.remove(element); | |
| 2388 } | |
| 2389 return result; | |
| 2390 } | |
| 2391 difference(other) { | |
| 2392 let result = this.toSet(); | |
| 2393 for (let element of this) { | |
| 2394 if (other.contains(element)) | |
| 2395 result.remove(element); | |
| 2396 } | |
| 2397 return result; | |
| 2398 } | |
| 2399 toList(opt$) { | |
| 2400 let growable = opt$.growable === void 0 ? true : opt$.growable; | |
| 2401 let result = growable ? ((_) => { | |
| 2402 _.length = this.length; | |
| 2403 return _; | |
| 2404 }).bind(this)(new core.List()) : new core.List(this.length); | |
| 2405 let i = 0; | |
| 2406 for (let element of this) | |
| 2407 result.set((($tmp) => i = dart.notNull($tmp) + 1, $tmp)(i), element); | |
| 2408 return result; | |
| 2409 } | |
| 2410 map(f) { | |
| 2411 return new _internal.EfficientLengthMappedIterable(this, f); | |
| 2412 } | |
| 2413 get single() { | |
| 2414 if (dart.notNull(this.length) > 1) | |
| 2415 throw _internal.IterableElementError.tooMany(); | |
| 2416 let it = this.iterator; | |
| 2417 if (!dart.notNull(it.moveNext())) | |
| 2418 throw _internal.IterableElementError.noElement(); | |
| 2419 let result = dart.as(it.current, E); | |
| 2420 return result; | |
| 2421 } | |
| 2422 toString() { | |
| 2423 return IterableBase.iterableToFullString(this, '{', '}'); | |
| 2424 } | |
| 2425 where(f) { | |
| 2426 return new _internal.WhereIterable(this, f); | |
| 2427 } | |
| 2428 expand(f) { | |
| 2429 return new _internal.ExpandIterable(this, f); | |
| 2430 } | |
| 2431 forEach(f) { | |
| 2432 for (let element of this) | |
| 2433 f(element); | |
| 2434 } | |
| 2435 reduce(combine) { | |
| 2436 let iterator = this.iterator; | |
| 2437 if (!dart.notNull(iterator.moveNext())) { | |
| 2438 throw _internal.IterableElementError.noElement(); | |
| 2439 } | |
| 2440 let value = iterator.current; | |
| 2441 while (iterator.moveNext()) { | |
| 2442 value = combine(value, iterator.current); | |
| 2443 } | |
| 2444 return value; | |
| 2445 } | |
| 2446 fold(initialValue, combine) { | |
| 2447 let value = initialValue; | |
| 2448 for (let element of this) | |
| 2449 value = combine(value, element); | |
| 2450 return value; | |
| 2451 } | |
| 2452 every(f) { | |
| 2453 for (let element of this) { | |
| 2454 if (!dart.notNull(f(element))) | |
| 2455 return false; | |
| 2456 } | |
| 2457 return true; | |
| 2458 } | |
| 2459 join(separator) { | |
| 2460 if (separator === void 0) | |
| 2461 separator = ""; | |
| 2462 let iterator = this.iterator; | |
| 2463 if (!dart.notNull(iterator.moveNext())) | |
| 2464 return ""; | |
| 2465 let buffer = new core.StringBuffer(); | |
| 2466 if (dart.notNull(separator === null) || dart.notNull(dart.equals(separat
or, ""))) { | |
| 2467 do { | |
| 2468 buffer.write(`${iterator.current}`); | |
| 2469 } while (iterator.moveNext()); | |
| 2470 } else { | |
| 2471 buffer.write(`${iterator.current}`); | |
| 2472 while (iterator.moveNext()) { | |
| 2473 buffer.write(separator); | |
| 2474 buffer.write(`${iterator.current}`); | |
| 2475 } | |
| 2476 } | |
| 2477 return buffer.toString(); | |
| 2478 } | |
| 2479 any(test) { | |
| 2480 for (let element of this) { | |
| 2481 if (test(element)) | |
| 2482 return true; | |
| 2483 } | |
| 2484 return false; | |
| 2485 } | |
| 2486 take(n) { | |
| 2487 return new _internal.TakeIterable(this, n); | |
| 2488 } | |
| 2489 takeWhile(test) { | |
| 2490 return new _internal.TakeWhileIterable(this, test); | |
| 2491 } | |
| 2492 skip(n) { | |
| 2493 return new _internal.SkipIterable(this, n); | |
| 2494 } | |
| 2495 skipWhile(test) { | |
| 2496 return new _internal.SkipWhileIterable(this, test); | |
| 2497 } | |
| 2498 get first() { | |
| 2499 let it = this.iterator; | |
| 2500 if (!dart.notNull(it.moveNext())) { | |
| 2501 throw _internal.IterableElementError.noElement(); | |
| 2502 } | |
| 2503 return dart.as(it.current, E); | |
| 2504 } | |
| 2505 get last() { | |
| 2506 let it = this.iterator; | |
| 2507 if (!dart.notNull(it.moveNext())) { | |
| 2508 throw _internal.IterableElementError.noElement(); | |
| 2509 } | |
| 2510 let result = null; | |
| 2511 do { | |
| 2512 result = dart.as(it.current, E); | |
| 2513 } while (it.moveNext()); | |
| 2514 return result; | |
| 2515 } | |
| 2516 firstWhere(test, opt$) { | |
| 2517 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; | |
| 2518 for (let element of this) { | |
| 2519 if (test(element)) | |
| 2520 return element; | |
| 2521 } | |
| 2522 if (orElse !== null) | |
| 2523 return orElse(); | |
| 2524 throw _internal.IterableElementError.noElement(); | |
| 2525 } | |
| 2526 lastWhere(test, opt$) { | |
| 2527 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; | |
| 2528 let result = null; | |
| 2529 let foundMatching = false; | |
| 2530 for (let element of this) { | |
| 2531 if (test(element)) { | |
| 2532 result = element; | |
| 2533 foundMatching = true; | |
| 2534 } | |
| 2535 } | |
| 2536 if (foundMatching) | |
| 2537 return result; | |
| 2538 if (orElse !== null) | |
| 2539 return orElse(); | |
| 2540 throw _internal.IterableElementError.noElement(); | |
| 2541 } | |
| 2542 singleWhere(test) { | |
| 2543 let result = null; | |
| 2544 let foundMatching = false; | |
| 2545 for (let element of this) { | |
| 2546 if (test(element)) { | |
| 2547 if (foundMatching) { | |
| 2548 throw _internal.IterableElementError.tooMany(); | |
| 2549 } | |
| 2550 result = element; | |
| 2551 foundMatching = true; | |
| 2552 } | |
| 2553 } | |
| 2554 if (foundMatching) | |
| 2555 return result; | |
| 2556 throw _internal.IterableElementError.noElement(); | |
| 2557 } | |
| 2558 elementAt(index) { | |
| 2559 if (!(typeof index == number)) | |
| 2560 throw new core.ArgumentError.notNull("index"); | |
| 2561 core.RangeError.checkNotNegative(index, "index"); | |
| 2562 let elementIndex = 0; | |
| 2563 for (let element of this) { | |
| 2564 if (index === elementIndex) | |
| 2565 return element; | |
| 2566 elementIndex = dart.notNull(elementIndex) + 1; | |
| 2567 } | |
| 2568 throw new core.RangeError.index(index, this, "index", null, elementIndex
); | |
| 2569 } | |
| 2570 } | |
| 2571 return SetMixin; | |
| 2572 }); | |
| 2573 let SetMixin = SetMixin$(dart.dynamic); | |
| 2574 let SetBase$ = dart.generic(function(E) { | |
| 2575 class SetBase extends SetMixin$(E) { | |
| 2576 static setToString(set) { | |
| 2577 return IterableBase.iterableToFullString(set, '{', '}'); | |
| 2578 } | |
| 2579 } | |
| 2580 return SetBase; | |
| 2581 }); | |
| 2582 let SetBase = SetBase$(dart.dynamic); | |
| 2583 let _SplayTreeNode$ = dart.generic(function(K) { | 2583 let _SplayTreeNode$ = dart.generic(function(K) { |
| 2584 class _SplayTreeNode extends core.Object { | 2584 class _SplayTreeNode extends core.Object { |
| 2585 _SplayTreeNode(key) { | 2585 _SplayTreeNode(key) { |
| 2586 this.key = key; | 2586 this.key = key; |
| 2587 this.left = null; | 2587 this.left = null; |
| 2588 this.right = null; | 2588 this.right = null; |
| 2589 } | 2589 } |
| 2590 } | 2590 } |
| 2591 return _SplayTreeNode; | 2591 return _SplayTreeNode; |
| 2592 }); | 2592 }); |
| (...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4828 } | 4828 } |
| 4829 } | 4829 } |
| 4830 return LinkedHashSetIterator; | 4830 return LinkedHashSetIterator; |
| 4831 }); | 4831 }); |
| 4832 let LinkedHashSetIterator = LinkedHashSetIterator$(dart.dynamic); | 4832 let LinkedHashSetIterator = LinkedHashSetIterator$(dart.dynamic); |
| 4833 // Exports: | 4833 // Exports: |
| 4834 exports.UnmodifiableListView = UnmodifiableListView; | 4834 exports.UnmodifiableListView = UnmodifiableListView; |
| 4835 exports.UnmodifiableListView$ = UnmodifiableListView$; | 4835 exports.UnmodifiableListView$ = UnmodifiableListView$; |
| 4836 exports.HashMap = HashMap; | 4836 exports.HashMap = HashMap; |
| 4837 exports.HashMap$ = HashMap$; | 4837 exports.HashMap$ = HashMap$; |
| 4838 exports.SetBase = SetBase; |
| 4839 exports.SetBase$ = SetBase$; |
| 4840 exports.SetMixin = SetMixin; |
| 4841 exports.SetMixin$ = SetMixin$; |
| 4838 exports.HashSet = HashSet; | 4842 exports.HashSet = HashSet; |
| 4839 exports.HashSet$ = HashSet$; | 4843 exports.HashSet$ = HashSet$; |
| 4840 exports.IterableMixin = IterableMixin; | 4844 exports.IterableMixin = IterableMixin; |
| 4841 exports.IterableMixin$ = IterableMixin$; | 4845 exports.IterableMixin$ = IterableMixin$; |
| 4842 exports.IterableBase = IterableBase; | 4846 exports.IterableBase = IterableBase; |
| 4843 exports.IterableBase$ = IterableBase$; | 4847 exports.IterableBase$ = IterableBase$; |
| 4844 exports.HasNextIterator = HasNextIterator; | 4848 exports.HasNextIterator = HasNextIterator; |
| 4845 exports.HasNextIterator$ = HasNextIterator$; | 4849 exports.HasNextIterator$ = HasNextIterator$; |
| 4846 exports.LinkedHashMap = LinkedHashMap; | 4850 exports.LinkedHashMap = LinkedHashMap; |
| 4847 exports.LinkedHashMap$ = LinkedHashMap$; | 4851 exports.LinkedHashMap$ = LinkedHashMap$; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4867 exports.UnmodifiableMapView$ = UnmodifiableMapView$; | 4871 exports.UnmodifiableMapView$ = UnmodifiableMapView$; |
| 4868 exports.Maps = Maps; | 4872 exports.Maps = Maps; |
| 4869 exports.Queue = Queue; | 4873 exports.Queue = Queue; |
| 4870 exports.Queue$ = Queue$; | 4874 exports.Queue$ = Queue$; |
| 4871 exports.DoubleLinkedQueueEntry = DoubleLinkedQueueEntry; | 4875 exports.DoubleLinkedQueueEntry = DoubleLinkedQueueEntry; |
| 4872 exports.DoubleLinkedQueueEntry$ = DoubleLinkedQueueEntry$; | 4876 exports.DoubleLinkedQueueEntry$ = DoubleLinkedQueueEntry$; |
| 4873 exports.DoubleLinkedQueue = DoubleLinkedQueue; | 4877 exports.DoubleLinkedQueue = DoubleLinkedQueue; |
| 4874 exports.DoubleLinkedQueue$ = DoubleLinkedQueue$; | 4878 exports.DoubleLinkedQueue$ = DoubleLinkedQueue$; |
| 4875 exports.ListQueue = ListQueue; | 4879 exports.ListQueue = ListQueue; |
| 4876 exports.ListQueue$ = ListQueue$; | 4880 exports.ListQueue$ = ListQueue$; |
| 4877 exports.SetMixin = SetMixin; | |
| 4878 exports.SetMixin$ = SetMixin$; | |
| 4879 exports.SetBase = SetBase; | |
| 4880 exports.SetBase$ = SetBase$; | |
| 4881 exports.SplayTreeMap = SplayTreeMap; | 4881 exports.SplayTreeMap = SplayTreeMap; |
| 4882 exports.SplayTreeMap$ = SplayTreeMap$; | 4882 exports.SplayTreeMap$ = SplayTreeMap$; |
| 4883 exports.SplayTreeSet = SplayTreeSet; | 4883 exports.SplayTreeSet = SplayTreeSet; |
| 4884 exports.SplayTreeSet$ = SplayTreeSet$; | 4884 exports.SplayTreeSet$ = SplayTreeSet$; |
| 4885 exports.HashMapKeyIterable = HashMapKeyIterable; | 4885 exports.HashMapKeyIterable = HashMapKeyIterable; |
| 4886 exports.HashMapKeyIterable$ = HashMapKeyIterable$; | 4886 exports.HashMapKeyIterable$ = HashMapKeyIterable$; |
| 4887 exports.HashMapKeyIterator = HashMapKeyIterator; | 4887 exports.HashMapKeyIterator = HashMapKeyIterator; |
| 4888 exports.HashMapKeyIterator$ = HashMapKeyIterator$; | 4888 exports.HashMapKeyIterator$ = HashMapKeyIterator$; |
| 4889 exports.LinkedHashMapCell = LinkedHashMapCell; | 4889 exports.LinkedHashMapCell = LinkedHashMapCell; |
| 4890 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; | 4890 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; |
| 4891 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; | 4891 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; |
| 4892 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; | 4892 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; |
| 4893 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; | 4893 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; |
| 4894 exports.HashSetIterator = HashSetIterator; | 4894 exports.HashSetIterator = HashSetIterator; |
| 4895 exports.HashSetIterator$ = HashSetIterator$; | 4895 exports.HashSetIterator$ = HashSetIterator$; |
| 4896 exports.LinkedHashSetCell = LinkedHashSetCell; | 4896 exports.LinkedHashSetCell = LinkedHashSetCell; |
| 4897 exports.LinkedHashSetIterator = LinkedHashSetIterator; | 4897 exports.LinkedHashSetIterator = LinkedHashSetIterator; |
| 4898 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; | 4898 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; |
| 4899 })(collection || (collection = {})); | 4899 })(collection || (collection = {})); |
| OLD | NEW |