| OLD | NEW |
| 1 var collection; | 1 var collection; |
| 2 (function(exports) { | 2 (function(exports) { |
| 3 'use strict'; | 3 'use strict'; |
| 4 let _length = Symbol('_length'); | |
| 5 let _strings = Symbol('_strings'); | |
| 6 let _nums = Symbol('_nums'); | |
| 7 let _rest = Symbol('_rest'); | |
| 8 let _keys = Symbol('_keys'); | |
| 9 let _containsKey = Symbol('_containsKey'); | |
| 10 let _getBucket = Symbol('_getBucket'); | |
| 11 let _findBucketIndex = Symbol('_findBucketIndex'); | |
| 12 let _computeKeys = Symbol('_computeKeys'); | |
| 13 let _get = Symbol('_get'); | |
| 14 let _addHashTableEntry = Symbol('_addHashTableEntry'); | |
| 15 let _set = Symbol('_set'); | |
| 16 let _computeHashCode = Symbol('_computeHashCode'); | |
| 17 let _removeHashTableEntry = Symbol('_removeHashTableEntry'); | |
| 18 let _remove = Symbol('_remove'); | |
| 19 let _isStringKey = Symbol('_isStringKey'); | |
| 20 let _isNumericKey = Symbol('_isNumericKey'); | |
| 21 let _hasTableEntry = Symbol('_hasTableEntry'); | |
| 22 let _getTableEntry = Symbol('_getTableEntry'); | |
| 23 let _setTableEntry = Symbol('_setTableEntry'); | |
| 24 let _deleteTableEntry = Symbol('_deleteTableEntry'); | |
| 25 let _newHashTable = Symbol('_newHashTable'); | |
| 26 let _HashMap$ = dart.generic(function(K, V) { | |
| 27 class _HashMap extends dart.Object { | |
| 28 _HashMap() { | |
| 29 this[_length] = 0; | |
| 30 this[_strings] = null; | |
| 31 this[_nums] = null; | |
| 32 this[_rest] = null; | |
| 33 this[_keys] = null; | |
| 34 } | |
| 35 get length() { | |
| 36 return this[_length]; | |
| 37 } | |
| 38 get isEmpty() { | |
| 39 return this[_length] === 0; | |
| 40 } | |
| 41 get isNotEmpty() { | |
| 42 return !dart.notNull(this.isEmpty); | |
| 43 } | |
| 44 get keys() { | |
| 45 return new HashMapKeyIterable(this); | |
| 46 } | |
| 47 get values() { | |
| 48 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); | |
| 49 } | |
| 50 containsKey(key) { | |
| 51 if (_isStringKey(key)) { | |
| 52 let strings = this[_strings]; | |
| 53 return strings === null ? false : _hasTableEntry(strings, key); | |
| 54 } else if (_isNumericKey(key)) { | |
| 55 let nums = this[_nums]; | |
| 56 return nums === null ? false : _hasTableEntry(nums, key); | |
| 57 } else { | |
| 58 return this[_containsKey](key); | |
| 59 } | |
| 60 } | |
| 61 [_containsKey](key) { | |
| 62 let rest = this[_rest]; | |
| 63 if (rest === null) | |
| 64 return false; | |
| 65 let bucket = this[_getBucket](rest, key); | |
| 66 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; | |
| 67 } | |
| 68 containsValue(value) { | |
| 69 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v
alue)).bind(this)); | |
| 70 } | |
| 71 addAll(other) { | |
| 72 other.forEach(((key, value) => { | |
| 73 this.set(key, value); | |
| 74 }).bind(this)); | |
| 75 } | |
| 76 get(key) { | |
| 77 if (_isStringKey(key)) { | |
| 78 let strings = this[_strings]; | |
| 79 return dart.as(strings === null ? null : _getTableEntry(strings, key),
V); | |
| 80 } else if (_isNumericKey(key)) { | |
| 81 let nums = this[_nums]; | |
| 82 return dart.as(nums === null ? null : _getTableEntry(nums, key), V); | |
| 83 } else { | |
| 84 return this[_get](key); | |
| 85 } | |
| 86 } | |
| 87 [_get](key) { | |
| 88 let rest = this[_rest]; | |
| 89 if (rest === null) | |
| 90 return null; | |
| 91 let bucket = this[_getBucket](rest, key); | |
| 92 let index = this[_findBucketIndex](bucket, key); | |
| 93 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde
x) + 1], V); | |
| 94 } | |
| 95 set(key, value) { | |
| 96 if (_isStringKey(key)) { | |
| 97 let strings = this[_strings]; | |
| 98 if (strings === null) | |
| 99 this[_strings] = strings = _newHashTable(); | |
| 100 this[_addHashTableEntry](strings, key, value); | |
| 101 } else if (_isNumericKey(key)) { | |
| 102 let nums = this[_nums]; | |
| 103 if (nums === null) | |
| 104 this[_nums] = nums = _newHashTable(); | |
| 105 this[_addHashTableEntry](nums, key, value); | |
| 106 } else { | |
| 107 this[_set](key, value); | |
| 108 } | |
| 109 } | |
| 110 [_set](key, value) { | |
| 111 let rest = this[_rest]; | |
| 112 if (rest === null) | |
| 113 this[_rest] = rest = _newHashTable(); | |
| 114 let hash = this[_computeHashCode](key); | |
| 115 let bucket = rest[hash]; | |
| 116 if (bucket === null) { | |
| 117 _setTableEntry(rest, hash, [key, value]); | |
| 118 this[_length] = dart.notNull(this[_length]) + 1; | |
| 119 this[_keys] = null; | |
| 120 } else { | |
| 121 let index = this[_findBucketIndex](bucket, key); | |
| 122 if (dart.notNull(index) >= 0) { | |
| 123 bucket[dart.notNull(index) + 1] = value; | |
| 124 } else { | |
| 125 bucket.push(key, value); | |
| 126 this[_length] = dart.notNull(this[_length]) + 1; | |
| 127 this[_keys] = null; | |
| 128 } | |
| 129 } | |
| 130 } | |
| 131 putIfAbsent(key, ifAbsent) { | |
| 132 if (this.containsKey(key)) | |
| 133 return this.get(key); | |
| 134 let value = ifAbsent(); | |
| 135 this.set(key, value); | |
| 136 return value; | |
| 137 } | |
| 138 remove(key) { | |
| 139 if (_isStringKey(key)) { | |
| 140 return this[_removeHashTableEntry](this[_strings], key); | |
| 141 } else if (_isNumericKey(key)) { | |
| 142 return this[_removeHashTableEntry](this[_nums], key); | |
| 143 } else { | |
| 144 return this[_remove](key); | |
| 145 } | |
| 146 } | |
| 147 [_remove](key) { | |
| 148 let rest = this[_rest]; | |
| 149 if (rest === null) | |
| 150 return null; | |
| 151 let bucket = this[_getBucket](rest, key); | |
| 152 let index = this[_findBucketIndex](bucket, key); | |
| 153 if (dart.notNull(index) < 0) | |
| 154 return null; | |
| 155 this[_length] = dart.notNull(this[_length]) - 1; | |
| 156 this[_keys] = null; | |
| 157 return dart.as(bucket.splice(index, 2)[1], V); | |
| 158 } | |
| 159 clear() { | |
| 160 if (dart.notNull(this[_length]) > 0) { | |
| 161 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; | |
| 162 this[_length] = 0; | |
| 163 } | |
| 164 } | |
| 165 forEach(action) { | |
| 166 let keys = this[_computeKeys](); | |
| 167 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len
gth); i = dart.notNull(i) + 1) { | |
| 168 let key = keys[i]; | |
| 169 action(dart.as(key, K), this.get(key)); | |
| 170 if (keys !== this[_keys]) { | |
| 171 throw new core.ConcurrentModificationError(this); | |
| 172 } | |
| 173 } | |
| 174 } | |
| 175 [_computeKeys]() { | |
| 176 if (this[_keys] !== null) | |
| 177 return this[_keys]; | |
| 178 let result = new core.List(this[_length]); | |
| 179 let index = 0; | |
| 180 let strings = this[_strings]; | |
| 181 if (strings !== null) { | |
| 182 let names = Object.getOwnPropertyNames(strings); | |
| 183 let entries = names.length; | |
| 184 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { | |
| 185 let key = names[i]; | |
| 186 result[index] = key; | |
| 187 index = dart.notNull(index) + 1; | |
| 188 } | |
| 189 } | |
| 190 let nums = this[_nums]; | |
| 191 if (nums !== null) { | |
| 192 let names = Object.getOwnPropertyNames(nums); | |
| 193 let entries = names.length; | |
| 194 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { | |
| 195 let key = +names[i]; | |
| 196 result[index] = key; | |
| 197 index = dart.notNull(index) + 1; | |
| 198 } | |
| 199 } | |
| 200 let rest = this[_rest]; | |
| 201 if (rest !== null) { | |
| 202 let names = Object.getOwnPropertyNames(rest); | |
| 203 let entries = names.length; | |
| 204 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { | |
| 205 let key = names[i]; | |
| 206 let bucket = rest[key]; | |
| 207 let length = bucket.length; | |
| 208 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { | |
| 209 let key = bucket[i]; | |
| 210 result[index] = key; | |
| 211 index = dart.notNull(index) + 1; | |
| 212 } | |
| 213 } | |
| 214 } | |
| 215 dart.assert(index === this[_length]); | |
| 216 return this[_keys] = result; | |
| 217 } | |
| 218 [_addHashTableEntry](table, key, value) { | |
| 219 if (!dart.notNull(_hasTableEntry(table, key))) { | |
| 220 this[_length] = dart.notNull(this[_length]) + 1; | |
| 221 this[_keys] = null; | |
| 222 } | |
| 223 _setTableEntry(table, key, value); | |
| 224 } | |
| 225 [_removeHashTableEntry](table, key) { | |
| 226 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k
ey))) { | |
| 227 let value = dart.as(_getTableEntry(table, key), V); | |
| 228 _deleteTableEntry(table, key); | |
| 229 this[_length] = dart.notNull(this[_length]) - 1; | |
| 230 this[_keys] = null; | |
| 231 return value; | |
| 232 } else { | |
| 233 return null; | |
| 234 } | |
| 235 } | |
| 236 static [_isStringKey](key) { | |
| 237 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); | |
| 238 } | |
| 239 static [_isNumericKey](key) { | |
| 240 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key
; | |
| 241 } | |
| 242 [_computeHashCode](key) { | |
| 243 return dart.dload(key, 'hashCode') & 0x3ffffff; | |
| 244 } | |
| 245 static [_hasTableEntry](table, key) { | |
| 246 let entry = table[key]; | |
| 247 return entry !== null; | |
| 248 } | |
| 249 static [_getTableEntry](table, key) { | |
| 250 let entry = table[key]; | |
| 251 return entry === table ? null : entry; | |
| 252 } | |
| 253 static [_setTableEntry](table, key, value) { | |
| 254 if (value === null) { | |
| 255 table[key] = table; | |
| 256 } else { | |
| 257 table[key] = value; | |
| 258 } | |
| 259 } | |
| 260 static [_deleteTableEntry](table, key) { | |
| 261 delete table[key]; | |
| 262 } | |
| 263 [_getBucket](table, key) { | |
| 264 let hash = this[_computeHashCode](key); | |
| 265 return dart.as(table[hash], core.List); | |
| 266 } | |
| 267 [_findBucketIndex](bucket, key) { | |
| 268 if (bucket === null) | |
| 269 return -1; | |
| 270 let length = bucket.length; | |
| 271 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { | |
| 272 if (dart.equals(bucket[i], key)) | |
| 273 return i; | |
| 274 } | |
| 275 return -1; | |
| 276 } | |
| 277 static [_newHashTable]() { | |
| 278 let table = Object.create(null); | |
| 279 let temporaryKey = '<non-identifier-key>'; | |
| 280 _setTableEntry(table, temporaryKey, table); | |
| 281 _deleteTableEntry(table, temporaryKey); | |
| 282 return table; | |
| 283 } | |
| 284 } | |
| 285 return _HashMap; | |
| 286 }); | |
| 287 let _HashMap = _HashMap$(dynamic, dynamic); | |
| 288 let _IdentityHashMap$ = dart.generic(function(K, V) { | |
| 289 class _IdentityHashMap extends _HashMap$(K, V) { | |
| 290 [_computeHashCode](key) { | |
| 291 return core.identityHashCode(key) & 0x3ffffff; | |
| 292 } | |
| 293 [_findBucketIndex](bucket, key) { | |
| 294 if (bucket === null) | |
| 295 return -1; | |
| 296 let length = bucket.length; | |
| 297 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { | |
| 298 if (core.identical(bucket[i], key)) | |
| 299 return i; | |
| 300 } | |
| 301 return -1; | |
| 302 } | |
| 303 } | |
| 304 return _IdentityHashMap; | |
| 305 }); | |
| 306 let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic); | |
| 307 let _equals = Symbol('_equals'); | |
| 308 let _hashCode = Symbol('_hashCode'); | |
| 309 let _validKey = Symbol('_validKey'); | |
| 310 let _CustomHashMap$ = dart.generic(function(K, V) { | |
| 311 class _CustomHashMap extends _HashMap$(K, V) { | |
| 312 _CustomHashMap($_equals, $_hashCode, validKey) { | |
| 313 this[_equals] = $_equals; | |
| 314 this[_hashCode] = $_hashCode; | |
| 315 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); | |
| 316 super._HashMap(); | |
| 317 } | |
| 318 get(key) { | |
| 319 if (!dart.notNull(this[_validKey](key))) | |
| 320 return null; | |
| 321 return super._get(key); | |
| 322 } | |
| 323 set(key, value) { | |
| 324 super._set(key, value); | |
| 325 } | |
| 326 containsKey(key) { | |
| 327 if (!dart.notNull(this[_validKey](key))) | |
| 328 return false; | |
| 329 return super._containsKey(key); | |
| 330 } | |
| 331 remove(key) { | |
| 332 if (!dart.notNull(this[_validKey](key))) | |
| 333 return null; | |
| 334 return super._remove(key); | |
| 335 } | |
| 336 [_computeHashCode](key) { | |
| 337 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; | |
| 338 } | |
| 339 [_findBucketIndex](bucket, key) { | |
| 340 if (bucket === null) | |
| 341 return -1; | |
| 342 let length = bucket.length; | |
| 343 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { | |
| 344 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K))) | |
| 345 return i; | |
| 346 } | |
| 347 return -1; | |
| 348 } | |
| 349 toString() { | |
| 350 return Maps.mapToString(this); | |
| 351 } | |
| 352 } | |
| 353 return _CustomHashMap; | |
| 354 }); | |
| 355 let _CustomHashMap = _CustomHashMap$(dynamic, dynamic); | |
| 356 let _map = Symbol('_map'); | |
| 357 let HashMapKeyIterable$ = dart.generic(function(E) { | |
| 358 class HashMapKeyIterable extends IterableBase$(E) { | |
| 359 HashMapKeyIterable($_map) { | |
| 360 this[_map] = $_map; | |
| 361 super.IterableBase(); | |
| 362 } | |
| 363 get length() { | |
| 364 return dart.as(dart.dload(this[_map], '_length'), core.int); | |
| 365 } | |
| 366 get isEmpty() { | |
| 367 return dart.equals(dart.dload(this[_map], '_length'), 0); | |
| 368 } | |
| 369 get iterator() { | |
| 370 return new HashMapKeyIterator(this[_map], dart.as(dart.dinvoke(this[_map
], '_computeKeys'), core.List)); | |
| 371 } | |
| 372 contains(element) { | |
| 373 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); | |
| 374 } | |
| 375 forEach(f) { | |
| 376 let keys = dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List); | |
| 377 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len
gth); i = dart.notNull(i) + 1) { | |
| 378 f(dart.as(keys[i], E)); | |
| 379 if (keys !== dart.dload(this[_map], '_keys')) { | |
| 380 throw new core.ConcurrentModificationError(this[_map]); | |
| 381 } | |
| 382 } | |
| 383 } | |
| 384 } | |
| 385 return HashMapKeyIterable; | |
| 386 }); | |
| 387 let HashMapKeyIterable = HashMapKeyIterable$(dynamic); | |
| 388 let _offset = Symbol('_offset'); | |
| 389 let _current = Symbol('_current'); | |
| 390 let HashMapKeyIterator$ = dart.generic(function(E) { | |
| 391 class HashMapKeyIterator extends dart.Object { | |
| 392 HashMapKeyIterator($_map, $_keys) { | |
| 393 this[_map] = $_map; | |
| 394 this[_keys] = $_keys; | |
| 395 this[_offset] = 0; | |
| 396 this[_current] = null; | |
| 397 } | |
| 398 get current() { | |
| 399 return this[_current]; | |
| 400 } | |
| 401 moveNext() { | |
| 402 let keys = this[_keys]; | |
| 403 let offset = this[_offset]; | |
| 404 if (keys !== dart.dload(this[_map], '_keys')) { | |
| 405 throw new core.ConcurrentModificationError(this[_map]); | |
| 406 } else if (dart.notNull(offset) >= keys.length) { | |
| 407 this[_current] = null; | |
| 408 return false; | |
| 409 } else { | |
| 410 this[_current] = dart.as(keys[offset], E); | |
| 411 this[_offset] = dart.notNull(offset) + 1; | |
| 412 return true; | |
| 413 } | |
| 414 } | |
| 415 } | |
| 416 return HashMapKeyIterator; | |
| 417 }); | |
| 418 let HashMapKeyIterator = HashMapKeyIterator$(dynamic); | |
| 419 let _first = Symbol('_first'); | |
| 420 let _last = Symbol('_last'); | |
| 421 let _modifications = Symbol('_modifications'); | |
| 422 let _value = Symbol('_value'); | |
| 423 let _newLinkedCell = Symbol('_newLinkedCell'); | |
| 424 let _unlinkCell = Symbol('_unlinkCell'); | |
| 425 let _modified = Symbol('_modified'); | |
| 426 let _key = Symbol('_key'); | |
| 427 let _next = Symbol('_next'); | |
| 428 let _previous = Symbol('_previous'); | |
| 429 let _LinkedHashMap$ = dart.generic(function(K, V) { | |
| 430 class _LinkedHashMap extends dart.Object { | |
| 431 _LinkedHashMap() { | |
| 432 this[_length] = 0; | |
| 433 this[_strings] = null; | |
| 434 this[_nums] = null; | |
| 435 this[_rest] = null; | |
| 436 this[_first] = null; | |
| 437 this[_last] = null; | |
| 438 this[_modifications] = 0; | |
| 439 } | |
| 440 get length() { | |
| 441 return this[_length]; | |
| 442 } | |
| 443 get isEmpty() { | |
| 444 return this[_length] === 0; | |
| 445 } | |
| 446 get isNotEmpty() { | |
| 447 return !dart.notNull(this.isEmpty); | |
| 448 } | |
| 449 get keys() { | |
| 450 return new LinkedHashMapKeyIterable(this); | |
| 451 } | |
| 452 get values() { | |
| 453 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); | |
| 454 } | |
| 455 containsKey(key) { | |
| 456 if (_isStringKey(key)) { | |
| 457 let strings = this[_strings]; | |
| 458 if (strings === null) | |
| 459 return false; | |
| 460 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); | |
| 461 return cell !== null; | |
| 462 } else if (_isNumericKey(key)) { | |
| 463 let nums = this[_nums]; | |
| 464 if (nums === null) | |
| 465 return false; | |
| 466 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); | |
| 467 return cell !== null; | |
| 468 } else { | |
| 469 return this[_containsKey](key); | |
| 470 } | |
| 471 } | |
| 472 [_containsKey](key) { | |
| 473 let rest = this[_rest]; | |
| 474 if (rest === null) | |
| 475 return false; | |
| 476 let bucket = this[_getBucket](rest, key); | |
| 477 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; | |
| 478 } | |
| 479 containsValue(value) { | |
| 480 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind
(this)); | |
| 481 } | |
| 482 addAll(other) { | |
| 483 other.forEach(((key, value) => { | |
| 484 this.set(key, value); | |
| 485 }).bind(this)); | |
| 486 } | |
| 487 get(key) { | |
| 488 if (_isStringKey(key)) { | |
| 489 let strings = this[_strings]; | |
| 490 if (strings === null) | |
| 491 return null; | |
| 492 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); | |
| 493 return dart.as(cell === null ? null : cell[_value], V); | |
| 494 } else if (_isNumericKey(key)) { | |
| 495 let nums = this[_nums]; | |
| 496 if (nums === null) | |
| 497 return null; | |
| 498 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); | |
| 499 return dart.as(cell === null ? null : cell[_value], V); | |
| 500 } else { | |
| 501 return this[_get](key); | |
| 502 } | |
| 503 } | |
| 504 [_get](key) { | |
| 505 let rest = this[_rest]; | |
| 506 if (rest === null) | |
| 507 return null; | |
| 508 let bucket = this[_getBucket](rest, key); | |
| 509 let index = this[_findBucketIndex](bucket, key); | |
| 510 if (dart.notNull(index) < 0) | |
| 511 return null; | |
| 512 let cell = dart.as(bucket[index], LinkedHashMapCell); | |
| 513 return dart.as(cell[_value], V); | |
| 514 } | |
| 515 set(key, value) { | |
| 516 if (_isStringKey(key)) { | |
| 517 let strings = this[_strings]; | |
| 518 if (strings === null) | |
| 519 this[_strings] = strings = _newHashTable(); | |
| 520 this[_addHashTableEntry](strings, key, value); | |
| 521 } else if (_isNumericKey(key)) { | |
| 522 let nums = this[_nums]; | |
| 523 if (nums === null) | |
| 524 this[_nums] = nums = _newHashTable(); | |
| 525 this[_addHashTableEntry](nums, key, value); | |
| 526 } else { | |
| 527 this[_set](key, value); | |
| 528 } | |
| 529 } | |
| 530 [_set](key, value) { | |
| 531 let rest = this[_rest]; | |
| 532 if (rest === null) | |
| 533 this[_rest] = rest = _newHashTable(); | |
| 534 let hash = this[_computeHashCode](key); | |
| 535 let bucket = rest[hash]; | |
| 536 if (bucket === null) { | |
| 537 let cell = this[_newLinkedCell](key, value); | |
| 538 _setTableEntry(rest, hash, [cell]); | |
| 539 } else { | |
| 540 let index = this[_findBucketIndex](bucket, key); | |
| 541 if (dart.notNull(index) >= 0) { | |
| 542 let cell = dart.as(bucket[index], LinkedHashMapCell); | |
| 543 cell[_value] = value; | |
| 544 } else { | |
| 545 let cell = this[_newLinkedCell](key, value); | |
| 546 bucket.push(cell); | |
| 547 } | |
| 548 } | |
| 549 } | |
| 550 putIfAbsent(key, ifAbsent) { | |
| 551 if (this.containsKey(key)) | |
| 552 return this.get(key); | |
| 553 let value = ifAbsent(); | |
| 554 this.set(key, value); | |
| 555 return value; | |
| 556 } | |
| 557 remove(key) { | |
| 558 if (_isStringKey(key)) { | |
| 559 return this[_removeHashTableEntry](this[_strings], key); | |
| 560 } else if (_isNumericKey(key)) { | |
| 561 return this[_removeHashTableEntry](this[_nums], key); | |
| 562 } else { | |
| 563 return this[_remove](key); | |
| 564 } | |
| 565 } | |
| 566 [_remove](key) { | |
| 567 let rest = this[_rest]; | |
| 568 if (rest === null) | |
| 569 return null; | |
| 570 let bucket = this[_getBucket](rest, key); | |
| 571 let index = this[_findBucketIndex](bucket, key); | |
| 572 if (dart.notNull(index) < 0) | |
| 573 return null; | |
| 574 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); | |
| 575 this[_unlinkCell](cell); | |
| 576 return dart.as(cell[_value], V); | |
| 577 } | |
| 578 clear() { | |
| 579 if (dart.notNull(this[_length]) > 0) { | |
| 580 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; | |
| 581 this[_length] = 0; | |
| 582 this[_modified](); | |
| 583 } | |
| 584 } | |
| 585 forEach(action) { | |
| 586 let cell = this[_first]; | |
| 587 let modifications = this[_modifications]; | |
| 588 while (cell !== null) { | |
| 589 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); | |
| 590 if (modifications !== this[_modifications]) { | |
| 591 throw new core.ConcurrentModificationError(this); | |
| 592 } | |
| 593 cell = cell[_next]; | |
| 594 } | |
| 595 } | |
| 596 [_addHashTableEntry](table, key, value) { | |
| 597 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); | |
| 598 if (cell === null) { | |
| 599 _setTableEntry(table, key, this[_newLinkedCell](key, value)); | |
| 600 } else { | |
| 601 cell[_value] = value; | |
| 602 } | |
| 603 } | |
| 604 [_removeHashTableEntry](table, key) { | |
| 605 if (table === null) | |
| 606 return null; | |
| 607 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); | |
| 608 if (cell === null) | |
| 609 return null; | |
| 610 this[_unlinkCell](cell); | |
| 611 _deleteTableEntry(table, key); | |
| 612 return dart.as(cell[_value], V); | |
| 613 } | |
| 614 [_modified]() { | |
| 615 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; | |
| 616 } | |
| 617 [_newLinkedCell](key, value) { | |
| 618 let cell = new LinkedHashMapCell(key, value); | |
| 619 if (this[_first] === null) { | |
| 620 this[_first] = this[_last] = cell; | |
| 621 } else { | |
| 622 let last = this[_last]; | |
| 623 cell[_previous] = last; | |
| 624 this[_last] = last[_next] = cell; | |
| 625 } | |
| 626 this[_length] = dart.notNull(this[_length]) + 1; | |
| 627 this[_modified](); | |
| 628 return cell; | |
| 629 } | |
| 630 [_unlinkCell](cell) { | |
| 631 let previous = cell[_previous]; | |
| 632 let next = cell[_next]; | |
| 633 if (previous === null) { | |
| 634 dart.assert(dart.equals(cell, this[_first])); | |
| 635 this[_first] = next; | |
| 636 } else { | |
| 637 previous[_next] = next; | |
| 638 } | |
| 639 if (next === null) { | |
| 640 dart.assert(dart.equals(cell, this[_last])); | |
| 641 this[_last] = previous; | |
| 642 } else { | |
| 643 next[_previous] = previous; | |
| 644 } | |
| 645 this[_length] = dart.notNull(this[_length]) - 1; | |
| 646 this[_modified](); | |
| 647 } | |
| 648 static [_isStringKey](key) { | |
| 649 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); | |
| 650 } | |
| 651 static [_isNumericKey](key) { | |
| 652 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key
; | |
| 653 } | |
| 654 [_computeHashCode](key) { | |
| 655 return dart.dload(key, 'hashCode') & 0x3ffffff; | |
| 656 } | |
| 657 static [_getTableEntry](table, key) { | |
| 658 return table[key]; | |
| 659 } | |
| 660 static [_setTableEntry](table, key, value) { | |
| 661 dart.assert(value !== null); | |
| 662 table[key] = value; | |
| 663 } | |
| 664 static [_deleteTableEntry](table, key) { | |
| 665 delete table[key]; | |
| 666 } | |
| 667 [_getBucket](table, key) { | |
| 668 let hash = this[_computeHashCode](key); | |
| 669 return dart.as(table[hash], core.List); | |
| 670 } | |
| 671 [_findBucketIndex](bucket, key) { | |
| 672 if (bucket === null) | |
| 673 return -1; | |
| 674 let length = bucket.length; | |
| 675 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 676 let cell = dart.as(bucket[i], LinkedHashMapCell); | |
| 677 if (dart.equals(cell[_key], key)) | |
| 678 return i; | |
| 679 } | |
| 680 return -1; | |
| 681 } | |
| 682 static [_newHashTable]() { | |
| 683 let table = Object.create(null); | |
| 684 let temporaryKey = '<non-identifier-key>'; | |
| 685 _setTableEntry(table, temporaryKey, table); | |
| 686 _deleteTableEntry(table, temporaryKey); | |
| 687 return table; | |
| 688 } | |
| 689 toString() { | |
| 690 return Maps.mapToString(this); | |
| 691 } | |
| 692 } | |
| 693 return _LinkedHashMap; | |
| 694 }); | |
| 695 let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic); | |
| 696 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { | |
| 697 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { | |
| 698 [_computeHashCode](key) { | |
| 699 return core.identityHashCode(key) & 0x3ffffff; | |
| 700 } | |
| 701 [_findBucketIndex](bucket, key) { | |
| 702 if (bucket === null) | |
| 703 return -1; | |
| 704 let length = bucket.length; | |
| 705 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 706 let cell = dart.as(bucket[i], LinkedHashMapCell); | |
| 707 if (core.identical(cell[_key], key)) | |
| 708 return i; | |
| 709 } | |
| 710 return -1; | |
| 711 } | |
| 712 } | |
| 713 return _LinkedIdentityHashMap; | |
| 714 }); | |
| 715 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic); | |
| 716 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { | |
| 717 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { | |
| 718 _LinkedCustomHashMap($_equals, $_hashCode, validKey) { | |
| 719 this[_equals] = $_equals; | |
| 720 this[_hashCode] = $_hashCode; | |
| 721 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); | |
| 722 super._LinkedHashMap(); | |
| 723 } | |
| 724 get(key) { | |
| 725 if (!dart.notNull(this[_validKey](key))) | |
| 726 return null; | |
| 727 return super._get(key); | |
| 728 } | |
| 729 set(key, value) { | |
| 730 super._set(key, value); | |
| 731 } | |
| 732 containsKey(key) { | |
| 733 if (!dart.notNull(this[_validKey](key))) | |
| 734 return false; | |
| 735 return super._containsKey(key); | |
| 736 } | |
| 737 remove(key) { | |
| 738 if (!dart.notNull(this[_validKey](key))) | |
| 739 return null; | |
| 740 return super._remove(key); | |
| 741 } | |
| 742 [_computeHashCode](key) { | |
| 743 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; | |
| 744 } | |
| 745 [_findBucketIndex](bucket, key) { | |
| 746 if (bucket === null) | |
| 747 return -1; | |
| 748 let length = bucket.length; | |
| 749 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 750 let cell = dart.as(bucket[i], LinkedHashMapCell); | |
| 751 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K))) | |
| 752 return i; | |
| 753 } | |
| 754 return -1; | |
| 755 } | |
| 756 } | |
| 757 return _LinkedCustomHashMap; | |
| 758 }); | |
| 759 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic); | |
| 760 class LinkedHashMapCell extends dart.Object { | |
| 761 LinkedHashMapCell($_key, $_value) { | |
| 762 this[_key] = $_key; | |
| 763 this[_value] = $_value; | |
| 764 this[_next] = null; | |
| 765 this[_previous] = null; | |
| 766 } | |
| 767 } | |
| 768 let LinkedHashMapKeyIterable$ = dart.generic(function(E) { | |
| 769 class LinkedHashMapKeyIterable extends IterableBase$(E) { | |
| 770 LinkedHashMapKeyIterable($_map) { | |
| 771 this[_map] = $_map; | |
| 772 super.IterableBase(); | |
| 773 } | |
| 774 get length() { | |
| 775 return dart.as(dart.dload(this[_map], '_length'), core.int); | |
| 776 } | |
| 777 get isEmpty() { | |
| 778 return dart.equals(dart.dload(this[_map], '_length'), 0); | |
| 779 } | |
| 780 get iterator() { | |
| 781 return new LinkedHashMapKeyIterator(this[_map], dart.as(dart.dload(this[
_map], '_modifications'), core.int)); | |
| 782 } | |
| 783 contains(element) { | |
| 784 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); | |
| 785 } | |
| 786 forEach(f) { | |
| 787 let cell = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell); | |
| 788 let modifications = dart.as(dart.dload(this[_map], '_modifications'), co
re.int); | |
| 789 while (cell !== null) { | |
| 790 f(dart.as(cell[_key], E)); | |
| 791 if (modifications !== dart.dload(this[_map], '_modifications')) { | |
| 792 throw new core.ConcurrentModificationError(this[_map]); | |
| 793 } | |
| 794 cell = cell[_next]; | |
| 795 } | |
| 796 } | |
| 797 } | |
| 798 return LinkedHashMapKeyIterable; | |
| 799 }); | |
| 800 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic); | |
| 801 let _cell = Symbol('_cell'); | |
| 802 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { | |
| 803 class LinkedHashMapKeyIterator extends dart.Object { | |
| 804 LinkedHashMapKeyIterator($_map, $_modifications) { | |
| 805 this[_map] = $_map; | |
| 806 this[_modifications] = $_modifications; | |
| 807 this[_cell] = null; | |
| 808 this[_current] = null; | |
| 809 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel
l); | |
| 810 } | |
| 811 get current() { | |
| 812 return this[_current]; | |
| 813 } | |
| 814 moveNext() { | |
| 815 if (this[_modifications] !== dart.dload(this[_map], '_modifications')) { | |
| 816 throw new core.ConcurrentModificationError(this[_map]); | |
| 817 } else if (this[_cell] === null) { | |
| 818 this[_current] = null; | |
| 819 return false; | |
| 820 } else { | |
| 821 this[_current] = dart.as(this[_cell][_key], E); | |
| 822 this[_cell] = this[_cell][_next]; | |
| 823 return true; | |
| 824 } | |
| 825 } | |
| 826 } | |
| 827 return LinkedHashMapKeyIterator; | |
| 828 }); | |
| 829 let LinkedHashMapKeyIterator = LinkedHashMapKeyIterator$(dynamic); | |
| 830 let _elements = Symbol('_elements'); | |
| 831 let _newSet = Symbol('_newSet'); | |
| 832 let _computeElements = Symbol('_computeElements'); | |
| 833 let _contains = Symbol('_contains'); | |
| 834 let _lookup = Symbol('_lookup'); | |
| 835 let _add = Symbol('_add'); | |
| 836 let _isStringElement = Symbol('_isStringElement'); | |
| 837 let _isNumericElement = Symbol('_isNumericElement'); | |
| 838 let _HashSet$ = dart.generic(function(E) { | |
| 839 class _HashSet extends _HashSetBase$(E) { | |
| 840 _HashSet() { | |
| 841 this[_length] = 0; | |
| 842 this[_strings] = null; | |
| 843 this[_nums] = null; | |
| 844 this[_rest] = null; | |
| 845 this[_elements] = null; | |
| 846 super._HashSetBase(); | |
| 847 } | |
| 848 [_newSet]() { | |
| 849 return new _HashSet(); | |
| 850 } | |
| 851 get iterator() { | |
| 852 return new HashSetIterator(this, this[_computeElements]()); | |
| 853 } | |
| 854 get length() { | |
| 855 return this[_length]; | |
| 856 } | |
| 857 get isEmpty() { | |
| 858 return this[_length] === 0; | |
| 859 } | |
| 860 get isNotEmpty() { | |
| 861 return !dart.notNull(this.isEmpty); | |
| 862 } | |
| 863 contains(object) { | |
| 864 if (_isStringElement(object)) { | |
| 865 let strings = this[_strings]; | |
| 866 return strings === null ? false : _hasTableEntry(strings, object); | |
| 867 } else if (_isNumericElement(object)) { | |
| 868 let nums = this[_nums]; | |
| 869 return nums === null ? false : _hasTableEntry(nums, object); | |
| 870 } else { | |
| 871 return this[_contains](object); | |
| 872 } | |
| 873 } | |
| 874 [_contains](object) { | |
| 875 let rest = this[_rest]; | |
| 876 if (rest === null) | |
| 877 return false; | |
| 878 let bucket = this[_getBucket](rest, object); | |
| 879 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0; | |
| 880 } | |
| 881 lookup(object) { | |
| 882 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { | |
| 883 return dart.as(this.contains(object) ? object : null, E); | |
| 884 } | |
| 885 return this[_lookup](object); | |
| 886 } | |
| 887 [_lookup](object) { | |
| 888 let rest = this[_rest]; | |
| 889 if (rest === null) | |
| 890 return null; | |
| 891 let bucket = this[_getBucket](rest, object); | |
| 892 let index = this[_findBucketIndex](bucket, object); | |
| 893 if (dart.notNull(index) < 0) | |
| 894 return null; | |
| 895 return dart.as(bucket.get(index), E); | |
| 896 } | |
| 897 add(element) { | |
| 898 if (_isStringElement(element)) { | |
| 899 let strings = this[_strings]; | |
| 900 if (strings === null) | |
| 901 this[_strings] = strings = _newHashTable(); | |
| 902 return this[_addHashTableEntry](strings, element); | |
| 903 } else if (_isNumericElement(element)) { | |
| 904 let nums = this[_nums]; | |
| 905 if (nums === null) | |
| 906 this[_nums] = nums = _newHashTable(); | |
| 907 return this[_addHashTableEntry](nums, element); | |
| 908 } else { | |
| 909 return this[_add](element); | |
| 910 } | |
| 911 } | |
| 912 [_add](element) { | |
| 913 let rest = this[_rest]; | |
| 914 if (rest === null) | |
| 915 this[_rest] = rest = _newHashTable(); | |
| 916 let hash = this[_computeHashCode](element); | |
| 917 let bucket = rest[hash]; | |
| 918 if (bucket === null) { | |
| 919 _setTableEntry(rest, hash, [element]); | |
| 920 } else { | |
| 921 let index = this[_findBucketIndex](bucket, element); | |
| 922 if (dart.notNull(index) >= 0) | |
| 923 return false; | |
| 924 bucket.push(element); | |
| 925 } | |
| 926 this[_length] = dart.notNull(this[_length]) + 1; | |
| 927 this[_elements] = null; | |
| 928 return true; | |
| 929 } | |
| 930 addAll(objects) { | |
| 931 for (let each of objects) { | |
| 932 this.add(each); | |
| 933 } | |
| 934 } | |
| 935 remove(object) { | |
| 936 if (_isStringElement(object)) { | |
| 937 return this[_removeHashTableEntry](this[_strings], object); | |
| 938 } else if (_isNumericElement(object)) { | |
| 939 return this[_removeHashTableEntry](this[_nums], object); | |
| 940 } else { | |
| 941 return this[_remove](object); | |
| 942 } | |
| 943 } | |
| 944 [_remove](object) { | |
| 945 let rest = this[_rest]; | |
| 946 if (rest === null) | |
| 947 return false; | |
| 948 let bucket = this[_getBucket](rest, object); | |
| 949 let index = this[_findBucketIndex](bucket, object); | |
| 950 if (dart.notNull(index) < 0) | |
| 951 return false; | |
| 952 this[_length] = dart.notNull(this[_length]) - 1; | |
| 953 this[_elements] = null; | |
| 954 bucket.splice(index, 1); | |
| 955 return true; | |
| 956 } | |
| 957 clear() { | |
| 958 if (dart.notNull(this[_length]) > 0) { | |
| 959 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null; | |
| 960 this[_length] = 0; | |
| 961 } | |
| 962 } | |
| 963 [_computeElements]() { | |
| 964 if (this[_elements] !== null) | |
| 965 return this[_elements]; | |
| 966 let result = new core.List(this[_length]); | |
| 967 let index = 0; | |
| 968 let strings = this[_strings]; | |
| 969 if (strings !== null) { | |
| 970 let names = Object.getOwnPropertyNames(strings); | |
| 971 let entries = names.length; | |
| 972 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { | |
| 973 let element = names[i]; | |
| 974 result[index] = element; | |
| 975 index = dart.notNull(index) + 1; | |
| 976 } | |
| 977 } | |
| 978 let nums = this[_nums]; | |
| 979 if (nums !== null) { | |
| 980 let names = Object.getOwnPropertyNames(nums); | |
| 981 let entries = names.length; | |
| 982 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { | |
| 983 let element = +names[i]; | |
| 984 result[index] = element; | |
| 985 index = dart.notNull(index) + 1; | |
| 986 } | |
| 987 } | |
| 988 let rest = this[_rest]; | |
| 989 if (rest !== null) { | |
| 990 let names = Object.getOwnPropertyNames(rest); | |
| 991 let entries = names.length; | |
| 992 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { | |
| 993 let entry = names[i]; | |
| 994 let bucket = rest[entry]; | |
| 995 let length = bucket.length; | |
| 996 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not
Null(i) + 1) { | |
| 997 result[index] = bucket[i]; | |
| 998 index = dart.notNull(index) + 1; | |
| 999 } | |
| 1000 } | |
| 1001 } | |
| 1002 dart.assert(index === this[_length]); | |
| 1003 return this[_elements] = result; | |
| 1004 } | |
| 1005 [_addHashTableEntry](table, element) { | |
| 1006 if (_hasTableEntry(table, element)) | |
| 1007 return false; | |
| 1008 _setTableEntry(table, element, 0); | |
| 1009 this[_length] = dart.notNull(this[_length]) + 1; | |
| 1010 this[_elements] = null; | |
| 1011 return true; | |
| 1012 } | |
| 1013 [_removeHashTableEntry](table, element) { | |
| 1014 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e
lement))) { | |
| 1015 _deleteTableEntry(table, element); | |
| 1016 this[_length] = dart.notNull(this[_length]) - 1; | |
| 1017 this[_elements] = null; | |
| 1018 return true; | |
| 1019 } else { | |
| 1020 return false; | |
| 1021 } | |
| 1022 } | |
| 1023 static [_isStringElement](element) { | |
| 1024 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); | |
| 1025 } | |
| 1026 static [_isNumericElement](element) { | |
| 1027 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff)
=== element; | |
| 1028 } | |
| 1029 [_computeHashCode](element) { | |
| 1030 return dart.dload(element, 'hashCode') & 0x3ffffff; | |
| 1031 } | |
| 1032 static [_hasTableEntry](table, key) { | |
| 1033 let entry = table[key]; | |
| 1034 return entry !== null; | |
| 1035 } | |
| 1036 static [_setTableEntry](table, key, value) { | |
| 1037 dart.assert(value !== null); | |
| 1038 table[key] = value; | |
| 1039 } | |
| 1040 static [_deleteTableEntry](table, key) { | |
| 1041 delete table[key]; | |
| 1042 } | |
| 1043 [_getBucket](table, element) { | |
| 1044 let hash = this[_computeHashCode](element); | |
| 1045 return dart.as(table[hash], core.List); | |
| 1046 } | |
| 1047 [_findBucketIndex](bucket, element) { | |
| 1048 if (bucket === null) | |
| 1049 return -1; | |
| 1050 let length = bucket.length; | |
| 1051 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 1052 if (dart.equals(bucket[i], element)) | |
| 1053 return i; | |
| 1054 } | |
| 1055 return -1; | |
| 1056 } | |
| 1057 static [_newHashTable]() { | |
| 1058 let table = Object.create(null); | |
| 1059 let temporaryKey = '<non-identifier-key>'; | |
| 1060 _setTableEntry(table, temporaryKey, table); | |
| 1061 _deleteTableEntry(table, temporaryKey); | |
| 1062 return table; | |
| 1063 } | |
| 1064 } | |
| 1065 return _HashSet; | |
| 1066 }); | |
| 1067 let _HashSet = _HashSet$(dynamic); | |
| 1068 let _IdentityHashSet$ = dart.generic(function(E) { | |
| 1069 class _IdentityHashSet extends _HashSet$(E) { | |
| 1070 [_newSet]() { | |
| 1071 return new _IdentityHashSet(); | |
| 1072 } | |
| 1073 [_computeHashCode](key) { | |
| 1074 return core.identityHashCode(key) & 0x3ffffff; | |
| 1075 } | |
| 1076 [_findBucketIndex](bucket, element) { | |
| 1077 if (bucket === null) | |
| 1078 return -1; | |
| 1079 let length = bucket.length; | |
| 1080 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 1081 if (core.identical(bucket[i], element)) | |
| 1082 return i; | |
| 1083 } | |
| 1084 return -1; | |
| 1085 } | |
| 1086 } | |
| 1087 return _IdentityHashSet; | |
| 1088 }); | |
| 1089 let _IdentityHashSet = _IdentityHashSet$(dynamic); | |
| 1090 let _equality = Symbol('_equality'); | |
| 1091 let _hasher = Symbol('_hasher'); | |
| 1092 let _CustomHashSet$ = dart.generic(function(E) { | |
| 1093 class _CustomHashSet extends _HashSet$(E) { | |
| 1094 _CustomHashSet($_equality, $_hasher, validKey) { | |
| 1095 this[_equality] = $_equality; | |
| 1096 this[_hasher] = $_hasher; | |
| 1097 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); | |
| 1098 super._HashSet(); | |
| 1099 } | |
| 1100 [_newSet]() { | |
| 1101 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey
]); | |
| 1102 } | |
| 1103 [_findBucketIndex](bucket, element) { | |
| 1104 if (bucket === null) | |
| 1105 return -1; | |
| 1106 let length = bucket.length; | |
| 1107 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 1108 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) | |
| 1109 return i; | |
| 1110 } | |
| 1111 return -1; | |
| 1112 } | |
| 1113 [_computeHashCode](element) { | |
| 1114 return this[_hasher](dart.as(element, E)) & 0x3ffffff; | |
| 1115 } | |
| 1116 add(object) { | |
| 1117 return super._add(object); | |
| 1118 } | |
| 1119 contains(object) { | |
| 1120 if (!dart.notNull(this[_validKey](object))) | |
| 1121 return false; | |
| 1122 return super._contains(object); | |
| 1123 } | |
| 1124 lookup(object) { | |
| 1125 if (!dart.notNull(this[_validKey](object))) | |
| 1126 return null; | |
| 1127 return super._lookup(object); | |
| 1128 } | |
| 1129 remove(object) { | |
| 1130 if (!dart.notNull(this[_validKey](object))) | |
| 1131 return false; | |
| 1132 return super._remove(object); | |
| 1133 } | |
| 1134 } | |
| 1135 return _CustomHashSet; | |
| 1136 }); | |
| 1137 let _CustomHashSet = _CustomHashSet$(dynamic); | |
| 1138 let HashSetIterator$ = dart.generic(function(E) { | |
| 1139 class HashSetIterator extends dart.Object { | |
| 1140 HashSetIterator($_set, $_elements) { | |
| 1141 this[_set] = $_set; | |
| 1142 this[_elements] = $_elements; | |
| 1143 this[_offset] = 0; | |
| 1144 this[_current] = null; | |
| 1145 } | |
| 1146 get current() { | |
| 1147 return this[_current]; | |
| 1148 } | |
| 1149 moveNext() { | |
| 1150 let elements = this[_elements]; | |
| 1151 let offset = this[_offset]; | |
| 1152 if (elements !== dart.dload(this[_set], '_elements')) { | |
| 1153 throw new core.ConcurrentModificationError(this[_set]); | |
| 1154 } else if (dart.notNull(offset) >= elements.length) { | |
| 1155 this[_current] = null; | |
| 1156 return false; | |
| 1157 } else { | |
| 1158 this[_current] = dart.as(elements[offset], E); | |
| 1159 this[_offset] = dart.notNull(offset) + 1; | |
| 1160 return true; | |
| 1161 } | |
| 1162 } | |
| 1163 } | |
| 1164 return HashSetIterator; | |
| 1165 }); | |
| 1166 let HashSetIterator = HashSetIterator$(dynamic); | |
| 1167 let _unsupported = Symbol('_unsupported'); | |
| 1168 let _element = Symbol('_element'); | |
| 1169 let _filterWhere = Symbol('_filterWhere'); | |
| 1170 let _LinkedHashSet$ = dart.generic(function(E) { | |
| 1171 class _LinkedHashSet extends _HashSetBase$(E) { | |
| 1172 _LinkedHashSet() { | |
| 1173 this[_length] = 0; | |
| 1174 this[_strings] = null; | |
| 1175 this[_nums] = null; | |
| 1176 this[_rest] = null; | |
| 1177 this[_first] = null; | |
| 1178 this[_last] = null; | |
| 1179 this[_modifications] = 0; | |
| 1180 super._HashSetBase(); | |
| 1181 } | |
| 1182 [_newSet]() { | |
| 1183 return new _LinkedHashSet(); | |
| 1184 } | |
| 1185 [_unsupported](operation) { | |
| 1186 throw `LinkedHashSet: unsupported ${operation}`; | |
| 1187 } | |
| 1188 get iterator() { | |
| 1189 return dart.as(new LinkedHashSetIterator(this, this[_modifications]), co
re.Iterator$(E)); | |
| 1190 } | |
| 1191 get length() { | |
| 1192 return this[_length]; | |
| 1193 } | |
| 1194 get isEmpty() { | |
| 1195 return this[_length] === 0; | |
| 1196 } | |
| 1197 get isNotEmpty() { | |
| 1198 return !dart.notNull(this.isEmpty); | |
| 1199 } | |
| 1200 contains(object) { | |
| 1201 if (_isStringElement(object)) { | |
| 1202 let strings = this[_strings]; | |
| 1203 if (strings === null) | |
| 1204 return false; | |
| 1205 let cell = dart.as(_getTableEntry(strings, object), LinkedHashSetCell)
; | |
| 1206 return cell !== null; | |
| 1207 } else if (_isNumericElement(object)) { | |
| 1208 let nums = this[_nums]; | |
| 1209 if (nums === null) | |
| 1210 return false; | |
| 1211 let cell = dart.as(_getTableEntry(nums, object), LinkedHashSetCell); | |
| 1212 return cell !== null; | |
| 1213 } else { | |
| 1214 return this[_contains](object); | |
| 1215 } | |
| 1216 } | |
| 1217 [_contains](object) { | |
| 1218 let rest = this[_rest]; | |
| 1219 if (rest === null) | |
| 1220 return false; | |
| 1221 let bucket = this[_getBucket](rest, object); | |
| 1222 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0; | |
| 1223 } | |
| 1224 lookup(object) { | |
| 1225 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { | |
| 1226 return dart.as(this.contains(object) ? object : null, E); | |
| 1227 } else { | |
| 1228 return this[_lookup](object); | |
| 1229 } | |
| 1230 } | |
| 1231 [_lookup](object) { | |
| 1232 let rest = this[_rest]; | |
| 1233 if (rest === null) | |
| 1234 return null; | |
| 1235 let bucket = this[_getBucket](rest, object); | |
| 1236 let index = this[_findBucketIndex](bucket, object); | |
| 1237 if (dart.notNull(index) < 0) | |
| 1238 return null; | |
| 1239 return dart.as(dart.dload(bucket.get(index), '_element'), E); | |
| 1240 } | |
| 1241 forEach(action) { | |
| 1242 let cell = this[_first]; | |
| 1243 let modifications = this[_modifications]; | |
| 1244 while (cell !== null) { | |
| 1245 action(dart.as(cell[_element], E)); | |
| 1246 if (modifications !== this[_modifications]) { | |
| 1247 throw new core.ConcurrentModificationError(this); | |
| 1248 } | |
| 1249 cell = cell[_next]; | |
| 1250 } | |
| 1251 } | |
| 1252 get first() { | |
| 1253 if (this[_first] === null) | |
| 1254 throw new core.StateError("No elements"); | |
| 1255 return dart.as(this[_first][_element], E); | |
| 1256 } | |
| 1257 get last() { | |
| 1258 if (this[_last] === null) | |
| 1259 throw new core.StateError("No elements"); | |
| 1260 return dart.as(this[_last][_element], E); | |
| 1261 } | |
| 1262 add(element) { | |
| 1263 if (_isStringElement(element)) { | |
| 1264 let strings = this[_strings]; | |
| 1265 if (strings === null) | |
| 1266 this[_strings] = strings = _newHashTable(); | |
| 1267 return this[_addHashTableEntry](strings, element); | |
| 1268 } else if (_isNumericElement(element)) { | |
| 1269 let nums = this[_nums]; | |
| 1270 if (nums === null) | |
| 1271 this[_nums] = nums = _newHashTable(); | |
| 1272 return this[_addHashTableEntry](nums, element); | |
| 1273 } else { | |
| 1274 return this[_add](element); | |
| 1275 } | |
| 1276 } | |
| 1277 [_add](element) { | |
| 1278 let rest = this[_rest]; | |
| 1279 if (rest === null) | |
| 1280 this[_rest] = rest = _newHashTable(); | |
| 1281 let hash = this[_computeHashCode](element); | |
| 1282 let bucket = rest[hash]; | |
| 1283 if (bucket === null) { | |
| 1284 let cell = this[_newLinkedCell](element); | |
| 1285 _setTableEntry(rest, hash, [cell]); | |
| 1286 } else { | |
| 1287 let index = this[_findBucketIndex](bucket, element); | |
| 1288 if (dart.notNull(index) >= 0) | |
| 1289 return false; | |
| 1290 let cell = this[_newLinkedCell](element); | |
| 1291 bucket.push(cell); | |
| 1292 } | |
| 1293 return true; | |
| 1294 } | |
| 1295 remove(object) { | |
| 1296 if (_isStringElement(object)) { | |
| 1297 return this[_removeHashTableEntry](this[_strings], object); | |
| 1298 } else if (_isNumericElement(object)) { | |
| 1299 return this[_removeHashTableEntry](this[_nums], object); | |
| 1300 } else { | |
| 1301 return this[_remove](object); | |
| 1302 } | |
| 1303 } | |
| 1304 [_remove](object) { | |
| 1305 let rest = this[_rest]; | |
| 1306 if (rest === null) | |
| 1307 return false; | |
| 1308 let bucket = this[_getBucket](rest, object); | |
| 1309 let index = this[_findBucketIndex](bucket, object); | |
| 1310 if (dart.notNull(index) < 0) | |
| 1311 return false; | |
| 1312 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); | |
| 1313 this[_unlinkCell](cell); | |
| 1314 return true; | |
| 1315 } | |
| 1316 removeWhere(test) { | |
| 1317 this[_filterWhere](test, true); | |
| 1318 } | |
| 1319 retainWhere(test) { | |
| 1320 this[_filterWhere](test, false); | |
| 1321 } | |
| 1322 [_filterWhere](test, removeMatching) { | |
| 1323 let cell = this[_first]; | |
| 1324 while (cell !== null) { | |
| 1325 let element = dart.as(cell[_element], E); | |
| 1326 let next = cell[_next]; | |
| 1327 let modifications = this[_modifications]; | |
| 1328 let shouldRemove = removeMatching === test(element); | |
| 1329 if (modifications !== this[_modifications]) { | |
| 1330 throw new core.ConcurrentModificationError(this); | |
| 1331 } | |
| 1332 if (shouldRemove) | |
| 1333 this.remove(element); | |
| 1334 cell = next; | |
| 1335 } | |
| 1336 } | |
| 1337 clear() { | |
| 1338 if (dart.notNull(this[_length]) > 0) { | |
| 1339 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; | |
| 1340 this[_length] = 0; | |
| 1341 this[_modified](); | |
| 1342 } | |
| 1343 } | |
| 1344 [_addHashTableEntry](table, element) { | |
| 1345 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); | |
| 1346 if (cell !== null) | |
| 1347 return false; | |
| 1348 _setTableEntry(table, element, this[_newLinkedCell](element)); | |
| 1349 return true; | |
| 1350 } | |
| 1351 [_removeHashTableEntry](table, element) { | |
| 1352 if (table === null) | |
| 1353 return false; | |
| 1354 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); | |
| 1355 if (cell === null) | |
| 1356 return false; | |
| 1357 this[_unlinkCell](cell); | |
| 1358 _deleteTableEntry(table, element); | |
| 1359 return true; | |
| 1360 } | |
| 1361 [_modified]() { | |
| 1362 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; | |
| 1363 } | |
| 1364 [_newLinkedCell](element) { | |
| 1365 let cell = new LinkedHashSetCell(element); | |
| 1366 if (this[_first] === null) { | |
| 1367 this[_first] = this[_last] = cell; | |
| 1368 } else { | |
| 1369 let last = this[_last]; | |
| 1370 cell[_previous] = last; | |
| 1371 this[_last] = last[_next] = cell; | |
| 1372 } | |
| 1373 this[_length] = dart.notNull(this[_length]) + 1; | |
| 1374 this[_modified](); | |
| 1375 return cell; | |
| 1376 } | |
| 1377 [_unlinkCell](cell) { | |
| 1378 let previous = cell[_previous]; | |
| 1379 let next = cell[_next]; | |
| 1380 if (previous === null) { | |
| 1381 dart.assert(dart.equals(cell, this[_first])); | |
| 1382 this[_first] = next; | |
| 1383 } else { | |
| 1384 previous[_next] = next; | |
| 1385 } | |
| 1386 if (next === null) { | |
| 1387 dart.assert(dart.equals(cell, this[_last])); | |
| 1388 this[_last] = previous; | |
| 1389 } else { | |
| 1390 next[_previous] = previous; | |
| 1391 } | |
| 1392 this[_length] = dart.notNull(this[_length]) - 1; | |
| 1393 this[_modified](); | |
| 1394 } | |
| 1395 static [_isStringElement](element) { | |
| 1396 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); | |
| 1397 } | |
| 1398 static [_isNumericElement](element) { | |
| 1399 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff)
=== element; | |
| 1400 } | |
| 1401 [_computeHashCode](element) { | |
| 1402 return dart.dload(element, 'hashCode') & 0x3ffffff; | |
| 1403 } | |
| 1404 static [_getTableEntry](table, key) { | |
| 1405 return table[key]; | |
| 1406 } | |
| 1407 static [_setTableEntry](table, key, value) { | |
| 1408 dart.assert(value !== null); | |
| 1409 table[key] = value; | |
| 1410 } | |
| 1411 static [_deleteTableEntry](table, key) { | |
| 1412 delete table[key]; | |
| 1413 } | |
| 1414 [_getBucket](table, element) { | |
| 1415 let hash = this[_computeHashCode](element); | |
| 1416 return dart.as(table[hash], core.List); | |
| 1417 } | |
| 1418 [_findBucketIndex](bucket, element) { | |
| 1419 if (bucket === null) | |
| 1420 return -1; | |
| 1421 let length = bucket.length; | |
| 1422 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 1423 let cell = dart.as(bucket[i], LinkedHashSetCell); | |
| 1424 if (dart.equals(cell[_element], element)) | |
| 1425 return i; | |
| 1426 } | |
| 1427 return -1; | |
| 1428 } | |
| 1429 static [_newHashTable]() { | |
| 1430 let table = Object.create(null); | |
| 1431 let temporaryKey = '<non-identifier-key>'; | |
| 1432 _setTableEntry(table, temporaryKey, table); | |
| 1433 _deleteTableEntry(table, temporaryKey); | |
| 1434 return table; | |
| 1435 } | |
| 1436 } | |
| 1437 return _LinkedHashSet; | |
| 1438 }); | |
| 1439 let _LinkedHashSet = _LinkedHashSet$(dynamic); | |
| 1440 let _LinkedIdentityHashSet$ = dart.generic(function(E) { | |
| 1441 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { | |
| 1442 [_newSet]() { | |
| 1443 return new _LinkedIdentityHashSet(); | |
| 1444 } | |
| 1445 [_computeHashCode](key) { | |
| 1446 return core.identityHashCode(key) & 0x3ffffff; | |
| 1447 } | |
| 1448 [_findBucketIndex](bucket, element) { | |
| 1449 if (bucket === null) | |
| 1450 return -1; | |
| 1451 let length = bucket.length; | |
| 1452 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 1453 let cell = dart.as(bucket[i], LinkedHashSetCell); | |
| 1454 if (core.identical(cell[_element], element)) | |
| 1455 return i; | |
| 1456 } | |
| 1457 return -1; | |
| 1458 } | |
| 1459 } | |
| 1460 return _LinkedIdentityHashSet; | |
| 1461 }); | |
| 1462 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic); | |
| 1463 let _LinkedCustomHashSet$ = dart.generic(function(E) { | |
| 1464 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { | |
| 1465 _LinkedCustomHashSet($_equality, $_hasher, validKey) { | |
| 1466 this[_equality] = $_equality; | |
| 1467 this[_hasher] = $_hasher; | |
| 1468 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); | |
| 1469 super._LinkedHashSet(); | |
| 1470 } | |
| 1471 [_newSet]() { | |
| 1472 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va
lidKey]); | |
| 1473 } | |
| 1474 [_findBucketIndex](bucket, element) { | |
| 1475 if (bucket === null) | |
| 1476 return -1; | |
| 1477 let length = bucket.length; | |
| 1478 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 1479 let cell = dart.as(bucket[i], LinkedHashSetCell); | |
| 1480 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) | |
| 1481 return i; | |
| 1482 } | |
| 1483 return -1; | |
| 1484 } | |
| 1485 [_computeHashCode](element) { | |
| 1486 return this[_hasher](dart.as(element, E)) & 0x3ffffff; | |
| 1487 } | |
| 1488 add(element) { | |
| 1489 return super._add(element); | |
| 1490 } | |
| 1491 contains(object) { | |
| 1492 if (!dart.notNull(this[_validKey](object))) | |
| 1493 return false; | |
| 1494 return super._contains(object); | |
| 1495 } | |
| 1496 lookup(object) { | |
| 1497 if (!dart.notNull(this[_validKey](object))) | |
| 1498 return null; | |
| 1499 return super._lookup(object); | |
| 1500 } | |
| 1501 remove(object) { | |
| 1502 if (!dart.notNull(this[_validKey](object))) | |
| 1503 return false; | |
| 1504 return super._remove(object); | |
| 1505 } | |
| 1506 containsAll(elements) { | |
| 1507 for (let element of elements) { | |
| 1508 if (!dart.notNull(this[_validKey](element)) || !dart.notNull(this.cont
ains(element))) | |
| 1509 return false; | |
| 1510 } | |
| 1511 return true; | |
| 1512 } | |
| 1513 removeAll(elements) { | |
| 1514 for (let element of elements) { | |
| 1515 if (this[_validKey](element)) { | |
| 1516 super._remove(element); | |
| 1517 } | |
| 1518 } | |
| 1519 } | |
| 1520 } | |
| 1521 return _LinkedCustomHashSet; | |
| 1522 }); | |
| 1523 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic); | |
| 1524 class LinkedHashSetCell extends dart.Object { | |
| 1525 LinkedHashSetCell($_element) { | |
| 1526 this[_element] = $_element; | |
| 1527 this[_next] = null; | |
| 1528 this[_previous] = null; | |
| 1529 } | |
| 1530 } | |
| 1531 let LinkedHashSetIterator$ = dart.generic(function(E) { | |
| 1532 class LinkedHashSetIterator extends dart.Object { | |
| 1533 LinkedHashSetIterator($_set, $_modifications) { | |
| 1534 this[_set] = $_set; | |
| 1535 this[_modifications] = $_modifications; | |
| 1536 this[_cell] = null; | |
| 1537 this[_current] = null; | |
| 1538 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel
l); | |
| 1539 } | |
| 1540 get current() { | |
| 1541 return this[_current]; | |
| 1542 } | |
| 1543 moveNext() { | |
| 1544 if (this[_modifications] !== dart.dload(this[_set], '_modifications')) { | |
| 1545 throw new core.ConcurrentModificationError(this[_set]); | |
| 1546 } else if (this[_cell] === null) { | |
| 1547 this[_current] = null; | |
| 1548 return false; | |
| 1549 } else { | |
| 1550 this[_current] = dart.as(this[_cell][_element], E); | |
| 1551 this[_cell] = this[_cell][_next]; | |
| 1552 return true; | |
| 1553 } | |
| 1554 } | |
| 1555 } | |
| 1556 return LinkedHashSetIterator; | |
| 1557 }); | |
| 1558 let LinkedHashSetIterator = LinkedHashSetIterator$(dynamic); | |
| 1559 let _source = Symbol('_source'); | 4 let _source = Symbol('_source'); |
| 1560 let UnmodifiableListView$ = dart.generic(function(E) { | 5 let UnmodifiableListView$ = dart.generic(function(E) { |
| 1561 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { | 6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { |
| 1562 UnmodifiableListView(source) { | 7 UnmodifiableListView(source) { |
| 1563 this[_source] = source; | 8 this[_source] = source; |
| 1564 super.UnmodifiableListBase(); | 9 super.UnmodifiableListBase(); |
| 1565 } | 10 } |
| 1566 get length() { | 11 get length() { |
| 1567 return this[_source].length; | 12 return this[_source].length; |
| 1568 } | 13 } |
| 1569 get(index) { | 14 get(index) { |
| 1570 return this[_source].elementAt(index); | 15 return this[_source].elementAt(index); |
| 1571 } | 16 } |
| 1572 } | 17 } |
| 1573 return UnmodifiableListView; | 18 return UnmodifiableListView; |
| 1574 }); | 19 }); |
| 1575 let UnmodifiableListView = UnmodifiableListView$(dynamic); | 20 let UnmodifiableListView = UnmodifiableListView$(dart.dynamic); |
| 1576 // Function _defaultEquals: (dynamic, dynamic) → bool | 21 // Function _defaultEquals: (dynamic, dynamic) → bool |
| 1577 function _defaultEquals(a, b) { | 22 function _defaultEquals(a, b) { |
| 1578 return dart.equals(a, b); | 23 return dart.equals(a, b); |
| 1579 } | 24 } |
| 1580 // Function _defaultHashCode: (dynamic) → int | 25 // Function _defaultHashCode: (dynamic) → int |
| 1581 function _defaultHashCode(a) { | 26 function _defaultHashCode(a) { |
| 1582 return dart.as(dart.dload(a, 'hashCode'), core.int); | 27 return dart.as(dart.dload(a, 'hashCode'), core.int); |
| 1583 } | 28 } |
| 1584 let HashMap$ = dart.generic(function(K, V) { | 29 let HashMap$ = dart.generic(function(K, V) { |
| 1585 class HashMap extends dart.Object { | 30 class HashMap extends core.Object { |
| 1586 HashMap(opt$) { | 31 HashMap(opt$) { |
| 1587 let equals = opt$.equals === void 0 ? null : opt$.equals; | 32 let equals = opt$.equals === void 0 ? null : opt$.equals; |
| 1588 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; | 33 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; |
| 1589 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; | 34 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; |
| 1590 if (isValidKey === null) { | 35 if (isValidKey === null) { |
| 1591 if (hashCode === null) { | 36 if (hashCode === null) { |
| 1592 if (equals === null) { | 37 if (equals === null) { |
| 1593 return new _HashMap(); | 38 return new _HashMap(); |
| 1594 } | 39 } |
| 1595 hashCode = _defaultHashCode; | 40 hashCode = _defaultHashCode; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 Maps._fillMapWithIterables(map, keys, values); | 78 Maps._fillMapWithIterables(map, keys, values); |
| 1634 return map; | 79 return map; |
| 1635 } | 80 } |
| 1636 } | 81 } |
| 1637 dart.defineNamedConstructor(HashMap, 'identity'); | 82 dart.defineNamedConstructor(HashMap, 'identity'); |
| 1638 dart.defineNamedConstructor(HashMap, 'from'); | 83 dart.defineNamedConstructor(HashMap, 'from'); |
| 1639 dart.defineNamedConstructor(HashMap, 'fromIterable'); | 84 dart.defineNamedConstructor(HashMap, 'fromIterable'); |
| 1640 dart.defineNamedConstructor(HashMap, 'fromIterables'); | 85 dart.defineNamedConstructor(HashMap, 'fromIterables'); |
| 1641 return HashMap; | 86 return HashMap; |
| 1642 }); | 87 }); |
| 1643 let HashMap = HashMap$(dynamic, dynamic); | 88 let HashMap = HashMap$(dart.dynamic, dart.dynamic); |
| 89 let _newSet = Symbol('_newSet'); |
| 1644 let _HashSetBase$ = dart.generic(function(E) { | 90 let _HashSetBase$ = dart.generic(function(E) { |
| 1645 class _HashSetBase extends SetBase$(E) { | 91 class _HashSetBase extends SetBase$(E) { |
| 1646 difference(other) { | 92 difference(other) { |
| 1647 let result = this[_newSet](); | 93 let result = this[_newSet](); |
| 1648 for (let element of this) { | 94 for (let element of this) { |
| 1649 if (!dart.notNull(other.contains(element))) | 95 if (!dart.notNull(other.contains(element))) |
| 1650 result.add(dart.as(element, E)); | 96 result.add(dart.as(element, E)); |
| 1651 } | 97 } |
| 1652 return result; | 98 return result; |
| 1653 } | 99 } |
| 1654 intersection(other) { | 100 intersection(other) { |
| 1655 let result = this[_newSet](); | 101 let result = this[_newSet](); |
| 1656 for (let element of this) { | 102 for (let element of this) { |
| 1657 if (other.contains(element)) | 103 if (other.contains(element)) |
| 1658 result.add(dart.as(element, E)); | 104 result.add(dart.as(element, E)); |
| 1659 } | 105 } |
| 1660 return result; | 106 return result; |
| 1661 } | 107 } |
| 1662 toSet() { | 108 toSet() { |
| 1663 return ((_) => { | 109 return ((_) => { |
| 1664 _.addAll(this); | 110 _.addAll(this); |
| 1665 return _; | 111 return _; |
| 1666 }).bind(this)(this[_newSet]()); | 112 }).bind(this)(this[_newSet]()); |
| 1667 } | 113 } |
| 1668 } | 114 } |
| 1669 return _HashSetBase; | 115 return _HashSetBase; |
| 1670 }); | 116 }); |
| 1671 let _HashSetBase = _HashSetBase$(dynamic); | 117 let _HashSetBase = _HashSetBase$(dart.dynamic); |
| 1672 let HashSet$ = dart.generic(function(E) { | 118 let HashSet$ = dart.generic(function(E) { |
| 1673 class HashSet extends dart.Object { | 119 class HashSet extends core.Object { |
| 1674 HashSet(opt$) { | 120 HashSet(opt$) { |
| 1675 let equals = opt$.equals === void 0 ? null : opt$.equals; | 121 let equals = opt$.equals === void 0 ? null : opt$.equals; |
| 1676 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; | 122 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; |
| 1677 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; | 123 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; |
| 1678 if (isValidKey === null) { | 124 if (isValidKey === null) { |
| 1679 if (hashCode === null) { | 125 if (hashCode === null) { |
| 1680 if (equals === null) { | 126 if (equals === null) { |
| 1681 return new _HashSet(); | 127 return new _HashSet(); |
| 1682 } | 128 } |
| 1683 hashCode = _defaultHashCode; | 129 hashCode = _defaultHashCode; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1706 let result = new HashSet(); | 152 let result = new HashSet(); |
| 1707 for (let e of elements) | 153 for (let e of elements) |
| 1708 result.add(e); | 154 result.add(e); |
| 1709 return result; | 155 return result; |
| 1710 } | 156 } |
| 1711 } | 157 } |
| 1712 dart.defineNamedConstructor(HashSet, 'identity'); | 158 dart.defineNamedConstructor(HashSet, 'identity'); |
| 1713 dart.defineNamedConstructor(HashSet, 'from'); | 159 dart.defineNamedConstructor(HashSet, 'from'); |
| 1714 return HashSet; | 160 return HashSet; |
| 1715 }); | 161 }); |
| 1716 let HashSet = HashSet$(dynamic); | 162 let HashSet = HashSet$(dart.dynamic); |
| 1717 let IterableMixin$ = dart.generic(function(E) { | 163 let IterableMixin$ = dart.generic(function(E) { |
| 1718 class IterableMixin extends dart.Object { | 164 class IterableMixin extends core.Object { |
| 1719 map(f) { | 165 map(f) { |
| 1720 return new _internal.MappedIterable(this, f); | 166 return new _internal.MappedIterable(this, f); |
| 1721 } | 167 } |
| 1722 where(f) { | 168 where(f) { |
| 1723 return new _internal.WhereIterable(this, f); | 169 return new _internal.WhereIterable(this, f); |
| 1724 } | 170 } |
| 1725 expand(f) { | 171 expand(f) { |
| 1726 return new _internal.ExpandIterable(this, f); | 172 return new _internal.ExpandIterable(this, f); |
| 1727 } | 173 } |
| 1728 contains(element) { | 174 contains(element) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 elementIndex = dart.notNull(elementIndex) + 1; | 347 elementIndex = dart.notNull(elementIndex) + 1; |
| 1902 } | 348 } |
| 1903 throw new core.RangeError.index(index, this, "index", null, elementIndex
); | 349 throw new core.RangeError.index(index, this, "index", null, elementIndex
); |
| 1904 } | 350 } |
| 1905 toString() { | 351 toString() { |
| 1906 return IterableBase.iterableToShortString(this, '(', ')'); | 352 return IterableBase.iterableToShortString(this, '(', ')'); |
| 1907 } | 353 } |
| 1908 } | 354 } |
| 1909 return IterableMixin; | 355 return IterableMixin; |
| 1910 }); | 356 }); |
| 1911 let IterableMixin = IterableMixin$(dynamic); | 357 let IterableMixin = IterableMixin$(dart.dynamic); |
| 1912 let _isToStringVisiting = Symbol('_isToStringVisiting'); | 358 let _isToStringVisiting = Symbol('_isToStringVisiting'); |
| 1913 let _iterablePartsToStrings = Symbol('_iterablePartsToStrings'); | 359 let _iterablePartsToStrings = Symbol('_iterablePartsToStrings'); |
| 1914 let IterableBase$ = dart.generic(function(E) { | 360 let IterableBase$ = dart.generic(function(E) { |
| 1915 class IterableBase extends dart.Object { | 361 class IterableBase extends core.Object { |
| 1916 IterableBase() { | 362 IterableBase() { |
| 1917 } | 363 } |
| 1918 map(f) { | 364 map(f) { |
| 1919 return new _internal.MappedIterable(this, f); | 365 return new _internal.MappedIterable(this, f); |
| 1920 } | 366 } |
| 1921 where(f) { | 367 where(f) { |
| 1922 return new _internal.WhereIterable(this, f); | 368 return new _internal.WhereIterable(this, f); |
| 1923 } | 369 } |
| 1924 expand(f) { | 370 expand(f) { |
| 1925 return new _internal.ExpandIterable(this, f); | 371 return new _internal.ExpandIterable(this, f); |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2234 parts.add(ultimateString); | 680 parts.add(ultimateString); |
| 2235 } | 681 } |
| 2236 } | 682 } |
| 2237 dart.defineLazyProperties(IterableBase, { | 683 dart.defineLazyProperties(IterableBase, { |
| 2238 get _toStringVisiting() { | 684 get _toStringVisiting() { |
| 2239 return new List.from([]); | 685 return new List.from([]); |
| 2240 } | 686 } |
| 2241 }); | 687 }); |
| 2242 return IterableBase; | 688 return IterableBase; |
| 2243 }); | 689 }); |
| 2244 let IterableBase = IterableBase$(dynamic); | 690 let IterableBase = IterableBase$(dart.dynamic); |
| 2245 let _iterator = Symbol('_iterator'); | 691 let _iterator = Symbol('_iterator'); |
| 2246 let _state = Symbol('_state'); | 692 let _state = Symbol('_state'); |
| 2247 let _move = Symbol('_move'); | 693 let _move = Symbol('_move'); |
| 2248 let HasNextIterator$ = dart.generic(function(E) { | 694 let HasNextIterator$ = dart.generic(function(E) { |
| 2249 class HasNextIterator extends dart.Object { | 695 class HasNextIterator extends core.Object { |
| 2250 HasNextIterator($_iterator) { | 696 HasNextIterator($_iterator) { |
| 2251 this[_iterator] = $_iterator; | 697 this[_iterator] = $_iterator; |
| 2252 this[_state] = _NOT_MOVED_YET; | 698 this[_state] = HasNextIterator._NOT_MOVED_YET; |
| 2253 } | 699 } |
| 2254 get hasNext() { | 700 get hasNext() { |
| 2255 if (this[_state] === _NOT_MOVED_YET) | 701 if (this[_state] === HasNextIterator._NOT_MOVED_YET) |
| 2256 this[_move](); | 702 this[_move](); |
| 2257 return this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT; | 703 return this[_state] === HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT; |
| 2258 } | 704 } |
| 2259 next() { | 705 next() { |
| 2260 if (!dart.notNull(this.hasNext)) | 706 if (!dart.notNull(this.hasNext)) |
| 2261 throw new core.StateError("No more elements"); | 707 throw new core.StateError("No more elements"); |
| 2262 dart.assert(this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT); | 708 dart.assert(this[_state] === HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRE
NT); |
| 2263 let result = dart.as(this[_iterator].current, E); | 709 let result = dart.as(this[_iterator].current, E); |
| 2264 this[_move](); | 710 this[_move](); |
| 2265 return result; | 711 return result; |
| 2266 } | 712 } |
| 2267 [_move]() { | 713 [_move]() { |
| 2268 if (this[_iterator].moveNext()) { | 714 if (this[_iterator].moveNext()) { |
| 2269 this[_state] = _HAS_NEXT_AND_NEXT_IN_CURRENT; | 715 this[_state] = HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT; |
| 2270 } else { | 716 } else { |
| 2271 this[_state] = _NO_NEXT; | 717 this[_state] = HasNextIterator._NO_NEXT; |
| 2272 } | 718 } |
| 2273 } | 719 } |
| 2274 } | 720 } |
| 2275 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; | 721 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; |
| 2276 HasNextIterator._NO_NEXT = 1; | 722 HasNextIterator._NO_NEXT = 1; |
| 2277 HasNextIterator._NOT_MOVED_YET = 2; | 723 HasNextIterator._NOT_MOVED_YET = 2; |
| 2278 return HasNextIterator; | 724 return HasNextIterator; |
| 2279 }); | 725 }); |
| 2280 let HasNextIterator = HasNextIterator$(dynamic); | 726 let HasNextIterator = HasNextIterator$(dart.dynamic); |
| 2281 let LinkedHashMap$ = dart.generic(function(K, V) { | 727 let LinkedHashMap$ = dart.generic(function(K, V) { |
| 2282 class LinkedHashMap extends dart.Object { | 728 class LinkedHashMap extends core.Object { |
| 2283 LinkedHashMap(opt$) { | 729 LinkedHashMap(opt$) { |
| 2284 let equals = opt$.equals === void 0 ? null : opt$.equals; | 730 let equals = opt$.equals === void 0 ? null : opt$.equals; |
| 2285 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; | 731 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; |
| 2286 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; | 732 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; |
| 2287 if (isValidKey === null) { | 733 if (isValidKey === null) { |
| 2288 if (hashCode === null) { | 734 if (hashCode === null) { |
| 2289 if (equals === null) { | 735 if (equals === null) { |
| 2290 return new _LinkedHashMap(); | 736 return new _LinkedHashMap(); |
| 2291 } | 737 } |
| 2292 hashCode = _defaultHashCode; | 738 hashCode = _defaultHashCode; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2338 } | 784 } |
| 2339 } | 785 } |
| 2340 dart.defineNamedConstructor(LinkedHashMap, 'identity'); | 786 dart.defineNamedConstructor(LinkedHashMap, 'identity'); |
| 2341 dart.defineNamedConstructor(LinkedHashMap, 'from'); | 787 dart.defineNamedConstructor(LinkedHashMap, 'from'); |
| 2342 dart.defineNamedConstructor(LinkedHashMap, 'fromIterable'); | 788 dart.defineNamedConstructor(LinkedHashMap, 'fromIterable'); |
| 2343 dart.defineNamedConstructor(LinkedHashMap, 'fromIterables'); | 789 dart.defineNamedConstructor(LinkedHashMap, 'fromIterables'); |
| 2344 dart.defineNamedConstructor(LinkedHashMap, '_literal'); | 790 dart.defineNamedConstructor(LinkedHashMap, '_literal'); |
| 2345 dart.defineNamedConstructor(LinkedHashMap, '_empty'); | 791 dart.defineNamedConstructor(LinkedHashMap, '_empty'); |
| 2346 return LinkedHashMap; | 792 return LinkedHashMap; |
| 2347 }); | 793 }); |
| 2348 let LinkedHashMap = LinkedHashMap$(dynamic, dynamic); | 794 let LinkedHashMap = LinkedHashMap$(dart.dynamic, dart.dynamic); |
| 2349 let LinkedHashSet$ = dart.generic(function(E) { | 795 let LinkedHashSet$ = dart.generic(function(E) { |
| 2350 class LinkedHashSet extends dart.Object { | 796 class LinkedHashSet extends core.Object { |
| 2351 LinkedHashSet(opt$) { | 797 LinkedHashSet(opt$) { |
| 2352 let equals = opt$.equals === void 0 ? null : opt$.equals; | 798 let equals = opt$.equals === void 0 ? null : opt$.equals; |
| 2353 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; | 799 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; |
| 2354 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; | 800 let isValidKey = opt$.isValidKey === void 0 ? null : opt$.isValidKey; |
| 2355 if (isValidKey === null) { | 801 if (isValidKey === null) { |
| 2356 if (hashCode === null) { | 802 if (hashCode === null) { |
| 2357 if (equals === null) { | 803 if (equals === null) { |
| 2358 return new _LinkedHashSet(); | 804 return new _LinkedHashSet(); |
| 2359 } | 805 } |
| 2360 hashCode = _defaultHashCode; | 806 hashCode = _defaultHashCode; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2384 for (let element of elements) { | 830 for (let element of elements) { |
| 2385 result.add(element); | 831 result.add(element); |
| 2386 } | 832 } |
| 2387 return result; | 833 return result; |
| 2388 } | 834 } |
| 2389 } | 835 } |
| 2390 dart.defineNamedConstructor(LinkedHashSet, 'identity'); | 836 dart.defineNamedConstructor(LinkedHashSet, 'identity'); |
| 2391 dart.defineNamedConstructor(LinkedHashSet, 'from'); | 837 dart.defineNamedConstructor(LinkedHashSet, 'from'); |
| 2392 return LinkedHashSet; | 838 return LinkedHashSet; |
| 2393 }); | 839 }); |
| 2394 let LinkedHashSet = LinkedHashSet$(dynamic); | 840 let LinkedHashSet = LinkedHashSet$(dart.dynamic); |
| 2395 let _modificationCount = Symbol('_modificationCount'); | 841 let _modificationCount = Symbol('_modificationCount'); |
| 842 let _length = Symbol('_length'); |
| 843 let _next = Symbol('_next'); |
| 844 let _previous = Symbol('_previous'); |
| 2396 let _insertAfter = Symbol('_insertAfter'); | 845 let _insertAfter = Symbol('_insertAfter'); |
| 2397 let _list = Symbol('_list'); | 846 let _list = Symbol('_list'); |
| 2398 let _unlink = Symbol('_unlink'); | 847 let _unlink = Symbol('_unlink'); |
| 2399 let LinkedList$ = dart.generic(function(E) { | 848 let LinkedList$ = dart.generic(function(E) { |
| 2400 class LinkedList extends IterableBase$(E) { | 849 class LinkedList extends IterableBase$(E) { |
| 2401 LinkedList() { | 850 LinkedList() { |
| 2402 this[_modificationCount] = 0; | 851 this[_modificationCount] = 0; |
| 2403 this[_length] = 0; | 852 this[_length] = 0; |
| 2404 this[_next] = null; | 853 this[_next] = null; |
| 2405 this[_previous] = null; | 854 this[_previous] = null; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2490 [_unlink](entry) { | 939 [_unlink](entry) { |
| 2491 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 940 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 2492 entry[_next][_previous] = entry[_previous]; | 941 entry[_next][_previous] = entry[_previous]; |
| 2493 entry[_previous][_next] = entry[_next]; | 942 entry[_previous][_next] = entry[_next]; |
| 2494 this[_length] = dart.notNull(this[_length]) - 1; | 943 this[_length] = dart.notNull(this[_length]) - 1; |
| 2495 entry[_list] = entry[_next] = entry[_previous] = null; | 944 entry[_list] = entry[_next] = entry[_previous] = null; |
| 2496 } | 945 } |
| 2497 } | 946 } |
| 2498 return LinkedList; | 947 return LinkedList; |
| 2499 }); | 948 }); |
| 2500 let LinkedList = LinkedList$(dynamic); | 949 let LinkedList = LinkedList$(dart.dynamic); |
| 950 let _current = Symbol('_current'); |
| 2501 let _LinkedListIterator$ = dart.generic(function(E) { | 951 let _LinkedListIterator$ = dart.generic(function(E) { |
| 2502 class _LinkedListIterator extends dart.Object { | 952 class _LinkedListIterator extends core.Object { |
| 2503 _LinkedListIterator(list) { | 953 _LinkedListIterator(list) { |
| 2504 this[_list] = list; | 954 this[_list] = list; |
| 2505 this[_modificationCount] = list[_modificationCount]; | 955 this[_modificationCount] = list[_modificationCount]; |
| 2506 this[_next] = list[_next]; | 956 this[_next] = list[_next]; |
| 2507 this[_current] = null; | 957 this[_current] = null; |
| 2508 } | 958 } |
| 2509 get current() { | 959 get current() { |
| 2510 return this[_current]; | 960 return this[_current]; |
| 2511 } | 961 } |
| 2512 moveNext() { | 962 moveNext() { |
| 2513 if (core.identical(this[_next], this[_list])) { | 963 if (core.identical(this[_next], this[_list])) { |
| 2514 this[_current] = null; | 964 this[_current] = null; |
| 2515 return false; | 965 return false; |
| 2516 } | 966 } |
| 2517 if (this[_modificationCount] !== this[_list][_modificationCount]) { | 967 if (this[_modificationCount] !== this[_list][_modificationCount]) { |
| 2518 throw new core.ConcurrentModificationError(this); | 968 throw new core.ConcurrentModificationError(this); |
| 2519 } | 969 } |
| 2520 this[_current] = dart.as(this[_next], E); | 970 this[_current] = dart.as(this[_next], E); |
| 2521 this[_next] = this[_next][_next]; | 971 this[_next] = this[_next][_next]; |
| 2522 return true; | 972 return true; |
| 2523 } | 973 } |
| 2524 } | 974 } |
| 2525 return _LinkedListIterator; | 975 return _LinkedListIterator; |
| 2526 }); | 976 }); |
| 2527 let _LinkedListIterator = _LinkedListIterator$(dynamic); | 977 let _LinkedListIterator = _LinkedListIterator$(dart.dynamic); |
| 2528 class _LinkedListLink extends dart.Object { | 978 class _LinkedListLink extends core.Object { |
| 2529 _LinkedListLink() { | 979 _LinkedListLink() { |
| 2530 this[_next] = null; | 980 this[_next] = null; |
| 2531 this[_previous] = null; | 981 this[_previous] = null; |
| 2532 } | 982 } |
| 2533 } | 983 } |
| 2534 let LinkedListEntry$ = dart.generic(function(E) { | 984 let LinkedListEntry$ = dart.generic(function(E) { |
| 2535 class LinkedListEntry extends dart.Object { | 985 class LinkedListEntry extends core.Object { |
| 2536 LinkedListEntry() { | 986 LinkedListEntry() { |
| 2537 this[_list] = null; | 987 this[_list] = null; |
| 2538 this[_next] = null; | 988 this[_next] = null; |
| 2539 this[_previous] = null; | 989 this[_previous] = null; |
| 2540 } | 990 } |
| 2541 get list() { | 991 get list() { |
| 2542 return this[_list]; | 992 return this[_list]; |
| 2543 } | 993 } |
| 2544 unlink() { | 994 unlink() { |
| 2545 this[_list]._unlink(this); | 995 this[_list]._unlink(this); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2557 } | 1007 } |
| 2558 insertAfter(entry) { | 1008 insertAfter(entry) { |
| 2559 this[_list]._insertAfter(this, entry); | 1009 this[_list]._insertAfter(this, entry); |
| 2560 } | 1010 } |
| 2561 insertBefore(entry) { | 1011 insertBefore(entry) { |
| 2562 this[_list]._insertAfter(this[_previous], entry); | 1012 this[_list]._insertAfter(this[_previous], entry); |
| 2563 } | 1013 } |
| 2564 } | 1014 } |
| 2565 return LinkedListEntry; | 1015 return LinkedListEntry; |
| 2566 }); | 1016 }); |
| 2567 let LinkedListEntry = LinkedListEntry$(dynamic); | 1017 let LinkedListEntry = LinkedListEntry$(dart.dynamic); |
| 2568 let ListBase$ = dart.generic(function(E) { | 1018 let ListBase$ = dart.generic(function(E) { |
| 2569 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { | 1019 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { |
| 2570 static listToString(list) { | 1020 static listToString(list) { |
| 2571 return IterableBase.iterableToFullString(list, '[', ']'); | 1021 return IterableBase.iterableToFullString(list, '[', ']'); |
| 2572 } | 1022 } |
| 2573 } | 1023 } |
| 2574 return ListBase; | 1024 return ListBase; |
| 2575 }); | 1025 }); |
| 2576 let ListBase = ListBase$(dynamic); | 1026 let ListBase = ListBase$(dart.dynamic); |
| 2577 let _filter = Symbol('_filter'); | 1027 let _filter = Symbol('_filter'); |
| 2578 let ListMixin$ = dart.generic(function(E) { | 1028 let ListMixin$ = dart.generic(function(E) { |
| 2579 class ListMixin extends dart.Object { | 1029 class ListMixin extends core.Object { |
| 2580 get iterator() { | 1030 get iterator() { |
| 2581 return new _internal.ListIterator(this); | 1031 return new _internal.ListIterator(this); |
| 2582 } | 1032 } |
| 2583 elementAt(index) { | 1033 elementAt(index) { |
| 2584 return this.get(index); | 1034 return this.get(index); |
| 2585 } | 1035 } |
| 2586 forEach(action) { | 1036 forEach(action) { |
| 2587 let length = this.length; | 1037 let length = this.length; |
| 2588 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1038 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 2589 action(this.get(i)); | 1039 action(this.get(i)); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2654 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | 1104 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 2655 let element = this.get(i); | 1105 let element = this.get(i); |
| 2656 if (test(element)) | 1106 if (test(element)) |
| 2657 return element; | 1107 return element; |
| 2658 if (length !== this.length) { | 1108 if (length !== this.length) { |
| 2659 throw new core.ConcurrentModificationError(this); | 1109 throw new core.ConcurrentModificationError(this); |
| 2660 } | 1110 } |
| 2661 } | 1111 } |
| 2662 if (orElse !== null) | 1112 if (orElse !== null) |
| 2663 return orElse(); | 1113 return orElse(); |
| 1114 throw _internal.IterableElementError.noElement(); |
| 1115 } |
| 1116 lastWhere(test, opt$) { |
| 1117 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 1118 let length = this.length; |
| 1119 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no
tNull(i) - 1) { |
| 1120 let element = this.get(i); |
| 1121 if (test(element)) |
| 1122 return element; |
| 1123 if (length !== this.length) { |
| 1124 throw new core.ConcurrentModificationError(this); |
| 1125 } |
| 1126 } |
| 1127 if (orElse !== null) |
| 1128 return orElse(); |
| 1129 throw _internal.IterableElementError.noElement(); |
| 1130 } |
| 1131 singleWhere(test) { |
| 1132 let length = this.length; |
| 1133 let match = null; |
| 1134 let matchFound = false; |
| 1135 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 1136 let element = this.get(i); |
| 1137 if (test(element)) { |
| 1138 if (matchFound) { |
| 1139 throw _internal.IterableElementError.tooMany(); |
| 1140 } |
| 1141 matchFound = true; |
| 1142 match = element; |
| 1143 } |
| 1144 if (length !== this.length) { |
| 1145 throw new core.ConcurrentModificationError(this); |
| 1146 } |
| 1147 } |
| 1148 if (matchFound) |
| 1149 return match; |
| 1150 throw _internal.IterableElementError.noElement(); |
| 1151 } |
| 1152 join(separator) { |
| 1153 if (separator === void 0) |
| 1154 separator = ""; |
| 1155 if (this.length === 0) |
| 1156 return ""; |
| 1157 let buffer = new core.StringBuffer(); |
| 1158 buffer.writeAll(this, separator); |
| 1159 return buffer.toString(); |
| 1160 } |
| 1161 where(test) { |
| 1162 return new _internal.WhereIterable(this, test); |
| 1163 } |
| 1164 map(f) { |
| 1165 return new _internal.MappedListIterable(this, dart.as(f, dart.throw_("Un
implemented type (dynamic) → dynamic"))); |
| 1166 } |
| 1167 expand(f) { |
| 1168 return new _internal.ExpandIterable(this, f); |
| 1169 } |
| 1170 reduce(combine) { |
| 1171 let length = this.length; |
| 1172 if (length === 0) |
| 1173 throw _internal.IterableElementError.noElement(); |
| 1174 let value = this.get(0); |
| 1175 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 1176 value = combine(value, this.get(i)); |
| 1177 if (length !== this.length) { |
| 1178 throw new core.ConcurrentModificationError(this); |
| 1179 } |
| 1180 } |
| 1181 return value; |
| 1182 } |
| 1183 fold(initialValue, combine) { |
| 1184 let value = initialValue; |
| 1185 let length = this.length; |
| 1186 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 1187 value = combine(value, this.get(i)); |
| 1188 if (length !== this.length) { |
| 1189 throw new core.ConcurrentModificationError(this); |
| 1190 } |
| 1191 } |
| 1192 return value; |
| 1193 } |
| 1194 skip(count) { |
| 1195 return new _internal.SubListIterable(this, count, null); |
| 1196 } |
| 1197 skipWhile(test) { |
| 1198 return new _internal.SkipWhileIterable(this, test); |
| 1199 } |
| 1200 take(count) { |
| 1201 return new _internal.SubListIterable(this, 0, count); |
| 1202 } |
| 1203 takeWhile(test) { |
| 1204 return new _internal.TakeWhileIterable(this, test); |
| 1205 } |
| 1206 toList(opt$) { |
| 1207 let growable = opt$.growable === void 0 ? true : opt$.growable; |
| 1208 let result = null; |
| 1209 if (growable) { |
| 1210 result = ((_) => { |
| 1211 _.length = this.length; |
| 1212 return _; |
| 1213 }).bind(this)(new core.List()); |
| 1214 } else { |
| 1215 result = new core.List(this.length); |
| 1216 } |
| 1217 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { |
| 1218 result.set(i, this.get(i)); |
| 1219 } |
| 1220 return result; |
| 1221 } |
| 1222 toSet() { |
| 1223 let result = new core.Set(); |
| 1224 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { |
| 1225 result.add(this.get(i)); |
| 1226 } |
| 1227 return result; |
| 1228 } |
| 1229 add(element) { |
| 1230 this.set((($tmp) => this.length = dart.notNull($tmp) + 1, $tmp).bind(thi
s)(this.length), element); |
| 1231 } |
| 1232 addAll(iterable) { |
| 1233 for (let element of iterable) { |
| 1234 this.set((($tmp) => this.length = dart.notNull($tmp) + 1, $tmp).bind(t
his)(this.length), element); |
| 1235 } |
| 1236 } |
| 1237 remove(element) { |
| 1238 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { |
| 1239 if (dart.equals(this.get(i), element)) { |
| 1240 this.setRange(i, dart.notNull(this.length) - 1, this, dart.notNull(i
) + 1); |
| 1241 this.length = 1; |
| 1242 return true; |
| 1243 } |
| 1244 } |
| 1245 return false; |
| 1246 } |
| 1247 removeWhere(test) { |
| 1248 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), false); |
| 1249 } |
| 1250 retainWhere(test) { |
| 1251 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), true); |
| 1252 } |
| 1253 static [_filter](source, test, retainMatching) { |
| 1254 let retained = new List.from([]); |
| 1255 let length = source.length; |
| 1256 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 1257 let element = source.get(i); |
| 1258 if (test(element) === retainMatching) { |
| 1259 retained.add(element); |
| 1260 } |
| 1261 if (length !== source.length) { |
| 1262 throw new core.ConcurrentModificationError(source); |
| 1263 } |
| 1264 } |
| 1265 if (retained.length !== source.length) { |
| 1266 source.setRange(0, retained.length, retained); |
| 1267 source.length = retained.length; |
| 1268 } |
| 1269 } |
| 1270 clear() { |
| 1271 this.length = 0; |
| 1272 } |
| 1273 removeLast() { |
| 1274 if (this.length === 0) { |
| 1275 throw _internal.IterableElementError.noElement(); |
| 1276 } |
| 1277 let result = this.get(dart.notNull(this.length) - 1); |
| 1278 this.length = dart.notNull(this.length) - 1; |
| 1279 return result; |
| 1280 } |
| 1281 sort(compare) { |
| 1282 if (compare === void 0) |
| 1283 compare = null; |
| 1284 if (compare === null) { |
| 1285 let defaultCompare = core.Comparable.compare; |
| 1286 compare = defaultCompare; |
| 1287 } |
| 1288 _internal.Sort.sort(this, dart.as(compare, dart.throw_("Unimplemented ty
pe (dynamic, dynamic) → int"))); |
| 1289 } |
| 1290 shuffle(random) { |
| 1291 if (random === void 0) |
| 1292 random = null; |
| 1293 if (random === null) |
| 1294 random = new math.Random(); |
| 1295 let length = this.length; |
| 1296 while (dart.notNull(length) > 1) { |
| 1297 let pos = random.nextInt(length); |
| 1298 length = 1; |
| 1299 let tmp = this.get(length); |
| 1300 this.set(length, this.get(pos)); |
| 1301 this.set(pos, tmp); |
| 1302 } |
| 1303 } |
| 1304 asMap() { |
| 1305 return new _internal.ListMapView(this); |
| 1306 } |
| 1307 sublist(start, end) { |
| 1308 if (end === void 0) |
| 1309 end = null; |
| 1310 let listLength = this.length; |
| 1311 if (end === null) |
| 1312 end = listLength; |
| 1313 core.RangeError.checkValidRange(start, end, listLength); |
| 1314 let length = dart.notNull(end) - dart.notNull(start); |
| 1315 let result = new core.List(); |
| 1316 result.length = length; |
| 1317 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 1318 result.set(i, this.get(dart.notNull(start) + dart.notNull(i))); |
| 1319 } |
| 1320 return result; |
| 1321 } |
| 1322 getRange(start, end) { |
| 1323 core.RangeError.checkValidRange(start, end, this.length); |
| 1324 return new _internal.SubListIterable(this, start, end); |
| 1325 } |
| 1326 removeRange(start, end) { |
| 1327 core.RangeError.checkValidRange(start, end, this.length); |
| 1328 let length = dart.notNull(end) - dart.notNull(start); |
| 1329 this.setRange(start, dart.notNull(this.length) - dart.notNull(length), t
his, end); |
| 1330 this.length = length; |
| 1331 } |
| 1332 fillRange(start, end, fill) { |
| 1333 if (fill === void 0) |
| 1334 fill = null; |
| 1335 core.RangeError.checkValidRange(start, end, this.length); |
| 1336 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { |
| 1337 this.set(i, fill); |
| 1338 } |
| 1339 } |
| 1340 setRange(start, end, iterable, skipCount) { |
| 1341 if (skipCount === void 0) |
| 1342 skipCount = 0; |
| 1343 core.RangeError.checkValidRange(start, end, this.length); |
| 1344 let length = dart.notNull(end) - dart.notNull(start); |
| 1345 if (length === 0) |
| 1346 return; |
| 1347 core.RangeError.checkNotNegative(skipCount, "skipCount"); |
| 1348 let otherList = null; |
| 1349 let otherStart = null; |
| 1350 if (dart.is(iterable, core.List)) { |
| 1351 otherList = dart.as(iterable, core.List); |
| 1352 otherStart = skipCount; |
| 1353 } else { |
| 1354 otherList = iterable.skip(skipCount).toList({growable: false}); |
| 1355 otherStart = 0; |
| 1356 } |
| 1357 if (dart.notNull(otherStart) + dart.notNull(length) > dart.notNull(other
List.length)) { |
| 1358 throw _internal.IterableElementError.tooFew(); |
| 1359 } |
| 1360 if (dart.notNull(otherStart) < dart.notNull(start)) { |
| 1361 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.
notNull(i) - 1) { |
| 1362 this.set(dart.notNull(start) + dart.notNull(i), dart.as(otherList.ge
t(dart.notNull(otherStart) + dart.notNull(i)), E)); |
| 1363 } |
| 1364 } else { |
| 1365 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNu
ll(i) + 1) { |
| 1366 this.set(dart.notNull(start) + dart.notNull(i), dart.as(otherList.ge
t(dart.notNull(otherStart) + dart.notNull(i)), E)); |
| 1367 } |
| 1368 } |
| 1369 } |
| 1370 replaceRange(start, end, newContents) { |
| 1371 core.RangeError.checkValidRange(start, end, this.length); |
| 1372 if (!dart.is(newContents, _internal.EfficientLength)) { |
| 1373 newContents = newContents.toList(); |
| 1374 } |
| 1375 let removeLength = dart.notNull(end) - dart.notNull(start); |
| 1376 let insertLength = newContents.length; |
| 1377 if (dart.notNull(removeLength) >= dart.notNull(insertLength)) { |
| 1378 let delta = dart.notNull(removeLength) - dart.notNull(insertLength); |
| 1379 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); |
| 1380 let newLength = dart.notNull(this.length) - dart.notNull(delta); |
| 1381 this.setRange(start, insertEnd, newContents); |
| 1382 if (delta !== 0) { |
| 1383 this.setRange(insertEnd, newLength, this, end); |
| 1384 this.length = newLength; |
| 1385 } |
| 1386 } else { |
| 1387 let delta = dart.notNull(insertLength) - dart.notNull(removeLength); |
| 1388 let newLength = dart.notNull(this.length) + dart.notNull(delta); |
| 1389 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); |
| 1390 this.length = newLength; |
| 1391 this.setRange(insertEnd, newLength, this, end); |
| 1392 this.setRange(start, insertEnd, newContents); |
| 1393 } |
| 1394 } |
| 1395 indexOf(element, startIndex) { |
| 1396 if (startIndex === void 0) |
| 1397 startIndex = 0; |
| 1398 if (dart.notNull(startIndex) >= dart.notNull(this.length)) { |
| 1399 return -1; |
| 1400 } |
| 1401 if (dart.notNull(startIndex) < 0) { |
| 1402 startIndex = 0; |
| 1403 } |
| 1404 for (let i = startIndex; dart.notNull(i) < dart.notNull(this.length); i
= dart.notNull(i) + 1) { |
| 1405 if (dart.equals(this.get(i), element)) { |
| 1406 return i; |
| 1407 } |
| 1408 } |
| 1409 return -1; |
| 1410 } |
| 1411 lastIndexOf(element, startIndex) { |
| 1412 if (startIndex === void 0) |
| 1413 startIndex = null; |
| 1414 if (startIndex === null) { |
| 1415 startIndex = dart.notNull(this.length) - 1; |
| 1416 } else { |
| 1417 if (dart.notNull(startIndex) < 0) { |
| 1418 return -1; |
| 1419 } |
| 1420 if (dart.notNull(startIndex) >= dart.notNull(this.length)) { |
| 1421 startIndex = dart.notNull(this.length) - 1; |
| 1422 } |
| 1423 } |
| 1424 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1)
{ |
| 1425 if (dart.equals(this.get(i), element)) { |
| 1426 return i; |
| 1427 } |
| 1428 } |
| 1429 return -1; |
| 1430 } |
| 1431 insert(index, element) { |
| 1432 core.RangeError.checkValueInInterval(index, 0, this.length, "index"); |
| 1433 if (index === this.length) { |
| 1434 this.add(element); |
| 1435 return; |
| 1436 } |
| 1437 if (!(typeof index == number)) |
| 1438 throw new core.ArgumentError(index); |
| 1439 this.length = dart.notNull(this.length) + 1; |
| 1440 this.setRange(dart.notNull(index) + 1, this.length, this, index); |
| 1441 this.set(index, element); |
| 1442 } |
| 1443 removeAt(index) { |
| 1444 let result = this.get(index); |
| 1445 this.setRange(index, dart.notNull(this.length) - 1, this, dart.notNull(i
ndex) + 1); |
| 1446 this.length = dart.notNull(this.length) - 1; |
| 1447 return result; |
| 1448 } |
| 1449 insertAll(index, iterable) { |
| 1450 core.RangeError.checkValueInInterval(index, 0, this.length, "index"); |
| 1451 if (dart.is(iterable, _internal.EfficientLength)) { |
| 1452 iterable = iterable.toList(); |
| 1453 } |
| 1454 let insertionLength = iterable.length; |
| 1455 this.length = insertionLength; |
| 1456 this.setRange(dart.notNull(index) + dart.notNull(insertionLength), this.
length, this, index); |
| 1457 this.setAll(index, iterable); |
| 1458 } |
| 1459 setAll(index, iterable) { |
| 1460 if (dart.is(iterable, core.List)) { |
| 1461 this.setRange(index, dart.notNull(index) + dart.notNull(iterable.lengt
h), iterable); |
| 1462 } else { |
| 1463 for (let element of iterable) { |
| 1464 this.set((($tmp) => index = dart.notNull($tmp) + 1, $tmp)(index), el
ement); |
| 1465 } |
| 1466 } |
| 1467 } |
| 1468 get reversed() { |
| 1469 return new _internal.ReversedListIterable(this); |
| 1470 } |
| 1471 toString() { |
| 1472 return IterableBase.iterableToFullString(this, '[', ']'); |
| 1473 } |
| 1474 } |
| 1475 return ListMixin; |
| 1476 }); |
| 1477 let ListMixin = ListMixin$(dart.dynamic); |
| 1478 let MapBase$ = dart.generic(function(K, V) { |
| 1479 class MapBase extends dart.mixin(MapMixin$(K, V)) { |
| 1480 } |
| 1481 return MapBase; |
| 1482 }); |
| 1483 let MapBase = MapBase$(dart.dynamic, dart.dynamic); |
| 1484 let MapMixin$ = dart.generic(function(K, V) { |
| 1485 class MapMixin extends core.Object { |
| 1486 forEach(action) { |
| 1487 for (let key of this.keys) { |
| 1488 action(key, this.get(key)); |
| 1489 } |
| 1490 } |
| 1491 addAll(other) { |
| 1492 for (let key of other.keys) { |
| 1493 this.set(key, other.get(key)); |
| 1494 } |
| 1495 } |
| 1496 containsValue(value) { |
| 1497 for (let key of this.keys) { |
| 1498 if (dart.equals(this.get(key), value)) |
| 1499 return true; |
| 1500 } |
| 1501 return false; |
| 1502 } |
| 1503 putIfAbsent(key, ifAbsent) { |
| 1504 if (this.keys.contains(key)) { |
| 1505 return this.get(key); |
| 1506 } |
| 1507 return this.set(key, ifAbsent()); |
| 1508 } |
| 1509 containsKey(key) { |
| 1510 return this.keys.contains(key); |
| 1511 } |
| 1512 get length() { |
| 1513 return this.keys.length; |
| 1514 } |
| 1515 get isEmpty() { |
| 1516 return this.keys.isEmpty; |
| 1517 } |
| 1518 get isNotEmpty() { |
| 1519 return this.keys.isNotEmpty; |
| 1520 } |
| 1521 get values() { |
| 1522 return new _MapBaseValueIterable(this); |
| 1523 } |
| 1524 toString() { |
| 1525 return Maps.mapToString(this); |
| 1526 } |
| 1527 } |
| 1528 return MapMixin; |
| 1529 }); |
| 1530 let MapMixin = MapMixin$(dart.dynamic, dart.dynamic); |
| 1531 let UnmodifiableMapBase$ = dart.generic(function(K, V) { |
| 1532 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { |
| 1533 } |
| 1534 return UnmodifiableMapBase; |
| 1535 }); |
| 1536 let UnmodifiableMapBase = UnmodifiableMapBase$(dart.dynamic, dart.dynamic); |
| 1537 let _map = Symbol('_map'); |
| 1538 let _MapBaseValueIterable$ = dart.generic(function(V) { |
| 1539 class _MapBaseValueIterable extends IterableBase$(V) { |
| 1540 _MapBaseValueIterable($_map) { |
| 1541 this[_map] = $_map; |
| 1542 super.IterableBase(); |
| 1543 } |
| 1544 get length() { |
| 1545 return this[_map].length; |
| 1546 } |
| 1547 get isEmpty() { |
| 1548 return this[_map].isEmpty; |
| 1549 } |
| 1550 get isNotEmpty() { |
| 1551 return this[_map].isNotEmpty; |
| 1552 } |
| 1553 get first() { |
| 1554 return dart.as(this[_map].get(this[_map].keys.first), V); |
| 1555 } |
| 1556 get single() { |
| 1557 return dart.as(this[_map].get(this[_map].keys.single), V); |
| 1558 } |
| 1559 get last() { |
| 1560 return dart.as(this[_map].get(this[_map].keys.last), V); |
| 1561 } |
| 1562 get iterator() { |
| 1563 return new _MapBaseValueIterator(this[_map]); |
| 1564 } |
| 1565 } |
| 1566 return _MapBaseValueIterable; |
| 1567 }); |
| 1568 let _MapBaseValueIterable = _MapBaseValueIterable$(dart.dynamic); |
| 1569 let _keys = Symbol('_keys'); |
| 1570 let _MapBaseValueIterator$ = dart.generic(function(V) { |
| 1571 class _MapBaseValueIterator extends core.Object { |
| 1572 _MapBaseValueIterator(map) { |
| 1573 this[_map] = map; |
| 1574 this[_keys] = map.keys.iterator; |
| 1575 this[_current] = null; |
| 1576 } |
| 1577 moveNext() { |
| 1578 if (this[_keys].moveNext()) { |
| 1579 this[_current] = dart.as(this[_map].get(this[_keys].current), V); |
| 1580 return true; |
| 1581 } |
| 1582 this[_current] = null; |
| 1583 return false; |
| 1584 } |
| 1585 get current() { |
| 1586 return this[_current]; |
| 1587 } |
| 1588 } |
| 1589 return _MapBaseValueIterator; |
| 1590 }); |
| 1591 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) { |
| 1614 class MapView extends core.Object { |
| 1615 MapView(map) { |
| 1616 this[_map] = map; |
| 1617 } |
| 1618 get(key) { |
| 1619 return this[_map].get(key); |
| 1620 } |
| 1621 set(key, value) { |
| 1622 this[_map].set(key, value); |
| 1623 } |
| 1624 addAll(other) { |
| 1625 this[_map].addAll(other); |
| 1626 } |
| 1627 clear() { |
| 1628 this[_map].clear(); |
| 1629 } |
| 1630 putIfAbsent(key, ifAbsent) { |
| 1631 return this[_map].putIfAbsent(key, ifAbsent); |
| 1632 } |
| 1633 containsKey(key) { |
| 1634 return this[_map].containsKey(key); |
| 1635 } |
| 1636 containsValue(value) { |
| 1637 return this[_map].containsValue(value); |
| 1638 } |
| 1639 forEach(action) { |
| 1640 this[_map].forEach(action); |
| 1641 } |
| 1642 get isEmpty() { |
| 1643 return this[_map].isEmpty; |
| 1644 } |
| 1645 get isNotEmpty() { |
| 1646 return this[_map].isNotEmpty; |
| 1647 } |
| 1648 get length() { |
| 1649 return this[_map].length; |
| 1650 } |
| 1651 get keys() { |
| 1652 return this[_map].keys; |
| 1653 } |
| 1654 remove(key) { |
| 1655 return this[_map].remove(key); |
| 1656 } |
| 1657 toString() { |
| 1658 return this[_map].toString(); |
| 1659 } |
| 1660 get values() { |
| 1661 return this[_map].values; |
| 1662 } |
| 1663 } |
| 1664 return MapView; |
| 1665 }); |
| 1666 let MapView = MapView$(dart.dynamic, dart.dynamic); |
| 1667 let UnmodifiableMapView$ = dart.generic(function(K, V) { |
| 1668 class UnmodifiableMapView extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { |
| 1669 } |
| 1670 return UnmodifiableMapView; |
| 1671 }); |
| 1672 let UnmodifiableMapView = UnmodifiableMapView$(dart.dynamic, dart.dynamic); |
| 1673 let _toStringVisiting = Symbol('_toStringVisiting'); |
| 1674 let _id = Symbol('_id'); |
| 1675 let _fillMapWithMappedIterable = Symbol('_fillMapWithMappedIterable'); |
| 1676 let _fillMapWithIterables = Symbol('_fillMapWithIterables'); |
| 1677 class Maps extends core.Object { |
| 1678 static containsValue(map, value) { |
| 1679 for (let v of map.values) { |
| 1680 if (dart.equals(value, v)) { |
| 1681 return true; |
| 1682 } |
| 1683 } |
| 1684 return false; |
| 1685 } |
| 1686 static containsKey(map, key) { |
| 1687 for (let k of map.keys) { |
| 1688 if (dart.equals(key, k)) { |
| 1689 return true; |
| 1690 } |
| 1691 } |
| 1692 return false; |
| 1693 } |
| 1694 static putIfAbsent(map, key, ifAbsent) { |
| 1695 if (map.containsKey(key)) { |
| 1696 return map.get(key); |
| 1697 } |
| 1698 let v = ifAbsent(); |
| 1699 map.set(key, v); |
| 1700 return v; |
| 1701 } |
| 1702 static clear(map) { |
| 1703 for (let k of map.keys.toList()) { |
| 1704 map.remove(k); |
| 1705 } |
| 1706 } |
| 1707 static forEach(map, f) { |
| 1708 for (let k of map.keys) { |
| 1709 f(k, map.get(k)); |
| 1710 } |
| 1711 } |
| 1712 static getValues(map) { |
| 1713 return map.keys.map((key) => map.get(key)); |
| 1714 } |
| 1715 static length(map) { |
| 1716 return map.keys.length; |
| 1717 } |
| 1718 static isEmpty(map) { |
| 1719 return map.keys.isEmpty; |
| 1720 } |
| 1721 static isNotEmpty(map) { |
| 1722 return map.keys.isNotEmpty; |
| 1723 } |
| 1724 static mapToString(m) { |
| 1725 if (IterableBase._isToStringVisiting(m)) { |
| 1726 return '{...}'; |
| 1727 } |
| 1728 let result = new core.StringBuffer(); |
| 1729 try { |
| 1730 IterableBase[_toStringVisiting].add(m); |
| 1731 result.write('{'); |
| 1732 let first = true; |
| 1733 m.forEach(((k, v) => { |
| 1734 if (!dart.notNull(first)) { |
| 1735 result.write(', '); |
| 1736 } |
| 1737 first = false; |
| 1738 result.write(k); |
| 1739 result.write(': '); |
| 1740 result.write(v); |
| 1741 }).bind(this)); |
| 1742 result.write('}'); |
| 1743 } finally { |
| 1744 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m)); |
| 1745 IterableBase[_toStringVisiting].removeLast(); |
| 1746 } |
| 1747 return result.toString(); |
| 1748 } |
| 1749 static [_id](x) { |
| 1750 return x; |
| 1751 } |
| 1752 static [_fillMapWithMappedIterable](map, iterable, key, value) { |
| 1753 if (key === null) |
| 1754 key = _id; |
| 1755 if (value === null) |
| 1756 value = _id; |
| 1757 for (let element of iterable) { |
| 1758 map.set(key(element), value(element)); |
| 1759 } |
| 1760 } |
| 1761 static [_fillMapWithIterables](map, keys, values) { |
| 1762 let keyIterator = keys.iterator; |
| 1763 let valueIterator = values.iterator; |
| 1764 let hasNextKey = keyIterator.moveNext(); |
| 1765 let hasNextValue = valueIterator.moveNext(); |
| 1766 while (dart.notNull(hasNextKey) && dart.notNull(hasNextValue)) { |
| 1767 map.set(keyIterator.current, valueIterator.current); |
| 1768 hasNextKey = keyIterator.moveNext(); |
| 1769 hasNextValue = valueIterator.moveNext(); |
| 1770 } |
| 1771 if (dart.notNull(hasNextKey) || dart.notNull(hasNextValue)) { |
| 1772 throw new core.ArgumentError("Iterables do not have same length."); |
| 1773 } |
| 1774 } |
| 1775 } |
| 1776 let Queue$ = dart.generic(function(E) { |
| 1777 class Queue extends core.Object { |
| 1778 Queue() { |
| 1779 return new ListQueue(); |
| 1780 } |
| 1781 Queue$from(elements) { |
| 1782 return new ListQueue.from(elements); |
| 1783 } |
| 1784 } |
| 1785 dart.defineNamedConstructor(Queue, 'from'); |
| 1786 return Queue; |
| 1787 }); |
| 1788 let Queue = Queue$(dart.dynamic); |
| 1789 let _element = Symbol('_element'); |
| 1790 let _link = Symbol('_link'); |
| 1791 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry'); |
| 1792 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { |
| 1793 class DoubleLinkedQueueEntry extends core.Object { |
| 1794 DoubleLinkedQueueEntry(e) { |
| 1795 this[_element] = e; |
| 1796 this[_previous] = null; |
| 1797 this[_next] = null; |
| 1798 } |
| 1799 [_link](previous, next) { |
| 1800 this[_next] = next; |
| 1801 this[_previous] = previous; |
| 1802 previous[_next] = this; |
| 1803 next[_previous] = this; |
| 1804 } |
| 1805 append(e) { |
| 1806 new DoubleLinkedQueueEntry(e)._link(this, this[_next]); |
| 1807 } |
| 1808 prepend(e) { |
| 1809 new DoubleLinkedQueueEntry(e)._link(this[_previous], this); |
| 1810 } |
| 1811 remove() { |
| 1812 this[_previous][_next] = this[_next]; |
| 1813 this[_next][_previous] = this[_previous]; |
| 1814 this[_next] = null; |
| 1815 this[_previous] = null; |
| 1816 return this[_element]; |
| 1817 } |
| 1818 [_asNonSentinelEntry]() { |
| 1819 return this; |
| 1820 } |
| 1821 previousEntry() { |
| 1822 return this[_previous]._asNonSentinelEntry(); |
| 1823 } |
| 1824 nextEntry() { |
| 1825 return this[_next]._asNonSentinelEntry(); |
| 1826 } |
| 1827 get element() { |
| 1828 return this[_element]; |
| 1829 } |
| 1830 set element(e) { |
| 1831 this[_element] = e; |
| 1832 } |
| 1833 } |
| 1834 return DoubleLinkedQueueEntry; |
| 1835 }); |
| 1836 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dart.dynamic); |
| 1837 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { |
| 1838 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { |
| 1839 _DoubleLinkedQueueEntrySentinel() { |
| 1840 super.DoubleLinkedQueueEntry(null); |
| 1841 this[_link](this, this); |
| 1842 } |
| 1843 remove() { |
| 1844 throw _internal.IterableElementError.noElement(); |
| 1845 } |
| 1846 [_asNonSentinelEntry]() { |
| 1847 return null; |
| 1848 } |
| 1849 set element(e) { |
| 1850 dart.assert(false); |
| 1851 } |
| 1852 get element() { |
| 1853 throw _internal.IterableElementError.noElement(); |
| 1854 } |
| 1855 } |
| 1856 return _DoubleLinkedQueueEntrySentinel; |
| 1857 }); |
| 1858 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(dart.dy
namic); |
| 1859 let _sentinel = Symbol('_sentinel'); |
| 1860 let _elementCount = Symbol('_elementCount'); |
| 1861 let DoubleLinkedQueue$ = dart.generic(function(E) { |
| 1862 class DoubleLinkedQueue extends IterableBase$(E) { |
| 1863 DoubleLinkedQueue() { |
| 1864 this[_sentinel] = null; |
| 1865 this[_elementCount] = 0; |
| 1866 super.IterableBase(); |
| 1867 this[_sentinel] = new _DoubleLinkedQueueEntrySentinel(); |
| 1868 } |
| 1869 DoubleLinkedQueue$from(elements) { |
| 1870 let list = dart.as(new DoubleLinkedQueue(), Queue$(E)); |
| 1871 for (let e of elements) { |
| 1872 list.addLast(e); |
| 1873 } |
| 1874 return dart.as(list, DoubleLinkedQueue$(E)); |
| 1875 } |
| 1876 get length() { |
| 1877 return this[_elementCount]; |
| 1878 } |
| 1879 addLast(value) { |
| 1880 this[_sentinel].prepend(value); |
| 1881 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
| 1882 } |
| 1883 addFirst(value) { |
| 1884 this[_sentinel].append(value); |
| 1885 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
| 1886 } |
| 1887 add(value) { |
| 1888 this[_sentinel].prepend(value); |
| 1889 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
| 1890 } |
| 1891 addAll(iterable) { |
| 1892 for (let value of iterable) { |
| 1893 this[_sentinel].prepend(value); |
| 1894 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; |
| 1895 } |
| 1896 } |
| 1897 removeLast() { |
| 1898 let result = this[_sentinel][_previous].remove(); |
| 1899 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
| 1900 return result; |
| 1901 } |
| 1902 removeFirst() { |
| 1903 let result = this[_sentinel][_next].remove(); |
| 1904 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
| 1905 return result; |
| 1906 } |
| 1907 remove(o) { |
| 1908 let entry = this[_sentinel][_next]; |
| 1909 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
| 1910 if (dart.equals(entry.element, o)) { |
| 1911 entry.remove(); |
| 1912 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
| 1913 return true; |
| 1914 } |
| 1915 entry = entry[_next]; |
| 1916 } |
| 1917 return false; |
| 1918 } |
| 1919 [_filter](test, removeMatching) { |
| 1920 let entry = this[_sentinel][_next]; |
| 1921 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
| 1922 let next = entry[_next]; |
| 1923 if (core.identical(removeMatching, test(entry.element))) { |
| 1924 entry.remove(); |
| 1925 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; |
| 1926 } |
| 1927 entry = next; |
| 1928 } |
| 1929 } |
| 1930 removeWhere(test) { |
| 1931 this[_filter](test, true); |
| 1932 } |
| 1933 retainWhere(test) { |
| 1934 this[_filter](test, false); |
| 1935 } |
| 1936 get first() { |
| 1937 return this[_sentinel][_next].element; |
| 1938 } |
| 1939 get last() { |
| 1940 return this[_sentinel][_previous].element; |
| 1941 } |
| 1942 get single() { |
| 1943 if (core.identical(this[_sentinel][_next], this[_sentinel][_previous]))
{ |
| 1944 return this[_sentinel][_next].element; |
| 1945 } |
| 1946 throw _internal.IterableElementError.tooMany(); |
| 1947 } |
| 1948 lastEntry() { |
| 1949 return this[_sentinel].previousEntry(); |
| 1950 } |
| 1951 firstEntry() { |
| 1952 return this[_sentinel].nextEntry(); |
| 1953 } |
| 1954 get isEmpty() { |
| 1955 return core.identical(this[_sentinel][_next], this[_sentinel]); |
| 1956 } |
| 1957 clear() { |
| 1958 this[_sentinel][_next] = this[_sentinel]; |
| 1959 this[_sentinel][_previous] = this[_sentinel]; |
| 1960 this[_elementCount] = 0; |
| 1961 } |
| 1962 forEachEntry(f) { |
| 1963 let entry = this[_sentinel][_next]; |
| 1964 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
| 1965 let nextEntry = entry[_next]; |
| 1966 f(entry); |
| 1967 entry = nextEntry; |
| 1968 } |
| 1969 } |
| 1970 get iterator() { |
| 1971 return new _DoubleLinkedQueueIterator(this[_sentinel]); |
| 1972 } |
| 1973 toString() { |
| 1974 return IterableBase.iterableToFullString(this, '{', '}'); |
| 1975 } |
| 1976 } |
| 1977 dart.defineNamedConstructor(DoubleLinkedQueue, 'from'); |
| 1978 return DoubleLinkedQueue; |
| 1979 }); |
| 1980 let DoubleLinkedQueue = DoubleLinkedQueue$(dart.dynamic); |
| 1981 let _nextEntry = Symbol('_nextEntry'); |
| 1982 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) { |
| 1983 class _DoubleLinkedQueueIterator extends core.Object { |
| 1984 _DoubleLinkedQueueIterator(sentinel) { |
| 1985 this[_sentinel] = sentinel; |
| 1986 this[_nextEntry] = sentinel[_next]; |
| 1987 this[_current] = null; |
| 1988 } |
| 1989 moveNext() { |
| 1990 if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) { |
| 1991 this[_current] = this[_nextEntry][_element]; |
| 1992 this[_nextEntry] = this[_nextEntry][_next]; |
| 1993 return true; |
| 1994 } |
| 1995 this[_current] = null; |
| 1996 this[_nextEntry] = this[_sentinel] = null; |
| 1997 return false; |
| 1998 } |
| 1999 get current() { |
| 2000 return this[_current]; |
| 2001 } |
| 2002 } |
| 2003 return _DoubleLinkedQueueIterator; |
| 2004 }); |
| 2005 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dart.dynamic); |
| 2006 let _head = Symbol('_head'); |
| 2007 let _tail = Symbol('_tail'); |
| 2008 let _table = Symbol('_table'); |
| 2009 let _checkModification = Symbol('_checkModification'); |
| 2010 let _writeToList = Symbol('_writeToList'); |
| 2011 let _add = Symbol('_add'); |
| 2012 let _preGrow = Symbol('_preGrow'); |
| 2013 let _remove = Symbol('_remove'); |
| 2014 let _filterWhere = Symbol('_filterWhere'); |
| 2015 let _grow = Symbol('_grow'); |
| 2016 let _isPowerOf2 = Symbol('_isPowerOf2'); |
| 2017 let _nextPowerOf2 = Symbol('_nextPowerOf2'); |
| 2018 let ListQueue$ = dart.generic(function(E) { |
| 2019 class ListQueue extends IterableBase$(E) { |
| 2020 ListQueue(initialCapacity) { |
| 2021 if (initialCapacity === void 0) |
| 2022 initialCapacity = null; |
| 2023 this[_head] = 0; |
| 2024 this[_tail] = 0; |
| 2025 this[_table] = null; |
| 2026 this[_modificationCount] = 0; |
| 2027 super.IterableBase(); |
| 2028 if (initialCapacity === null || dart.notNull(initialCapacity) < dart.not
Null(ListQueue._INITIAL_CAPACITY)) { |
| 2029 initialCapacity = ListQueue._INITIAL_CAPACITY; |
| 2030 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) { |
| 2031 initialCapacity = _nextPowerOf2(initialCapacity); |
| 2032 } |
| 2033 dart.assert(_isPowerOf2(initialCapacity)); |
| 2034 this[_table] = new core.List(initialCapacity); |
| 2035 } |
| 2036 ListQueue$from(elements) { |
| 2037 if (dart.is(elements, core.List)) { |
| 2038 let length = elements.length; |
| 2039 let queue = dart.as(new ListQueue(dart.notNull(length) + 1), ListQueue
$(E)); |
| 2040 dart.assert(dart.notNull(queue[_table].length) > dart.notNull(length))
; |
| 2041 let sourceList = elements; |
| 2042 queue[_table].setRange(0, length, dart.as(sourceList, core.Iterable$(E
)), 0); |
| 2043 queue[_tail] = length; |
| 2044 return queue; |
| 2045 } else { |
| 2046 let capacity = ListQueue._INITIAL_CAPACITY; |
| 2047 if (dart.is(elements, _internal.EfficientLength)) { |
| 2048 capacity = elements.length; |
| 2049 } |
| 2050 let result = new ListQueue(capacity); |
| 2051 for (let element of elements) { |
| 2052 result.addLast(element); |
| 2053 } |
| 2054 return result; |
| 2055 } |
| 2056 } |
| 2057 get iterator() { |
| 2058 return new _ListQueueIterator(this); |
| 2059 } |
| 2060 forEach(action) { |
| 2061 let modificationCount = this[_modificationCount]; |
| 2062 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d
art.notNull(this[_table].length) - 1) { |
| 2063 action(this[_table].get(i)); |
| 2064 this[_checkModification](modificationCount); |
| 2065 } |
| 2066 } |
| 2067 get isEmpty() { |
| 2068 return this[_head] === this[_tail]; |
| 2069 } |
| 2070 get length() { |
| 2071 return dart.notNull(this[_tail]) - dart.notNull(this[_head]) & dart.notN
ull(this[_table].length) - 1; |
| 2072 } |
| 2073 get first() { |
| 2074 if (this[_head] === this[_tail]) |
| 2075 throw _internal.IterableElementError.noElement(); |
| 2076 return this[_table].get(this[_head]); |
| 2077 } |
| 2078 get last() { |
| 2079 if (this[_head] === this[_tail]) |
| 2080 throw _internal.IterableElementError.noElement(); |
| 2081 return this[_table].get(dart.notNull(this[_tail]) - 1 & dart.notNull(thi
s[_table].length) - 1); |
| 2082 } |
| 2083 get single() { |
| 2084 if (this[_head] === this[_tail]) |
| 2085 throw _internal.IterableElementError.noElement(); |
| 2086 if (dart.notNull(this.length) > 1) |
| 2087 throw _internal.IterableElementError.tooMany(); |
| 2088 return this[_table].get(this[_head]); |
| 2089 } |
| 2090 elementAt(index) { |
| 2091 core.RangeError.checkValidIndex(index, this); |
| 2092 return this[_table].get(dart.notNull(this[_head]) + dart.notNull(index)
& dart.notNull(this[_table].length) - 1); |
| 2093 } |
| 2094 toList(opt$) { |
| 2095 let growable = opt$.growable === void 0 ? true : opt$.growable; |
| 2096 let list = null; |
| 2097 if (growable) { |
| 2098 list = ((_) => { |
| 2099 _.length = this.length; |
| 2100 return _; |
| 2101 }).bind(this)(new core.List()); |
| 2102 } else { |
| 2103 list = new core.List(this.length); |
| 2104 } |
| 2105 this[_writeToList](list); |
| 2106 return list; |
| 2107 } |
| 2108 add(element) { |
| 2109 this[_add](element); |
| 2110 } |
| 2111 addAll(elements) { |
| 2112 if (dart.is(elements, core.List)) { |
| 2113 let list = dart.as(elements, core.List); |
| 2114 let addCount = list.length; |
| 2115 let length = this.length; |
| 2116 if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this
[_table].length)) { |
| 2117 this[_preGrow](dart.notNull(length) + dart.notNull(addCount)); |
| 2118 this[_table].setRange(length, dart.notNull(length) + dart.notNull(ad
dCount), dart.as(list, core.Iterable$(E)), 0); |
| 2119 this[_tail] = addCount; |
| 2120 } else { |
| 2121 let endSpace = dart.notNull(this[_table].length) - dart.notNull(this
[_tail]); |
| 2122 if (dart.notNull(addCount) < dart.notNull(endSpace)) { |
| 2123 this[_table].setRange(this[_tail], dart.notNull(this[_tail]) + dar
t.notNull(addCount), dart.as(list, core.Iterable$(E)), 0); |
| 2124 this[_tail] = addCount; |
| 2125 } else { |
| 2126 let preSpace = dart.notNull(addCount) - dart.notNull(endSpace); |
| 2127 this[_table].setRange(this[_tail], dart.notNull(this[_tail]) + dar
t.notNull(endSpace), dart.as(list, core.Iterable$(E)), 0); |
| 2128 this[_table].setRange(0, preSpace, dart.as(list, core.Iterable$(E)
), endSpace); |
| 2129 this[_tail] = preSpace; |
| 2130 } |
| 2131 } |
| 2132 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 2133 } else { |
| 2134 for (let element of elements) |
| 2135 this[_add](element); |
| 2136 } |
| 2137 } |
| 2138 remove(object) { |
| 2139 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d
art.notNull(this[_table].length) - 1) { |
| 2140 let element = this[_table].get(i); |
| 2141 if (dart.equals(element, object)) { |
| 2142 this[_remove](i); |
| 2143 this[_modificationCount] = dart.notNull(this[_modificationCount]) +
1; |
| 2144 return true; |
| 2145 } |
| 2146 } |
| 2147 return false; |
| 2148 } |
| 2149 [_filterWhere](test, removeMatching) { |
| 2150 let index = this[_head]; |
| 2151 let modificationCount = this[_modificationCount]; |
| 2152 let i = this[_head]; |
| 2153 while (i !== this[_tail]) { |
| 2154 let element = this[_table].get(i); |
| 2155 let remove = core.identical(removeMatching, test(element)); |
| 2156 this[_checkModification](modificationCount); |
| 2157 if (remove) { |
| 2158 i = this[_remove](i); |
| 2159 modificationCount = this[_modificationCount] = dart.notNull(this[_mo
dificationCount]) + 1; |
| 2160 } else { |
| 2161 i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1; |
| 2162 } |
| 2163 } |
| 2164 } |
| 2165 removeWhere(test) { |
| 2166 this[_filterWhere](test, true); |
| 2167 } |
| 2168 retainWhere(test) { |
| 2169 this[_filterWhere](test, false); |
| 2170 } |
| 2171 clear() { |
| 2172 if (this[_head] !== this[_tail]) { |
| 2173 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 &
dart.notNull(this[_table].length) - 1) { |
| 2174 this[_table].set(i, null); |
| 2175 } |
| 2176 this[_head] = this[_tail] = 0; |
| 2177 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 2178 } |
| 2179 } |
| 2180 toString() { |
| 2181 return IterableBase.iterableToFullString(this, "{", "}"); |
| 2182 } |
| 2183 addLast(element) { |
| 2184 this[_add](element); |
| 2185 } |
| 2186 addFirst(element) { |
| 2187 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table].
length) - 1; |
| 2188 this[_table].set(this[_head], element); |
| 2189 if (this[_head] === this[_tail]) |
| 2190 this[_grow](); |
| 2191 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 2192 } |
| 2193 removeFirst() { |
| 2194 if (this[_head] === this[_tail]) |
| 2195 throw _internal.IterableElementError.noElement(); |
| 2196 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 2197 let result = this[_table].get(this[_head]); |
| 2198 this[_table].set(this[_head], null); |
| 2199 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(this[_table].
length) - 1; |
| 2200 return result; |
| 2201 } |
| 2202 removeLast() { |
| 2203 if (this[_head] === this[_tail]) |
| 2204 throw _internal.IterableElementError.noElement(); |
| 2205 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 2206 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table].
length) - 1; |
| 2207 let result = this[_table].get(this[_tail]); |
| 2208 this[_table].set(this[_tail], null); |
| 2209 return result; |
| 2210 } |
| 2211 static [_isPowerOf2](number) { |
| 2212 return (dart.notNull(number) & dart.notNull(number) - 1) === 0; |
| 2213 } |
| 2214 static [_nextPowerOf2](number) { |
| 2215 dart.assert(dart.notNull(number) > 0); |
| 2216 number = (dart.notNull(number) << 1) - 1; |
| 2217 for (;;) { |
| 2218 let nextNumber = dart.notNull(number) & dart.notNull(number) - 1; |
| 2219 if (nextNumber === 0) |
| 2220 return number; |
| 2221 number = nextNumber; |
| 2222 } |
| 2223 } |
| 2224 [_checkModification](expectedModificationCount) { |
| 2225 if (expectedModificationCount !== this[_modificationCount]) { |
| 2226 throw new core.ConcurrentModificationError(this); |
| 2227 } |
| 2228 } |
| 2229 [_add](element) { |
| 2230 this[_table].set(this[_tail], element); |
| 2231 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table].
length) - 1; |
| 2232 if (this[_head] === this[_tail]) |
| 2233 this[_grow](); |
| 2234 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 2235 } |
| 2236 [_remove](offset) { |
| 2237 let mask = dart.notNull(this[_table].length) - 1; |
| 2238 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d
art.notNull(mask); |
| 2239 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar
t.notNull(mask); |
| 2240 if (dart.notNull(startDistance) < dart.notNull(endDistance)) { |
| 2241 let i = offset; |
| 2242 while (i !== this[_head]) { |
| 2243 let prevOffset = dart.notNull(i) - 1 & dart.notNull(mask); |
| 2244 this[_table].set(i, this[_table].get(prevOffset)); |
| 2245 i = prevOffset; |
| 2246 } |
| 2247 this[_table].set(this[_head], null); |
| 2248 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(mask); |
| 2249 return dart.notNull(offset) + 1 & dart.notNull(mask); |
| 2250 } else { |
| 2251 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(mask); |
| 2252 let i = offset; |
| 2253 while (i !== this[_tail]) { |
| 2254 let nextOffset = dart.notNull(i) + 1 & dart.notNull(mask); |
| 2255 this[_table].set(i, this[_table].get(nextOffset)); |
| 2256 i = nextOffset; |
| 2257 } |
| 2258 this[_table].set(this[_tail], null); |
| 2259 return offset; |
| 2260 } |
| 2261 } |
| 2262 [_grow]() { |
| 2263 let newTable = new core.List(dart.notNull(this[_table].length) * 2); |
| 2264 let split = dart.notNull(this[_table].length) - dart.notNull(this[_head]
); |
| 2265 newTable.setRange(0, split, this[_table], this[_head]); |
| 2266 newTable.setRange(split, dart.notNull(split) + dart.notNull(this[_head])
, this[_table], 0); |
| 2267 this[_head] = 0; |
| 2268 this[_tail] = this[_table].length; |
| 2269 this[_table] = newTable; |
| 2270 } |
| 2271 [_writeToList](target) { |
| 2272 dart.assert(dart.notNull(target.length) >= dart.notNull(this.length)); |
| 2273 if (dart.notNull(this[_head]) <= dart.notNull(this[_tail])) { |
| 2274 let length = dart.notNull(this[_tail]) - dart.notNull(this[_head]); |
| 2275 target.setRange(0, length, this[_table], this[_head]); |
| 2276 return length; |
| 2277 } else { |
| 2278 let firstPartSize = dart.notNull(this[_table].length) - dart.notNull(t
his[_head]); |
| 2279 target.setRange(0, firstPartSize, this[_table], this[_head]); |
| 2280 target.setRange(firstPartSize, dart.notNull(firstPartSize) + dart.notN
ull(this[_tail]), this[_table], 0); |
| 2281 return dart.notNull(this[_tail]) + dart.notNull(firstPartSize); |
| 2282 } |
| 2283 } |
| 2284 [_preGrow](newElementCount) { |
| 2285 dart.assert(dart.notNull(newElementCount) >= dart.notNull(this.length)); |
| 2286 newElementCount = dart.notNull(newElementCount) >> 1; |
| 2287 let newCapacity = _nextPowerOf2(newElementCount); |
| 2288 let newTable = new core.List(newCapacity); |
| 2289 this[_tail] = this[_writeToList](newTable); |
| 2290 this[_table] = newTable; |
| 2291 this[_head] = 0; |
| 2292 } |
| 2293 } |
| 2294 dart.defineNamedConstructor(ListQueue, 'from'); |
| 2295 ListQueue._INITIAL_CAPACITY = 8; |
| 2296 return ListQueue; |
| 2297 }); |
| 2298 let ListQueue = ListQueue$(dart.dynamic); |
| 2299 let _queue = Symbol('_queue'); |
| 2300 let _end = Symbol('_end'); |
| 2301 let _position = Symbol('_position'); |
| 2302 let _ListQueueIterator$ = dart.generic(function(E) { |
| 2303 class _ListQueueIterator extends core.Object { |
| 2304 _ListQueueIterator(queue) { |
| 2305 this[_queue] = queue; |
| 2306 this[_end] = queue[_tail]; |
| 2307 this[_modificationCount] = queue[_modificationCount]; |
| 2308 this[_position] = queue[_head]; |
| 2309 this[_current] = null; |
| 2310 } |
| 2311 get current() { |
| 2312 return this[_current]; |
| 2313 } |
| 2314 moveNext() { |
| 2315 this[_queue]._checkModification(this[_modificationCount]); |
| 2316 if (this[_position] === this[_end]) { |
| 2317 this[_current] = null; |
| 2318 return false; |
| 2319 } |
| 2320 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; |
| 2322 return true; |
| 2323 } |
| 2324 } |
| 2325 return _ListQueueIterator; |
| 2326 }); |
| 2327 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(); |
| 2664 throw _internal.IterableElementError.noElement(); | 2524 throw _internal.IterableElementError.noElement(); |
| 2665 } | 2525 } |
| 2666 lastWhere(test, opt$) { | 2526 lastWhere(test, opt$) { |
| 2667 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; | 2527 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; |
| 2668 let length = this.length; | |
| 2669 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.no
tNull(i) - 1) { | |
| 2670 let element = this.get(i); | |
| 2671 if (test(element)) | |
| 2672 return element; | |
| 2673 if (length !== this.length) { | |
| 2674 throw new core.ConcurrentModificationError(this); | |
| 2675 } | |
| 2676 } | |
| 2677 if (orElse !== null) | |
| 2678 return orElse(); | |
| 2679 throw _internal.IterableElementError.noElement(); | |
| 2680 } | |
| 2681 singleWhere(test) { | |
| 2682 let length = this.length; | |
| 2683 let match = null; | |
| 2684 let matchFound = false; | |
| 2685 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 2686 let element = this.get(i); | |
| 2687 if (test(element)) { | |
| 2688 if (matchFound) { | |
| 2689 throw _internal.IterableElementError.tooMany(); | |
| 2690 } | |
| 2691 matchFound = true; | |
| 2692 match = element; | |
| 2693 } | |
| 2694 if (length !== this.length) { | |
| 2695 throw new core.ConcurrentModificationError(this); | |
| 2696 } | |
| 2697 } | |
| 2698 if (matchFound) | |
| 2699 return match; | |
| 2700 throw _internal.IterableElementError.noElement(); | |
| 2701 } | |
| 2702 join(separator) { | |
| 2703 if (separator === void 0) | |
| 2704 separator = ""; | |
| 2705 if (this.length === 0) | |
| 2706 return ""; | |
| 2707 let buffer = new core.StringBuffer(); | |
| 2708 buffer.writeAll(this, separator); | |
| 2709 return buffer.toString(); | |
| 2710 } | |
| 2711 where(test) { | |
| 2712 return new _internal.WhereIterable(this, test); | |
| 2713 } | |
| 2714 map(f) { | |
| 2715 return new _internal.MappedListIterable(this, dart.as(f, dart.throw_("Un
implemented type (dynamic) → dynamic"))); | |
| 2716 } | |
| 2717 expand(f) { | |
| 2718 return new _internal.ExpandIterable(this, f); | |
| 2719 } | |
| 2720 reduce(combine) { | |
| 2721 let length = this.length; | |
| 2722 if (length === 0) | |
| 2723 throw _internal.IterableElementError.noElement(); | |
| 2724 let value = this.get(0); | |
| 2725 for (let i = 1; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 2726 value = combine(value, this.get(i)); | |
| 2727 if (length !== this.length) { | |
| 2728 throw new core.ConcurrentModificationError(this); | |
| 2729 } | |
| 2730 } | |
| 2731 return value; | |
| 2732 } | |
| 2733 fold(initialValue, combine) { | |
| 2734 let value = initialValue; | |
| 2735 let length = this.length; | |
| 2736 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 2737 value = combine(value, this.get(i)); | |
| 2738 if (length !== this.length) { | |
| 2739 throw new core.ConcurrentModificationError(this); | |
| 2740 } | |
| 2741 } | |
| 2742 return value; | |
| 2743 } | |
| 2744 skip(count) { | |
| 2745 return new _internal.SubListIterable(this, count, null); | |
| 2746 } | |
| 2747 skipWhile(test) { | |
| 2748 return new _internal.SkipWhileIterable(this, test); | |
| 2749 } | |
| 2750 take(count) { | |
| 2751 return new _internal.SubListIterable(this, 0, count); | |
| 2752 } | |
| 2753 takeWhile(test) { | |
| 2754 return new _internal.TakeWhileIterable(this, test); | |
| 2755 } | |
| 2756 toList(opt$) { | |
| 2757 let growable = opt$.growable === void 0 ? true : opt$.growable; | |
| 2758 let result = null; | |
| 2759 if (growable) { | |
| 2760 result = ((_) => { | |
| 2761 _.length = this.length; | |
| 2762 return _; | |
| 2763 }).bind(this)(new core.List()); | |
| 2764 } else { | |
| 2765 result = new core.List(this.length); | |
| 2766 } | |
| 2767 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { | |
| 2768 result.set(i, this.get(i)); | |
| 2769 } | |
| 2770 return result; | |
| 2771 } | |
| 2772 toSet() { | |
| 2773 let result = new core.Set(); | |
| 2774 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { | |
| 2775 result.add(this.get(i)); | |
| 2776 } | |
| 2777 return result; | |
| 2778 } | |
| 2779 add(element) { | |
| 2780 this.set((($tmp) => this.length = dart.notNull($tmp) + 1, $tmp).bind(thi
s)(this.length), element); | |
| 2781 } | |
| 2782 addAll(iterable) { | |
| 2783 for (let element of iterable) { | |
| 2784 this.set((($tmp) => this.length = dart.notNull($tmp) + 1, $tmp).bind(t
his)(this.length), element); | |
| 2785 } | |
| 2786 } | |
| 2787 remove(element) { | |
| 2788 for (let i = 0; dart.notNull(i) < dart.notNull(this.length); i = dart.no
tNull(i) + 1) { | |
| 2789 if (dart.equals(this.get(i), element)) { | |
| 2790 this.setRange(i, dart.notNull(this.length) - 1, this, dart.notNull(i
) + 1); | |
| 2791 this.length = 1; | |
| 2792 return true; | |
| 2793 } | |
| 2794 } | |
| 2795 return false; | |
| 2796 } | |
| 2797 removeWhere(test) { | |
| 2798 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), false); | |
| 2799 } | |
| 2800 retainWhere(test) { | |
| 2801 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), true); | |
| 2802 } | |
| 2803 static [_filter](source, test, retainMatching) { | |
| 2804 let retained = new List.from([]); | |
| 2805 let length = source.length; | |
| 2806 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 2807 let element = source.get(i); | |
| 2808 if (test(element) === retainMatching) { | |
| 2809 retained.add(element); | |
| 2810 } | |
| 2811 if (length !== source.length) { | |
| 2812 throw new core.ConcurrentModificationError(source); | |
| 2813 } | |
| 2814 } | |
| 2815 if (retained.length !== source.length) { | |
| 2816 source.setRange(0, retained.length, retained); | |
| 2817 source.length = retained.length; | |
| 2818 } | |
| 2819 } | |
| 2820 clear() { | |
| 2821 this.length = 0; | |
| 2822 } | |
| 2823 removeLast() { | |
| 2824 if (this.length === 0) { | |
| 2825 throw _internal.IterableElementError.noElement(); | |
| 2826 } | |
| 2827 let result = this.get(dart.notNull(this.length) - 1); | |
| 2828 this.length = dart.notNull(this.length) - 1; | |
| 2829 return result; | |
| 2830 } | |
| 2831 sort(compare) { | |
| 2832 if (compare === void 0) | |
| 2833 compare = null; | |
| 2834 if (compare === null) { | |
| 2835 let defaultCompare = core.Comparable.compare; | |
| 2836 compare = defaultCompare; | |
| 2837 } | |
| 2838 _internal.Sort.sort(this, dart.as(compare, dart.throw_("Unimplemented ty
pe (dynamic, dynamic) → int"))); | |
| 2839 } | |
| 2840 shuffle(random) { | |
| 2841 if (random === void 0) | |
| 2842 random = null; | |
| 2843 if (random === null) | |
| 2844 random = new math.Random(); | |
| 2845 let length = this.length; | |
| 2846 while (dart.notNull(length) > 1) { | |
| 2847 let pos = random.nextInt(length); | |
| 2848 length = 1; | |
| 2849 let tmp = this.get(length); | |
| 2850 this.set(length, this.get(pos)); | |
| 2851 this.set(pos, tmp); | |
| 2852 } | |
| 2853 } | |
| 2854 asMap() { | |
| 2855 return new _internal.ListMapView(this); | |
| 2856 } | |
| 2857 sublist(start, end) { | |
| 2858 if (end === void 0) | |
| 2859 end = null; | |
| 2860 let listLength = this.length; | |
| 2861 if (end === null) | |
| 2862 end = listLength; | |
| 2863 core.RangeError.checkValidRange(start, end, listLength); | |
| 2864 let length = dart.notNull(end) - dart.notNull(start); | |
| 2865 let result = new core.List(); | |
| 2866 result.length = length; | |
| 2867 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { | |
| 2868 result.set(i, this.get(dart.notNull(start) + dart.notNull(i))); | |
| 2869 } | |
| 2870 return result; | |
| 2871 } | |
| 2872 getRange(start, end) { | |
| 2873 core.RangeError.checkValidRange(start, end, this.length); | |
| 2874 return new _internal.SubListIterable(this, start, end); | |
| 2875 } | |
| 2876 removeRange(start, end) { | |
| 2877 core.RangeError.checkValidRange(start, end, this.length); | |
| 2878 let length = dart.notNull(end) - dart.notNull(start); | |
| 2879 this.setRange(start, dart.notNull(this.length) - dart.notNull(length), t
his, end); | |
| 2880 this.length = length; | |
| 2881 } | |
| 2882 fillRange(start, end, fill) { | |
| 2883 if (fill === void 0) | |
| 2884 fill = null; | |
| 2885 core.RangeError.checkValidRange(start, end, this.length); | |
| 2886 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNul
l(i) + 1) { | |
| 2887 this.set(i, fill); | |
| 2888 } | |
| 2889 } | |
| 2890 setRange(start, end, iterable, skipCount) { | |
| 2891 if (skipCount === void 0) | |
| 2892 skipCount = 0; | |
| 2893 core.RangeError.checkValidRange(start, end, this.length); | |
| 2894 let length = dart.notNull(end) - dart.notNull(start); | |
| 2895 if (length === 0) | |
| 2896 return; | |
| 2897 core.RangeError.checkNotNegative(skipCount, "skipCount"); | |
| 2898 let otherList = null; | |
| 2899 let otherStart = null; | |
| 2900 if (dart.is(iterable, core.List)) { | |
| 2901 otherList = dart.as(iterable, core.List); | |
| 2902 otherStart = skipCount; | |
| 2903 } else { | |
| 2904 otherList = iterable.skip(skipCount).toList({growable: false}); | |
| 2905 otherStart = 0; | |
| 2906 } | |
| 2907 if (dart.notNull(otherStart) + dart.notNull(length) > dart.notNull(other
List.length)) { | |
| 2908 throw _internal.IterableElementError.tooFew(); | |
| 2909 } | |
| 2910 if (dart.notNull(otherStart) < dart.notNull(start)) { | |
| 2911 for (let i = dart.notNull(length) - 1; dart.notNull(i) >= 0; i = dart.
notNull(i) - 1) { | |
| 2912 this.set(dart.notNull(start) + dart.notNull(i), dart.as(otherList.ge
t(dart.notNull(otherStart) + dart.notNull(i)), E)); | |
| 2913 } | |
| 2914 } else { | |
| 2915 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNu
ll(i) + 1) { | |
| 2916 this.set(dart.notNull(start) + dart.notNull(i), dart.as(otherList.ge
t(dart.notNull(otherStart) + dart.notNull(i)), E)); | |
| 2917 } | |
| 2918 } | |
| 2919 } | |
| 2920 replaceRange(start, end, newContents) { | |
| 2921 core.RangeError.checkValidRange(start, end, this.length); | |
| 2922 if (!dart.is(newContents, _internal.EfficientLength)) { | |
| 2923 newContents = newContents.toList(); | |
| 2924 } | |
| 2925 let removeLength = dart.notNull(end) - dart.notNull(start); | |
| 2926 let insertLength = newContents.length; | |
| 2927 if (dart.notNull(removeLength) >= dart.notNull(insertLength)) { | |
| 2928 let delta = dart.notNull(removeLength) - dart.notNull(insertLength); | |
| 2929 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); | |
| 2930 let newLength = dart.notNull(this.length) - dart.notNull(delta); | |
| 2931 this.setRange(start, insertEnd, newContents); | |
| 2932 if (delta !== 0) { | |
| 2933 this.setRange(insertEnd, newLength, this, end); | |
| 2934 this.length = newLength; | |
| 2935 } | |
| 2936 } else { | |
| 2937 let delta = dart.notNull(insertLength) - dart.notNull(removeLength); | |
| 2938 let newLength = dart.notNull(this.length) + dart.notNull(delta); | |
| 2939 let insertEnd = dart.notNull(start) + dart.notNull(insertLength); | |
| 2940 this.length = newLength; | |
| 2941 this.setRange(insertEnd, newLength, this, end); | |
| 2942 this.setRange(start, insertEnd, newContents); | |
| 2943 } | |
| 2944 } | |
| 2945 indexOf(element, startIndex) { | |
| 2946 if (startIndex === void 0) | |
| 2947 startIndex = 0; | |
| 2948 if (dart.notNull(startIndex) >= dart.notNull(this.length)) { | |
| 2949 return -1; | |
| 2950 } | |
| 2951 if (dart.notNull(startIndex) < 0) { | |
| 2952 startIndex = 0; | |
| 2953 } | |
| 2954 for (let i = startIndex; dart.notNull(i) < dart.notNull(this.length); i
= dart.notNull(i) + 1) { | |
| 2955 if (dart.equals(this.get(i), element)) { | |
| 2956 return i; | |
| 2957 } | |
| 2958 } | |
| 2959 return -1; | |
| 2960 } | |
| 2961 lastIndexOf(element, startIndex) { | |
| 2962 if (startIndex === void 0) | |
| 2963 startIndex = null; | |
| 2964 if (startIndex === null) { | |
| 2965 startIndex = dart.notNull(this.length) - 1; | |
| 2966 } else { | |
| 2967 if (dart.notNull(startIndex) < 0) { | |
| 2968 return -1; | |
| 2969 } | |
| 2970 if (dart.notNull(startIndex) >= dart.notNull(this.length)) { | |
| 2971 startIndex = dart.notNull(this.length) - 1; | |
| 2972 } | |
| 2973 } | |
| 2974 for (let i = startIndex; dart.notNull(i) >= 0; i = dart.notNull(i) - 1)
{ | |
| 2975 if (dart.equals(this.get(i), element)) { | |
| 2976 return i; | |
| 2977 } | |
| 2978 } | |
| 2979 return -1; | |
| 2980 } | |
| 2981 insert(index, element) { | |
| 2982 core.RangeError.checkValueInInterval(index, 0, this.length, "index"); | |
| 2983 if (index === this.length) { | |
| 2984 this.add(element); | |
| 2985 return; | |
| 2986 } | |
| 2987 if (!(typeof index == number)) | |
| 2988 throw new core.ArgumentError(index); | |
| 2989 this.length = dart.notNull(this.length) + 1; | |
| 2990 this.setRange(dart.notNull(index) + 1, this.length, this, index); | |
| 2991 this.set(index, element); | |
| 2992 } | |
| 2993 removeAt(index) { | |
| 2994 let result = this.get(index); | |
| 2995 this.setRange(index, dart.notNull(this.length) - 1, this, dart.notNull(i
ndex) + 1); | |
| 2996 this.length = dart.notNull(this.length) - 1; | |
| 2997 return result; | |
| 2998 } | |
| 2999 insertAll(index, iterable) { | |
| 3000 core.RangeError.checkValueInInterval(index, 0, this.length, "index"); | |
| 3001 if (dart.is(iterable, _internal.EfficientLength)) { | |
| 3002 iterable = iterable.toList(); | |
| 3003 } | |
| 3004 let insertionLength = iterable.length; | |
| 3005 this.length = insertionLength; | |
| 3006 this.setRange(dart.notNull(index) + dart.notNull(insertionLength), this.
length, this, index); | |
| 3007 this.setAll(index, iterable); | |
| 3008 } | |
| 3009 setAll(index, iterable) { | |
| 3010 if (dart.is(iterable, core.List)) { | |
| 3011 this.setRange(index, dart.notNull(index) + dart.notNull(iterable.lengt
h), iterable); | |
| 3012 } else { | |
| 3013 for (let element of iterable) { | |
| 3014 this.set((($tmp) => index = dart.notNull($tmp) + 1, $tmp)(index), el
ement); | |
| 3015 } | |
| 3016 } | |
| 3017 } | |
| 3018 get reversed() { | |
| 3019 return new _internal.ReversedListIterable(this); | |
| 3020 } | |
| 3021 toString() { | |
| 3022 return IterableBase.iterableToFullString(this, '[', ']'); | |
| 3023 } | |
| 3024 } | |
| 3025 return ListMixin; | |
| 3026 }); | |
| 3027 let ListMixin = ListMixin$(dynamic); | |
| 3028 let MapBase$ = dart.generic(function(K, V) { | |
| 3029 class MapBase extends dart.mixin(MapMixin$(K, V)) { | |
| 3030 } | |
| 3031 return MapBase; | |
| 3032 }); | |
| 3033 let MapBase = MapBase$(dynamic, dynamic); | |
| 3034 let MapMixin$ = dart.generic(function(K, V) { | |
| 3035 class MapMixin extends dart.Object { | |
| 3036 forEach(action) { | |
| 3037 for (let key of this.keys) { | |
| 3038 action(key, this.get(key)); | |
| 3039 } | |
| 3040 } | |
| 3041 addAll(other) { | |
| 3042 for (let key of other.keys) { | |
| 3043 this.set(key, other.get(key)); | |
| 3044 } | |
| 3045 } | |
| 3046 containsValue(value) { | |
| 3047 for (let key of this.keys) { | |
| 3048 if (dart.equals(this.get(key), value)) | |
| 3049 return true; | |
| 3050 } | |
| 3051 return false; | |
| 3052 } | |
| 3053 putIfAbsent(key, ifAbsent) { | |
| 3054 if (this.keys.contains(key)) { | |
| 3055 return this.get(key); | |
| 3056 } | |
| 3057 return this.set(key, ifAbsent()); | |
| 3058 } | |
| 3059 containsKey(key) { | |
| 3060 return this.keys.contains(key); | |
| 3061 } | |
| 3062 get length() { | |
| 3063 return this.keys.length; | |
| 3064 } | |
| 3065 get isEmpty() { | |
| 3066 return this.keys.isEmpty; | |
| 3067 } | |
| 3068 get isNotEmpty() { | |
| 3069 return this.keys.isNotEmpty; | |
| 3070 } | |
| 3071 get values() { | |
| 3072 return new _MapBaseValueIterable(this); | |
| 3073 } | |
| 3074 toString() { | |
| 3075 return Maps.mapToString(this); | |
| 3076 } | |
| 3077 } | |
| 3078 return MapMixin; | |
| 3079 }); | |
| 3080 let MapMixin = MapMixin$(dynamic, dynamic); | |
| 3081 let UnmodifiableMapBase$ = dart.generic(function(K, V) { | |
| 3082 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { | |
| 3083 } | |
| 3084 return UnmodifiableMapBase; | |
| 3085 }); | |
| 3086 let UnmodifiableMapBase = UnmodifiableMapBase$(dynamic, dynamic); | |
| 3087 let _MapBaseValueIterable$ = dart.generic(function(V) { | |
| 3088 class _MapBaseValueIterable extends IterableBase$(V) { | |
| 3089 _MapBaseValueIterable($_map) { | |
| 3090 this[_map] = $_map; | |
| 3091 super.IterableBase(); | |
| 3092 } | |
| 3093 get length() { | |
| 3094 return this[_map].length; | |
| 3095 } | |
| 3096 get isEmpty() { | |
| 3097 return this[_map].isEmpty; | |
| 3098 } | |
| 3099 get isNotEmpty() { | |
| 3100 return this[_map].isNotEmpty; | |
| 3101 } | |
| 3102 get first() { | |
| 3103 return dart.as(this[_map].get(this[_map].keys.first), V); | |
| 3104 } | |
| 3105 get single() { | |
| 3106 return dart.as(this[_map].get(this[_map].keys.single), V); | |
| 3107 } | |
| 3108 get last() { | |
| 3109 return dart.as(this[_map].get(this[_map].keys.last), V); | |
| 3110 } | |
| 3111 get iterator() { | |
| 3112 return new _MapBaseValueIterator(this[_map]); | |
| 3113 } | |
| 3114 } | |
| 3115 return _MapBaseValueIterable; | |
| 3116 }); | |
| 3117 let _MapBaseValueIterable = _MapBaseValueIterable$(dynamic); | |
| 3118 let _MapBaseValueIterator$ = dart.generic(function(V) { | |
| 3119 class _MapBaseValueIterator extends dart.Object { | |
| 3120 _MapBaseValueIterator(map) { | |
| 3121 this[_map] = map; | |
| 3122 this[_keys] = map.keys.iterator; | |
| 3123 this[_current] = null; | |
| 3124 } | |
| 3125 moveNext() { | |
| 3126 if (this[_keys].moveNext()) { | |
| 3127 this[_current] = dart.as(this[_map].get(this[_keys].current), V); | |
| 3128 return true; | |
| 3129 } | |
| 3130 this[_current] = null; | |
| 3131 return false; | |
| 3132 } | |
| 3133 get current() { | |
| 3134 return this[_current]; | |
| 3135 } | |
| 3136 } | |
| 3137 return _MapBaseValueIterator; | |
| 3138 }); | |
| 3139 let _MapBaseValueIterator = _MapBaseValueIterator$(dynamic); | |
| 3140 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { | |
| 3141 class _UnmodifiableMapMixin extends dart.Object { | |
| 3142 set(key, value) { | |
| 3143 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 3144 } | |
| 3145 addAll(other) { | |
| 3146 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 3147 } | |
| 3148 clear() { | |
| 3149 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 3150 } | |
| 3151 remove(key) { | |
| 3152 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 3153 } | |
| 3154 putIfAbsent(key, ifAbsent) { | |
| 3155 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | |
| 3156 } | |
| 3157 } | |
| 3158 return _UnmodifiableMapMixin; | |
| 3159 }); | |
| 3160 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(dynamic, dynamic); | |
| 3161 let MapView$ = dart.generic(function(K, V) { | |
| 3162 class MapView extends dart.Object { | |
| 3163 MapView(map) { | |
| 3164 this[_map] = map; | |
| 3165 } | |
| 3166 get(key) { | |
| 3167 return this[_map].get(key); | |
| 3168 } | |
| 3169 set(key, value) { | |
| 3170 this[_map].set(key, value); | |
| 3171 } | |
| 3172 addAll(other) { | |
| 3173 this[_map].addAll(other); | |
| 3174 } | |
| 3175 clear() { | |
| 3176 this[_map].clear(); | |
| 3177 } | |
| 3178 putIfAbsent(key, ifAbsent) { | |
| 3179 return this[_map].putIfAbsent(key, ifAbsent); | |
| 3180 } | |
| 3181 containsKey(key) { | |
| 3182 return this[_map].containsKey(key); | |
| 3183 } | |
| 3184 containsValue(value) { | |
| 3185 return this[_map].containsValue(value); | |
| 3186 } | |
| 3187 forEach(action) { | |
| 3188 this[_map].forEach(action); | |
| 3189 } | |
| 3190 get isEmpty() { | |
| 3191 return this[_map].isEmpty; | |
| 3192 } | |
| 3193 get isNotEmpty() { | |
| 3194 return this[_map].isNotEmpty; | |
| 3195 } | |
| 3196 get length() { | |
| 3197 return this[_map].length; | |
| 3198 } | |
| 3199 get keys() { | |
| 3200 return this[_map].keys; | |
| 3201 } | |
| 3202 remove(key) { | |
| 3203 return this[_map].remove(key); | |
| 3204 } | |
| 3205 toString() { | |
| 3206 return this[_map].toString(); | |
| 3207 } | |
| 3208 get values() { | |
| 3209 return this[_map].values; | |
| 3210 } | |
| 3211 } | |
| 3212 return MapView; | |
| 3213 }); | |
| 3214 let MapView = MapView$(dynamic, dynamic); | |
| 3215 let UnmodifiableMapView$ = dart.generic(function(K, V) { | |
| 3216 class UnmodifiableMapView extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { | |
| 3217 } | |
| 3218 return UnmodifiableMapView; | |
| 3219 }); | |
| 3220 let UnmodifiableMapView = UnmodifiableMapView$(dynamic, dynamic); | |
| 3221 let _toStringVisiting = Symbol('_toStringVisiting'); | |
| 3222 let _id = Symbol('_id'); | |
| 3223 let _fillMapWithMappedIterable = Symbol('_fillMapWithMappedIterable'); | |
| 3224 let _fillMapWithIterables = Symbol('_fillMapWithIterables'); | |
| 3225 class Maps extends dart.Object { | |
| 3226 static containsValue(map, value) { | |
| 3227 for (let v of map.values) { | |
| 3228 if (dart.equals(value, v)) { | |
| 3229 return true; | |
| 3230 } | |
| 3231 } | |
| 3232 return false; | |
| 3233 } | |
| 3234 static containsKey(map, key) { | |
| 3235 for (let k of map.keys) { | |
| 3236 if (dart.equals(key, k)) { | |
| 3237 return true; | |
| 3238 } | |
| 3239 } | |
| 3240 return false; | |
| 3241 } | |
| 3242 static putIfAbsent(map, key, ifAbsent) { | |
| 3243 if (map.containsKey(key)) { | |
| 3244 return map.get(key); | |
| 3245 } | |
| 3246 let v = ifAbsent(); | |
| 3247 map.set(key, v); | |
| 3248 return v; | |
| 3249 } | |
| 3250 static clear(map) { | |
| 3251 for (let k of map.keys.toList()) { | |
| 3252 map.remove(k); | |
| 3253 } | |
| 3254 } | |
| 3255 static forEach(map, f) { | |
| 3256 for (let k of map.keys) { | |
| 3257 f(k, map.get(k)); | |
| 3258 } | |
| 3259 } | |
| 3260 static getValues(map) { | |
| 3261 return map.keys.map((key) => map.get(key)); | |
| 3262 } | |
| 3263 static length(map) { | |
| 3264 return map.keys.length; | |
| 3265 } | |
| 3266 static isEmpty(map) { | |
| 3267 return map.keys.isEmpty; | |
| 3268 } | |
| 3269 static isNotEmpty(map) { | |
| 3270 return map.keys.isNotEmpty; | |
| 3271 } | |
| 3272 static mapToString(m) { | |
| 3273 if (IterableBase._isToStringVisiting(m)) { | |
| 3274 return '{...}'; | |
| 3275 } | |
| 3276 let result = new core.StringBuffer(); | |
| 3277 try { | |
| 3278 IterableBase[_toStringVisiting].add(m); | |
| 3279 result.write('{'); | |
| 3280 let first = true; | |
| 3281 m.forEach(((k, v) => { | |
| 3282 if (!dart.notNull(first)) { | |
| 3283 result.write(', '); | |
| 3284 } | |
| 3285 first = false; | |
| 3286 result.write(k); | |
| 3287 result.write(': '); | |
| 3288 result.write(v); | |
| 3289 }).bind(this)); | |
| 3290 result.write('}'); | |
| 3291 } finally { | |
| 3292 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m)); | |
| 3293 IterableBase[_toStringVisiting].removeLast(); | |
| 3294 } | |
| 3295 return result.toString(); | |
| 3296 } | |
| 3297 static [_id](x) { | |
| 3298 return x; | |
| 3299 } | |
| 3300 static [_fillMapWithMappedIterable](map, iterable, key, value) { | |
| 3301 if (key === null) | |
| 3302 key = _id; | |
| 3303 if (value === null) | |
| 3304 value = _id; | |
| 3305 for (let element of iterable) { | |
| 3306 map.set(key(element), value(element)); | |
| 3307 } | |
| 3308 } | |
| 3309 static [_fillMapWithIterables](map, keys, values) { | |
| 3310 let keyIterator = keys.iterator; | |
| 3311 let valueIterator = values.iterator; | |
| 3312 let hasNextKey = keyIterator.moveNext(); | |
| 3313 let hasNextValue = valueIterator.moveNext(); | |
| 3314 while (dart.notNull(hasNextKey) && dart.notNull(hasNextValue)) { | |
| 3315 map.set(keyIterator.current, valueIterator.current); | |
| 3316 hasNextKey = keyIterator.moveNext(); | |
| 3317 hasNextValue = valueIterator.moveNext(); | |
| 3318 } | |
| 3319 if (dart.notNull(hasNextKey) || dart.notNull(hasNextValue)) { | |
| 3320 throw new core.ArgumentError("Iterables do not have same length."); | |
| 3321 } | |
| 3322 } | |
| 3323 } | |
| 3324 let Queue$ = dart.generic(function(E) { | |
| 3325 class Queue extends dart.Object { | |
| 3326 Queue() { | |
| 3327 return new ListQueue(); | |
| 3328 } | |
| 3329 Queue$from(elements) { | |
| 3330 return new ListQueue.from(elements); | |
| 3331 } | |
| 3332 } | |
| 3333 dart.defineNamedConstructor(Queue, 'from'); | |
| 3334 return Queue; | |
| 3335 }); | |
| 3336 let Queue = Queue$(dynamic); | |
| 3337 let _link = Symbol('_link'); | |
| 3338 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry'); | |
| 3339 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { | |
| 3340 class DoubleLinkedQueueEntry extends dart.Object { | |
| 3341 DoubleLinkedQueueEntry(e) { | |
| 3342 this[_element] = e; | |
| 3343 this[_previous] = null; | |
| 3344 this[_next] = null; | |
| 3345 } | |
| 3346 [_link](previous, next) { | |
| 3347 this[_next] = next; | |
| 3348 this[_previous] = previous; | |
| 3349 previous[_next] = this; | |
| 3350 next[_previous] = this; | |
| 3351 } | |
| 3352 append(e) { | |
| 3353 new DoubleLinkedQueueEntry(e)._link(this, this[_next]); | |
| 3354 } | |
| 3355 prepend(e) { | |
| 3356 new DoubleLinkedQueueEntry(e)._link(this[_previous], this); | |
| 3357 } | |
| 3358 remove() { | |
| 3359 this[_previous][_next] = this[_next]; | |
| 3360 this[_next][_previous] = this[_previous]; | |
| 3361 this[_next] = null; | |
| 3362 this[_previous] = null; | |
| 3363 return this[_element]; | |
| 3364 } | |
| 3365 [_asNonSentinelEntry]() { | |
| 3366 return this; | |
| 3367 } | |
| 3368 previousEntry() { | |
| 3369 return this[_previous]._asNonSentinelEntry(); | |
| 3370 } | |
| 3371 nextEntry() { | |
| 3372 return this[_next]._asNonSentinelEntry(); | |
| 3373 } | |
| 3374 get element() { | |
| 3375 return this[_element]; | |
| 3376 } | |
| 3377 set element(e) { | |
| 3378 this[_element] = e; | |
| 3379 } | |
| 3380 } | |
| 3381 return DoubleLinkedQueueEntry; | |
| 3382 }); | |
| 3383 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dynamic); | |
| 3384 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { | |
| 3385 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { | |
| 3386 _DoubleLinkedQueueEntrySentinel() { | |
| 3387 super.DoubleLinkedQueueEntry(null); | |
| 3388 this[_link](this, this); | |
| 3389 } | |
| 3390 remove() { | |
| 3391 throw _internal.IterableElementError.noElement(); | |
| 3392 } | |
| 3393 [_asNonSentinelEntry]() { | |
| 3394 return null; | |
| 3395 } | |
| 3396 set element(e) { | |
| 3397 dart.assert(false); | |
| 3398 } | |
| 3399 get element() { | |
| 3400 throw _internal.IterableElementError.noElement(); | |
| 3401 } | |
| 3402 } | |
| 3403 return _DoubleLinkedQueueEntrySentinel; | |
| 3404 }); | |
| 3405 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(dynamic
); | |
| 3406 let _sentinel = Symbol('_sentinel'); | |
| 3407 let _elementCount = Symbol('_elementCount'); | |
| 3408 let DoubleLinkedQueue$ = dart.generic(function(E) { | |
| 3409 class DoubleLinkedQueue extends IterableBase$(E) { | |
| 3410 DoubleLinkedQueue() { | |
| 3411 this[_sentinel] = null; | |
| 3412 this[_elementCount] = 0; | |
| 3413 super.IterableBase(); | |
| 3414 this[_sentinel] = new _DoubleLinkedQueueEntrySentinel(); | |
| 3415 } | |
| 3416 DoubleLinkedQueue$from(elements) { | |
| 3417 let list = dart.as(new DoubleLinkedQueue(), Queue$(E)); | |
| 3418 for (let e of elements) { | |
| 3419 list.addLast(e); | |
| 3420 } | |
| 3421 return dart.as(list, DoubleLinkedQueue$(E)); | |
| 3422 } | |
| 3423 get length() { | |
| 3424 return this[_elementCount]; | |
| 3425 } | |
| 3426 addLast(value) { | |
| 3427 this[_sentinel].prepend(value); | |
| 3428 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | |
| 3429 } | |
| 3430 addFirst(value) { | |
| 3431 this[_sentinel].append(value); | |
| 3432 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | |
| 3433 } | |
| 3434 add(value) { | |
| 3435 this[_sentinel].prepend(value); | |
| 3436 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | |
| 3437 } | |
| 3438 addAll(iterable) { | |
| 3439 for (let value of iterable) { | |
| 3440 this[_sentinel].prepend(value); | |
| 3441 this[_elementCount] = dart.notNull(this[_elementCount]) + 1; | |
| 3442 } | |
| 3443 } | |
| 3444 removeLast() { | |
| 3445 let result = this[_sentinel][_previous].remove(); | |
| 3446 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | |
| 3447 return result; | |
| 3448 } | |
| 3449 removeFirst() { | |
| 3450 let result = this[_sentinel][_next].remove(); | |
| 3451 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | |
| 3452 return result; | |
| 3453 } | |
| 3454 remove(o) { | |
| 3455 let entry = this[_sentinel][_next]; | |
| 3456 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { | |
| 3457 if (dart.equals(entry.element, o)) { | |
| 3458 entry.remove(); | |
| 3459 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | |
| 3460 return true; | |
| 3461 } | |
| 3462 entry = entry[_next]; | |
| 3463 } | |
| 3464 return false; | |
| 3465 } | |
| 3466 [_filter](test, removeMatching) { | |
| 3467 let entry = this[_sentinel][_next]; | |
| 3468 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { | |
| 3469 let next = entry[_next]; | |
| 3470 if (core.identical(removeMatching, test(entry.element))) { | |
| 3471 entry.remove(); | |
| 3472 this[_elementCount] = dart.notNull(this[_elementCount]) - 1; | |
| 3473 } | |
| 3474 entry = next; | |
| 3475 } | |
| 3476 } | |
| 3477 removeWhere(test) { | |
| 3478 this[_filter](test, true); | |
| 3479 } | |
| 3480 retainWhere(test) { | |
| 3481 this[_filter](test, false); | |
| 3482 } | |
| 3483 get first() { | |
| 3484 return this[_sentinel][_next].element; | |
| 3485 } | |
| 3486 get last() { | |
| 3487 return this[_sentinel][_previous].element; | |
| 3488 } | |
| 3489 get single() { | |
| 3490 if (core.identical(this[_sentinel][_next], this[_sentinel][_previous]))
{ | |
| 3491 return this[_sentinel][_next].element; | |
| 3492 } | |
| 3493 throw _internal.IterableElementError.tooMany(); | |
| 3494 } | |
| 3495 lastEntry() { | |
| 3496 return this[_sentinel].previousEntry(); | |
| 3497 } | |
| 3498 firstEntry() { | |
| 3499 return this[_sentinel].nextEntry(); | |
| 3500 } | |
| 3501 get isEmpty() { | |
| 3502 return core.identical(this[_sentinel][_next], this[_sentinel]); | |
| 3503 } | |
| 3504 clear() { | |
| 3505 this[_sentinel][_next] = this[_sentinel]; | |
| 3506 this[_sentinel][_previous] = this[_sentinel]; | |
| 3507 this[_elementCount] = 0; | |
| 3508 } | |
| 3509 forEachEntry(f) { | |
| 3510 let entry = this[_sentinel][_next]; | |
| 3511 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { | |
| 3512 let nextEntry = entry[_next]; | |
| 3513 f(entry); | |
| 3514 entry = nextEntry; | |
| 3515 } | |
| 3516 } | |
| 3517 get iterator() { | |
| 3518 return new _DoubleLinkedQueueIterator(this[_sentinel]); | |
| 3519 } | |
| 3520 toString() { | |
| 3521 return IterableBase.iterableToFullString(this, '{', '}'); | |
| 3522 } | |
| 3523 } | |
| 3524 dart.defineNamedConstructor(DoubleLinkedQueue, 'from'); | |
| 3525 return DoubleLinkedQueue; | |
| 3526 }); | |
| 3527 let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic); | |
| 3528 let _nextEntry = Symbol('_nextEntry'); | |
| 3529 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) { | |
| 3530 class _DoubleLinkedQueueIterator extends dart.Object { | |
| 3531 _DoubleLinkedQueueIterator(sentinel) { | |
| 3532 this[_sentinel] = sentinel; | |
| 3533 this[_nextEntry] = sentinel[_next]; | |
| 3534 this[_current] = null; | |
| 3535 } | |
| 3536 moveNext() { | |
| 3537 if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) { | |
| 3538 this[_current] = this[_nextEntry][_element]; | |
| 3539 this[_nextEntry] = this[_nextEntry][_next]; | |
| 3540 return true; | |
| 3541 } | |
| 3542 this[_current] = null; | |
| 3543 this[_nextEntry] = this[_sentinel] = null; | |
| 3544 return false; | |
| 3545 } | |
| 3546 get current() { | |
| 3547 return this[_current]; | |
| 3548 } | |
| 3549 } | |
| 3550 return _DoubleLinkedQueueIterator; | |
| 3551 }); | |
| 3552 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic); | |
| 3553 let _head = Symbol('_head'); | |
| 3554 let _tail = Symbol('_tail'); | |
| 3555 let _table = Symbol('_table'); | |
| 3556 let _checkModification = Symbol('_checkModification'); | |
| 3557 let _writeToList = Symbol('_writeToList'); | |
| 3558 let _preGrow = Symbol('_preGrow'); | |
| 3559 let _grow = Symbol('_grow'); | |
| 3560 let _isPowerOf2 = Symbol('_isPowerOf2'); | |
| 3561 let _nextPowerOf2 = Symbol('_nextPowerOf2'); | |
| 3562 let ListQueue$ = dart.generic(function(E) { | |
| 3563 class ListQueue extends IterableBase$(E) { | |
| 3564 ListQueue(initialCapacity) { | |
| 3565 if (initialCapacity === void 0) | |
| 3566 initialCapacity = null; | |
| 3567 this[_head] = 0; | |
| 3568 this[_tail] = 0; | |
| 3569 this[_table] = null; | |
| 3570 this[_modificationCount] = 0; | |
| 3571 super.IterableBase(); | |
| 3572 if (initialCapacity === null || dart.notNull(initialCapacity) < dart.not
Null(_INITIAL_CAPACITY)) { | |
| 3573 initialCapacity = _INITIAL_CAPACITY; | |
| 3574 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) { | |
| 3575 initialCapacity = _nextPowerOf2(initialCapacity); | |
| 3576 } | |
| 3577 dart.assert(_isPowerOf2(initialCapacity)); | |
| 3578 this[_table] = new core.List(initialCapacity); | |
| 3579 } | |
| 3580 ListQueue$from(elements) { | |
| 3581 if (dart.is(elements, core.List)) { | |
| 3582 let length = elements.length; | |
| 3583 let queue = dart.as(new ListQueue(dart.notNull(length) + 1), ListQueue
$(E)); | |
| 3584 dart.assert(dart.notNull(queue[_table].length) > dart.notNull(length))
; | |
| 3585 let sourceList = elements; | |
| 3586 queue[_table].setRange(0, length, dart.as(sourceList, core.Iterable$(E
)), 0); | |
| 3587 queue[_tail] = length; | |
| 3588 return queue; | |
| 3589 } else { | |
| 3590 let capacity = _INITIAL_CAPACITY; | |
| 3591 if (dart.is(elements, _internal.EfficientLength)) { | |
| 3592 capacity = elements.length; | |
| 3593 } | |
| 3594 let result = new ListQueue(capacity); | |
| 3595 for (let element of elements) { | |
| 3596 result.addLast(element); | |
| 3597 } | |
| 3598 return result; | |
| 3599 } | |
| 3600 } | |
| 3601 get iterator() { | |
| 3602 return new _ListQueueIterator(this); | |
| 3603 } | |
| 3604 forEach(action) { | |
| 3605 let modificationCount = this[_modificationCount]; | |
| 3606 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d
art.notNull(this[_table].length) - 1) { | |
| 3607 action(this[_table].get(i)); | |
| 3608 this[_checkModification](modificationCount); | |
| 3609 } | |
| 3610 } | |
| 3611 get isEmpty() { | |
| 3612 return this[_head] === this[_tail]; | |
| 3613 } | |
| 3614 get length() { | |
| 3615 return dart.notNull(this[_tail]) - dart.notNull(this[_head]) & dart.notN
ull(this[_table].length) - 1; | |
| 3616 } | |
| 3617 get first() { | |
| 3618 if (this[_head] === this[_tail]) | |
| 3619 throw _internal.IterableElementError.noElement(); | |
| 3620 return this[_table].get(this[_head]); | |
| 3621 } | |
| 3622 get last() { | |
| 3623 if (this[_head] === this[_tail]) | |
| 3624 throw _internal.IterableElementError.noElement(); | |
| 3625 return this[_table].get(dart.notNull(this[_tail]) - 1 & dart.notNull(thi
s[_table].length) - 1); | |
| 3626 } | |
| 3627 get single() { | |
| 3628 if (this[_head] === this[_tail]) | |
| 3629 throw _internal.IterableElementError.noElement(); | |
| 3630 if (dart.notNull(this.length) > 1) | |
| 3631 throw _internal.IterableElementError.tooMany(); | |
| 3632 return this[_table].get(this[_head]); | |
| 3633 } | |
| 3634 elementAt(index) { | |
| 3635 core.RangeError.checkValidIndex(index, this); | |
| 3636 return this[_table].get(dart.notNull(this[_head]) + dart.notNull(index)
& dart.notNull(this[_table].length) - 1); | |
| 3637 } | |
| 3638 toList(opt$) { | |
| 3639 let growable = opt$.growable === void 0 ? true : opt$.growable; | |
| 3640 let list = null; | |
| 3641 if (growable) { | |
| 3642 list = ((_) => { | |
| 3643 _.length = this.length; | |
| 3644 return _; | |
| 3645 }).bind(this)(new core.List()); | |
| 3646 } else { | |
| 3647 list = new core.List(this.length); | |
| 3648 } | |
| 3649 this[_writeToList](list); | |
| 3650 return list; | |
| 3651 } | |
| 3652 add(element) { | |
| 3653 this[_add](element); | |
| 3654 } | |
| 3655 addAll(elements) { | |
| 3656 if (dart.is(elements, core.List)) { | |
| 3657 let list = dart.as(elements, core.List); | |
| 3658 let addCount = list.length; | |
| 3659 let length = this.length; | |
| 3660 if (dart.notNull(length) + dart.notNull(addCount) >= dart.notNull(this
[_table].length)) { | |
| 3661 this[_preGrow](dart.notNull(length) + dart.notNull(addCount)); | |
| 3662 this[_table].setRange(length, dart.notNull(length) + dart.notNull(ad
dCount), dart.as(list, core.Iterable$(E)), 0); | |
| 3663 this[_tail] = addCount; | |
| 3664 } else { | |
| 3665 let endSpace = dart.notNull(this[_table].length) - dart.notNull(this
[_tail]); | |
| 3666 if (dart.notNull(addCount) < dart.notNull(endSpace)) { | |
| 3667 this[_table].setRange(this[_tail], dart.notNull(this[_tail]) + dar
t.notNull(addCount), dart.as(list, core.Iterable$(E)), 0); | |
| 3668 this[_tail] = addCount; | |
| 3669 } else { | |
| 3670 let preSpace = dart.notNull(addCount) - dart.notNull(endSpace); | |
| 3671 this[_table].setRange(this[_tail], dart.notNull(this[_tail]) + dar
t.notNull(endSpace), dart.as(list, core.Iterable$(E)), 0); | |
| 3672 this[_table].setRange(0, preSpace, dart.as(list, core.Iterable$(E)
), endSpace); | |
| 3673 this[_tail] = preSpace; | |
| 3674 } | |
| 3675 } | |
| 3676 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | |
| 3677 } else { | |
| 3678 for (let element of elements) | |
| 3679 this[_add](element); | |
| 3680 } | |
| 3681 } | |
| 3682 remove(object) { | |
| 3683 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 & d
art.notNull(this[_table].length) - 1) { | |
| 3684 let element = this[_table].get(i); | |
| 3685 if (dart.equals(element, object)) { | |
| 3686 this[_remove](i); | |
| 3687 this[_modificationCount] = dart.notNull(this[_modificationCount]) +
1; | |
| 3688 return true; | |
| 3689 } | |
| 3690 } | |
| 3691 return false; | |
| 3692 } | |
| 3693 [_filterWhere](test, removeMatching) { | |
| 3694 let index = this[_head]; | |
| 3695 let modificationCount = this[_modificationCount]; | |
| 3696 let i = this[_head]; | |
| 3697 while (i !== this[_tail]) { | |
| 3698 let element = this[_table].get(i); | |
| 3699 let remove = core.identical(removeMatching, test(element)); | |
| 3700 this[_checkModification](modificationCount); | |
| 3701 if (remove) { | |
| 3702 i = this[_remove](i); | |
| 3703 modificationCount = this[_modificationCount] = dart.notNull(this[_mo
dificationCount]) + 1; | |
| 3704 } else { | |
| 3705 i = dart.notNull(i) + 1 & dart.notNull(this[_table].length) - 1; | |
| 3706 } | |
| 3707 } | |
| 3708 } | |
| 3709 removeWhere(test) { | |
| 3710 this[_filterWhere](test, true); | |
| 3711 } | |
| 3712 retainWhere(test) { | |
| 3713 this[_filterWhere](test, false); | |
| 3714 } | |
| 3715 clear() { | |
| 3716 if (this[_head] !== this[_tail]) { | |
| 3717 for (let i = this[_head]; i !== this[_tail]; i = dart.notNull(i) + 1 &
dart.notNull(this[_table].length) - 1) { | |
| 3718 this[_table].set(i, null); | |
| 3719 } | |
| 3720 this[_head] = this[_tail] = 0; | |
| 3721 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | |
| 3722 } | |
| 3723 } | |
| 3724 toString() { | |
| 3725 return IterableBase.iterableToFullString(this, "{", "}"); | |
| 3726 } | |
| 3727 addLast(element) { | |
| 3728 this[_add](element); | |
| 3729 } | |
| 3730 addFirst(element) { | |
| 3731 this[_head] = dart.notNull(this[_head]) - 1 & dart.notNull(this[_table].
length) - 1; | |
| 3732 this[_table].set(this[_head], element); | |
| 3733 if (this[_head] === this[_tail]) | |
| 3734 this[_grow](); | |
| 3735 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | |
| 3736 } | |
| 3737 removeFirst() { | |
| 3738 if (this[_head] === this[_tail]) | |
| 3739 throw _internal.IterableElementError.noElement(); | |
| 3740 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | |
| 3741 let result = this[_table].get(this[_head]); | |
| 3742 this[_table].set(this[_head], null); | |
| 3743 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(this[_table].
length) - 1; | |
| 3744 return result; | |
| 3745 } | |
| 3746 removeLast() { | |
| 3747 if (this[_head] === this[_tail]) | |
| 3748 throw _internal.IterableElementError.noElement(); | |
| 3749 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | |
| 3750 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(this[_table].
length) - 1; | |
| 3751 let result = this[_table].get(this[_tail]); | |
| 3752 this[_table].set(this[_tail], null); | |
| 3753 return result; | |
| 3754 } | |
| 3755 static [_isPowerOf2](number) { | |
| 3756 return (dart.notNull(number) & dart.notNull(number) - 1) === 0; | |
| 3757 } | |
| 3758 static [_nextPowerOf2](number) { | |
| 3759 dart.assert(dart.notNull(number) > 0); | |
| 3760 number = (dart.notNull(number) << 1) - 1; | |
| 3761 for (;;) { | |
| 3762 let nextNumber = dart.notNull(number) & dart.notNull(number) - 1; | |
| 3763 if (nextNumber === 0) | |
| 3764 return number; | |
| 3765 number = nextNumber; | |
| 3766 } | |
| 3767 } | |
| 3768 [_checkModification](expectedModificationCount) { | |
| 3769 if (expectedModificationCount !== this[_modificationCount]) { | |
| 3770 throw new core.ConcurrentModificationError(this); | |
| 3771 } | |
| 3772 } | |
| 3773 [_add](element) { | |
| 3774 this[_table].set(this[_tail], element); | |
| 3775 this[_tail] = dart.notNull(this[_tail]) + 1 & dart.notNull(this[_table].
length) - 1; | |
| 3776 if (this[_head] === this[_tail]) | |
| 3777 this[_grow](); | |
| 3778 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | |
| 3779 } | |
| 3780 [_remove](offset) { | |
| 3781 let mask = dart.notNull(this[_table].length) - 1; | |
| 3782 let startDistance = dart.notNull(offset) - dart.notNull(this[_head]) & d
art.notNull(mask); | |
| 3783 let endDistance = dart.notNull(this[_tail]) - dart.notNull(offset) & dar
t.notNull(mask); | |
| 3784 if (dart.notNull(startDistance) < dart.notNull(endDistance)) { | |
| 3785 let i = offset; | |
| 3786 while (i !== this[_head]) { | |
| 3787 let prevOffset = dart.notNull(i) - 1 & dart.notNull(mask); | |
| 3788 this[_table].set(i, this[_table].get(prevOffset)); | |
| 3789 i = prevOffset; | |
| 3790 } | |
| 3791 this[_table].set(this[_head], null); | |
| 3792 this[_head] = dart.notNull(this[_head]) + 1 & dart.notNull(mask); | |
| 3793 return dart.notNull(offset) + 1 & dart.notNull(mask); | |
| 3794 } else { | |
| 3795 this[_tail] = dart.notNull(this[_tail]) - 1 & dart.notNull(mask); | |
| 3796 let i = offset; | |
| 3797 while (i !== this[_tail]) { | |
| 3798 let nextOffset = dart.notNull(i) + 1 & dart.notNull(mask); | |
| 3799 this[_table].set(i, this[_table].get(nextOffset)); | |
| 3800 i = nextOffset; | |
| 3801 } | |
| 3802 this[_table].set(this[_tail], null); | |
| 3803 return offset; | |
| 3804 } | |
| 3805 } | |
| 3806 [_grow]() { | |
| 3807 let newTable = new core.List(dart.notNull(this[_table].length) * 2); | |
| 3808 let split = dart.notNull(this[_table].length) - dart.notNull(this[_head]
); | |
| 3809 newTable.setRange(0, split, this[_table], this[_head]); | |
| 3810 newTable.setRange(split, dart.notNull(split) + dart.notNull(this[_head])
, this[_table], 0); | |
| 3811 this[_head] = 0; | |
| 3812 this[_tail] = this[_table].length; | |
| 3813 this[_table] = newTable; | |
| 3814 } | |
| 3815 [_writeToList](target) { | |
| 3816 dart.assert(dart.notNull(target.length) >= dart.notNull(this.length)); | |
| 3817 if (dart.notNull(this[_head]) <= dart.notNull(this[_tail])) { | |
| 3818 let length = dart.notNull(this[_tail]) - dart.notNull(this[_head]); | |
| 3819 target.setRange(0, length, this[_table], this[_head]); | |
| 3820 return length; | |
| 3821 } else { | |
| 3822 let firstPartSize = dart.notNull(this[_table].length) - dart.notNull(t
his[_head]); | |
| 3823 target.setRange(0, firstPartSize, this[_table], this[_head]); | |
| 3824 target.setRange(firstPartSize, dart.notNull(firstPartSize) + dart.notN
ull(this[_tail]), this[_table], 0); | |
| 3825 return dart.notNull(this[_tail]) + dart.notNull(firstPartSize); | |
| 3826 } | |
| 3827 } | |
| 3828 [_preGrow](newElementCount) { | |
| 3829 dart.assert(dart.notNull(newElementCount) >= dart.notNull(this.length)); | |
| 3830 newElementCount = dart.notNull(newElementCount) >> 1; | |
| 3831 let newCapacity = _nextPowerOf2(newElementCount); | |
| 3832 let newTable = new core.List(newCapacity); | |
| 3833 this[_tail] = this[_writeToList](newTable); | |
| 3834 this[_table] = newTable; | |
| 3835 this[_head] = 0; | |
| 3836 } | |
| 3837 } | |
| 3838 dart.defineNamedConstructor(ListQueue, 'from'); | |
| 3839 ListQueue._INITIAL_CAPACITY = 8; | |
| 3840 return ListQueue; | |
| 3841 }); | |
| 3842 let ListQueue = ListQueue$(dynamic); | |
| 3843 let _queue = Symbol('_queue'); | |
| 3844 let _end = Symbol('_end'); | |
| 3845 let _position = Symbol('_position'); | |
| 3846 let _ListQueueIterator$ = dart.generic(function(E) { | |
| 3847 class _ListQueueIterator extends dart.Object { | |
| 3848 _ListQueueIterator(queue) { | |
| 3849 this[_queue] = queue; | |
| 3850 this[_end] = queue[_tail]; | |
| 3851 this[_modificationCount] = queue[_modificationCount]; | |
| 3852 this[_position] = queue[_head]; | |
| 3853 this[_current] = null; | |
| 3854 } | |
| 3855 get current() { | |
| 3856 return this[_current]; | |
| 3857 } | |
| 3858 moveNext() { | |
| 3859 this[_queue]._checkModification(this[_modificationCount]); | |
| 3860 if (this[_position] === this[_end]) { | |
| 3861 this[_current] = null; | |
| 3862 return false; | |
| 3863 } | |
| 3864 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E); | |
| 3865 this[_position] = dart.notNull(this[_position]) + 1 & dart.notNull(this[
_queue][_table].length) - 1; | |
| 3866 return true; | |
| 3867 } | |
| 3868 } | |
| 3869 return _ListQueueIterator; | |
| 3870 }); | |
| 3871 let _ListQueueIterator = _ListQueueIterator$(dynamic); | |
| 3872 let SetMixin$ = dart.generic(function(E) { | |
| 3873 class SetMixin extends dart.Object { | |
| 3874 get isEmpty() { | |
| 3875 return this.length === 0; | |
| 3876 } | |
| 3877 get isNotEmpty() { | |
| 3878 return this.length !== 0; | |
| 3879 } | |
| 3880 clear() { | |
| 3881 this.removeAll(this.toList()); | |
| 3882 } | |
| 3883 addAll(elements) { | |
| 3884 for (let element of elements) | |
| 3885 this.add(element); | |
| 3886 } | |
| 3887 removeAll(elements) { | |
| 3888 for (let element of elements) | |
| 3889 this.remove(element); | |
| 3890 } | |
| 3891 retainAll(elements) { | |
| 3892 let toRemove = this.toSet(); | |
| 3893 for (let o of elements) { | |
| 3894 toRemove.remove(o); | |
| 3895 } | |
| 3896 this.removeAll(toRemove); | |
| 3897 } | |
| 3898 removeWhere(test) { | |
| 3899 let toRemove = new List.from([]); | |
| 3900 for (let element of this) { | |
| 3901 if (test(element)) | |
| 3902 toRemove.add(element); | |
| 3903 } | |
| 3904 this.removeAll(dart.as(toRemove, core.Iterable$(core.Object))); | |
| 3905 } | |
| 3906 retainWhere(test) { | |
| 3907 let toRemove = new List.from([]); | |
| 3908 for (let element of this) { | |
| 3909 if (!dart.notNull(test(element))) | |
| 3910 toRemove.add(element); | |
| 3911 } | |
| 3912 this.removeAll(dart.as(toRemove, core.Iterable$(core.Object))); | |
| 3913 } | |
| 3914 containsAll(other) { | |
| 3915 for (let o of other) { | |
| 3916 if (!dart.notNull(this.contains(o))) | |
| 3917 return false; | |
| 3918 } | |
| 3919 return true; | |
| 3920 } | |
| 3921 union(other) { | |
| 3922 return ((_) => { | |
| 3923 _.addAll(other); | |
| 3924 return _; | |
| 3925 }).bind(this)(this.toSet()); | |
| 3926 } | |
| 3927 intersection(other) { | |
| 3928 let result = this.toSet(); | |
| 3929 for (let element of this) { | |
| 3930 if (!dart.notNull(other.contains(element))) | |
| 3931 result.remove(element); | |
| 3932 } | |
| 3933 return result; | |
| 3934 } | |
| 3935 difference(other) { | |
| 3936 let result = this.toSet(); | |
| 3937 for (let element of this) { | |
| 3938 if (other.contains(element)) | |
| 3939 result.remove(element); | |
| 3940 } | |
| 3941 return result; | |
| 3942 } | |
| 3943 toList(opt$) { | |
| 3944 let growable = opt$.growable === void 0 ? true : opt$.growable; | |
| 3945 let result = growable ? ((_) => { | |
| 3946 _.length = this.length; | |
| 3947 return _; | |
| 3948 }).bind(this)(new core.List()) : new core.List(this.length); | |
| 3949 let i = 0; | |
| 3950 for (let element of this) | |
| 3951 result.set((($tmp) => i = dart.notNull($tmp) + 1, $tmp)(i), element); | |
| 3952 return result; | |
| 3953 } | |
| 3954 map(f) { | |
| 3955 return new _internal.EfficientLengthMappedIterable(this, f); | |
| 3956 } | |
| 3957 get single() { | |
| 3958 if (dart.notNull(this.length) > 1) | |
| 3959 throw _internal.IterableElementError.tooMany(); | |
| 3960 let it = this.iterator; | |
| 3961 if (!dart.notNull(it.moveNext())) | |
| 3962 throw _internal.IterableElementError.noElement(); | |
| 3963 let result = dart.as(it.current, E); | |
| 3964 return result; | |
| 3965 } | |
| 3966 toString() { | |
| 3967 return IterableBase.iterableToFullString(this, '{', '}'); | |
| 3968 } | |
| 3969 where(f) { | |
| 3970 return new _internal.WhereIterable(this, f); | |
| 3971 } | |
| 3972 expand(f) { | |
| 3973 return new _internal.ExpandIterable(this, f); | |
| 3974 } | |
| 3975 forEach(f) { | |
| 3976 for (let element of this) | |
| 3977 f(element); | |
| 3978 } | |
| 3979 reduce(combine) { | |
| 3980 let iterator = this.iterator; | |
| 3981 if (!dart.notNull(iterator.moveNext())) { | |
| 3982 throw _internal.IterableElementError.noElement(); | |
| 3983 } | |
| 3984 let value = iterator.current; | |
| 3985 while (iterator.moveNext()) { | |
| 3986 value = combine(value, iterator.current); | |
| 3987 } | |
| 3988 return value; | |
| 3989 } | |
| 3990 fold(initialValue, combine) { | |
| 3991 let value = initialValue; | |
| 3992 for (let element of this) | |
| 3993 value = combine(value, element); | |
| 3994 return value; | |
| 3995 } | |
| 3996 every(f) { | |
| 3997 for (let element of this) { | |
| 3998 if (!dart.notNull(f(element))) | |
| 3999 return false; | |
| 4000 } | |
| 4001 return true; | |
| 4002 } | |
| 4003 join(separator) { | |
| 4004 if (separator === void 0) | |
| 4005 separator = ""; | |
| 4006 let iterator = this.iterator; | |
| 4007 if (!dart.notNull(iterator.moveNext())) | |
| 4008 return ""; | |
| 4009 let buffer = new core.StringBuffer(); | |
| 4010 if (dart.notNull(separator === null) || dart.notNull(dart.equals(separat
or, ""))) { | |
| 4011 do { | |
| 4012 buffer.write(`${iterator.current}`); | |
| 4013 } while (iterator.moveNext()); | |
| 4014 } else { | |
| 4015 buffer.write(`${iterator.current}`); | |
| 4016 while (iterator.moveNext()) { | |
| 4017 buffer.write(separator); | |
| 4018 buffer.write(`${iterator.current}`); | |
| 4019 } | |
| 4020 } | |
| 4021 return buffer.toString(); | |
| 4022 } | |
| 4023 any(test) { | |
| 4024 for (let element of this) { | |
| 4025 if (test(element)) | |
| 4026 return true; | |
| 4027 } | |
| 4028 return false; | |
| 4029 } | |
| 4030 take(n) { | |
| 4031 return new _internal.TakeIterable(this, n); | |
| 4032 } | |
| 4033 takeWhile(test) { | |
| 4034 return new _internal.TakeWhileIterable(this, test); | |
| 4035 } | |
| 4036 skip(n) { | |
| 4037 return new _internal.SkipIterable(this, n); | |
| 4038 } | |
| 4039 skipWhile(test) { | |
| 4040 return new _internal.SkipWhileIterable(this, test); | |
| 4041 } | |
| 4042 get first() { | |
| 4043 let it = this.iterator; | |
| 4044 if (!dart.notNull(it.moveNext())) { | |
| 4045 throw _internal.IterableElementError.noElement(); | |
| 4046 } | |
| 4047 return dart.as(it.current, E); | |
| 4048 } | |
| 4049 get last() { | |
| 4050 let it = this.iterator; | |
| 4051 if (!dart.notNull(it.moveNext())) { | |
| 4052 throw _internal.IterableElementError.noElement(); | |
| 4053 } | |
| 4054 let result = null; | |
| 4055 do { | |
| 4056 result = dart.as(it.current, E); | |
| 4057 } while (it.moveNext()); | |
| 4058 return result; | |
| 4059 } | |
| 4060 firstWhere(test, opt$) { | |
| 4061 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; | |
| 4062 for (let element of this) { | |
| 4063 if (test(element)) | |
| 4064 return element; | |
| 4065 } | |
| 4066 if (orElse !== null) | |
| 4067 return orElse(); | |
| 4068 throw _internal.IterableElementError.noElement(); | |
| 4069 } | |
| 4070 lastWhere(test, opt$) { | |
| 4071 let orElse = opt$.orElse === void 0 ? null : opt$.orElse; | |
| 4072 let result = null; | 2528 let result = null; |
| 4073 let foundMatching = false; | 2529 let foundMatching = false; |
| 4074 for (let element of this) { | 2530 for (let element of this) { |
| 4075 if (test(element)) { | 2531 if (test(element)) { |
| 4076 result = element; | 2532 result = element; |
| 4077 foundMatching = true; | 2533 foundMatching = true; |
| 4078 } | 2534 } |
| 4079 } | 2535 } |
| 4080 if (foundMatching) | 2536 if (foundMatching) |
| 4081 return result; | 2537 return result; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 4107 for (let element of this) { | 2563 for (let element of this) { |
| 4108 if (index === elementIndex) | 2564 if (index === elementIndex) |
| 4109 return element; | 2565 return element; |
| 4110 elementIndex = dart.notNull(elementIndex) + 1; | 2566 elementIndex = dart.notNull(elementIndex) + 1; |
| 4111 } | 2567 } |
| 4112 throw new core.RangeError.index(index, this, "index", null, elementIndex
); | 2568 throw new core.RangeError.index(index, this, "index", null, elementIndex
); |
| 4113 } | 2569 } |
| 4114 } | 2570 } |
| 4115 return SetMixin; | 2571 return SetMixin; |
| 4116 }); | 2572 }); |
| 4117 let SetMixin = SetMixin$(dynamic); | 2573 let SetMixin = SetMixin$(dart.dynamic); |
| 4118 let SetBase$ = dart.generic(function(E) { | 2574 let SetBase$ = dart.generic(function(E) { |
| 4119 class SetBase extends SetMixin$(E) { | 2575 class SetBase extends SetMixin$(E) { |
| 4120 static setToString(set) { | 2576 static setToString(set) { |
| 4121 return IterableBase.iterableToFullString(set, '{', '}'); | 2577 return IterableBase.iterableToFullString(set, '{', '}'); |
| 4122 } | 2578 } |
| 4123 } | 2579 } |
| 4124 return SetBase; | 2580 return SetBase; |
| 4125 }); | 2581 }); |
| 4126 let SetBase = SetBase$(dynamic); | 2582 let SetBase = SetBase$(dart.dynamic); |
| 4127 let _SplayTreeNode$ = dart.generic(function(K) { | 2583 let _SplayTreeNode$ = dart.generic(function(K) { |
| 4128 class _SplayTreeNode extends dart.Object { | 2584 class _SplayTreeNode extends core.Object { |
| 4129 _SplayTreeNode(key) { | 2585 _SplayTreeNode(key) { |
| 4130 this.key = key; | 2586 this.key = key; |
| 4131 this.left = null; | 2587 this.left = null; |
| 4132 this.right = null; | 2588 this.right = null; |
| 4133 } | 2589 } |
| 4134 } | 2590 } |
| 4135 return _SplayTreeNode; | 2591 return _SplayTreeNode; |
| 4136 }); | 2592 }); |
| 4137 let _SplayTreeNode = _SplayTreeNode$(dynamic); | 2593 let _SplayTreeNode = _SplayTreeNode$(dart.dynamic); |
| 4138 let _SplayTreeMapNode$ = dart.generic(function(K, V) { | 2594 let _SplayTreeMapNode$ = dart.generic(function(K, V) { |
| 4139 class _SplayTreeMapNode extends _SplayTreeNode$(K) { | 2595 class _SplayTreeMapNode extends _SplayTreeNode$(K) { |
| 4140 _SplayTreeMapNode(key, value) { | 2596 _SplayTreeMapNode(key, value) { |
| 4141 this.value = value; | 2597 this.value = value; |
| 4142 super._SplayTreeNode(key); | 2598 super._SplayTreeNode(key); |
| 4143 } | 2599 } |
| 4144 } | 2600 } |
| 4145 return _SplayTreeMapNode; | 2601 return _SplayTreeMapNode; |
| 4146 }); | 2602 }); |
| 4147 let _SplayTreeMapNode = _SplayTreeMapNode$(dynamic, dynamic); | 2603 let _SplayTreeMapNode = _SplayTreeMapNode$(dart.dynamic, dart.dynamic); |
| 4148 let _dummy = Symbol('_dummy'); | 2604 let _dummy = Symbol('_dummy'); |
| 4149 let _root = Symbol('_root'); | 2605 let _root = Symbol('_root'); |
| 4150 let _count = Symbol('_count'); | 2606 let _count = Symbol('_count'); |
| 4151 let _splayCount = Symbol('_splayCount'); | 2607 let _splayCount = Symbol('_splayCount'); |
| 4152 let _splay = Symbol('_splay'); | 2608 let _splay = Symbol('_splay'); |
| 4153 let _compare = Symbol('_compare'); | 2609 let _compare = Symbol('_compare'); |
| 4154 let _splayMin = Symbol('_splayMin'); | 2610 let _splayMin = Symbol('_splayMin'); |
| 4155 let _splayMax = Symbol('_splayMax'); | 2611 let _splayMax = Symbol('_splayMax'); |
| 4156 let _addNewRoot = Symbol('_addNewRoot'); | 2612 let _addNewRoot = Symbol('_addNewRoot'); |
| 2613 let _first = Symbol('_first'); |
| 2614 let _last = Symbol('_last'); |
| 4157 let _clear = Symbol('_clear'); | 2615 let _clear = Symbol('_clear'); |
| 4158 let _SplayTree$ = dart.generic(function(K) { | 2616 let _SplayTree$ = dart.generic(function(K) { |
| 4159 class _SplayTree extends dart.Object { | 2617 class _SplayTree extends core.Object { |
| 4160 _SplayTree() { | 2618 _SplayTree() { |
| 4161 this[_dummy] = new _SplayTreeNode(null); | 2619 this[_dummy] = new _SplayTreeNode(null); |
| 4162 this[_root] = null; | 2620 this[_root] = null; |
| 4163 this[_count] = 0; | 2621 this[_count] = 0; |
| 4164 this[_modificationCount] = 0; | 2622 this[_modificationCount] = 0; |
| 4165 this[_splayCount] = 0; | 2623 this[_splayCount] = 0; |
| 4166 } | 2624 } |
| 4167 [_splay](key) { | 2625 [_splay](key) { |
| 4168 if (this[_root] === null) | 2626 if (this[_root] === null) |
| 4169 return -1; | 2627 return -1; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4286 return this[_root]; | 2744 return this[_root]; |
| 4287 } | 2745 } |
| 4288 [_clear]() { | 2746 [_clear]() { |
| 4289 this[_root] = null; | 2747 this[_root] = null; |
| 4290 this[_count] = 0; | 2748 this[_count] = 0; |
| 4291 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; | 2749 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; |
| 4292 } | 2750 } |
| 4293 } | 2751 } |
| 4294 return _SplayTree; | 2752 return _SplayTree; |
| 4295 }); | 2753 }); |
| 4296 let _SplayTree = _SplayTree$(dynamic); | 2754 let _SplayTree = _SplayTree$(dart.dynamic); |
| 4297 let _TypeTest$ = dart.generic(function(T) { | 2755 let _TypeTest$ = dart.generic(function(T) { |
| 4298 class _TypeTest extends dart.Object { | 2756 class _TypeTest extends core.Object { |
| 4299 test(v) { | 2757 test(v) { |
| 4300 return dart.is(v, T); | 2758 return dart.is(v, T); |
| 4301 } | 2759 } |
| 4302 } | 2760 } |
| 4303 return _TypeTest; | 2761 return _TypeTest; |
| 4304 }); | 2762 }); |
| 4305 let _TypeTest = _TypeTest$(dynamic); | 2763 let _TypeTest = _TypeTest$(dart.dynamic); |
| 4306 let _comparator = Symbol('_comparator'); | 2764 let _comparator = Symbol('_comparator'); |
| 2765 let _validKey = Symbol('_validKey'); |
| 4307 let SplayTreeMap$ = dart.generic(function(K, V) { | 2766 let SplayTreeMap$ = dart.generic(function(K, V) { |
| 4308 class SplayTreeMap extends _SplayTree$(K) { | 2767 class SplayTreeMap extends _SplayTree$(K) { |
| 4309 SplayTreeMap(compare, isValidKey) { | 2768 SplayTreeMap(compare, isValidKey) { |
| 4310 if (compare === void 0) | 2769 if (compare === void 0) |
| 4311 compare = null; | 2770 compare = null; |
| 4312 if (isValidKey === void 0) | 2771 if (isValidKey === void 0) |
| 4313 isValidKey = null; | 2772 isValidKey = null; |
| 4314 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); | 2773 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); |
| 4315 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart
.is(v, K), _Predicate); | 2774 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart
.is(v, K), _Predicate); |
| 4316 super._SplayTree(); | 2775 super._SplayTree(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4503 } | 2962 } |
| 4504 return node.key; | 2963 return node.key; |
| 4505 } | 2964 } |
| 4506 } | 2965 } |
| 4507 dart.defineNamedConstructor(SplayTreeMap, 'from'); | 2966 dart.defineNamedConstructor(SplayTreeMap, 'from'); |
| 4508 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); | 2967 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); |
| 4509 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); | 2968 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); |
| 4510 dart.defineNamedConstructor(SplayTreeMap, '_internal'); | 2969 dart.defineNamedConstructor(SplayTreeMap, '_internal'); |
| 4511 return SplayTreeMap; | 2970 return SplayTreeMap; |
| 4512 }); | 2971 }); |
| 4513 let SplayTreeMap = SplayTreeMap$(dynamic, dynamic); | 2972 let SplayTreeMap = SplayTreeMap$(dart.dynamic, dart.dynamic); |
| 4514 let _workList = Symbol('_workList'); | 2973 let _workList = Symbol('_workList'); |
| 4515 let _tree = Symbol('_tree'); | 2974 let _tree = Symbol('_tree'); |
| 4516 let _currentNode = Symbol('_currentNode'); | 2975 let _currentNode = Symbol('_currentNode'); |
| 4517 let _findLeftMostDescendent = Symbol('_findLeftMostDescendent'); | 2976 let _findLeftMostDescendent = Symbol('_findLeftMostDescendent'); |
| 4518 let _getValue = Symbol('_getValue'); | 2977 let _getValue = Symbol('_getValue'); |
| 4519 let _rebuildWorkList = Symbol('_rebuildWorkList'); | 2978 let _rebuildWorkList = Symbol('_rebuildWorkList'); |
| 4520 let _SplayTreeIterator$ = dart.generic(function(T) { | 2979 let _SplayTreeIterator$ = dart.generic(function(T) { |
| 4521 class _SplayTreeIterator extends dart.Object { | 2980 class _SplayTreeIterator extends core.Object { |
| 4522 _SplayTreeIterator(tree) { | 2981 _SplayTreeIterator(tree) { |
| 4523 this[_workList] = new List.from([]); | 2982 this[_workList] = new List.from([]); |
| 4524 this[_tree] = tree; | 2983 this[_tree] = tree; |
| 4525 this[_modificationCount] = tree[_modificationCount]; | 2984 this[_modificationCount] = tree[_modificationCount]; |
| 4526 this[_splayCount] = tree[_splayCount]; | 2985 this[_splayCount] = tree[_splayCount]; |
| 4527 this[_currentNode] = null; | 2986 this[_currentNode] = null; |
| 4528 this[_findLeftMostDescendent](tree[_root]); | 2987 this[_findLeftMostDescendent](tree[_root]); |
| 4529 } | 2988 } |
| 4530 _SplayTreeIterator$startAt(tree, startKey) { | 2989 _SplayTreeIterator$startAt(tree, startKey) { |
| 4531 this[_workList] = new List.from([]); | 2990 this[_workList] = new List.from([]); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4577 this[_rebuildWorkList](this[_currentNode]); | 3036 this[_rebuildWorkList](this[_currentNode]); |
| 4578 } | 3037 } |
| 4579 this[_currentNode] = this[_workList].removeLast(); | 3038 this[_currentNode] = this[_workList].removeLast(); |
| 4580 this[_findLeftMostDescendent](this[_currentNode].right); | 3039 this[_findLeftMostDescendent](this[_currentNode].right); |
| 4581 return true; | 3040 return true; |
| 4582 } | 3041 } |
| 4583 } | 3042 } |
| 4584 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); | 3043 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); |
| 4585 return _SplayTreeIterator; | 3044 return _SplayTreeIterator; |
| 4586 }); | 3045 }); |
| 4587 let _SplayTreeIterator = _SplayTreeIterator$(dynamic); | 3046 let _SplayTreeIterator = _SplayTreeIterator$(dart.dynamic); |
| 4588 let _SplayTreeKeyIterable$ = dart.generic(function(K) { | 3047 let _SplayTreeKeyIterable$ = dart.generic(function(K) { |
| 4589 class _SplayTreeKeyIterable extends IterableBase$(K) { | 3048 class _SplayTreeKeyIterable extends IterableBase$(K) { |
| 4590 _SplayTreeKeyIterable($_tree) { | 3049 _SplayTreeKeyIterable($_tree) { |
| 4591 this[_tree] = $_tree; | 3050 this[_tree] = $_tree; |
| 4592 super.IterableBase(); | 3051 super.IterableBase(); |
| 4593 } | 3052 } |
| 4594 get length() { | 3053 get length() { |
| 4595 return this[_tree][_count]; | 3054 return this[_tree][_count]; |
| 4596 } | 3055 } |
| 4597 get isEmpty() { | 3056 get isEmpty() { |
| 4598 return this[_tree][_count] === 0; | 3057 return this[_tree][_count] === 0; |
| 4599 } | 3058 } |
| 4600 get iterator() { | 3059 get iterator() { |
| 4601 return new _SplayTreeKeyIterator(this[_tree]); | 3060 return new _SplayTreeKeyIterator(this[_tree]); |
| 4602 } | 3061 } |
| 4603 toSet() { | 3062 toSet() { |
| 4604 let setOrMap = this[_tree]; | 3063 let setOrMap = this[_tree]; |
| 4605 let set = new SplayTreeSet(dart.as(setOrMap[_comparator], dart.throw_("U
nimplemented type (K, K) → int")), dart.as(setOrMap[_validKey], dart.throw_("Uni
mplemented type (dynamic) → bool"))); | 3064 let set = new SplayTreeSet(dart.as(setOrMap[_comparator], dart.throw_("U
nimplemented type (K, K) → int")), dart.as(setOrMap[_validKey], dart.throw_("Uni
mplemented type (dynamic) → bool"))); |
| 4606 set[_count] = this[_tree][_count]; | 3065 set[_count] = this[_tree][_count]; |
| 4607 set[_root] = set._copyNode(this[_tree][_root]); | 3066 set[_root] = set._copyNode(this[_tree][_root]); |
| 4608 return set; | 3067 return set; |
| 4609 } | 3068 } |
| 4610 } | 3069 } |
| 4611 return _SplayTreeKeyIterable; | 3070 return _SplayTreeKeyIterable; |
| 4612 }); | 3071 }); |
| 4613 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dynamic); | 3072 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dart.dynamic); |
| 4614 let _SplayTreeValueIterable$ = dart.generic(function(K, V) { | 3073 let _SplayTreeValueIterable$ = dart.generic(function(K, V) { |
| 4615 class _SplayTreeValueIterable extends IterableBase$(V) { | 3074 class _SplayTreeValueIterable extends IterableBase$(V) { |
| 4616 _SplayTreeValueIterable($_map) { | 3075 _SplayTreeValueIterable($_map) { |
| 4617 this[_map] = $_map; | 3076 this[_map] = $_map; |
| 4618 super.IterableBase(); | 3077 super.IterableBase(); |
| 4619 } | 3078 } |
| 4620 get length() { | 3079 get length() { |
| 4621 return this[_map][_count]; | 3080 return this[_map][_count]; |
| 4622 } | 3081 } |
| 4623 get isEmpty() { | 3082 get isEmpty() { |
| 4624 return this[_map][_count] === 0; | 3083 return this[_map][_count] === 0; |
| 4625 } | 3084 } |
| 4626 get iterator() { | 3085 get iterator() { |
| 4627 return new _SplayTreeValueIterator(this[_map]); | 3086 return new _SplayTreeValueIterator(this[_map]); |
| 4628 } | 3087 } |
| 4629 } | 3088 } |
| 4630 return _SplayTreeValueIterable; | 3089 return _SplayTreeValueIterable; |
| 4631 }); | 3090 }); |
| 4632 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dynamic, dynamic); | 3091 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dart.dynamic, dart.dyna
mic); |
| 4633 let _SplayTreeKeyIterator$ = dart.generic(function(K) { | 3092 let _SplayTreeKeyIterator$ = dart.generic(function(K) { |
| 4634 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) { | 3093 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) { |
| 4635 _SplayTreeKeyIterator(map) { | 3094 _SplayTreeKeyIterator(map) { |
| 4636 super._SplayTreeIterator(map); | 3095 super._SplayTreeIterator(map); |
| 4637 } | 3096 } |
| 4638 [_getValue](node) { | 3097 [_getValue](node) { |
| 4639 return dart.as(node.key, K); | 3098 return dart.as(node.key, K); |
| 4640 } | 3099 } |
| 4641 } | 3100 } |
| 4642 return _SplayTreeKeyIterator; | 3101 return _SplayTreeKeyIterator; |
| 4643 }); | 3102 }); |
| 4644 let _SplayTreeKeyIterator = _SplayTreeKeyIterator$(dynamic); | 3103 let _SplayTreeKeyIterator = _SplayTreeKeyIterator$(dart.dynamic); |
| 4645 let _SplayTreeValueIterator$ = dart.generic(function(K, V) { | 3104 let _SplayTreeValueIterator$ = dart.generic(function(K, V) { |
| 4646 class _SplayTreeValueIterator extends _SplayTreeIterator$(V) { | 3105 class _SplayTreeValueIterator extends _SplayTreeIterator$(V) { |
| 4647 _SplayTreeValueIterator(map) { | 3106 _SplayTreeValueIterator(map) { |
| 4648 super._SplayTreeIterator(map); | 3107 super._SplayTreeIterator(map); |
| 4649 } | 3108 } |
| 4650 [_getValue](node) { | 3109 [_getValue](node) { |
| 4651 return dart.as(node.value, V); | 3110 return dart.as(node.value, V); |
| 4652 } | 3111 } |
| 4653 } | 3112 } |
| 4654 return _SplayTreeValueIterator; | 3113 return _SplayTreeValueIterator; |
| 4655 }); | 3114 }); |
| 4656 let _SplayTreeValueIterator = _SplayTreeValueIterator$(dynamic, dynamic); | 3115 let _SplayTreeValueIterator = _SplayTreeValueIterator$(dart.dynamic, dart.dyna
mic); |
| 4657 let _SplayTreeNodeIterator$ = dart.generic(function(K) { | 3116 let _SplayTreeNodeIterator$ = dart.generic(function(K) { |
| 4658 class _SplayTreeNodeIterator extends _SplayTreeIterator$(_SplayTreeNode$(K))
{ | 3117 class _SplayTreeNodeIterator extends _SplayTreeIterator$(_SplayTreeNode$(K))
{ |
| 4659 _SplayTreeNodeIterator(tree) { | 3118 _SplayTreeNodeIterator(tree) { |
| 4660 super._SplayTreeIterator(tree); | 3119 super._SplayTreeIterator(tree); |
| 4661 } | 3120 } |
| 4662 _SplayTreeNodeIterator$startAt(tree, startKey) { | 3121 _SplayTreeNodeIterator$startAt(tree, startKey) { |
| 4663 super._SplayTreeIterator$startAt(tree, startKey); | 3122 super._SplayTreeIterator$startAt(tree, startKey); |
| 4664 } | 3123 } |
| 4665 [_getValue](node) { | 3124 [_getValue](node) { |
| 4666 return dart.as(node, _SplayTreeNode$(K)); | 3125 return dart.as(node, _SplayTreeNode$(K)); |
| 4667 } | 3126 } |
| 4668 } | 3127 } |
| 4669 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt'); | 3128 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt'); |
| 4670 return _SplayTreeNodeIterator; | 3129 return _SplayTreeNodeIterator; |
| 4671 }); | 3130 }); |
| 4672 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dynamic); | 3131 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dart.dynamic); |
| 4673 let _clone = Symbol('_clone'); | 3132 let _clone = Symbol('_clone'); |
| 4674 let _copyNode = Symbol('_copyNode'); | 3133 let _copyNode = Symbol('_copyNode'); |
| 4675 let SplayTreeSet$ = dart.generic(function(E) { | 3134 let SplayTreeSet$ = dart.generic(function(E) { |
| 4676 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set
Mixin$(E)) { | 3135 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set
Mixin$(E)) { |
| 4677 SplayTreeSet(compare, isValidKey) { | 3136 SplayTreeSet(compare, isValidKey) { |
| 4678 if (compare === void 0) | 3137 if (compare === void 0) |
| 4679 compare = null; | 3138 compare = null; |
| 4680 if (isValidKey === void 0) | 3139 if (isValidKey === void 0) |
| 4681 isValidKey = null; | 3140 isValidKey = null; |
| 4682 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); | 3141 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4822 toSet() { | 3281 toSet() { |
| 4823 return this[_clone](); | 3282 return this[_clone](); |
| 4824 } | 3283 } |
| 4825 toString() { | 3284 toString() { |
| 4826 return IterableBase.iterableToFullString(this, '{', '}'); | 3285 return IterableBase.iterableToFullString(this, '{', '}'); |
| 4827 } | 3286 } |
| 4828 } | 3287 } |
| 4829 dart.defineNamedConstructor(SplayTreeSet, 'from'); | 3288 dart.defineNamedConstructor(SplayTreeSet, 'from'); |
| 4830 return SplayTreeSet; | 3289 return SplayTreeSet; |
| 4831 }); | 3290 }); |
| 4832 let SplayTreeSet = SplayTreeSet$(dynamic); | 3291 let SplayTreeSet = SplayTreeSet$(dart.dynamic); |
| 3292 let _strings = Symbol('_strings'); |
| 3293 let _nums = Symbol('_nums'); |
| 3294 let _rest = Symbol('_rest'); |
| 3295 let _containsKey = Symbol('_containsKey'); |
| 3296 let _getBucket = Symbol('_getBucket'); |
| 3297 let _findBucketIndex = Symbol('_findBucketIndex'); |
| 3298 let _computeKeys = Symbol('_computeKeys'); |
| 3299 let _get = Symbol('_get'); |
| 3300 let _addHashTableEntry = Symbol('_addHashTableEntry'); |
| 3301 let _set = Symbol('_set'); |
| 3302 let _computeHashCode = Symbol('_computeHashCode'); |
| 3303 let _removeHashTableEntry = Symbol('_removeHashTableEntry'); |
| 3304 let _isStringKey = Symbol('_isStringKey'); |
| 3305 let _isNumericKey = Symbol('_isNumericKey'); |
| 3306 let _hasTableEntry = Symbol('_hasTableEntry'); |
| 3307 let _getTableEntry = Symbol('_getTableEntry'); |
| 3308 let _setTableEntry = Symbol('_setTableEntry'); |
| 3309 let _deleteTableEntry = Symbol('_deleteTableEntry'); |
| 3310 let _newHashTable = Symbol('_newHashTable'); |
| 3311 let _HashMap$ = dart.generic(function(K, V) { |
| 3312 class _HashMap extends core.Object { |
| 3313 _HashMap() { |
| 3314 this[_length] = 0; |
| 3315 this[_strings] = null; |
| 3316 this[_nums] = null; |
| 3317 this[_rest] = null; |
| 3318 this[_keys] = null; |
| 3319 } |
| 3320 get length() { |
| 3321 return this[_length]; |
| 3322 } |
| 3323 get isEmpty() { |
| 3324 return this[_length] === 0; |
| 3325 } |
| 3326 get isNotEmpty() { |
| 3327 return !dart.notNull(this.isEmpty); |
| 3328 } |
| 3329 get keys() { |
| 3330 return new HashMapKeyIterable(this); |
| 3331 } |
| 3332 get values() { |
| 3333 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); |
| 3334 } |
| 3335 containsKey(key) { |
| 3336 if (_isStringKey(key)) { |
| 3337 let strings = this[_strings]; |
| 3338 return strings === null ? false : _hasTableEntry(strings, key); |
| 3339 } else if (_isNumericKey(key)) { |
| 3340 let nums = this[_nums]; |
| 3341 return nums === null ? false : _hasTableEntry(nums, key); |
| 3342 } else { |
| 3343 return this[_containsKey](key); |
| 3344 } |
| 3345 } |
| 3346 [_containsKey](key) { |
| 3347 let rest = this[_rest]; |
| 3348 if (rest === null) |
| 3349 return false; |
| 3350 let bucket = this[_getBucket](rest, key); |
| 3351 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; |
| 3352 } |
| 3353 containsValue(value) { |
| 3354 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v
alue)).bind(this)); |
| 3355 } |
| 3356 addAll(other) { |
| 3357 other.forEach(((key, value) => { |
| 3358 this.set(key, value); |
| 3359 }).bind(this)); |
| 3360 } |
| 3361 get(key) { |
| 3362 if (_isStringKey(key)) { |
| 3363 let strings = this[_strings]; |
| 3364 return dart.as(strings === null ? null : _getTableEntry(strings, key),
V); |
| 3365 } else if (_isNumericKey(key)) { |
| 3366 let nums = this[_nums]; |
| 3367 return dart.as(nums === null ? null : _getTableEntry(nums, key), V); |
| 3368 } else { |
| 3369 return this[_get](key); |
| 3370 } |
| 3371 } |
| 3372 [_get](key) { |
| 3373 let rest = this[_rest]; |
| 3374 if (rest === null) |
| 3375 return null; |
| 3376 let bucket = this[_getBucket](rest, key); |
| 3377 let index = this[_findBucketIndex](bucket, key); |
| 3378 return dart.as(dart.notNull(index) < 0 ? null : bucket[dart.notNull(inde
x) + 1], V); |
| 3379 } |
| 3380 set(key, value) { |
| 3381 if (_isStringKey(key)) { |
| 3382 let strings = this[_strings]; |
| 3383 if (strings === null) |
| 3384 this[_strings] = strings = _newHashTable(); |
| 3385 this[_addHashTableEntry](strings, key, value); |
| 3386 } else if (_isNumericKey(key)) { |
| 3387 let nums = this[_nums]; |
| 3388 if (nums === null) |
| 3389 this[_nums] = nums = _newHashTable(); |
| 3390 this[_addHashTableEntry](nums, key, value); |
| 3391 } else { |
| 3392 this[_set](key, value); |
| 3393 } |
| 3394 } |
| 3395 [_set](key, value) { |
| 3396 let rest = this[_rest]; |
| 3397 if (rest === null) |
| 3398 this[_rest] = rest = _newHashTable(); |
| 3399 let hash = this[_computeHashCode](key); |
| 3400 let bucket = rest[hash]; |
| 3401 if (bucket === null) { |
| 3402 _setTableEntry(rest, hash, [key, value]); |
| 3403 this[_length] = dart.notNull(this[_length]) + 1; |
| 3404 this[_keys] = null; |
| 3405 } else { |
| 3406 let index = this[_findBucketIndex](bucket, key); |
| 3407 if (dart.notNull(index) >= 0) { |
| 3408 bucket[dart.notNull(index) + 1] = value; |
| 3409 } else { |
| 3410 bucket.push(key, value); |
| 3411 this[_length] = dart.notNull(this[_length]) + 1; |
| 3412 this[_keys] = null; |
| 3413 } |
| 3414 } |
| 3415 } |
| 3416 putIfAbsent(key, ifAbsent) { |
| 3417 if (this.containsKey(key)) |
| 3418 return this.get(key); |
| 3419 let value = ifAbsent(); |
| 3420 this.set(key, value); |
| 3421 return value; |
| 3422 } |
| 3423 remove(key) { |
| 3424 if (_isStringKey(key)) { |
| 3425 return this[_removeHashTableEntry](this[_strings], key); |
| 3426 } else if (_isNumericKey(key)) { |
| 3427 return this[_removeHashTableEntry](this[_nums], key); |
| 3428 } else { |
| 3429 return this[_remove](key); |
| 3430 } |
| 3431 } |
| 3432 [_remove](key) { |
| 3433 let rest = this[_rest]; |
| 3434 if (rest === null) |
| 3435 return null; |
| 3436 let bucket = this[_getBucket](rest, key); |
| 3437 let index = this[_findBucketIndex](bucket, key); |
| 3438 if (dart.notNull(index) < 0) |
| 3439 return null; |
| 3440 this[_length] = dart.notNull(this[_length]) - 1; |
| 3441 this[_keys] = null; |
| 3442 return dart.as(bucket.splice(index, 2)[1], V); |
| 3443 } |
| 3444 clear() { |
| 3445 if (dart.notNull(this[_length]) > 0) { |
| 3446 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; |
| 3447 this[_length] = 0; |
| 3448 } |
| 3449 } |
| 3450 forEach(action) { |
| 3451 let keys = this[_computeKeys](); |
| 3452 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len
gth); i = dart.notNull(i) + 1) { |
| 3453 let key = keys[i]; |
| 3454 action(dart.as(key, K), this.get(key)); |
| 3455 if (keys !== this[_keys]) { |
| 3456 throw new core.ConcurrentModificationError(this); |
| 3457 } |
| 3458 } |
| 3459 } |
| 3460 [_computeKeys]() { |
| 3461 if (this[_keys] !== null) |
| 3462 return this[_keys]; |
| 3463 let result = new core.List(this[_length]); |
| 3464 let index = 0; |
| 3465 let strings = this[_strings]; |
| 3466 if (strings !== null) { |
| 3467 let names = Object.getOwnPropertyNames(strings); |
| 3468 let entries = names.length; |
| 3469 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { |
| 3470 let key = names[i]; |
| 3471 result[index] = key; |
| 3472 index = dart.notNull(index) + 1; |
| 3473 } |
| 3474 } |
| 3475 let nums = this[_nums]; |
| 3476 if (nums !== null) { |
| 3477 let names = Object.getOwnPropertyNames(nums); |
| 3478 let entries = names.length; |
| 3479 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { |
| 3480 let key = +names[i]; |
| 3481 result[index] = key; |
| 3482 index = dart.notNull(index) + 1; |
| 3483 } |
| 3484 } |
| 3485 let rest = this[_rest]; |
| 3486 if (rest !== null) { |
| 3487 let names = Object.getOwnPropertyNames(rest); |
| 3488 let entries = names.length; |
| 3489 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { |
| 3490 let key = names[i]; |
| 3491 let bucket = rest[key]; |
| 3492 let length = bucket.length; |
| 3493 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { |
| 3494 let key = bucket[i]; |
| 3495 result[index] = key; |
| 3496 index = dart.notNull(index) + 1; |
| 3497 } |
| 3498 } |
| 3499 } |
| 3500 dart.assert(index === this[_length]); |
| 3501 return this[_keys] = result; |
| 3502 } |
| 3503 [_addHashTableEntry](table, key, value) { |
| 3504 if (!dart.notNull(_hasTableEntry(table, key))) { |
| 3505 this[_length] = dart.notNull(this[_length]) + 1; |
| 3506 this[_keys] = null; |
| 3507 } |
| 3508 _setTableEntry(table, key, value); |
| 3509 } |
| 3510 [_removeHashTableEntry](table, key) { |
| 3511 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k
ey))) { |
| 3512 let value = dart.as(_getTableEntry(table, key), V); |
| 3513 _deleteTableEntry(table, key); |
| 3514 this[_length] = dart.notNull(this[_length]) - 1; |
| 3515 this[_keys] = null; |
| 3516 return value; |
| 3517 } else { |
| 3518 return null; |
| 3519 } |
| 3520 } |
| 3521 static [_isStringKey](key) { |
| 3522 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); |
| 3523 } |
| 3524 static [_isNumericKey](key) { |
| 3525 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key
; |
| 3526 } |
| 3527 [_computeHashCode](key) { |
| 3528 return dart.dload(key, 'hashCode') & 0x3ffffff; |
| 3529 } |
| 3530 static [_hasTableEntry](table, key) { |
| 3531 let entry = table[key]; |
| 3532 return entry !== null; |
| 3533 } |
| 3534 static [_getTableEntry](table, key) { |
| 3535 let entry = table[key]; |
| 3536 return entry === table ? null : entry; |
| 3537 } |
| 3538 static [_setTableEntry](table, key, value) { |
| 3539 if (value === null) { |
| 3540 table[key] = table; |
| 3541 } else { |
| 3542 table[key] = value; |
| 3543 } |
| 3544 } |
| 3545 static [_deleteTableEntry](table, key) { |
| 3546 delete table[key]; |
| 3547 } |
| 3548 [_getBucket](table, key) { |
| 3549 let hash = this[_computeHashCode](key); |
| 3550 return dart.as(table[hash], core.List); |
| 3551 } |
| 3552 [_findBucketIndex](bucket, key) { |
| 3553 if (bucket === null) |
| 3554 return -1; |
| 3555 let length = bucket.length; |
| 3556 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { |
| 3557 if (dart.equals(bucket[i], key)) |
| 3558 return i; |
| 3559 } |
| 3560 return -1; |
| 3561 } |
| 3562 static [_newHashTable]() { |
| 3563 let table = Object.create(null); |
| 3564 let temporaryKey = '<non-identifier-key>'; |
| 3565 _setTableEntry(table, temporaryKey, table); |
| 3566 _deleteTableEntry(table, temporaryKey); |
| 3567 return table; |
| 3568 } |
| 3569 } |
| 3570 return _HashMap; |
| 3571 }); |
| 3572 let _HashMap = _HashMap$(dart.dynamic, dart.dynamic); |
| 3573 let _IdentityHashMap$ = dart.generic(function(K, V) { |
| 3574 class _IdentityHashMap extends _HashMap$(K, V) { |
| 3575 [_computeHashCode](key) { |
| 3576 return core.identityHashCode(key) & 0x3ffffff; |
| 3577 } |
| 3578 [_findBucketIndex](bucket, key) { |
| 3579 if (bucket === null) |
| 3580 return -1; |
| 3581 let length = bucket.length; |
| 3582 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { |
| 3583 if (core.identical(bucket[i], key)) |
| 3584 return i; |
| 3585 } |
| 3586 return -1; |
| 3587 } |
| 3588 } |
| 3589 return _IdentityHashMap; |
| 3590 }); |
| 3591 let _IdentityHashMap = _IdentityHashMap$(dart.dynamic, dart.dynamic); |
| 3592 let _equals = Symbol('_equals'); |
| 3593 let _hashCode = Symbol('_hashCode'); |
| 3594 let _CustomHashMap$ = dart.generic(function(K, V) { |
| 3595 class _CustomHashMap extends _HashMap$(K, V) { |
| 3596 _CustomHashMap($_equals, $_hashCode, validKey) { |
| 3597 this[_equals] = $_equals; |
| 3598 this[_hashCode] = $_hashCode; |
| 3599 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); |
| 3600 super._HashMap(); |
| 3601 } |
| 3602 get(key) { |
| 3603 if (!dart.notNull(this[_validKey](key))) |
| 3604 return null; |
| 3605 return super._get(key); |
| 3606 } |
| 3607 set(key, value) { |
| 3608 super._set(key, value); |
| 3609 } |
| 3610 containsKey(key) { |
| 3611 if (!dart.notNull(this[_validKey](key))) |
| 3612 return false; |
| 3613 return super._containsKey(key); |
| 3614 } |
| 3615 remove(key) { |
| 3616 if (!dart.notNull(this[_validKey](key))) |
| 3617 return null; |
| 3618 return super._remove(key); |
| 3619 } |
| 3620 [_computeHashCode](key) { |
| 3621 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; |
| 3622 } |
| 3623 [_findBucketIndex](bucket, key) { |
| 3624 if (bucket === null) |
| 3625 return -1; |
| 3626 let length = bucket.length; |
| 3627 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = 2) { |
| 3628 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K))) |
| 3629 return i; |
| 3630 } |
| 3631 return -1; |
| 3632 } |
| 3633 toString() { |
| 3634 return Maps.mapToString(this); |
| 3635 } |
| 3636 } |
| 3637 return _CustomHashMap; |
| 3638 }); |
| 3639 let _CustomHashMap = _CustomHashMap$(dart.dynamic, dart.dynamic); |
| 3640 let HashMapKeyIterable$ = dart.generic(function(E) { |
| 3641 class HashMapKeyIterable extends IterableBase$(E) { |
| 3642 HashMapKeyIterable($_map) { |
| 3643 this[_map] = $_map; |
| 3644 super.IterableBase(); |
| 3645 } |
| 3646 get length() { |
| 3647 return dart.as(dart.dload(this[_map], '_length'), core.int); |
| 3648 } |
| 3649 get isEmpty() { |
| 3650 return dart.equals(dart.dload(this[_map], '_length'), 0); |
| 3651 } |
| 3652 get iterator() { |
| 3653 return new HashMapKeyIterator(this[_map], dart.as(dart.dinvoke(this[_map
], '_computeKeys'), core.List)); |
| 3654 } |
| 3655 contains(element) { |
| 3656 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); |
| 3657 } |
| 3658 forEach(f) { |
| 3659 let keys = dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List); |
| 3660 for (let i = 0, length = keys.length; dart.notNull(i) < dart.notNull(len
gth); i = dart.notNull(i) + 1) { |
| 3661 f(dart.as(keys[i], E)); |
| 3662 if (keys !== dart.dload(this[_map], '_keys')) { |
| 3663 throw new core.ConcurrentModificationError(this[_map]); |
| 3664 } |
| 3665 } |
| 3666 } |
| 3667 } |
| 3668 return HashMapKeyIterable; |
| 3669 }); |
| 3670 let HashMapKeyIterable = HashMapKeyIterable$(dart.dynamic); |
| 3671 let _offset = Symbol('_offset'); |
| 3672 let HashMapKeyIterator$ = dart.generic(function(E) { |
| 3673 class HashMapKeyIterator extends core.Object { |
| 3674 HashMapKeyIterator($_map, $_keys) { |
| 3675 this[_map] = $_map; |
| 3676 this[_keys] = $_keys; |
| 3677 this[_offset] = 0; |
| 3678 this[_current] = null; |
| 3679 } |
| 3680 get current() { |
| 3681 return this[_current]; |
| 3682 } |
| 3683 moveNext() { |
| 3684 let keys = this[_keys]; |
| 3685 let offset = this[_offset]; |
| 3686 if (keys !== dart.dload(this[_map], '_keys')) { |
| 3687 throw new core.ConcurrentModificationError(this[_map]); |
| 3688 } else if (dart.notNull(offset) >= keys.length) { |
| 3689 this[_current] = null; |
| 3690 return false; |
| 3691 } else { |
| 3692 this[_current] = dart.as(keys[offset], E); |
| 3693 this[_offset] = dart.notNull(offset) + 1; |
| 3694 return true; |
| 3695 } |
| 3696 } |
| 3697 } |
| 3698 return HashMapKeyIterator; |
| 3699 }); |
| 3700 let HashMapKeyIterator = HashMapKeyIterator$(dart.dynamic); |
| 3701 let _modifications = Symbol('_modifications'); |
| 3702 let _value = Symbol('_value'); |
| 3703 let _newLinkedCell = Symbol('_newLinkedCell'); |
| 3704 let _unlinkCell = Symbol('_unlinkCell'); |
| 3705 let _modified = Symbol('_modified'); |
| 3706 let _key = Symbol('_key'); |
| 3707 let _LinkedHashMap$ = dart.generic(function(K, V) { |
| 3708 class _LinkedHashMap extends core.Object { |
| 3709 _LinkedHashMap() { |
| 3710 this[_length] = 0; |
| 3711 this[_strings] = null; |
| 3712 this[_nums] = null; |
| 3713 this[_rest] = null; |
| 3714 this[_first] = null; |
| 3715 this[_last] = null; |
| 3716 this[_modifications] = 0; |
| 3717 } |
| 3718 get length() { |
| 3719 return this[_length]; |
| 3720 } |
| 3721 get isEmpty() { |
| 3722 return this[_length] === 0; |
| 3723 } |
| 3724 get isNotEmpty() { |
| 3725 return !dart.notNull(this.isEmpty); |
| 3726 } |
| 3727 get keys() { |
| 3728 return new LinkedHashMapKeyIterable(this); |
| 3729 } |
| 3730 get values() { |
| 3731 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); |
| 3732 } |
| 3733 containsKey(key) { |
| 3734 if (_isStringKey(key)) { |
| 3735 let strings = this[_strings]; |
| 3736 if (strings === null) |
| 3737 return false; |
| 3738 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); |
| 3739 return cell !== null; |
| 3740 } else if (_isNumericKey(key)) { |
| 3741 let nums = this[_nums]; |
| 3742 if (nums === null) |
| 3743 return false; |
| 3744 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); |
| 3745 return cell !== null; |
| 3746 } else { |
| 3747 return this[_containsKey](key); |
| 3748 } |
| 3749 } |
| 3750 [_containsKey](key) { |
| 3751 let rest = this[_rest]; |
| 3752 if (rest === null) |
| 3753 return false; |
| 3754 let bucket = this[_getBucket](rest, key); |
| 3755 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; |
| 3756 } |
| 3757 containsValue(value) { |
| 3758 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind
(this)); |
| 3759 } |
| 3760 addAll(other) { |
| 3761 other.forEach(((key, value) => { |
| 3762 this.set(key, value); |
| 3763 }).bind(this)); |
| 3764 } |
| 3765 get(key) { |
| 3766 if (_isStringKey(key)) { |
| 3767 let strings = this[_strings]; |
| 3768 if (strings === null) |
| 3769 return null; |
| 3770 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); |
| 3771 return dart.as(cell === null ? null : cell[_value], V); |
| 3772 } else if (_isNumericKey(key)) { |
| 3773 let nums = this[_nums]; |
| 3774 if (nums === null) |
| 3775 return null; |
| 3776 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); |
| 3777 return dart.as(cell === null ? null : cell[_value], V); |
| 3778 } else { |
| 3779 return this[_get](key); |
| 3780 } |
| 3781 } |
| 3782 [_get](key) { |
| 3783 let rest = this[_rest]; |
| 3784 if (rest === null) |
| 3785 return null; |
| 3786 let bucket = this[_getBucket](rest, key); |
| 3787 let index = this[_findBucketIndex](bucket, key); |
| 3788 if (dart.notNull(index) < 0) |
| 3789 return null; |
| 3790 let cell = dart.as(bucket[index], LinkedHashMapCell); |
| 3791 return dart.as(cell[_value], V); |
| 3792 } |
| 3793 set(key, value) { |
| 3794 if (_isStringKey(key)) { |
| 3795 let strings = this[_strings]; |
| 3796 if (strings === null) |
| 3797 this[_strings] = strings = _newHashTable(); |
| 3798 this[_addHashTableEntry](strings, key, value); |
| 3799 } else if (_isNumericKey(key)) { |
| 3800 let nums = this[_nums]; |
| 3801 if (nums === null) |
| 3802 this[_nums] = nums = _newHashTable(); |
| 3803 this[_addHashTableEntry](nums, key, value); |
| 3804 } else { |
| 3805 this[_set](key, value); |
| 3806 } |
| 3807 } |
| 3808 [_set](key, value) { |
| 3809 let rest = this[_rest]; |
| 3810 if (rest === null) |
| 3811 this[_rest] = rest = _newHashTable(); |
| 3812 let hash = this[_computeHashCode](key); |
| 3813 let bucket = rest[hash]; |
| 3814 if (bucket === null) { |
| 3815 let cell = this[_newLinkedCell](key, value); |
| 3816 _setTableEntry(rest, hash, [cell]); |
| 3817 } else { |
| 3818 let index = this[_findBucketIndex](bucket, key); |
| 3819 if (dart.notNull(index) >= 0) { |
| 3820 let cell = dart.as(bucket[index], LinkedHashMapCell); |
| 3821 cell[_value] = value; |
| 3822 } else { |
| 3823 let cell = this[_newLinkedCell](key, value); |
| 3824 bucket.push(cell); |
| 3825 } |
| 3826 } |
| 3827 } |
| 3828 putIfAbsent(key, ifAbsent) { |
| 3829 if (this.containsKey(key)) |
| 3830 return this.get(key); |
| 3831 let value = ifAbsent(); |
| 3832 this.set(key, value); |
| 3833 return value; |
| 3834 } |
| 3835 remove(key) { |
| 3836 if (_isStringKey(key)) { |
| 3837 return this[_removeHashTableEntry](this[_strings], key); |
| 3838 } else if (_isNumericKey(key)) { |
| 3839 return this[_removeHashTableEntry](this[_nums], key); |
| 3840 } else { |
| 3841 return this[_remove](key); |
| 3842 } |
| 3843 } |
| 3844 [_remove](key) { |
| 3845 let rest = this[_rest]; |
| 3846 if (rest === null) |
| 3847 return null; |
| 3848 let bucket = this[_getBucket](rest, key); |
| 3849 let index = this[_findBucketIndex](bucket, key); |
| 3850 if (dart.notNull(index) < 0) |
| 3851 return null; |
| 3852 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); |
| 3853 this[_unlinkCell](cell); |
| 3854 return dart.as(cell[_value], V); |
| 3855 } |
| 3856 clear() { |
| 3857 if (dart.notNull(this[_length]) > 0) { |
| 3858 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
| 3859 this[_length] = 0; |
| 3860 this[_modified](); |
| 3861 } |
| 3862 } |
| 3863 forEach(action) { |
| 3864 let cell = this[_first]; |
| 3865 let modifications = this[_modifications]; |
| 3866 while (cell !== null) { |
| 3867 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); |
| 3868 if (modifications !== this[_modifications]) { |
| 3869 throw new core.ConcurrentModificationError(this); |
| 3870 } |
| 3871 cell = cell[_next]; |
| 3872 } |
| 3873 } |
| 3874 [_addHashTableEntry](table, key, value) { |
| 3875 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); |
| 3876 if (cell === null) { |
| 3877 _setTableEntry(table, key, this[_newLinkedCell](key, value)); |
| 3878 } else { |
| 3879 cell[_value] = value; |
| 3880 } |
| 3881 } |
| 3882 [_removeHashTableEntry](table, key) { |
| 3883 if (table === null) |
| 3884 return null; |
| 3885 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); |
| 3886 if (cell === null) |
| 3887 return null; |
| 3888 this[_unlinkCell](cell); |
| 3889 _deleteTableEntry(table, key); |
| 3890 return dart.as(cell[_value], V); |
| 3891 } |
| 3892 [_modified]() { |
| 3893 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; |
| 3894 } |
| 3895 [_newLinkedCell](key, value) { |
| 3896 let cell = new LinkedHashMapCell(key, value); |
| 3897 if (this[_first] === null) { |
| 3898 this[_first] = this[_last] = cell; |
| 3899 } else { |
| 3900 let last = this[_last]; |
| 3901 cell[_previous] = last; |
| 3902 this[_last] = last[_next] = cell; |
| 3903 } |
| 3904 this[_length] = dart.notNull(this[_length]) + 1; |
| 3905 this[_modified](); |
| 3906 return cell; |
| 3907 } |
| 3908 [_unlinkCell](cell) { |
| 3909 let previous = cell[_previous]; |
| 3910 let next = cell[_next]; |
| 3911 if (previous === null) { |
| 3912 dart.assert(dart.equals(cell, this[_first])); |
| 3913 this[_first] = next; |
| 3914 } else { |
| 3915 previous[_next] = next; |
| 3916 } |
| 3917 if (next === null) { |
| 3918 dart.assert(dart.equals(cell, this[_last])); |
| 3919 this[_last] = previous; |
| 3920 } else { |
| 3921 next[_previous] = previous; |
| 3922 } |
| 3923 this[_length] = dart.notNull(this[_length]) - 1; |
| 3924 this[_modified](); |
| 3925 } |
| 3926 static [_isStringKey](key) { |
| 3927 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); |
| 3928 } |
| 3929 static [_isNumericKey](key) { |
| 3930 return dart.notNull(dart.is(key, core.num)) && (key & 0x3ffffff) === key
; |
| 3931 } |
| 3932 [_computeHashCode](key) { |
| 3933 return dart.dload(key, 'hashCode') & 0x3ffffff; |
| 3934 } |
| 3935 static [_getTableEntry](table, key) { |
| 3936 return table[key]; |
| 3937 } |
| 3938 static [_setTableEntry](table, key, value) { |
| 3939 dart.assert(value !== null); |
| 3940 table[key] = value; |
| 3941 } |
| 3942 static [_deleteTableEntry](table, key) { |
| 3943 delete table[key]; |
| 3944 } |
| 3945 [_getBucket](table, key) { |
| 3946 let hash = this[_computeHashCode](key); |
| 3947 return dart.as(table[hash], core.List); |
| 3948 } |
| 3949 [_findBucketIndex](bucket, key) { |
| 3950 if (bucket === null) |
| 3951 return -1; |
| 3952 let length = bucket.length; |
| 3953 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 3954 let cell = dart.as(bucket[i], LinkedHashMapCell); |
| 3955 if (dart.equals(cell[_key], key)) |
| 3956 return i; |
| 3957 } |
| 3958 return -1; |
| 3959 } |
| 3960 static [_newHashTable]() { |
| 3961 let table = Object.create(null); |
| 3962 let temporaryKey = '<non-identifier-key>'; |
| 3963 _setTableEntry(table, temporaryKey, table); |
| 3964 _deleteTableEntry(table, temporaryKey); |
| 3965 return table; |
| 3966 } |
| 3967 toString() { |
| 3968 return Maps.mapToString(this); |
| 3969 } |
| 3970 } |
| 3971 return _LinkedHashMap; |
| 3972 }); |
| 3973 let _LinkedHashMap = _LinkedHashMap$(dart.dynamic, dart.dynamic); |
| 3974 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { |
| 3975 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { |
| 3976 [_computeHashCode](key) { |
| 3977 return core.identityHashCode(key) & 0x3ffffff; |
| 3978 } |
| 3979 [_findBucketIndex](bucket, key) { |
| 3980 if (bucket === null) |
| 3981 return -1; |
| 3982 let length = bucket.length; |
| 3983 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 3984 let cell = dart.as(bucket[i], LinkedHashMapCell); |
| 3985 if (core.identical(cell[_key], key)) |
| 3986 return i; |
| 3987 } |
| 3988 return -1; |
| 3989 } |
| 3990 } |
| 3991 return _LinkedIdentityHashMap; |
| 3992 }); |
| 3993 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dart.dynamic, dart.dynami
c); |
| 3994 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { |
| 3995 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { |
| 3996 _LinkedCustomHashMap($_equals, $_hashCode, validKey) { |
| 3997 this[_equals] = $_equals; |
| 3998 this[_hashCode] = $_hashCode; |
| 3999 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); |
| 4000 super._LinkedHashMap(); |
| 4001 } |
| 4002 get(key) { |
| 4003 if (!dart.notNull(this[_validKey](key))) |
| 4004 return null; |
| 4005 return super._get(key); |
| 4006 } |
| 4007 set(key, value) { |
| 4008 super._set(key, value); |
| 4009 } |
| 4010 containsKey(key) { |
| 4011 if (!dart.notNull(this[_validKey](key))) |
| 4012 return false; |
| 4013 return super._containsKey(key); |
| 4014 } |
| 4015 remove(key) { |
| 4016 if (!dart.notNull(this[_validKey](key))) |
| 4017 return null; |
| 4018 return super._remove(key); |
| 4019 } |
| 4020 [_computeHashCode](key) { |
| 4021 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; |
| 4022 } |
| 4023 [_findBucketIndex](bucket, key) { |
| 4024 if (bucket === null) |
| 4025 return -1; |
| 4026 let length = bucket.length; |
| 4027 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 4028 let cell = dart.as(bucket[i], LinkedHashMapCell); |
| 4029 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K))) |
| 4030 return i; |
| 4031 } |
| 4032 return -1; |
| 4033 } |
| 4034 } |
| 4035 return _LinkedCustomHashMap; |
| 4036 }); |
| 4037 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dart.dynamic, dart.dynamic); |
| 4038 class LinkedHashMapCell extends core.Object { |
| 4039 LinkedHashMapCell($_key, $_value) { |
| 4040 this[_key] = $_key; |
| 4041 this[_value] = $_value; |
| 4042 this[_next] = null; |
| 4043 this[_previous] = null; |
| 4044 } |
| 4045 } |
| 4046 let LinkedHashMapKeyIterable$ = dart.generic(function(E) { |
| 4047 class LinkedHashMapKeyIterable extends IterableBase$(E) { |
| 4048 LinkedHashMapKeyIterable($_map) { |
| 4049 this[_map] = $_map; |
| 4050 super.IterableBase(); |
| 4051 } |
| 4052 get length() { |
| 4053 return dart.as(dart.dload(this[_map], '_length'), core.int); |
| 4054 } |
| 4055 get isEmpty() { |
| 4056 return dart.equals(dart.dload(this[_map], '_length'), 0); |
| 4057 } |
| 4058 get iterator() { |
| 4059 return new LinkedHashMapKeyIterator(this[_map], dart.as(dart.dload(this[
_map], '_modifications'), core.int)); |
| 4060 } |
| 4061 contains(element) { |
| 4062 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); |
| 4063 } |
| 4064 forEach(f) { |
| 4065 let cell = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell); |
| 4066 let modifications = dart.as(dart.dload(this[_map], '_modifications'), co
re.int); |
| 4067 while (cell !== null) { |
| 4068 f(dart.as(cell[_key], E)); |
| 4069 if (modifications !== dart.dload(this[_map], '_modifications')) { |
| 4070 throw new core.ConcurrentModificationError(this[_map]); |
| 4071 } |
| 4072 cell = cell[_next]; |
| 4073 } |
| 4074 } |
| 4075 } |
| 4076 return LinkedHashMapKeyIterable; |
| 4077 }); |
| 4078 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dart.dynamic); |
| 4079 let _cell = Symbol('_cell'); |
| 4080 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { |
| 4081 class LinkedHashMapKeyIterator extends core.Object { |
| 4082 LinkedHashMapKeyIterator($_map, $_modifications) { |
| 4083 this[_map] = $_map; |
| 4084 this[_modifications] = $_modifications; |
| 4085 this[_cell] = null; |
| 4086 this[_current] = null; |
| 4087 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel
l); |
| 4088 } |
| 4089 get current() { |
| 4090 return this[_current]; |
| 4091 } |
| 4092 moveNext() { |
| 4093 if (this[_modifications] !== dart.dload(this[_map], '_modifications')) { |
| 4094 throw new core.ConcurrentModificationError(this[_map]); |
| 4095 } else if (this[_cell] === null) { |
| 4096 this[_current] = null; |
| 4097 return false; |
| 4098 } else { |
| 4099 this[_current] = dart.as(this[_cell][_key], E); |
| 4100 this[_cell] = this[_cell][_next]; |
| 4101 return true; |
| 4102 } |
| 4103 } |
| 4104 } |
| 4105 return LinkedHashMapKeyIterator; |
| 4106 }); |
| 4107 let LinkedHashMapKeyIterator = LinkedHashMapKeyIterator$(dart.dynamic); |
| 4108 let _elements = Symbol('_elements'); |
| 4109 let _computeElements = Symbol('_computeElements'); |
| 4110 let _contains = Symbol('_contains'); |
| 4111 let _lookup = Symbol('_lookup'); |
| 4112 let _isStringElement = Symbol('_isStringElement'); |
| 4113 let _isNumericElement = Symbol('_isNumericElement'); |
| 4114 let _HashSet$ = dart.generic(function(E) { |
| 4115 class _HashSet extends _HashSetBase$(E) { |
| 4116 _HashSet() { |
| 4117 this[_length] = 0; |
| 4118 this[_strings] = null; |
| 4119 this[_nums] = null; |
| 4120 this[_rest] = null; |
| 4121 this[_elements] = null; |
| 4122 super._HashSetBase(); |
| 4123 } |
| 4124 [_newSet]() { |
| 4125 return new _HashSet(); |
| 4126 } |
| 4127 get iterator() { |
| 4128 return new HashSetIterator(this, this[_computeElements]()); |
| 4129 } |
| 4130 get length() { |
| 4131 return this[_length]; |
| 4132 } |
| 4133 get isEmpty() { |
| 4134 return this[_length] === 0; |
| 4135 } |
| 4136 get isNotEmpty() { |
| 4137 return !dart.notNull(this.isEmpty); |
| 4138 } |
| 4139 contains(object) { |
| 4140 if (_isStringElement(object)) { |
| 4141 let strings = this[_strings]; |
| 4142 return strings === null ? false : _hasTableEntry(strings, object); |
| 4143 } else if (_isNumericElement(object)) { |
| 4144 let nums = this[_nums]; |
| 4145 return nums === null ? false : _hasTableEntry(nums, object); |
| 4146 } else { |
| 4147 return this[_contains](object); |
| 4148 } |
| 4149 } |
| 4150 [_contains](object) { |
| 4151 let rest = this[_rest]; |
| 4152 if (rest === null) |
| 4153 return false; |
| 4154 let bucket = this[_getBucket](rest, object); |
| 4155 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0; |
| 4156 } |
| 4157 lookup(object) { |
| 4158 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { |
| 4159 return dart.as(this.contains(object) ? object : null, E); |
| 4160 } |
| 4161 return this[_lookup](object); |
| 4162 } |
| 4163 [_lookup](object) { |
| 4164 let rest = this[_rest]; |
| 4165 if (rest === null) |
| 4166 return null; |
| 4167 let bucket = this[_getBucket](rest, object); |
| 4168 let index = this[_findBucketIndex](bucket, object); |
| 4169 if (dart.notNull(index) < 0) |
| 4170 return null; |
| 4171 return dart.as(bucket.get(index), E); |
| 4172 } |
| 4173 add(element) { |
| 4174 if (_isStringElement(element)) { |
| 4175 let strings = this[_strings]; |
| 4176 if (strings === null) |
| 4177 this[_strings] = strings = _newHashTable(); |
| 4178 return this[_addHashTableEntry](strings, element); |
| 4179 } else if (_isNumericElement(element)) { |
| 4180 let nums = this[_nums]; |
| 4181 if (nums === null) |
| 4182 this[_nums] = nums = _newHashTable(); |
| 4183 return this[_addHashTableEntry](nums, element); |
| 4184 } else { |
| 4185 return this[_add](element); |
| 4186 } |
| 4187 } |
| 4188 [_add](element) { |
| 4189 let rest = this[_rest]; |
| 4190 if (rest === null) |
| 4191 this[_rest] = rest = _newHashTable(); |
| 4192 let hash = this[_computeHashCode](element); |
| 4193 let bucket = rest[hash]; |
| 4194 if (bucket === null) { |
| 4195 _setTableEntry(rest, hash, [element]); |
| 4196 } else { |
| 4197 let index = this[_findBucketIndex](bucket, element); |
| 4198 if (dart.notNull(index) >= 0) |
| 4199 return false; |
| 4200 bucket.push(element); |
| 4201 } |
| 4202 this[_length] = dart.notNull(this[_length]) + 1; |
| 4203 this[_elements] = null; |
| 4204 return true; |
| 4205 } |
| 4206 addAll(objects) { |
| 4207 for (let each of objects) { |
| 4208 this.add(each); |
| 4209 } |
| 4210 } |
| 4211 remove(object) { |
| 4212 if (_isStringElement(object)) { |
| 4213 return this[_removeHashTableEntry](this[_strings], object); |
| 4214 } else if (_isNumericElement(object)) { |
| 4215 return this[_removeHashTableEntry](this[_nums], object); |
| 4216 } else { |
| 4217 return this[_remove](object); |
| 4218 } |
| 4219 } |
| 4220 [_remove](object) { |
| 4221 let rest = this[_rest]; |
| 4222 if (rest === null) |
| 4223 return false; |
| 4224 let bucket = this[_getBucket](rest, object); |
| 4225 let index = this[_findBucketIndex](bucket, object); |
| 4226 if (dart.notNull(index) < 0) |
| 4227 return false; |
| 4228 this[_length] = dart.notNull(this[_length]) - 1; |
| 4229 this[_elements] = null; |
| 4230 bucket.splice(index, 1); |
| 4231 return true; |
| 4232 } |
| 4233 clear() { |
| 4234 if (dart.notNull(this[_length]) > 0) { |
| 4235 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null; |
| 4236 this[_length] = 0; |
| 4237 } |
| 4238 } |
| 4239 [_computeElements]() { |
| 4240 if (this[_elements] !== null) |
| 4241 return this[_elements]; |
| 4242 let result = new core.List(this[_length]); |
| 4243 let index = 0; |
| 4244 let strings = this[_strings]; |
| 4245 if (strings !== null) { |
| 4246 let names = Object.getOwnPropertyNames(strings); |
| 4247 let entries = names.length; |
| 4248 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { |
| 4249 let element = names[i]; |
| 4250 result[index] = element; |
| 4251 index = dart.notNull(index) + 1; |
| 4252 } |
| 4253 } |
| 4254 let nums = this[_nums]; |
| 4255 if (nums !== null) { |
| 4256 let names = Object.getOwnPropertyNames(nums); |
| 4257 let entries = names.length; |
| 4258 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { |
| 4259 let element = +names[i]; |
| 4260 result[index] = element; |
| 4261 index = dart.notNull(index) + 1; |
| 4262 } |
| 4263 } |
| 4264 let rest = this[_rest]; |
| 4265 if (rest !== null) { |
| 4266 let names = Object.getOwnPropertyNames(rest); |
| 4267 let entries = names.length; |
| 4268 for (let i = 0; dart.notNull(i) < dart.notNull(entries); i = dart.notN
ull(i) + 1) { |
| 4269 let entry = names[i]; |
| 4270 let bucket = rest[entry]; |
| 4271 let length = bucket.length; |
| 4272 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.not
Null(i) + 1) { |
| 4273 result[index] = bucket[i]; |
| 4274 index = dart.notNull(index) + 1; |
| 4275 } |
| 4276 } |
| 4277 } |
| 4278 dart.assert(index === this[_length]); |
| 4279 return this[_elements] = result; |
| 4280 } |
| 4281 [_addHashTableEntry](table, element) { |
| 4282 if (_hasTableEntry(table, element)) |
| 4283 return false; |
| 4284 _setTableEntry(table, element, 0); |
| 4285 this[_length] = dart.notNull(this[_length]) + 1; |
| 4286 this[_elements] = null; |
| 4287 return true; |
| 4288 } |
| 4289 [_removeHashTableEntry](table, element) { |
| 4290 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e
lement))) { |
| 4291 _deleteTableEntry(table, element); |
| 4292 this[_length] = dart.notNull(this[_length]) - 1; |
| 4293 this[_elements] = null; |
| 4294 return true; |
| 4295 } else { |
| 4296 return false; |
| 4297 } |
| 4298 } |
| 4299 static [_isStringElement](element) { |
| 4300 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); |
| 4301 } |
| 4302 static [_isNumericElement](element) { |
| 4303 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff)
=== element; |
| 4304 } |
| 4305 [_computeHashCode](element) { |
| 4306 return dart.dload(element, 'hashCode') & 0x3ffffff; |
| 4307 } |
| 4308 static [_hasTableEntry](table, key) { |
| 4309 let entry = table[key]; |
| 4310 return entry !== null; |
| 4311 } |
| 4312 static [_setTableEntry](table, key, value) { |
| 4313 dart.assert(value !== null); |
| 4314 table[key] = value; |
| 4315 } |
| 4316 static [_deleteTableEntry](table, key) { |
| 4317 delete table[key]; |
| 4318 } |
| 4319 [_getBucket](table, element) { |
| 4320 let hash = this[_computeHashCode](element); |
| 4321 return dart.as(table[hash], core.List); |
| 4322 } |
| 4323 [_findBucketIndex](bucket, element) { |
| 4324 if (bucket === null) |
| 4325 return -1; |
| 4326 let length = bucket.length; |
| 4327 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 4328 if (dart.equals(bucket[i], element)) |
| 4329 return i; |
| 4330 } |
| 4331 return -1; |
| 4332 } |
| 4333 static [_newHashTable]() { |
| 4334 let table = Object.create(null); |
| 4335 let temporaryKey = '<non-identifier-key>'; |
| 4336 _setTableEntry(table, temporaryKey, table); |
| 4337 _deleteTableEntry(table, temporaryKey); |
| 4338 return table; |
| 4339 } |
| 4340 } |
| 4341 return _HashSet; |
| 4342 }); |
| 4343 let _HashSet = _HashSet$(dart.dynamic); |
| 4344 let _IdentityHashSet$ = dart.generic(function(E) { |
| 4345 class _IdentityHashSet extends _HashSet$(E) { |
| 4346 [_newSet]() { |
| 4347 return new _IdentityHashSet(); |
| 4348 } |
| 4349 [_computeHashCode](key) { |
| 4350 return core.identityHashCode(key) & 0x3ffffff; |
| 4351 } |
| 4352 [_findBucketIndex](bucket, element) { |
| 4353 if (bucket === null) |
| 4354 return -1; |
| 4355 let length = bucket.length; |
| 4356 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 4357 if (core.identical(bucket[i], element)) |
| 4358 return i; |
| 4359 } |
| 4360 return -1; |
| 4361 } |
| 4362 } |
| 4363 return _IdentityHashSet; |
| 4364 }); |
| 4365 let _IdentityHashSet = _IdentityHashSet$(dart.dynamic); |
| 4366 let _equality = Symbol('_equality'); |
| 4367 let _hasher = Symbol('_hasher'); |
| 4368 let _CustomHashSet$ = dart.generic(function(E) { |
| 4369 class _CustomHashSet extends _HashSet$(E) { |
| 4370 _CustomHashSet($_equality, $_hasher, validKey) { |
| 4371 this[_equality] = $_equality; |
| 4372 this[_hasher] = $_hasher; |
| 4373 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); |
| 4374 super._HashSet(); |
| 4375 } |
| 4376 [_newSet]() { |
| 4377 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey
]); |
| 4378 } |
| 4379 [_findBucketIndex](bucket, element) { |
| 4380 if (bucket === null) |
| 4381 return -1; |
| 4382 let length = bucket.length; |
| 4383 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 4384 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) |
| 4385 return i; |
| 4386 } |
| 4387 return -1; |
| 4388 } |
| 4389 [_computeHashCode](element) { |
| 4390 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
| 4391 } |
| 4392 add(object) { |
| 4393 return super._add(object); |
| 4394 } |
| 4395 contains(object) { |
| 4396 if (!dart.notNull(this[_validKey](object))) |
| 4397 return false; |
| 4398 return super._contains(object); |
| 4399 } |
| 4400 lookup(object) { |
| 4401 if (!dart.notNull(this[_validKey](object))) |
| 4402 return null; |
| 4403 return super._lookup(object); |
| 4404 } |
| 4405 remove(object) { |
| 4406 if (!dart.notNull(this[_validKey](object))) |
| 4407 return false; |
| 4408 return super._remove(object); |
| 4409 } |
| 4410 } |
| 4411 return _CustomHashSet; |
| 4412 }); |
| 4413 let _CustomHashSet = _CustomHashSet$(dart.dynamic); |
| 4414 let HashSetIterator$ = dart.generic(function(E) { |
| 4415 class HashSetIterator extends core.Object { |
| 4416 HashSetIterator($_set, $_elements) { |
| 4417 this[_set] = $_set; |
| 4418 this[_elements] = $_elements; |
| 4419 this[_offset] = 0; |
| 4420 this[_current] = null; |
| 4421 } |
| 4422 get current() { |
| 4423 return this[_current]; |
| 4424 } |
| 4425 moveNext() { |
| 4426 let elements = this[_elements]; |
| 4427 let offset = this[_offset]; |
| 4428 if (elements !== dart.dload(this[_set], '_elements')) { |
| 4429 throw new core.ConcurrentModificationError(this[_set]); |
| 4430 } else if (dart.notNull(offset) >= elements.length) { |
| 4431 this[_current] = null; |
| 4432 return false; |
| 4433 } else { |
| 4434 this[_current] = dart.as(elements[offset], E); |
| 4435 this[_offset] = dart.notNull(offset) + 1; |
| 4436 return true; |
| 4437 } |
| 4438 } |
| 4439 } |
| 4440 return HashSetIterator; |
| 4441 }); |
| 4442 let HashSetIterator = HashSetIterator$(dart.dynamic); |
| 4443 let _unsupported = Symbol('_unsupported'); |
| 4444 let _LinkedHashSet$ = dart.generic(function(E) { |
| 4445 class _LinkedHashSet extends _HashSetBase$(E) { |
| 4446 _LinkedHashSet() { |
| 4447 this[_length] = 0; |
| 4448 this[_strings] = null; |
| 4449 this[_nums] = null; |
| 4450 this[_rest] = null; |
| 4451 this[_first] = null; |
| 4452 this[_last] = null; |
| 4453 this[_modifications] = 0; |
| 4454 super._HashSetBase(); |
| 4455 } |
| 4456 [_newSet]() { |
| 4457 return new _LinkedHashSet(); |
| 4458 } |
| 4459 [_unsupported](operation) { |
| 4460 throw `LinkedHashSet: unsupported ${operation}`; |
| 4461 } |
| 4462 get iterator() { |
| 4463 return dart.as(new LinkedHashSetIterator(this, this[_modifications]), co
re.Iterator$(E)); |
| 4464 } |
| 4465 get length() { |
| 4466 return this[_length]; |
| 4467 } |
| 4468 get isEmpty() { |
| 4469 return this[_length] === 0; |
| 4470 } |
| 4471 get isNotEmpty() { |
| 4472 return !dart.notNull(this.isEmpty); |
| 4473 } |
| 4474 contains(object) { |
| 4475 if (_isStringElement(object)) { |
| 4476 let strings = this[_strings]; |
| 4477 if (strings === null) |
| 4478 return false; |
| 4479 let cell = dart.as(_getTableEntry(strings, object), LinkedHashSetCell)
; |
| 4480 return cell !== null; |
| 4481 } else if (_isNumericElement(object)) { |
| 4482 let nums = this[_nums]; |
| 4483 if (nums === null) |
| 4484 return false; |
| 4485 let cell = dart.as(_getTableEntry(nums, object), LinkedHashSetCell); |
| 4486 return cell !== null; |
| 4487 } else { |
| 4488 return this[_contains](object); |
| 4489 } |
| 4490 } |
| 4491 [_contains](object) { |
| 4492 let rest = this[_rest]; |
| 4493 if (rest === null) |
| 4494 return false; |
| 4495 let bucket = this[_getBucket](rest, object); |
| 4496 return dart.notNull(this[_findBucketIndex](bucket, object)) >= 0; |
| 4497 } |
| 4498 lookup(object) { |
| 4499 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { |
| 4500 return dart.as(this.contains(object) ? object : null, E); |
| 4501 } else { |
| 4502 return this[_lookup](object); |
| 4503 } |
| 4504 } |
| 4505 [_lookup](object) { |
| 4506 let rest = this[_rest]; |
| 4507 if (rest === null) |
| 4508 return null; |
| 4509 let bucket = this[_getBucket](rest, object); |
| 4510 let index = this[_findBucketIndex](bucket, object); |
| 4511 if (dart.notNull(index) < 0) |
| 4512 return null; |
| 4513 return dart.as(dart.dload(bucket.get(index), '_element'), E); |
| 4514 } |
| 4515 forEach(action) { |
| 4516 let cell = this[_first]; |
| 4517 let modifications = this[_modifications]; |
| 4518 while (cell !== null) { |
| 4519 action(dart.as(cell[_element], E)); |
| 4520 if (modifications !== this[_modifications]) { |
| 4521 throw new core.ConcurrentModificationError(this); |
| 4522 } |
| 4523 cell = cell[_next]; |
| 4524 } |
| 4525 } |
| 4526 get first() { |
| 4527 if (this[_first] === null) |
| 4528 throw new core.StateError("No elements"); |
| 4529 return dart.as(this[_first][_element], E); |
| 4530 } |
| 4531 get last() { |
| 4532 if (this[_last] === null) |
| 4533 throw new core.StateError("No elements"); |
| 4534 return dart.as(this[_last][_element], E); |
| 4535 } |
| 4536 add(element) { |
| 4537 if (_isStringElement(element)) { |
| 4538 let strings = this[_strings]; |
| 4539 if (strings === null) |
| 4540 this[_strings] = strings = _newHashTable(); |
| 4541 return this[_addHashTableEntry](strings, element); |
| 4542 } else if (_isNumericElement(element)) { |
| 4543 let nums = this[_nums]; |
| 4544 if (nums === null) |
| 4545 this[_nums] = nums = _newHashTable(); |
| 4546 return this[_addHashTableEntry](nums, element); |
| 4547 } else { |
| 4548 return this[_add](element); |
| 4549 } |
| 4550 } |
| 4551 [_add](element) { |
| 4552 let rest = this[_rest]; |
| 4553 if (rest === null) |
| 4554 this[_rest] = rest = _newHashTable(); |
| 4555 let hash = this[_computeHashCode](element); |
| 4556 let bucket = rest[hash]; |
| 4557 if (bucket === null) { |
| 4558 let cell = this[_newLinkedCell](element); |
| 4559 _setTableEntry(rest, hash, [cell]); |
| 4560 } else { |
| 4561 let index = this[_findBucketIndex](bucket, element); |
| 4562 if (dart.notNull(index) >= 0) |
| 4563 return false; |
| 4564 let cell = this[_newLinkedCell](element); |
| 4565 bucket.push(cell); |
| 4566 } |
| 4567 return true; |
| 4568 } |
| 4569 remove(object) { |
| 4570 if (_isStringElement(object)) { |
| 4571 return this[_removeHashTableEntry](this[_strings], object); |
| 4572 } else if (_isNumericElement(object)) { |
| 4573 return this[_removeHashTableEntry](this[_nums], object); |
| 4574 } else { |
| 4575 return this[_remove](object); |
| 4576 } |
| 4577 } |
| 4578 [_remove](object) { |
| 4579 let rest = this[_rest]; |
| 4580 if (rest === null) |
| 4581 return false; |
| 4582 let bucket = this[_getBucket](rest, object); |
| 4583 let index = this[_findBucketIndex](bucket, object); |
| 4584 if (dart.notNull(index) < 0) |
| 4585 return false; |
| 4586 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); |
| 4587 this[_unlinkCell](cell); |
| 4588 return true; |
| 4589 } |
| 4590 removeWhere(test) { |
| 4591 this[_filterWhere](test, true); |
| 4592 } |
| 4593 retainWhere(test) { |
| 4594 this[_filterWhere](test, false); |
| 4595 } |
| 4596 [_filterWhere](test, removeMatching) { |
| 4597 let cell = this[_first]; |
| 4598 while (cell !== null) { |
| 4599 let element = dart.as(cell[_element], E); |
| 4600 let next = cell[_next]; |
| 4601 let modifications = this[_modifications]; |
| 4602 let shouldRemove = removeMatching === test(element); |
| 4603 if (modifications !== this[_modifications]) { |
| 4604 throw new core.ConcurrentModificationError(this); |
| 4605 } |
| 4606 if (shouldRemove) |
| 4607 this.remove(element); |
| 4608 cell = next; |
| 4609 } |
| 4610 } |
| 4611 clear() { |
| 4612 if (dart.notNull(this[_length]) > 0) { |
| 4613 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
| 4614 this[_length] = 0; |
| 4615 this[_modified](); |
| 4616 } |
| 4617 } |
| 4618 [_addHashTableEntry](table, element) { |
| 4619 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); |
| 4620 if (cell !== null) |
| 4621 return false; |
| 4622 _setTableEntry(table, element, this[_newLinkedCell](element)); |
| 4623 return true; |
| 4624 } |
| 4625 [_removeHashTableEntry](table, element) { |
| 4626 if (table === null) |
| 4627 return false; |
| 4628 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); |
| 4629 if (cell === null) |
| 4630 return false; |
| 4631 this[_unlinkCell](cell); |
| 4632 _deleteTableEntry(table, element); |
| 4633 return true; |
| 4634 } |
| 4635 [_modified]() { |
| 4636 this[_modifications] = dart.notNull(this[_modifications]) + 1 & 67108863
; |
| 4637 } |
| 4638 [_newLinkedCell](element) { |
| 4639 let cell = new LinkedHashSetCell(element); |
| 4640 if (this[_first] === null) { |
| 4641 this[_first] = this[_last] = cell; |
| 4642 } else { |
| 4643 let last = this[_last]; |
| 4644 cell[_previous] = last; |
| 4645 this[_last] = last[_next] = cell; |
| 4646 } |
| 4647 this[_length] = dart.notNull(this[_length]) + 1; |
| 4648 this[_modified](); |
| 4649 return cell; |
| 4650 } |
| 4651 [_unlinkCell](cell) { |
| 4652 let previous = cell[_previous]; |
| 4653 let next = cell[_next]; |
| 4654 if (previous === null) { |
| 4655 dart.assert(dart.equals(cell, this[_first])); |
| 4656 this[_first] = next; |
| 4657 } else { |
| 4658 previous[_next] = next; |
| 4659 } |
| 4660 if (next === null) { |
| 4661 dart.assert(dart.equals(cell, this[_last])); |
| 4662 this[_last] = previous; |
| 4663 } else { |
| 4664 next[_previous] = previous; |
| 4665 } |
| 4666 this[_length] = dart.notNull(this[_length]) - 1; |
| 4667 this[_modified](); |
| 4668 } |
| 4669 static [_isStringElement](element) { |
| 4670 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); |
| 4671 } |
| 4672 static [_isNumericElement](element) { |
| 4673 return dart.notNull(dart.is(element, core.num)) && (element & 0x3ffffff)
=== element; |
| 4674 } |
| 4675 [_computeHashCode](element) { |
| 4676 return dart.dload(element, 'hashCode') & 0x3ffffff; |
| 4677 } |
| 4678 static [_getTableEntry](table, key) { |
| 4679 return table[key]; |
| 4680 } |
| 4681 static [_setTableEntry](table, key, value) { |
| 4682 dart.assert(value !== null); |
| 4683 table[key] = value; |
| 4684 } |
| 4685 static [_deleteTableEntry](table, key) { |
| 4686 delete table[key]; |
| 4687 } |
| 4688 [_getBucket](table, element) { |
| 4689 let hash = this[_computeHashCode](element); |
| 4690 return dart.as(table[hash], core.List); |
| 4691 } |
| 4692 [_findBucketIndex](bucket, element) { |
| 4693 if (bucket === null) |
| 4694 return -1; |
| 4695 let length = bucket.length; |
| 4696 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 4697 let cell = dart.as(bucket[i], LinkedHashSetCell); |
| 4698 if (dart.equals(cell[_element], element)) |
| 4699 return i; |
| 4700 } |
| 4701 return -1; |
| 4702 } |
| 4703 static [_newHashTable]() { |
| 4704 let table = Object.create(null); |
| 4705 let temporaryKey = '<non-identifier-key>'; |
| 4706 _setTableEntry(table, temporaryKey, table); |
| 4707 _deleteTableEntry(table, temporaryKey); |
| 4708 return table; |
| 4709 } |
| 4710 } |
| 4711 return _LinkedHashSet; |
| 4712 }); |
| 4713 let _LinkedHashSet = _LinkedHashSet$(dart.dynamic); |
| 4714 let _LinkedIdentityHashSet$ = dart.generic(function(E) { |
| 4715 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { |
| 4716 [_newSet]() { |
| 4717 return new _LinkedIdentityHashSet(); |
| 4718 } |
| 4719 [_computeHashCode](key) { |
| 4720 return core.identityHashCode(key) & 0x3ffffff; |
| 4721 } |
| 4722 [_findBucketIndex](bucket, element) { |
| 4723 if (bucket === null) |
| 4724 return -1; |
| 4725 let length = bucket.length; |
| 4726 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 4727 let cell = dart.as(bucket[i], LinkedHashSetCell); |
| 4728 if (core.identical(cell[_element], element)) |
| 4729 return i; |
| 4730 } |
| 4731 return -1; |
| 4732 } |
| 4733 } |
| 4734 return _LinkedIdentityHashSet; |
| 4735 }); |
| 4736 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dart.dynamic); |
| 4737 let _LinkedCustomHashSet$ = dart.generic(function(E) { |
| 4738 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { |
| 4739 _LinkedCustomHashSet($_equality, $_hasher, validKey) { |
| 4740 this[_equality] = $_equality; |
| 4741 this[_hasher] = $_hasher; |
| 4742 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); |
| 4743 super._LinkedHashSet(); |
| 4744 } |
| 4745 [_newSet]() { |
| 4746 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va
lidKey]); |
| 4747 } |
| 4748 [_findBucketIndex](bucket, element) { |
| 4749 if (bucket === null) |
| 4750 return -1; |
| 4751 let length = bucket.length; |
| 4752 for (let i = 0; dart.notNull(i) < dart.notNull(length); i = dart.notNull
(i) + 1) { |
| 4753 let cell = dart.as(bucket[i], LinkedHashSetCell); |
| 4754 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) |
| 4755 return i; |
| 4756 } |
| 4757 return -1; |
| 4758 } |
| 4759 [_computeHashCode](element) { |
| 4760 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
| 4761 } |
| 4762 add(element) { |
| 4763 return super._add(element); |
| 4764 } |
| 4765 contains(object) { |
| 4766 if (!dart.notNull(this[_validKey](object))) |
| 4767 return false; |
| 4768 return super._contains(object); |
| 4769 } |
| 4770 lookup(object) { |
| 4771 if (!dart.notNull(this[_validKey](object))) |
| 4772 return null; |
| 4773 return super._lookup(object); |
| 4774 } |
| 4775 remove(object) { |
| 4776 if (!dart.notNull(this[_validKey](object))) |
| 4777 return false; |
| 4778 return super._remove(object); |
| 4779 } |
| 4780 containsAll(elements) { |
| 4781 for (let element of elements) { |
| 4782 if (!dart.notNull(this[_validKey](element)) || !dart.notNull(this.cont
ains(element))) |
| 4783 return false; |
| 4784 } |
| 4785 return true; |
| 4786 } |
| 4787 removeAll(elements) { |
| 4788 for (let element of elements) { |
| 4789 if (this[_validKey](element)) { |
| 4790 super._remove(element); |
| 4791 } |
| 4792 } |
| 4793 } |
| 4794 } |
| 4795 return _LinkedCustomHashSet; |
| 4796 }); |
| 4797 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dart.dynamic); |
| 4798 class LinkedHashSetCell extends core.Object { |
| 4799 LinkedHashSetCell($_element) { |
| 4800 this[_element] = $_element; |
| 4801 this[_next] = null; |
| 4802 this[_previous] = null; |
| 4803 } |
| 4804 } |
| 4805 let LinkedHashSetIterator$ = dart.generic(function(E) { |
| 4806 class LinkedHashSetIterator extends core.Object { |
| 4807 LinkedHashSetIterator($_set, $_modifications) { |
| 4808 this[_set] = $_set; |
| 4809 this[_modifications] = $_modifications; |
| 4810 this[_cell] = null; |
| 4811 this[_current] = null; |
| 4812 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel
l); |
| 4813 } |
| 4814 get current() { |
| 4815 return this[_current]; |
| 4816 } |
| 4817 moveNext() { |
| 4818 if (this[_modifications] !== dart.dload(this[_set], '_modifications')) { |
| 4819 throw new core.ConcurrentModificationError(this[_set]); |
| 4820 } else if (this[_cell] === null) { |
| 4821 this[_current] = null; |
| 4822 return false; |
| 4823 } else { |
| 4824 this[_current] = dart.as(this[_cell][_element], E); |
| 4825 this[_cell] = this[_cell][_next]; |
| 4826 return true; |
| 4827 } |
| 4828 } |
| 4829 } |
| 4830 return LinkedHashSetIterator; |
| 4831 }); |
| 4832 let LinkedHashSetIterator = LinkedHashSetIterator$(dart.dynamic); |
| 4833 // Exports: | 4833 // Exports: |
| 4834 exports.HashMapKeyIterable = HashMapKeyIterable; | |
| 4835 exports.HashMapKeyIterable$ = HashMapKeyIterable$; | |
| 4836 exports.HashMapKeyIterator = HashMapKeyIterator; | |
| 4837 exports.HashMapKeyIterator$ = HashMapKeyIterator$; | |
| 4838 exports.LinkedHashMapCell = LinkedHashMapCell; | |
| 4839 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; | |
| 4840 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; | |
| 4841 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; | |
| 4842 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; | |
| 4843 exports.HashSetIterator = HashSetIterator; | |
| 4844 exports.HashSetIterator$ = HashSetIterator$; | |
| 4845 exports.LinkedHashSetCell = LinkedHashSetCell; | |
| 4846 exports.LinkedHashSetIterator = LinkedHashSetIterator; | |
| 4847 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; | |
| 4848 exports.UnmodifiableListView = UnmodifiableListView; | 4834 exports.UnmodifiableListView = UnmodifiableListView; |
| 4849 exports.UnmodifiableListView$ = UnmodifiableListView$; | 4835 exports.UnmodifiableListView$ = UnmodifiableListView$; |
| 4850 exports.HashMap = HashMap; | 4836 exports.HashMap = HashMap; |
| 4851 exports.HashMap$ = HashMap$; | 4837 exports.HashMap$ = HashMap$; |
| 4852 exports.HashSet = HashSet; | 4838 exports.HashSet = HashSet; |
| 4853 exports.HashSet$ = HashSet$; | 4839 exports.HashSet$ = HashSet$; |
| 4854 exports.IterableMixin = IterableMixin; | 4840 exports.IterableMixin = IterableMixin; |
| 4855 exports.IterableMixin$ = IterableMixin$; | 4841 exports.IterableMixin$ = IterableMixin$; |
| 4856 exports.IterableBase = IterableBase; | 4842 exports.IterableBase = IterableBase; |
| 4857 exports.IterableBase$ = IterableBase$; | 4843 exports.IterableBase$ = IterableBase$; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4889 exports.ListQueue = ListQueue; | 4875 exports.ListQueue = ListQueue; |
| 4890 exports.ListQueue$ = ListQueue$; | 4876 exports.ListQueue$ = ListQueue$; |
| 4891 exports.SetMixin = SetMixin; | 4877 exports.SetMixin = SetMixin; |
| 4892 exports.SetMixin$ = SetMixin$; | 4878 exports.SetMixin$ = SetMixin$; |
| 4893 exports.SetBase = SetBase; | 4879 exports.SetBase = SetBase; |
| 4894 exports.SetBase$ = SetBase$; | 4880 exports.SetBase$ = SetBase$; |
| 4895 exports.SplayTreeMap = SplayTreeMap; | 4881 exports.SplayTreeMap = SplayTreeMap; |
| 4896 exports.SplayTreeMap$ = SplayTreeMap$; | 4882 exports.SplayTreeMap$ = SplayTreeMap$; |
| 4897 exports.SplayTreeSet = SplayTreeSet; | 4883 exports.SplayTreeSet = SplayTreeSet; |
| 4898 exports.SplayTreeSet$ = SplayTreeSet$; | 4884 exports.SplayTreeSet$ = SplayTreeSet$; |
| 4885 exports.HashMapKeyIterable = HashMapKeyIterable; |
| 4886 exports.HashMapKeyIterable$ = HashMapKeyIterable$; |
| 4887 exports.HashMapKeyIterator = HashMapKeyIterator; |
| 4888 exports.HashMapKeyIterator$ = HashMapKeyIterator$; |
| 4889 exports.LinkedHashMapCell = LinkedHashMapCell; |
| 4890 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; |
| 4891 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; |
| 4892 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; |
| 4893 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; |
| 4894 exports.HashSetIterator = HashSetIterator; |
| 4895 exports.HashSetIterator$ = HashSetIterator$; |
| 4896 exports.LinkedHashSetCell = LinkedHashSetCell; |
| 4897 exports.LinkedHashSetIterator = LinkedHashSetIterator; |
| 4898 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; |
| 4899 })(collection || (collection = {})); | 4899 })(collection || (collection = {})); |
| OLD | NEW |