| Index: test/codegen/expect/collection/collection.js
|
| diff --git a/test/codegen/expect/collection/collection.js b/test/codegen/expect/collection/collection.js
|
| index 0a1ec4153fdd10071edbbacfa6451e86d1ff05f8..8645fe3aef5c321cc76f5bbdc8d0dc8f851932ba 100644
|
| --- a/test/codegen/expect/collection/collection.js
|
| +++ b/test/codegen/expect/collection/collection.js
|
| @@ -1,20 +1,42 @@
|
| var collection;
|
| (function(exports) {
|
| 'use strict';
|
| + let _length = Symbol('_length');
|
| + let _strings = Symbol('_strings');
|
| + let _nums = Symbol('_nums');
|
| + let _rest = Symbol('_rest');
|
| + let _keys = Symbol('_keys');
|
| + let _containsKey = Symbol('_containsKey');
|
| + let _getBucket = Symbol('_getBucket');
|
| + let _findBucketIndex = Symbol('_findBucketIndex');
|
| + let _computeKeys = Symbol('_computeKeys');
|
| + let _get = Symbol('_get');
|
| + let _addHashTableEntry = Symbol('_addHashTableEntry');
|
| + let _set = Symbol('_set');
|
| + let _computeHashCode = Symbol('_computeHashCode');
|
| + let _removeHashTableEntry = Symbol('_removeHashTableEntry');
|
| + let _remove = Symbol('_remove');
|
| + let _isStringKey = Symbol('_isStringKey');
|
| + let _isNumericKey = Symbol('_isNumericKey');
|
| + let _hasTableEntry = Symbol('_hasTableEntry');
|
| + let _getTableEntry = Symbol('_getTableEntry');
|
| + let _setTableEntry = Symbol('_setTableEntry');
|
| + let _deleteTableEntry = Symbol('_deleteTableEntry');
|
| + let _newHashTable = Symbol('_newHashTable');
|
| let _HashMap$ = dart.generic(function(K, V) {
|
| class _HashMap extends dart.Object {
|
| _HashMap() {
|
| - this._length = 0;
|
| - this._strings = null;
|
| - this._nums = null;
|
| - this._rest = null;
|
| - this._keys = null;
|
| + this[_length] = 0;
|
| + this[_strings] = null;
|
| + this[_nums] = null;
|
| + this[_rest] = null;
|
| + this[_keys] = null;
|
| }
|
| get length() {
|
| - return this._length;
|
| + return this[_length];
|
| }
|
| get isEmpty() {
|
| - return this._length === 0;
|
| + return this[_length] === 0;
|
| }
|
| get isNotEmpty() {
|
| return !dart.notNull(this.isEmpty);
|
| @@ -27,24 +49,24 @@ var collection;
|
| }
|
| containsKey(key) {
|
| if (_isStringKey(key)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| return strings === null ? false : _hasTableEntry(strings, key);
|
| } else if (_isNumericKey(key)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| return nums === null ? false : _hasTableEntry(nums, key);
|
| } else {
|
| - return this._containsKey(key);
|
| + return this[_containsKey](key);
|
| }
|
| }
|
| - _containsKey(key) {
|
| - let rest = this._rest;
|
| + [_containsKey](key) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return false;
|
| - let bucket = this._getBucket(rest, key);
|
| - return this._findBucketIndex(bucket, key) >= 0;
|
| + let bucket = this[_getBucket](rest, key);
|
| + return this[_findBucketIndex](bucket, key) >= 0;
|
| }
|
| containsValue(value) {
|
| - return this._computeKeys().any(((each) => dart.equals(this.get(each), value)).bind(this));
|
| + return this[_computeKeys]().any(((each) => dart.equals(this.get(each), value)).bind(this));
|
| }
|
| addAll(other) {
|
| other.forEach(((key, value) => {
|
| @@ -53,56 +75,56 @@ var collection;
|
| }
|
| get(key) {
|
| if (_isStringKey(key)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| return dart.as(strings === null ? null : _getTableEntry(strings, key), V);
|
| } else if (_isNumericKey(key)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| return dart.as(nums === null ? null : _getTableEntry(nums, key), V);
|
| } else {
|
| - return this._get(key);
|
| + return this[_get](key);
|
| }
|
| }
|
| - _get(key) {
|
| - let rest = this._rest;
|
| + [_get](key) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return dart.as(null, V);
|
| - let bucket = this._getBucket(rest, key);
|
| - let index = this._findBucketIndex(bucket, key);
|
| + let bucket = this[_getBucket](rest, key);
|
| + let index = this[_findBucketIndex](bucket, key);
|
| return dart.as(index < 0 ? null : bucket[index + 1], V);
|
| }
|
| set(key, value) {
|
| if (_isStringKey(key)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings === null)
|
| - this._strings = strings = _newHashTable();
|
| - this._addHashTableEntry(strings, key, value);
|
| + this[_strings] = strings = _newHashTable();
|
| + this[_addHashTableEntry](strings, key, value);
|
| } else if (_isNumericKey(key)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums === null)
|
| - this._nums = nums = _newHashTable();
|
| - this._addHashTableEntry(nums, key, value);
|
| + this[_nums] = nums = _newHashTable();
|
| + this[_addHashTableEntry](nums, key, value);
|
| } else {
|
| - this._set(key, value);
|
| + this[_set](key, value);
|
| }
|
| }
|
| - _set(key, value) {
|
| - let rest = this._rest;
|
| + [_set](key, value) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| - this._rest = rest = _newHashTable();
|
| - let hash = this._computeHashCode(key);
|
| + this[_rest] = rest = _newHashTable();
|
| + let hash = this[_computeHashCode](key);
|
| let bucket = rest[hash];
|
| if (bucket === null) {
|
| _setTableEntry(rest, hash, [key, value]);
|
| - this._length++;
|
| - this._keys = null;
|
| + this[_length]++;
|
| + this[_keys] = null;
|
| } else {
|
| - let index = this._findBucketIndex(bucket, key);
|
| + let index = this[_findBucketIndex](bucket, key);
|
| if (index >= 0) {
|
| bucket[index + 1] = value;
|
| } else {
|
| bucket.push(key, value);
|
| - this._length++;
|
| - this._keys = null;
|
| + this[_length]++;
|
| + this[_keys] = null;
|
| }
|
| }
|
| }
|
| @@ -115,47 +137,47 @@ var collection;
|
| }
|
| remove(key) {
|
| if (_isStringKey(key)) {
|
| - return this._removeHashTableEntry(this._strings, key);
|
| + return this[_removeHashTableEntry](this[_strings], key);
|
| } else if (_isNumericKey(key)) {
|
| - return this._removeHashTableEntry(this._nums, key);
|
| + return this[_removeHashTableEntry](this[_nums], key);
|
| } else {
|
| - return this._remove(key);
|
| + return this[_remove](key);
|
| }
|
| }
|
| - _remove(key) {
|
| - let rest = this._rest;
|
| + [_remove](key) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return dart.as(null, V);
|
| - let bucket = this._getBucket(rest, key);
|
| - let index = this._findBucketIndex(bucket, key);
|
| + let bucket = this[_getBucket](rest, key);
|
| + let index = this[_findBucketIndex](bucket, key);
|
| if (index < 0)
|
| return dart.as(null, V);
|
| - this._length--;
|
| - this._keys = null;
|
| + this[_length]--;
|
| + this[_keys] = null;
|
| return dart.as(bucket.splice(index, 2)[1], V);
|
| }
|
| clear() {
|
| - if (this._length > 0) {
|
| - this._strings = this._nums = this._rest = this._keys = null;
|
| - this._length = 0;
|
| + if (this[_length] > 0) {
|
| + this[_strings] = this[_nums] = this[_rest] = this[_keys] = null;
|
| + this[_length] = 0;
|
| }
|
| }
|
| forEach(action) {
|
| - let keys = this._computeKeys();
|
| + let keys = this[_computeKeys]();
|
| for (let i = 0, length = keys.length; i < length; i++) {
|
| let key = keys[i];
|
| action(dart.as(key, K), this.get(key));
|
| - if (keys !== this._keys) {
|
| + if (keys !== this[_keys]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| }
|
| }
|
| - _computeKeys() {
|
| - if (this._keys !== null)
|
| - return this._keys;
|
| - let result = new core.List(this._length);
|
| + [_computeKeys]() {
|
| + if (this[_keys] !== null)
|
| + return this[_keys];
|
| + let result = new core.List(this[_length]);
|
| let index = 0;
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings !== null) {
|
| let names = Object.getOwnPropertyNames(strings);
|
| let entries = names.length;
|
| @@ -165,7 +187,7 @@ var collection;
|
| index++;
|
| }
|
| }
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums !== null) {
|
| let names = Object.getOwnPropertyNames(nums);
|
| let entries = names.length;
|
| @@ -175,7 +197,7 @@ var collection;
|
| index++;
|
| }
|
| }
|
| - let rest = this._rest;
|
| + let rest = this[_rest];
|
| if (rest !== null) {
|
| let names = Object.getOwnPropertyNames(rest);
|
| let entries = names.length;
|
| @@ -190,59 +212,59 @@ var collection;
|
| }
|
| }
|
| }
|
| - dart.assert(index === this._length);
|
| - return this._keys = result;
|
| + dart.assert(index === this[_length]);
|
| + return this[_keys] = result;
|
| }
|
| - _addHashTableEntry(table, key, value) {
|
| + [_addHashTableEntry](table, key, value) {
|
| if (!dart.notNull(_hasTableEntry(table, key))) {
|
| - this._length++;
|
| - this._keys = null;
|
| + this[_length]++;
|
| + this[_keys] = null;
|
| }
|
| _setTableEntry(table, key, value);
|
| }
|
| - _removeHashTableEntry(table, key) {
|
| + [_removeHashTableEntry](table, key) {
|
| if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, key))) {
|
| let value = dart.as(_getTableEntry(table, key), V);
|
| _deleteTableEntry(table, key);
|
| - this._length--;
|
| - this._keys = null;
|
| + this[_length]--;
|
| + this[_keys] = null;
|
| return value;
|
| } else {
|
| return dart.as(null, V);
|
| }
|
| }
|
| - static _isStringKey(key) {
|
| + static [_isStringKey](key) {
|
| return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(key, '__proto__'));
|
| }
|
| - static _isNumericKey(key) {
|
| + static [_isNumericKey](key) {
|
| return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ffffff) === key);
|
| }
|
| - _computeHashCode(key) {
|
| + [_computeHashCode](key) {
|
| return dart.dload(key, 'hashCode') & 0x3ffffff;
|
| }
|
| - static _hasTableEntry(table, key) {
|
| + static [_hasTableEntry](table, key) {
|
| let entry = table[key];
|
| return entry !== null;
|
| }
|
| - static _getTableEntry(table, key) {
|
| + static [_getTableEntry](table, key) {
|
| let entry = table[key];
|
| return entry === table ? null : entry;
|
| }
|
| - static _setTableEntry(table, key, value) {
|
| + static [_setTableEntry](table, key, value) {
|
| if (value === null) {
|
| table[key] = table;
|
| } else {
|
| table[key] = value;
|
| }
|
| }
|
| - static _deleteTableEntry(table, key) {
|
| + static [_deleteTableEntry](table, key) {
|
| delete table[key];
|
| }
|
| - _getBucket(table, key) {
|
| - let hash = this._computeHashCode(key);
|
| + [_getBucket](table, key) {
|
| + let hash = this[_computeHashCode](key);
|
| return dart.as(table[hash], core.List);
|
| }
|
| - _findBucketIndex(bucket, key) {
|
| + [_findBucketIndex](bucket, key) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| @@ -252,7 +274,7 @@ var collection;
|
| }
|
| return -1;
|
| }
|
| - static _newHashTable() {
|
| + static [_newHashTable]() {
|
| let table = Object.create(null);
|
| let temporaryKey = '<non-identifier-key>';
|
| _setTableEntry(table, temporaryKey, table);
|
| @@ -265,10 +287,10 @@ var collection;
|
| let _HashMap = _HashMap$(dynamic, dynamic);
|
| let _IdentityHashMap$ = dart.generic(function(K, V) {
|
| class _IdentityHashMap extends _HashMap$(K, V) {
|
| - _computeHashCode(key) {
|
| + [_computeHashCode](key) {
|
| return core.identityHashCode(key) & 0x3ffffff;
|
| }
|
| - _findBucketIndex(bucket, key) {
|
| + [_findBucketIndex](bucket, key) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| @@ -282,16 +304,19 @@ var collection;
|
| return _IdentityHashMap;
|
| });
|
| let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic);
|
| + let _equals = Symbol('_equals');
|
| + let _hashCode = Symbol('_hashCode');
|
| + let _validKey = Symbol('_validKey');
|
| let _CustomHashMap$ = dart.generic(function(K, V) {
|
| class _CustomHashMap extends _HashMap$(K, V) {
|
| - _CustomHashMap(_equals, _hashCode, validKey) {
|
| - this._equals = _equals;
|
| - this._hashCode = _hashCode;
|
| - this._validKey = dart.as(validKey !== null ? validKey : (v) => dart.is(v, K), _Predicate);
|
| + _CustomHashMap($_equals, $_hashCode, validKey) {
|
| + this[_equals] = $_equals;
|
| + this[_hashCode] = $_hashCode;
|
| + this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(v, K), _Predicate);
|
| super._HashMap();
|
| }
|
| get(key) {
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return dart.as(null, V);
|
| return super._get(key);
|
| }
|
| @@ -299,24 +324,24 @@ var collection;
|
| super._set(key, value);
|
| }
|
| containsKey(key) {
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return false;
|
| return super._containsKey(key);
|
| }
|
| remove(key) {
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return dart.as(null, V);
|
| return super._remove(key);
|
| }
|
| - _computeHashCode(key) {
|
| - return this._hashCode(dart.as(key, K)) & 0x3ffffff;
|
| + [_computeHashCode](key) {
|
| + return this[_hashCode](dart.as(key, K)) & 0x3ffffff;
|
| }
|
| - _findBucketIndex(bucket, key) {
|
| + [_findBucketIndex](bucket, key) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i = 2) {
|
| - if (this._equals(dart.as(bucket[i], K), dart.as(key, K)))
|
| + if (this[_equals](dart.as(bucket[i], K), dart.as(key, K)))
|
| return i;
|
| }
|
| return -1;
|
| @@ -328,30 +353,31 @@ var collection;
|
| return _CustomHashMap;
|
| });
|
| let _CustomHashMap = _CustomHashMap$(dynamic, dynamic);
|
| + let _map = Symbol('_map');
|
| let HashMapKeyIterable$ = dart.generic(function(E) {
|
| class HashMapKeyIterable extends IterableBase$(E) {
|
| - HashMapKeyIterable(_map) {
|
| - this._map = _map;
|
| + HashMapKeyIterable($_map) {
|
| + this[_map] = $_map;
|
| super.IterableBase();
|
| }
|
| get length() {
|
| - return dart.as(dart.dload(this._map, '_length'), core.int);
|
| + return dart.as(dart.dload(this[_map], '_length'), core.int);
|
| }
|
| get isEmpty() {
|
| - return dart.equals(dart.dload(this._map, '_length'), 0);
|
| + return dart.equals(dart.dload(this[_map], '_length'), 0);
|
| }
|
| get iterator() {
|
| - return new HashMapKeyIterator(this._map, dart.as(dart.dinvoke(this._map, '_computeKeys'), core.List));
|
| + return new HashMapKeyIterator(this[_map], dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List));
|
| }
|
| contains(element) {
|
| - return dart.as(dart.dinvoke(this._map, 'containsKey', element), core.bool);
|
| + return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bool);
|
| }
|
| forEach(f) {
|
| - let keys = dart.as(dart.dinvoke(this._map, '_computeKeys'), core.List);
|
| + let keys = dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List);
|
| for (let i = 0, length = keys.length; i < length; i++) {
|
| f(dart.as(keys[i], E));
|
| - if (keys !== dart.dload(this._map, '_keys')) {
|
| - throw new core.ConcurrentModificationError(this._map);
|
| + if (keys !== dart.dload(this[_map], '_keys')) {
|
| + throw new core.ConcurrentModificationError(this[_map]);
|
| }
|
| }
|
| }
|
| @@ -359,28 +385,30 @@ var collection;
|
| return HashMapKeyIterable;
|
| });
|
| let HashMapKeyIterable = HashMapKeyIterable$(dynamic);
|
| + let _offset = Symbol('_offset');
|
| + let _current = Symbol('_current');
|
| let HashMapKeyIterator$ = dart.generic(function(E) {
|
| class HashMapKeyIterator extends dart.Object {
|
| - HashMapKeyIterator(_map, _keys) {
|
| - this._map = _map;
|
| - this._keys = _keys;
|
| - this._offset = 0;
|
| - this._current = dart.as(null, E);
|
| + HashMapKeyIterator($_map, $_keys) {
|
| + this[_map] = $_map;
|
| + this[_keys] = $_keys;
|
| + this[_offset] = 0;
|
| + this[_current] = dart.as(null, E);
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| moveNext() {
|
| - let keys = this._keys;
|
| - let offset = this._offset;
|
| - if (keys !== dart.dload(this._map, '_keys')) {
|
| - throw new core.ConcurrentModificationError(this._map);
|
| + let keys = this[_keys];
|
| + let offset = this[_offset];
|
| + if (keys !== dart.dload(this[_map], '_keys')) {
|
| + throw new core.ConcurrentModificationError(this[_map]);
|
| } else if (offset >= keys.length) {
|
| - this._current = dart.as(null, E);
|
| + this[_current] = dart.as(null, E);
|
| return false;
|
| } else {
|
| - this._current = dart.as(keys[offset], E);
|
| - this._offset = offset + 1;
|
| + this[_current] = dart.as(keys[offset], E);
|
| + this[_offset] = offset + 1;
|
| return true;
|
| }
|
| }
|
| @@ -388,22 +416,32 @@ var collection;
|
| return HashMapKeyIterator;
|
| });
|
| let HashMapKeyIterator = HashMapKeyIterator$(dynamic);
|
| + let _first = Symbol('_first');
|
| + let _last = Symbol('_last');
|
| + let _modifications = Symbol('_modifications');
|
| + let _value = Symbol('_value');
|
| + let _newLinkedCell = Symbol('_newLinkedCell');
|
| + let _unlinkCell = Symbol('_unlinkCell');
|
| + let _modified = Symbol('_modified');
|
| + let _key = Symbol('_key');
|
| + let _next = Symbol('_next');
|
| + let _previous = Symbol('_previous');
|
| let _LinkedHashMap$ = dart.generic(function(K, V) {
|
| class _LinkedHashMap extends dart.Object {
|
| _LinkedHashMap() {
|
| - this._length = 0;
|
| - this._strings = null;
|
| - this._nums = null;
|
| - this._rest = null;
|
| - this._first = null;
|
| - this._last = null;
|
| - this._modifications = 0;
|
| + this[_length] = 0;
|
| + this[_strings] = null;
|
| + this[_nums] = null;
|
| + this[_rest] = null;
|
| + this[_first] = null;
|
| + this[_last] = null;
|
| + this[_modifications] = 0;
|
| }
|
| get length() {
|
| - return this._length;
|
| + return this[_length];
|
| }
|
| get isEmpty() {
|
| - return this._length === 0;
|
| + return this[_length] === 0;
|
| }
|
| get isNotEmpty() {
|
| return !dart.notNull(this.isEmpty);
|
| @@ -416,27 +454,27 @@ var collection;
|
| }
|
| containsKey(key) {
|
| if (_isStringKey(key)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings === null)
|
| return false;
|
| let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell);
|
| return cell !== null;
|
| } else if (_isNumericKey(key)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums === null)
|
| return false;
|
| let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell);
|
| return cell !== null;
|
| } else {
|
| - return this._containsKey(key);
|
| + return this[_containsKey](key);
|
| }
|
| }
|
| - _containsKey(key) {
|
| - let rest = this._rest;
|
| + [_containsKey](key) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return false;
|
| - let bucket = this._getBucket(rest, key);
|
| - return this._findBucketIndex(bucket, key) >= 0;
|
| + let bucket = this[_getBucket](rest, key);
|
| + return this[_findBucketIndex](bucket, key) >= 0;
|
| }
|
| containsValue(value) {
|
| return this.keys.any(((each) => dart.equals(this.get(each), value)).bind(this));
|
| @@ -448,63 +486,63 @@ var collection;
|
| }
|
| get(key) {
|
| if (_isStringKey(key)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings === null)
|
| return dart.as(null, V);
|
| let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell);
|
| - return dart.as(cell === null ? null : cell._value, V);
|
| + return dart.as(cell === null ? null : cell[_value], V);
|
| } else if (_isNumericKey(key)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums === null)
|
| return dart.as(null, V);
|
| let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell);
|
| - return dart.as(cell === null ? null : cell._value, V);
|
| + return dart.as(cell === null ? null : cell[_value], V);
|
| } else {
|
| - return this._get(key);
|
| + return this[_get](key);
|
| }
|
| }
|
| - _get(key) {
|
| - let rest = this._rest;
|
| + [_get](key) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return dart.as(null, V);
|
| - let bucket = this._getBucket(rest, key);
|
| - let index = this._findBucketIndex(bucket, key);
|
| + let bucket = this[_getBucket](rest, key);
|
| + let index = this[_findBucketIndex](bucket, key);
|
| if (index < 0)
|
| return dart.as(null, V);
|
| let cell = dart.as(bucket[index], LinkedHashMapCell);
|
| - return dart.as(cell._value, V);
|
| + return dart.as(cell[_value], V);
|
| }
|
| set(key, value) {
|
| if (_isStringKey(key)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings === null)
|
| - this._strings = strings = _newHashTable();
|
| - this._addHashTableEntry(strings, key, value);
|
| + this[_strings] = strings = _newHashTable();
|
| + this[_addHashTableEntry](strings, key, value);
|
| } else if (_isNumericKey(key)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums === null)
|
| - this._nums = nums = _newHashTable();
|
| - this._addHashTableEntry(nums, key, value);
|
| + this[_nums] = nums = _newHashTable();
|
| + this[_addHashTableEntry](nums, key, value);
|
| } else {
|
| - this._set(key, value);
|
| + this[_set](key, value);
|
| }
|
| }
|
| - _set(key, value) {
|
| - let rest = this._rest;
|
| + [_set](key, value) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| - this._rest = rest = _newHashTable();
|
| - let hash = this._computeHashCode(key);
|
| + this[_rest] = rest = _newHashTable();
|
| + let hash = this[_computeHashCode](key);
|
| let bucket = rest[hash];
|
| if (bucket === null) {
|
| - let cell = this._newLinkedCell(key, value);
|
| + let cell = this[_newLinkedCell](key, value);
|
| _setTableEntry(rest, hash, [cell]);
|
| } else {
|
| - let index = this._findBucketIndex(bucket, key);
|
| + let index = this[_findBucketIndex](bucket, key);
|
| if (index >= 0) {
|
| let cell = dart.as(bucket[index], LinkedHashMapCell);
|
| - cell._value = value;
|
| + cell[_value] = value;
|
| } else {
|
| - let cell = this._newLinkedCell(key, value);
|
| + let cell = this[_newLinkedCell](key, value);
|
| bucket.push(cell);
|
| }
|
| }
|
| @@ -518,130 +556,130 @@ var collection;
|
| }
|
| remove(key) {
|
| if (_isStringKey(key)) {
|
| - return this._removeHashTableEntry(this._strings, key);
|
| + return this[_removeHashTableEntry](this[_strings], key);
|
| } else if (_isNumericKey(key)) {
|
| - return this._removeHashTableEntry(this._nums, key);
|
| + return this[_removeHashTableEntry](this[_nums], key);
|
| } else {
|
| - return this._remove(key);
|
| + return this[_remove](key);
|
| }
|
| }
|
| - _remove(key) {
|
| - let rest = this._rest;
|
| + [_remove](key) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return dart.as(null, V);
|
| - let bucket = this._getBucket(rest, key);
|
| - let index = this._findBucketIndex(bucket, key);
|
| + let bucket = this[_getBucket](rest, key);
|
| + let index = this[_findBucketIndex](bucket, key);
|
| if (index < 0)
|
| return dart.as(null, V);
|
| let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell);
|
| - this._unlinkCell(cell);
|
| - return dart.as(cell._value, V);
|
| + this[_unlinkCell](cell);
|
| + return dart.as(cell[_value], V);
|
| }
|
| clear() {
|
| - if (this._length > 0) {
|
| - this._strings = this._nums = this._rest = this._first = this._last = null;
|
| - this._length = 0;
|
| - this._modified();
|
| + if (this[_length] > 0) {
|
| + this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last] = null;
|
| + this[_length] = 0;
|
| + this[_modified]();
|
| }
|
| }
|
| forEach(action) {
|
| - let cell = this._first;
|
| - let modifications = this._modifications;
|
| + let cell = this[_first];
|
| + let modifications = this[_modifications];
|
| while (cell !== null) {
|
| - action(dart.as(cell._key, K), dart.as(cell._value, V));
|
| - if (modifications !== this._modifications) {
|
| + action(dart.as(cell[_key], K), dart.as(cell[_value], V));
|
| + if (modifications !== this[_modifications]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| - cell = cell._next;
|
| + cell = cell[_next];
|
| }
|
| }
|
| - _addHashTableEntry(table, key, value) {
|
| + [_addHashTableEntry](table, key, value) {
|
| let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell);
|
| if (cell === null) {
|
| - _setTableEntry(table, key, this._newLinkedCell(key, value));
|
| + _setTableEntry(table, key, this[_newLinkedCell](key, value));
|
| } else {
|
| - cell._value = value;
|
| + cell[_value] = value;
|
| }
|
| }
|
| - _removeHashTableEntry(table, key) {
|
| + [_removeHashTableEntry](table, key) {
|
| if (table === null)
|
| return dart.as(null, V);
|
| let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell);
|
| if (cell === null)
|
| return dart.as(null, V);
|
| - this._unlinkCell(cell);
|
| + this[_unlinkCell](cell);
|
| _deleteTableEntry(table, key);
|
| - return dart.as(cell._value, V);
|
| + return dart.as(cell[_value], V);
|
| }
|
| - _modified() {
|
| - this._modifications = this._modifications + 1 & 67108863;
|
| + [_modified]() {
|
| + this[_modifications] = this[_modifications] + 1 & 67108863;
|
| }
|
| - _newLinkedCell(key, value) {
|
| + [_newLinkedCell](key, value) {
|
| let cell = new LinkedHashMapCell(key, value);
|
| - if (this._first === null) {
|
| - this._first = this._last = cell;
|
| + if (this[_first] === null) {
|
| + this[_first] = this[_last] = cell;
|
| } else {
|
| - let last = this._last;
|
| - cell._previous = last;
|
| - this._last = last._next = cell;
|
| + let last = this[_last];
|
| + cell[_previous] = last;
|
| + this[_last] = last[_next] = cell;
|
| }
|
| - this._length++;
|
| - this._modified();
|
| + this[_length]++;
|
| + this[_modified]();
|
| return cell;
|
| }
|
| - _unlinkCell(cell) {
|
| - let previous = cell._previous;
|
| - let next = cell._next;
|
| + [_unlinkCell](cell) {
|
| + let previous = cell[_previous];
|
| + let next = cell[_next];
|
| if (previous === null) {
|
| - dart.assert(dart.equals(cell, this._first));
|
| - this._first = next;
|
| + dart.assert(dart.equals(cell, this[_first]));
|
| + this[_first] = next;
|
| } else {
|
| - previous._next = next;
|
| + previous[_next] = next;
|
| }
|
| if (next === null) {
|
| - dart.assert(dart.equals(cell, this._last));
|
| - this._last = previous;
|
| + dart.assert(dart.equals(cell, this[_last]));
|
| + this[_last] = previous;
|
| } else {
|
| - next._previous = previous;
|
| + next[_previous] = previous;
|
| }
|
| - this._length--;
|
| - this._modified();
|
| + this[_length]--;
|
| + this[_modified]();
|
| }
|
| - static _isStringKey(key) {
|
| + static [_isStringKey](key) {
|
| return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(key, '__proto__'));
|
| }
|
| - static _isNumericKey(key) {
|
| + static [_isNumericKey](key) {
|
| return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ffffff) === key);
|
| }
|
| - _computeHashCode(key) {
|
| + [_computeHashCode](key) {
|
| return dart.dload(key, 'hashCode') & 0x3ffffff;
|
| }
|
| - static _getTableEntry(table, key) {
|
| + static [_getTableEntry](table, key) {
|
| return table[key];
|
| }
|
| - static _setTableEntry(table, key, value) {
|
| + static [_setTableEntry](table, key, value) {
|
| dart.assert(value !== null);
|
| table[key] = value;
|
| }
|
| - static _deleteTableEntry(table, key) {
|
| + static [_deleteTableEntry](table, key) {
|
| delete table[key];
|
| }
|
| - _getBucket(table, key) {
|
| - let hash = this._computeHashCode(key);
|
| + [_getBucket](table, key) {
|
| + let hash = this[_computeHashCode](key);
|
| return dart.as(table[hash], core.List);
|
| }
|
| - _findBucketIndex(bucket, key) {
|
| + [_findBucketIndex](bucket, key) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i++) {
|
| let cell = dart.as(bucket[i], LinkedHashMapCell);
|
| - if (dart.equals(cell._key, key))
|
| + if (dart.equals(cell[_key], key))
|
| return i;
|
| }
|
| return -1;
|
| }
|
| - static _newHashTable() {
|
| + static [_newHashTable]() {
|
| let table = Object.create(null);
|
| let temporaryKey = '<non-identifier-key>';
|
| _setTableEntry(table, temporaryKey, table);
|
| @@ -657,16 +695,16 @@ var collection;
|
| let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic);
|
| let _LinkedIdentityHashMap$ = dart.generic(function(K, V) {
|
| class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) {
|
| - _computeHashCode(key) {
|
| + [_computeHashCode](key) {
|
| return core.identityHashCode(key) & 0x3ffffff;
|
| }
|
| - _findBucketIndex(bucket, key) {
|
| + [_findBucketIndex](bucket, key) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i++) {
|
| let cell = dart.as(bucket[i], LinkedHashMapCell);
|
| - if (core.identical(cell._key, key))
|
| + if (core.identical(cell[_key], key))
|
| return i;
|
| }
|
| return -1;
|
| @@ -677,14 +715,14 @@ var collection;
|
| let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic);
|
| let _LinkedCustomHashMap$ = dart.generic(function(K, V) {
|
| class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) {
|
| - _LinkedCustomHashMap(_equals, _hashCode, validKey) {
|
| - this._equals = _equals;
|
| - this._hashCode = _hashCode;
|
| - this._validKey = dart.as(validKey !== null ? validKey : (v) => dart.is(v, K), _Predicate);
|
| + _LinkedCustomHashMap($_equals, $_hashCode, validKey) {
|
| + this[_equals] = $_equals;
|
| + this[_hashCode] = $_hashCode;
|
| + this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(v, K), _Predicate);
|
| super._LinkedHashMap();
|
| }
|
| get(key) {
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return dart.as(null, V);
|
| return super._get(key);
|
| }
|
| @@ -692,25 +730,25 @@ var collection;
|
| super._set(key, value);
|
| }
|
| containsKey(key) {
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return false;
|
| return super._containsKey(key);
|
| }
|
| remove(key) {
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return dart.as(null, V);
|
| return super._remove(key);
|
| }
|
| - _computeHashCode(key) {
|
| - return this._hashCode(dart.as(key, K)) & 0x3ffffff;
|
| + [_computeHashCode](key) {
|
| + return this[_hashCode](dart.as(key, K)) & 0x3ffffff;
|
| }
|
| - _findBucketIndex(bucket, key) {
|
| + [_findBucketIndex](bucket, key) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i++) {
|
| let cell = dart.as(bucket[i], LinkedHashMapCell);
|
| - if (this._equals(dart.as(cell._key, K), dart.as(key, K)))
|
| + if (this[_equals](dart.as(cell[_key], K), dart.as(key, K)))
|
| return i;
|
| }
|
| return -1;
|
| @@ -720,67 +758,68 @@ var collection;
|
| });
|
| let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic);
|
| class LinkedHashMapCell extends dart.Object {
|
| - LinkedHashMapCell(_key, _value) {
|
| - this._key = _key;
|
| - this._value = _value;
|
| - this._next = null;
|
| - this._previous = null;
|
| + LinkedHashMapCell($_key, $_value) {
|
| + this[_key] = $_key;
|
| + this[_value] = $_value;
|
| + this[_next] = null;
|
| + this[_previous] = null;
|
| }
|
| }
|
| let LinkedHashMapKeyIterable$ = dart.generic(function(E) {
|
| class LinkedHashMapKeyIterable extends IterableBase$(E) {
|
| - LinkedHashMapKeyIterable(_map) {
|
| - this._map = _map;
|
| + LinkedHashMapKeyIterable($_map) {
|
| + this[_map] = $_map;
|
| super.IterableBase();
|
| }
|
| get length() {
|
| - return dart.as(dart.dload(this._map, '_length'), core.int);
|
| + return dart.as(dart.dload(this[_map], '_length'), core.int);
|
| }
|
| get isEmpty() {
|
| - return dart.equals(dart.dload(this._map, '_length'), 0);
|
| + return dart.equals(dart.dload(this[_map], '_length'), 0);
|
| }
|
| get iterator() {
|
| - return new LinkedHashMapKeyIterator(this._map, dart.as(dart.dload(this._map, '_modifications'), core.int));
|
| + return new LinkedHashMapKeyIterator(this[_map], dart.as(dart.dload(this[_map], '_modifications'), core.int));
|
| }
|
| contains(element) {
|
| - return dart.as(dart.dinvoke(this._map, 'containsKey', element), core.bool);
|
| + return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bool);
|
| }
|
| forEach(f) {
|
| - let cell = dart.as(dart.dload(this._map, '_first'), LinkedHashMapCell);
|
| - let modifications = dart.as(dart.dload(this._map, '_modifications'), core.int);
|
| + let cell = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell);
|
| + let modifications = dart.as(dart.dload(this[_map], '_modifications'), core.int);
|
| while (cell !== null) {
|
| - f(dart.as(cell._key, E));
|
| - if (modifications !== dart.dload(this._map, '_modifications')) {
|
| - throw new core.ConcurrentModificationError(this._map);
|
| + f(dart.as(cell[_key], E));
|
| + if (modifications !== dart.dload(this[_map], '_modifications')) {
|
| + throw new core.ConcurrentModificationError(this[_map]);
|
| }
|
| - cell = cell._next;
|
| + cell = cell[_next];
|
| }
|
| }
|
| }
|
| return LinkedHashMapKeyIterable;
|
| });
|
| let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic);
|
| + let _cell = Symbol('_cell');
|
| let LinkedHashMapKeyIterator$ = dart.generic(function(E) {
|
| class LinkedHashMapKeyIterator extends dart.Object {
|
| - LinkedHashMapKeyIterator(_map, _modifications) {
|
| - this._map = _map;
|
| - this._modifications = _modifications;
|
| - this._cell = null;
|
| - this._current = dart.as(null, E);
|
| - this._cell = dart.as(dart.dload(this._map, '_first'), LinkedHashMapCell);
|
| + LinkedHashMapKeyIterator($_map, $_modifications) {
|
| + this[_map] = $_map;
|
| + this[_modifications] = $_modifications;
|
| + this[_cell] = null;
|
| + this[_current] = dart.as(null, E);
|
| + this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell);
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| moveNext() {
|
| - if (this._modifications !== dart.dload(this._map, '_modifications')) {
|
| - throw new core.ConcurrentModificationError(this._map);
|
| - } else if (this._cell === null) {
|
| - this._current = dart.as(null, E);
|
| + if (this[_modifications] !== dart.dload(this[_map], '_modifications')) {
|
| + throw new core.ConcurrentModificationError(this[_map]);
|
| + } else if (this[_cell] === null) {
|
| + this[_current] = dart.as(null, E);
|
| return false;
|
| } else {
|
| - this._current = dart.as(this._cell._key, E);
|
| - this._cell = this._cell._next;
|
| + this[_current] = dart.as(this[_cell][_key], E);
|
| + this[_cell] = this[_cell][_next];
|
| return true;
|
| }
|
| }
|
| @@ -788,96 +827,104 @@ var collection;
|
| return LinkedHashMapKeyIterator;
|
| });
|
| let LinkedHashMapKeyIterator = LinkedHashMapKeyIterator$(dynamic);
|
| + let _elements = Symbol('_elements');
|
| + let _newSet = Symbol('_newSet');
|
| + let _computeElements = Symbol('_computeElements');
|
| + let _contains = Symbol('_contains');
|
| + let _lookup = Symbol('_lookup');
|
| + let _add = Symbol('_add');
|
| + let _isStringElement = Symbol('_isStringElement');
|
| + let _isNumericElement = Symbol('_isNumericElement');
|
| let _HashSet$ = dart.generic(function(E) {
|
| class _HashSet extends _HashSetBase$(E) {
|
| _HashSet() {
|
| - this._length = 0;
|
| - this._strings = null;
|
| - this._nums = null;
|
| - this._rest = null;
|
| - this._elements = null;
|
| + this[_length] = 0;
|
| + this[_strings] = null;
|
| + this[_nums] = null;
|
| + this[_rest] = null;
|
| + this[_elements] = null;
|
| super._HashSetBase();
|
| }
|
| - _newSet() {
|
| + [_newSet]() {
|
| return new _HashSet();
|
| }
|
| get iterator() {
|
| - return new HashSetIterator(this, this._computeElements());
|
| + return new HashSetIterator(this, this[_computeElements]());
|
| }
|
| get length() {
|
| - return this._length;
|
| + return this[_length];
|
| }
|
| get isEmpty() {
|
| - return this._length === 0;
|
| + return this[_length] === 0;
|
| }
|
| get isNotEmpty() {
|
| return !dart.notNull(this.isEmpty);
|
| }
|
| contains(object) {
|
| if (_isStringElement(object)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| return strings === null ? false : _hasTableEntry(strings, object);
|
| } else if (_isNumericElement(object)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| return nums === null ? false : _hasTableEntry(nums, object);
|
| } else {
|
| - return this._contains(object);
|
| + return this[_contains](object);
|
| }
|
| }
|
| - _contains(object) {
|
| - let rest = this._rest;
|
| + [_contains](object) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return false;
|
| - let bucket = this._getBucket(rest, object);
|
| - return this._findBucketIndex(bucket, object) >= 0;
|
| + let bucket = this[_getBucket](rest, object);
|
| + return this[_findBucketIndex](bucket, object) >= 0;
|
| }
|
| lookup(object) {
|
| if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericElement(object))) {
|
| return dart.as(this.contains(object) ? object : null, E);
|
| }
|
| - return this._lookup(object);
|
| + return this[_lookup](object);
|
| }
|
| - _lookup(object) {
|
| - let rest = this._rest;
|
| + [_lookup](object) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return dart.as(null, E);
|
| - let bucket = this._getBucket(rest, object);
|
| - let index = this._findBucketIndex(bucket, object);
|
| + let bucket = this[_getBucket](rest, object);
|
| + let index = this[_findBucketIndex](bucket, object);
|
| if (index < 0)
|
| return dart.as(null, E);
|
| return dart.as(bucket.get(index), E);
|
| }
|
| add(element) {
|
| if (_isStringElement(element)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings === null)
|
| - this._strings = strings = _newHashTable();
|
| - return this._addHashTableEntry(strings, element);
|
| + this[_strings] = strings = _newHashTable();
|
| + return this[_addHashTableEntry](strings, element);
|
| } else if (_isNumericElement(element)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums === null)
|
| - this._nums = nums = _newHashTable();
|
| - return this._addHashTableEntry(nums, element);
|
| + this[_nums] = nums = _newHashTable();
|
| + return this[_addHashTableEntry](nums, element);
|
| } else {
|
| - return this._add(element);
|
| + return this[_add](element);
|
| }
|
| }
|
| - _add(element) {
|
| - let rest = this._rest;
|
| + [_add](element) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| - this._rest = rest = _newHashTable();
|
| - let hash = this._computeHashCode(element);
|
| + this[_rest] = rest = _newHashTable();
|
| + let hash = this[_computeHashCode](element);
|
| let bucket = rest[hash];
|
| if (bucket === null) {
|
| _setTableEntry(rest, hash, [element]);
|
| } else {
|
| - let index = this._findBucketIndex(bucket, element);
|
| + let index = this[_findBucketIndex](bucket, element);
|
| if (index >= 0)
|
| return false;
|
| bucket.push(element);
|
| }
|
| - this._length++;
|
| - this._elements = null;
|
| + this[_length]++;
|
| + this[_elements] = null;
|
| return true;
|
| }
|
| addAll(objects) {
|
| @@ -887,38 +934,38 @@ var collection;
|
| }
|
| remove(object) {
|
| if (_isStringElement(object)) {
|
| - return this._removeHashTableEntry(this._strings, object);
|
| + return this[_removeHashTableEntry](this[_strings], object);
|
| } else if (_isNumericElement(object)) {
|
| - return this._removeHashTableEntry(this._nums, object);
|
| + return this[_removeHashTableEntry](this[_nums], object);
|
| } else {
|
| - return this._remove(object);
|
| + return this[_remove](object);
|
| }
|
| }
|
| - _remove(object) {
|
| - let rest = this._rest;
|
| + [_remove](object) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return false;
|
| - let bucket = this._getBucket(rest, object);
|
| - let index = this._findBucketIndex(bucket, object);
|
| + let bucket = this[_getBucket](rest, object);
|
| + let index = this[_findBucketIndex](bucket, object);
|
| if (index < 0)
|
| return false;
|
| - this._length--;
|
| - this._elements = null;
|
| + this[_length]--;
|
| + this[_elements] = null;
|
| bucket.splice(index, 1);
|
| return true;
|
| }
|
| clear() {
|
| - if (this._length > 0) {
|
| - this._strings = this._nums = this._rest = this._elements = null;
|
| - this._length = 0;
|
| + if (this[_length] > 0) {
|
| + this[_strings] = this[_nums] = this[_rest] = this[_elements] = null;
|
| + this[_length] = 0;
|
| }
|
| }
|
| - _computeElements() {
|
| - if (this._elements !== null)
|
| - return this._elements;
|
| - let result = new core.List(this._length);
|
| + [_computeElements]() {
|
| + if (this[_elements] !== null)
|
| + return this[_elements];
|
| + let result = new core.List(this[_length]);
|
| let index = 0;
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings !== null) {
|
| let names = Object.getOwnPropertyNames(strings);
|
| let entries = names.length;
|
| @@ -928,7 +975,7 @@ var collection;
|
| index++;
|
| }
|
| }
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums !== null) {
|
| let names = Object.getOwnPropertyNames(nums);
|
| let entries = names.length;
|
| @@ -938,7 +985,7 @@ var collection;
|
| index++;
|
| }
|
| }
|
| - let rest = this._rest;
|
| + let rest = this[_rest];
|
| if (rest !== null) {
|
| let names = Object.getOwnPropertyNames(rest);
|
| let entries = names.length;
|
| @@ -952,52 +999,52 @@ var collection;
|
| }
|
| }
|
| }
|
| - dart.assert(index === this._length);
|
| - return this._elements = result;
|
| + dart.assert(index === this[_length]);
|
| + return this[_elements] = result;
|
| }
|
| - _addHashTableEntry(table, element) {
|
| + [_addHashTableEntry](table, element) {
|
| if (_hasTableEntry(table, element))
|
| return false;
|
| _setTableEntry(table, element, 0);
|
| - this._length++;
|
| - this._elements = null;
|
| + this[_length]++;
|
| + this[_elements] = null;
|
| return true;
|
| }
|
| - _removeHashTableEntry(table, element) {
|
| + [_removeHashTableEntry](table, element) {
|
| if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, element))) {
|
| _deleteTableEntry(table, element);
|
| - this._length--;
|
| - this._elements = null;
|
| + this[_length]--;
|
| + this[_elements] = null;
|
| return true;
|
| } else {
|
| return false;
|
| }
|
| }
|
| - static _isStringElement(element) {
|
| + static [_isStringElement](element) {
|
| return dart.notNull(typeof element == string) && dart.notNull(!dart.equals(element, '__proto__'));
|
| }
|
| - static _isNumericElement(element) {
|
| + static [_isNumericElement](element) {
|
| return dart.notNull(dart.is(element, core.num)) && dart.notNull((element & 0x3ffffff) === element);
|
| }
|
| - _computeHashCode(element) {
|
| + [_computeHashCode](element) {
|
| return dart.dload(element, 'hashCode') & 0x3ffffff;
|
| }
|
| - static _hasTableEntry(table, key) {
|
| + static [_hasTableEntry](table, key) {
|
| let entry = table[key];
|
| return entry !== null;
|
| }
|
| - static _setTableEntry(table, key, value) {
|
| + static [_setTableEntry](table, key, value) {
|
| dart.assert(value !== null);
|
| table[key] = value;
|
| }
|
| - static _deleteTableEntry(table, key) {
|
| + static [_deleteTableEntry](table, key) {
|
| delete table[key];
|
| }
|
| - _getBucket(table, element) {
|
| - let hash = this._computeHashCode(element);
|
| + [_getBucket](table, element) {
|
| + let hash = this[_computeHashCode](element);
|
| return dart.as(table[hash], core.List);
|
| }
|
| - _findBucketIndex(bucket, element) {
|
| + [_findBucketIndex](bucket, element) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| @@ -1007,7 +1054,7 @@ var collection;
|
| }
|
| return -1;
|
| }
|
| - static _newHashTable() {
|
| + static [_newHashTable]() {
|
| let table = Object.create(null);
|
| let temporaryKey = '<non-identifier-key>';
|
| _setTableEntry(table, temporaryKey, table);
|
| @@ -1020,13 +1067,13 @@ var collection;
|
| let _HashSet = _HashSet$(dynamic);
|
| let _IdentityHashSet$ = dart.generic(function(E) {
|
| class _IdentityHashSet extends _HashSet$(E) {
|
| - _newSet() {
|
| + [_newSet]() {
|
| return new _IdentityHashSet();
|
| }
|
| - _computeHashCode(key) {
|
| + [_computeHashCode](key) {
|
| return core.identityHashCode(key) & 0x3ffffff;
|
| }
|
| - _findBucketIndex(bucket, element) {
|
| + [_findBucketIndex](bucket, element) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| @@ -1040,45 +1087,47 @@ var collection;
|
| return _IdentityHashSet;
|
| });
|
| let _IdentityHashSet = _IdentityHashSet$(dynamic);
|
| + let _equality = Symbol('_equality');
|
| + let _hasher = Symbol('_hasher');
|
| let _CustomHashSet$ = dart.generic(function(E) {
|
| class _CustomHashSet extends _HashSet$(E) {
|
| - _CustomHashSet(_equality, _hasher, validKey) {
|
| - this._equality = _equality;
|
| - this._hasher = _hasher;
|
| - this._validKey = dart.as(validKey !== null ? validKey : (x) => dart.is(x, E), _Predicate);
|
| + _CustomHashSet($_equality, $_hasher, validKey) {
|
| + this[_equality] = $_equality;
|
| + this[_hasher] = $_hasher;
|
| + this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(x, E), _Predicate);
|
| super._HashSet();
|
| }
|
| - _newSet() {
|
| - return new _CustomHashSet(this._equality, this._hasher, this._validKey);
|
| + [_newSet]() {
|
| + return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey]);
|
| }
|
| - _findBucketIndex(bucket, element) {
|
| + [_findBucketIndex](bucket, element) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i++) {
|
| - if (this._equality(dart.as(bucket[i], E), dart.as(element, E)))
|
| + if (this[_equality](dart.as(bucket[i], E), dart.as(element, E)))
|
| return i;
|
| }
|
| return -1;
|
| }
|
| - _computeHashCode(element) {
|
| - return this._hasher(dart.as(element, E)) & 0x3ffffff;
|
| + [_computeHashCode](element) {
|
| + return this[_hasher](dart.as(element, E)) & 0x3ffffff;
|
| }
|
| add(object) {
|
| return super._add(object);
|
| }
|
| contains(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return false;
|
| return super._contains(object);
|
| }
|
| lookup(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return dart.as(null, E);
|
| return super._lookup(object);
|
| }
|
| remove(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return false;
|
| return super._remove(object);
|
| }
|
| @@ -1088,26 +1137,26 @@ var collection;
|
| let _CustomHashSet = _CustomHashSet$(dynamic);
|
| let HashSetIterator$ = dart.generic(function(E) {
|
| class HashSetIterator extends dart.Object {
|
| - HashSetIterator(_set, _elements) {
|
| - this._set = _set;
|
| - this._elements = _elements;
|
| - this._offset = 0;
|
| - this._current = dart.as(null, E);
|
| + HashSetIterator($_set, $_elements) {
|
| + this[_set] = $_set;
|
| + this[_elements] = $_elements;
|
| + this[_offset] = 0;
|
| + this[_current] = dart.as(null, E);
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| moveNext() {
|
| - let elements = this._elements;
|
| - let offset = this._offset;
|
| - if (elements !== dart.dload(this._set, '_elements')) {
|
| - throw new core.ConcurrentModificationError(this._set);
|
| + let elements = this[_elements];
|
| + let offset = this[_offset];
|
| + if (elements !== dart.dload(this[_set], '_elements')) {
|
| + throw new core.ConcurrentModificationError(this[_set]);
|
| } else if (offset >= elements.length) {
|
| - this._current = dart.as(null, E);
|
| + this[_current] = dart.as(null, E);
|
| return false;
|
| } else {
|
| - this._current = dart.as(elements[offset], E);
|
| - this._offset = offset + 1;
|
| + this[_current] = dart.as(elements[offset], E);
|
| + this[_offset] = offset + 1;
|
| return true;
|
| }
|
| }
|
| @@ -1115,166 +1164,169 @@ var collection;
|
| return HashSetIterator;
|
| });
|
| let HashSetIterator = HashSetIterator$(dynamic);
|
| + let _unsupported = Symbol('_unsupported');
|
| + let _element = Symbol('_element');
|
| + let _filterWhere = Symbol('_filterWhere');
|
| let _LinkedHashSet$ = dart.generic(function(E) {
|
| class _LinkedHashSet extends _HashSetBase$(E) {
|
| _LinkedHashSet() {
|
| - this._length = 0;
|
| - this._strings = null;
|
| - this._nums = null;
|
| - this._rest = null;
|
| - this._first = null;
|
| - this._last = null;
|
| - this._modifications = 0;
|
| + this[_length] = 0;
|
| + this[_strings] = null;
|
| + this[_nums] = null;
|
| + this[_rest] = null;
|
| + this[_first] = null;
|
| + this[_last] = null;
|
| + this[_modifications] = 0;
|
| super._HashSetBase();
|
| }
|
| - _newSet() {
|
| + [_newSet]() {
|
| return new _LinkedHashSet();
|
| }
|
| - _unsupported(operation) {
|
| + [_unsupported](operation) {
|
| throw `LinkedHashSet: unsupported ${operation}`;
|
| }
|
| get iterator() {
|
| - return dart.as(new LinkedHashSetIterator(this, this._modifications), core.Iterator$(E));
|
| + return dart.as(new LinkedHashSetIterator(this, this[_modifications]), core.Iterator$(E));
|
| }
|
| get length() {
|
| - return this._length;
|
| + return this[_length];
|
| }
|
| get isEmpty() {
|
| - return this._length === 0;
|
| + return this[_length] === 0;
|
| }
|
| get isNotEmpty() {
|
| return !dart.notNull(this.isEmpty);
|
| }
|
| contains(object) {
|
| if (_isStringElement(object)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings === null)
|
| return false;
|
| let cell = dart.as(_getTableEntry(strings, object), LinkedHashSetCell);
|
| return cell !== null;
|
| } else if (_isNumericElement(object)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums === null)
|
| return false;
|
| let cell = dart.as(_getTableEntry(nums, object), LinkedHashSetCell);
|
| return cell !== null;
|
| } else {
|
| - return this._contains(object);
|
| + return this[_contains](object);
|
| }
|
| }
|
| - _contains(object) {
|
| - let rest = this._rest;
|
| + [_contains](object) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return false;
|
| - let bucket = this._getBucket(rest, object);
|
| - return this._findBucketIndex(bucket, object) >= 0;
|
| + let bucket = this[_getBucket](rest, object);
|
| + return this[_findBucketIndex](bucket, object) >= 0;
|
| }
|
| lookup(object) {
|
| if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericElement(object))) {
|
| return dart.as(this.contains(object) ? object : null, E);
|
| } else {
|
| - return this._lookup(object);
|
| + return this[_lookup](object);
|
| }
|
| }
|
| - _lookup(object) {
|
| - let rest = this._rest;
|
| + [_lookup](object) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return dart.as(null, E);
|
| - let bucket = this._getBucket(rest, object);
|
| - let index = this._findBucketIndex(bucket, object);
|
| + let bucket = this[_getBucket](rest, object);
|
| + let index = this[_findBucketIndex](bucket, object);
|
| if (index < 0)
|
| return dart.as(null, E);
|
| return dart.as(dart.dload(bucket.get(index), '_element'), E);
|
| }
|
| forEach(action) {
|
| - let cell = this._first;
|
| - let modifications = this._modifications;
|
| + let cell = this[_first];
|
| + let modifications = this[_modifications];
|
| while (cell !== null) {
|
| - action(dart.as(cell._element, E));
|
| - if (modifications !== this._modifications) {
|
| + action(dart.as(cell[_element], E));
|
| + if (modifications !== this[_modifications]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| - cell = cell._next;
|
| + cell = cell[_next];
|
| }
|
| }
|
| get first() {
|
| - if (this._first === null)
|
| + if (this[_first] === null)
|
| throw new core.StateError("No elements");
|
| - return dart.as(this._first._element, E);
|
| + return dart.as(this[_first][_element], E);
|
| }
|
| get last() {
|
| - if (this._last === null)
|
| + if (this[_last] === null)
|
| throw new core.StateError("No elements");
|
| - return dart.as(this._last._element, E);
|
| + return dart.as(this[_last][_element], E);
|
| }
|
| add(element) {
|
| if (_isStringElement(element)) {
|
| - let strings = this._strings;
|
| + let strings = this[_strings];
|
| if (strings === null)
|
| - this._strings = strings = _newHashTable();
|
| - return this._addHashTableEntry(strings, element);
|
| + this[_strings] = strings = _newHashTable();
|
| + return this[_addHashTableEntry](strings, element);
|
| } else if (_isNumericElement(element)) {
|
| - let nums = this._nums;
|
| + let nums = this[_nums];
|
| if (nums === null)
|
| - this._nums = nums = _newHashTable();
|
| - return this._addHashTableEntry(nums, element);
|
| + this[_nums] = nums = _newHashTable();
|
| + return this[_addHashTableEntry](nums, element);
|
| } else {
|
| - return this._add(element);
|
| + return this[_add](element);
|
| }
|
| }
|
| - _add(element) {
|
| - let rest = this._rest;
|
| + [_add](element) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| - this._rest = rest = _newHashTable();
|
| - let hash = this._computeHashCode(element);
|
| + this[_rest] = rest = _newHashTable();
|
| + let hash = this[_computeHashCode](element);
|
| let bucket = rest[hash];
|
| if (bucket === null) {
|
| - let cell = this._newLinkedCell(element);
|
| + let cell = this[_newLinkedCell](element);
|
| _setTableEntry(rest, hash, [cell]);
|
| } else {
|
| - let index = this._findBucketIndex(bucket, element);
|
| + let index = this[_findBucketIndex](bucket, element);
|
| if (index >= 0)
|
| return false;
|
| - let cell = this._newLinkedCell(element);
|
| + let cell = this[_newLinkedCell](element);
|
| bucket.push(cell);
|
| }
|
| return true;
|
| }
|
| remove(object) {
|
| if (_isStringElement(object)) {
|
| - return this._removeHashTableEntry(this._strings, object);
|
| + return this[_removeHashTableEntry](this[_strings], object);
|
| } else if (_isNumericElement(object)) {
|
| - return this._removeHashTableEntry(this._nums, object);
|
| + return this[_removeHashTableEntry](this[_nums], object);
|
| } else {
|
| - return this._remove(object);
|
| + return this[_remove](object);
|
| }
|
| }
|
| - _remove(object) {
|
| - let rest = this._rest;
|
| + [_remove](object) {
|
| + let rest = this[_rest];
|
| if (rest === null)
|
| return false;
|
| - let bucket = this._getBucket(rest, object);
|
| - let index = this._findBucketIndex(bucket, object);
|
| + let bucket = this[_getBucket](rest, object);
|
| + let index = this[_findBucketIndex](bucket, object);
|
| if (index < 0)
|
| return false;
|
| let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell);
|
| - this._unlinkCell(cell);
|
| + this[_unlinkCell](cell);
|
| return true;
|
| }
|
| removeWhere(test) {
|
| - this._filterWhere(test, true);
|
| + this[_filterWhere](test, true);
|
| }
|
| retainWhere(test) {
|
| - this._filterWhere(test, false);
|
| + this[_filterWhere](test, false);
|
| }
|
| - _filterWhere(test, removeMatching) {
|
| - let cell = this._first;
|
| + [_filterWhere](test, removeMatching) {
|
| + let cell = this[_first];
|
| while (cell !== null) {
|
| - let element = dart.as(cell._element, E);
|
| - let next = cell._next;
|
| - let modifications = this._modifications;
|
| + let element = dart.as(cell[_element], E);
|
| + let next = cell[_next];
|
| + let modifications = this[_modifications];
|
| let shouldRemove = removeMatching === test(element);
|
| - if (modifications !== this._modifications) {
|
| + if (modifications !== this[_modifications]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| if (shouldRemove)
|
| @@ -1283,98 +1335,98 @@ var collection;
|
| }
|
| }
|
| clear() {
|
| - if (this._length > 0) {
|
| - this._strings = this._nums = this._rest = this._first = this._last = null;
|
| - this._length = 0;
|
| - this._modified();
|
| + if (this[_length] > 0) {
|
| + this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last] = null;
|
| + this[_length] = 0;
|
| + this[_modified]();
|
| }
|
| }
|
| - _addHashTableEntry(table, element) {
|
| + [_addHashTableEntry](table, element) {
|
| let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell);
|
| if (cell !== null)
|
| return false;
|
| - _setTableEntry(table, element, this._newLinkedCell(element));
|
| + _setTableEntry(table, element, this[_newLinkedCell](element));
|
| return true;
|
| }
|
| - _removeHashTableEntry(table, element) {
|
| + [_removeHashTableEntry](table, element) {
|
| if (table === null)
|
| return false;
|
| let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell);
|
| if (cell === null)
|
| return false;
|
| - this._unlinkCell(cell);
|
| + this[_unlinkCell](cell);
|
| _deleteTableEntry(table, element);
|
| return true;
|
| }
|
| - _modified() {
|
| - this._modifications = this._modifications + 1 & 67108863;
|
| + [_modified]() {
|
| + this[_modifications] = this[_modifications] + 1 & 67108863;
|
| }
|
| - _newLinkedCell(element) {
|
| + [_newLinkedCell](element) {
|
| let cell = new LinkedHashSetCell(element);
|
| - if (this._first === null) {
|
| - this._first = this._last = cell;
|
| + if (this[_first] === null) {
|
| + this[_first] = this[_last] = cell;
|
| } else {
|
| - let last = this._last;
|
| - cell._previous = last;
|
| - this._last = last._next = cell;
|
| + let last = this[_last];
|
| + cell[_previous] = last;
|
| + this[_last] = last[_next] = cell;
|
| }
|
| - this._length++;
|
| - this._modified();
|
| + this[_length]++;
|
| + this[_modified]();
|
| return cell;
|
| }
|
| - _unlinkCell(cell) {
|
| - let previous = cell._previous;
|
| - let next = cell._next;
|
| + [_unlinkCell](cell) {
|
| + let previous = cell[_previous];
|
| + let next = cell[_next];
|
| if (previous === null) {
|
| - dart.assert(dart.equals(cell, this._first));
|
| - this._first = next;
|
| + dart.assert(dart.equals(cell, this[_first]));
|
| + this[_first] = next;
|
| } else {
|
| - previous._next = next;
|
| + previous[_next] = next;
|
| }
|
| if (next === null) {
|
| - dart.assert(dart.equals(cell, this._last));
|
| - this._last = previous;
|
| + dart.assert(dart.equals(cell, this[_last]));
|
| + this[_last] = previous;
|
| } else {
|
| - next._previous = previous;
|
| + next[_previous] = previous;
|
| }
|
| - this._length--;
|
| - this._modified();
|
| + this[_length]--;
|
| + this[_modified]();
|
| }
|
| - static _isStringElement(element) {
|
| + static [_isStringElement](element) {
|
| return dart.notNull(typeof element == string) && dart.notNull(!dart.equals(element, '__proto__'));
|
| }
|
| - static _isNumericElement(element) {
|
| + static [_isNumericElement](element) {
|
| return dart.notNull(dart.is(element, core.num)) && dart.notNull((element & 0x3ffffff) === element);
|
| }
|
| - _computeHashCode(element) {
|
| + [_computeHashCode](element) {
|
| return dart.dload(element, 'hashCode') & 0x3ffffff;
|
| }
|
| - static _getTableEntry(table, key) {
|
| + static [_getTableEntry](table, key) {
|
| return table[key];
|
| }
|
| - static _setTableEntry(table, key, value) {
|
| + static [_setTableEntry](table, key, value) {
|
| dart.assert(value !== null);
|
| table[key] = value;
|
| }
|
| - static _deleteTableEntry(table, key) {
|
| + static [_deleteTableEntry](table, key) {
|
| delete table[key];
|
| }
|
| - _getBucket(table, element) {
|
| - let hash = this._computeHashCode(element);
|
| + [_getBucket](table, element) {
|
| + let hash = this[_computeHashCode](element);
|
| return dart.as(table[hash], core.List);
|
| }
|
| - _findBucketIndex(bucket, element) {
|
| + [_findBucketIndex](bucket, element) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i++) {
|
| let cell = dart.as(bucket[i], LinkedHashSetCell);
|
| - if (dart.equals(cell._element, element))
|
| + if (dart.equals(cell[_element], element))
|
| return i;
|
| }
|
| return -1;
|
| }
|
| - static _newHashTable() {
|
| + static [_newHashTable]() {
|
| let table = Object.create(null);
|
| let temporaryKey = '<non-identifier-key>';
|
| _setTableEntry(table, temporaryKey, table);
|
| @@ -1387,19 +1439,19 @@ var collection;
|
| let _LinkedHashSet = _LinkedHashSet$(dynamic);
|
| let _LinkedIdentityHashSet$ = dart.generic(function(E) {
|
| class _LinkedIdentityHashSet extends _LinkedHashSet$(E) {
|
| - _newSet() {
|
| + [_newSet]() {
|
| return new _LinkedIdentityHashSet();
|
| }
|
| - _computeHashCode(key) {
|
| + [_computeHashCode](key) {
|
| return core.identityHashCode(key) & 0x3ffffff;
|
| }
|
| - _findBucketIndex(bucket, element) {
|
| + [_findBucketIndex](bucket, element) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i++) {
|
| let cell = dart.as(bucket[i], LinkedHashSetCell);
|
| - if (core.identical(cell._element, element))
|
| + if (core.identical(cell[_element], element))
|
| return i;
|
| }
|
| return -1;
|
| @@ -1410,57 +1462,57 @@ var collection;
|
| let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic);
|
| let _LinkedCustomHashSet$ = dart.generic(function(E) {
|
| class _LinkedCustomHashSet extends _LinkedHashSet$(E) {
|
| - _LinkedCustomHashSet(_equality, _hasher, validKey) {
|
| - this._equality = _equality;
|
| - this._hasher = _hasher;
|
| - this._validKey = dart.as(validKey !== null ? validKey : (x) => dart.is(x, E), _Predicate);
|
| + _LinkedCustomHashSet($_equality, $_hasher, validKey) {
|
| + this[_equality] = $_equality;
|
| + this[_hasher] = $_hasher;
|
| + this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(x, E), _Predicate);
|
| super._LinkedHashSet();
|
| }
|
| - _newSet() {
|
| - return new _LinkedCustomHashSet(this._equality, this._hasher, this._validKey);
|
| + [_newSet]() {
|
| + return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_validKey]);
|
| }
|
| - _findBucketIndex(bucket, element) {
|
| + [_findBucketIndex](bucket, element) {
|
| if (bucket === null)
|
| return -1;
|
| let length = bucket.length;
|
| for (let i = 0; i < length; i++) {
|
| let cell = dart.as(bucket[i], LinkedHashSetCell);
|
| - if (this._equality(dart.as(cell._element, E), dart.as(element, E)))
|
| + if (this[_equality](dart.as(cell[_element], E), dart.as(element, E)))
|
| return i;
|
| }
|
| return -1;
|
| }
|
| - _computeHashCode(element) {
|
| - return this._hasher(dart.as(element, E)) & 0x3ffffff;
|
| + [_computeHashCode](element) {
|
| + return this[_hasher](dart.as(element, E)) & 0x3ffffff;
|
| }
|
| add(element) {
|
| return super._add(element);
|
| }
|
| contains(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return false;
|
| return super._contains(object);
|
| }
|
| lookup(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return dart.as(null, E);
|
| return super._lookup(object);
|
| }
|
| remove(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return false;
|
| return super._remove(object);
|
| }
|
| containsAll(elements) {
|
| for (let element of elements) {
|
| - if (dart.notNull(!dart.notNull(this._validKey(element))) || dart.notNull(!dart.notNull(this.contains(element))))
|
| + if (dart.notNull(!dart.notNull(this[_validKey](element))) || dart.notNull(!dart.notNull(this.contains(element))))
|
| return false;
|
| }
|
| return true;
|
| }
|
| removeAll(elements) {
|
| for (let element of elements) {
|
| - if (this._validKey(element)) {
|
| + if (this[_validKey](element)) {
|
| super._remove(element);
|
| }
|
| }
|
| @@ -1470,33 +1522,33 @@ var collection;
|
| });
|
| let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic);
|
| class LinkedHashSetCell extends dart.Object {
|
| - LinkedHashSetCell(_element) {
|
| - this._element = _element;
|
| - this._next = null;
|
| - this._previous = null;
|
| + LinkedHashSetCell($_element) {
|
| + this[_element] = $_element;
|
| + this[_next] = null;
|
| + this[_previous] = null;
|
| }
|
| }
|
| let LinkedHashSetIterator$ = dart.generic(function(E) {
|
| class LinkedHashSetIterator extends dart.Object {
|
| - LinkedHashSetIterator(_set, _modifications) {
|
| - this._set = _set;
|
| - this._modifications = _modifications;
|
| - this._cell = null;
|
| - this._current = dart.as(null, E);
|
| - this._cell = dart.as(dart.dload(this._set, '_first'), LinkedHashSetCell);
|
| + LinkedHashSetIterator($_set, $_modifications) {
|
| + this[_set] = $_set;
|
| + this[_modifications] = $_modifications;
|
| + this[_cell] = null;
|
| + this[_current] = dart.as(null, E);
|
| + this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCell);
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| moveNext() {
|
| - if (this._modifications !== dart.dload(this._set, '_modifications')) {
|
| - throw new core.ConcurrentModificationError(this._set);
|
| - } else if (this._cell === null) {
|
| - this._current = dart.as(null, E);
|
| + if (this[_modifications] !== dart.dload(this[_set], '_modifications')) {
|
| + throw new core.ConcurrentModificationError(this[_set]);
|
| + } else if (this[_cell] === null) {
|
| + this[_current] = dart.as(null, E);
|
| return false;
|
| } else {
|
| - this._current = dart.as(this._cell._element, E);
|
| - this._cell = this._cell._next;
|
| + this[_current] = dart.as(this[_cell][_element], E);
|
| + this[_cell] = this[_cell][_next];
|
| return true;
|
| }
|
| }
|
| @@ -1504,17 +1556,18 @@ var collection;
|
| return LinkedHashSetIterator;
|
| });
|
| let LinkedHashSetIterator = LinkedHashSetIterator$(dynamic);
|
| + let _source = Symbol('_source');
|
| let UnmodifiableListView$ = dart.generic(function(E) {
|
| class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) {
|
| UnmodifiableListView(source) {
|
| - this._source = source;
|
| + this[_source] = source;
|
| super.UnmodifiableListBase();
|
| }
|
| get length() {
|
| - return this._source.length;
|
| + return this[_source].length;
|
| }
|
| get(index) {
|
| - return this._source.elementAt(index);
|
| + return this[_source].elementAt(index);
|
| }
|
| }
|
| return UnmodifiableListView;
|
| @@ -1591,7 +1644,7 @@ var collection;
|
| let _HashSetBase$ = dart.generic(function(E) {
|
| class _HashSetBase extends SetBase$(E) {
|
| difference(other) {
|
| - let result = this._newSet();
|
| + let result = this[_newSet]();
|
| for (let element of this) {
|
| if (!dart.notNull(other.contains(element)))
|
| result.add(dart.as(element, E));
|
| @@ -1599,7 +1652,7 @@ var collection;
|
| return result;
|
| }
|
| intersection(other) {
|
| - let result = this._newSet();
|
| + let result = this[_newSet]();
|
| for (let element of this) {
|
| if (other.contains(element))
|
| result.add(dart.as(element, E));
|
| @@ -1610,7 +1663,7 @@ var collection;
|
| return ((_) => {
|
| _.addAll(this);
|
| return _;
|
| - }).bind(this)(this._newSet());
|
| + }).bind(this)(this[_newSet]());
|
| }
|
| }
|
| return _HashSetBase;
|
| @@ -1856,6 +1909,8 @@ var collection;
|
| return IterableMixin;
|
| });
|
| let IterableMixin = IterableMixin$(dynamic);
|
| + let _isToStringVisiting = Symbol('_isToStringVisiting');
|
| + let _iterablePartsToStrings = Symbol('_iterablePartsToStrings');
|
| let IterableBase$ = dart.generic(function(E) {
|
| class IterableBase extends dart.Object {
|
| IterableBase() {
|
| @@ -2093,14 +2148,14 @@ var collection;
|
| buffer.write(rightDelimiter);
|
| return buffer.toString();
|
| }
|
| - static _isToStringVisiting(o) {
|
| + static [_isToStringVisiting](o) {
|
| for (let i = 0; i < _toStringVisiting.length; i++) {
|
| if (core.identical(o, _toStringVisiting.get(i)))
|
| return true;
|
| }
|
| return false;
|
| }
|
| - static _iterablePartsToStrings(iterable, parts) {
|
| + static [_iterablePartsToStrings](iterable, parts) {
|
| let LENGTH_LIMIT = 80;
|
| let HEAD_COUNT = 3;
|
| let TAIL_COUNT = 2;
|
| @@ -2187,30 +2242,33 @@ var collection;
|
| return IterableBase;
|
| });
|
| let IterableBase = IterableBase$(dynamic);
|
| + let _iterator = Symbol('_iterator');
|
| + let _state = Symbol('_state');
|
| + let _move = Symbol('_move');
|
| let HasNextIterator$ = dart.generic(function(E) {
|
| class HasNextIterator extends dart.Object {
|
| - HasNextIterator(_iterator) {
|
| - this._iterator = _iterator;
|
| - this._state = _NOT_MOVED_YET;
|
| + HasNextIterator($_iterator) {
|
| + this[_iterator] = $_iterator;
|
| + this[_state] = _NOT_MOVED_YET;
|
| }
|
| get hasNext() {
|
| - if (this._state === _NOT_MOVED_YET)
|
| - this._move();
|
| - return this._state === _HAS_NEXT_AND_NEXT_IN_CURRENT;
|
| + if (this[_state] === _NOT_MOVED_YET)
|
| + this[_move]();
|
| + return this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT;
|
| }
|
| next() {
|
| if (!dart.notNull(this.hasNext))
|
| throw new core.StateError("No more elements");
|
| - dart.assert(this._state === _HAS_NEXT_AND_NEXT_IN_CURRENT);
|
| - let result = dart.as(this._iterator.current, E);
|
| - this._move();
|
| + dart.assert(this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT);
|
| + let result = dart.as(this[_iterator].current, E);
|
| + this[_move]();
|
| return result;
|
| }
|
| - _move() {
|
| - if (this._iterator.moveNext()) {
|
| - this._state = _HAS_NEXT_AND_NEXT_IN_CURRENT;
|
| + [_move]() {
|
| + if (this[_iterator].moveNext()) {
|
| + this[_state] = _HAS_NEXT_AND_NEXT_IN_CURRENT;
|
| } else {
|
| - this._state = _NO_NEXT;
|
| + this[_state] = _NO_NEXT;
|
| }
|
| }
|
| }
|
| @@ -2334,103 +2392,107 @@ var collection;
|
| return LinkedHashSet;
|
| });
|
| let LinkedHashSet = LinkedHashSet$(dynamic);
|
| + let _modificationCount = Symbol('_modificationCount');
|
| + let _insertAfter = Symbol('_insertAfter');
|
| + let _list = Symbol('_list');
|
| + let _unlink = Symbol('_unlink');
|
| let LinkedList$ = dart.generic(function(E) {
|
| class LinkedList extends IterableBase$(E) {
|
| LinkedList() {
|
| - this._modificationCount = 0;
|
| - this._length = 0;
|
| - this._next = null;
|
| - this._previous = null;
|
| + this[_modificationCount] = 0;
|
| + this[_length] = 0;
|
| + this[_next] = null;
|
| + this[_previous] = null;
|
| super.IterableBase();
|
| - this._next = this._previous = this;
|
| + this[_next] = this[_previous] = this;
|
| }
|
| addFirst(entry) {
|
| - this._insertAfter(this, entry);
|
| + this[_insertAfter](this, entry);
|
| }
|
| add(entry) {
|
| - this._insertAfter(this._previous, entry);
|
| + this[_insertAfter](this[_previous], entry);
|
| }
|
| addAll(entries) {
|
| - entries.forEach(((entry) => this._insertAfter(this._previous, dart.as(entry, E))).bind(this));
|
| + entries.forEach(((entry) => this[_insertAfter](this[_previous], dart.as(entry, E))).bind(this));
|
| }
|
| remove(entry) {
|
| - if (!dart.equals(entry._list, this))
|
| + if (!dart.equals(entry[_list], this))
|
| return false;
|
| - this._unlink(entry);
|
| + this[_unlink](entry);
|
| return true;
|
| }
|
| get iterator() {
|
| return new _LinkedListIterator(this);
|
| }
|
| get length() {
|
| - return this._length;
|
| + return this[_length];
|
| }
|
| clear() {
|
| - this._modificationCount++;
|
| - let next = this._next;
|
| + this[_modificationCount]++;
|
| + let next = this[_next];
|
| while (!dart.notNull(core.identical(next, this))) {
|
| let entry = dart.as(next, E);
|
| - next = entry._next;
|
| - entry._next = entry._previous = entry._list = null;
|
| + next = entry[_next];
|
| + entry[_next] = entry[_previous] = entry[_list] = null;
|
| }
|
| - this._next = this._previous = this;
|
| - this._length = 0;
|
| + this[_next] = this[_previous] = this;
|
| + this[_length] = 0;
|
| }
|
| get first() {
|
| - if (core.identical(this._next, this)) {
|
| + if (core.identical(this[_next], this)) {
|
| throw new core.StateError('No such element');
|
| }
|
| - return dart.as(this._next, E);
|
| + return dart.as(this[_next], E);
|
| }
|
| get last() {
|
| - if (core.identical(this._previous, this)) {
|
| + if (core.identical(this[_previous], this)) {
|
| throw new core.StateError('No such element');
|
| }
|
| - return dart.as(this._previous, E);
|
| + return dart.as(this[_previous], E);
|
| }
|
| get single() {
|
| - if (core.identical(this._previous, this)) {
|
| + if (core.identical(this[_previous], this)) {
|
| throw new core.StateError('No such element');
|
| }
|
| - if (!dart.notNull(core.identical(this._previous, this._next))) {
|
| + if (!dart.notNull(core.identical(this[_previous], this[_next]))) {
|
| throw new core.StateError('Too many elements');
|
| }
|
| - return dart.as(this._next, E);
|
| + return dart.as(this[_next], E);
|
| }
|
| forEach(action) {
|
| - let modificationCount = this._modificationCount;
|
| - let current = this._next;
|
| + let modificationCount = this[_modificationCount];
|
| + let current = this[_next];
|
| while (!dart.notNull(core.identical(current, this))) {
|
| action(dart.as(current, E));
|
| - if (modificationCount !== this._modificationCount) {
|
| + if (modificationCount !== this[_modificationCount]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| - current = current._next;
|
| + current = current[_next];
|
| }
|
| }
|
| get isEmpty() {
|
| - return this._length === 0;
|
| + return this[_length] === 0;
|
| }
|
| - _insertAfter(entry, newEntry) {
|
| + [_insertAfter](entry, newEntry) {
|
| if (newEntry.list !== null) {
|
| throw new core.StateError('LinkedListEntry is already in a LinkedList');
|
| }
|
| - this._modificationCount++;
|
| - newEntry._list = this;
|
| + this[_modificationCount]++;
|
| + newEntry[_list] = this;
|
| let predecessor = entry;
|
| - let successor = entry._next;
|
| - successor._previous = newEntry;
|
| - newEntry._previous = predecessor;
|
| - newEntry._next = successor;
|
| - predecessor._next = newEntry;
|
| - this._length++;
|
| - }
|
| - _unlink(entry) {
|
| - this._modificationCount++;
|
| - entry._next._previous = entry._previous;
|
| - entry._previous._next = entry._next;
|
| - this._length--;
|
| - entry._list = entry._next = entry._previous = null;
|
| + let successor = entry[_next];
|
| + successor[_previous] = newEntry;
|
| + newEntry[_previous] = predecessor;
|
| + newEntry[_next] = successor;
|
| + predecessor[_next] = newEntry;
|
| + this[_length]++;
|
| + }
|
| + [_unlink](entry) {
|
| + this[_modificationCount]++;
|
| + entry[_next][_previous] = entry[_previous];
|
| + entry[_previous][_next] = entry[_next];
|
| + this[_length]--;
|
| + entry[_list] = entry[_next] = entry[_previous] = null;
|
| }
|
| }
|
| return LinkedList;
|
| @@ -2439,24 +2501,24 @@ var collection;
|
| let _LinkedListIterator$ = dart.generic(function(E) {
|
| class _LinkedListIterator extends dart.Object {
|
| _LinkedListIterator(list) {
|
| - this._list = list;
|
| - this._modificationCount = list._modificationCount;
|
| - this._next = list._next;
|
| - this._current = null;
|
| + this[_list] = list;
|
| + this[_modificationCount] = list[_modificationCount];
|
| + this[_next] = list[_next];
|
| + this[_current] = null;
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| moveNext() {
|
| - if (core.identical(this._next, this._list)) {
|
| - this._current = null;
|
| + if (core.identical(this[_next], this[_list])) {
|
| + this[_current] = null;
|
| return false;
|
| }
|
| - if (this._modificationCount !== this._list._modificationCount) {
|
| + if (this[_modificationCount] !== this[_list][_modificationCount]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| - this._current = dart.as(this._next, E);
|
| - this._next = this._next._next;
|
| + this[_current] = dart.as(this[_next], E);
|
| + this[_next] = this[_next][_next];
|
| return true;
|
| }
|
| }
|
| @@ -2465,39 +2527,39 @@ var collection;
|
| let _LinkedListIterator = _LinkedListIterator$(dynamic);
|
| class _LinkedListLink extends dart.Object {
|
| _LinkedListLink() {
|
| - this._next = null;
|
| - this._previous = null;
|
| + this[_next] = null;
|
| + this[_previous] = null;
|
| }
|
| }
|
| let LinkedListEntry$ = dart.generic(function(E) {
|
| class LinkedListEntry extends dart.Object {
|
| LinkedListEntry() {
|
| - this._list = null;
|
| - this._next = null;
|
| - this._previous = null;
|
| + this[_list] = null;
|
| + this[_next] = null;
|
| + this[_previous] = null;
|
| }
|
| get list() {
|
| - return this._list;
|
| + return this[_list];
|
| }
|
| unlink() {
|
| - this._list._unlink(this);
|
| + this[_list]._unlink(this);
|
| }
|
| get next() {
|
| - if (core.identical(this._next, this._list))
|
| + if (core.identical(this[_next], this[_list]))
|
| return null;
|
| - let result = dart.as(this._next, E);
|
| + let result = dart.as(this[_next], E);
|
| return result;
|
| }
|
| get previous() {
|
| - if (core.identical(this._previous, this._list))
|
| + if (core.identical(this[_previous], this[_list]))
|
| return null;
|
| - return dart.as(this._previous, E);
|
| + return dart.as(this[_previous], E);
|
| }
|
| insertAfter(entry) {
|
| - this._list._insertAfter(this, entry);
|
| + this[_list]._insertAfter(this, entry);
|
| }
|
| insertBefore(entry) {
|
| - this._list._insertAfter(this._previous, entry);
|
| + this[_list]._insertAfter(this[_previous], entry);
|
| }
|
| }
|
| return LinkedListEntry;
|
| @@ -2512,6 +2574,7 @@ var collection;
|
| return ListBase;
|
| });
|
| let ListBase = ListBase$(dynamic);
|
| + let _filter = Symbol('_filter');
|
| let ListMixin$ = dart.generic(function(E) {
|
| class ListMixin extends dart.Object {
|
| get iterator() {
|
| @@ -2737,7 +2800,7 @@ var collection;
|
| retainWhere(test) {
|
| _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) → bool")), true);
|
| }
|
| - static _filter(source, test, retainMatching) {
|
| + static [_filter](source, test, retainMatching) {
|
| let retained = new List.from([]);
|
| let length = source.length;
|
| for (let i = 0; i < length; i++) {
|
| @@ -3023,30 +3086,30 @@ var collection;
|
| let UnmodifiableMapBase = UnmodifiableMapBase$(dynamic, dynamic);
|
| let _MapBaseValueIterable$ = dart.generic(function(V) {
|
| class _MapBaseValueIterable extends IterableBase$(V) {
|
| - _MapBaseValueIterable(_map) {
|
| - this._map = _map;
|
| + _MapBaseValueIterable($_map) {
|
| + this[_map] = $_map;
|
| super.IterableBase();
|
| }
|
| get length() {
|
| - return this._map.length;
|
| + return this[_map].length;
|
| }
|
| get isEmpty() {
|
| - return this._map.isEmpty;
|
| + return this[_map].isEmpty;
|
| }
|
| get isNotEmpty() {
|
| - return this._map.isNotEmpty;
|
| + return this[_map].isNotEmpty;
|
| }
|
| get first() {
|
| - return dart.as(this._map.get(this._map.keys.first), V);
|
| + return dart.as(this[_map].get(this[_map].keys.first), V);
|
| }
|
| get single() {
|
| - return dart.as(this._map.get(this._map.keys.single), V);
|
| + return dart.as(this[_map].get(this[_map].keys.single), V);
|
| }
|
| get last() {
|
| - return dart.as(this._map.get(this._map.keys.last), V);
|
| + return dart.as(this[_map].get(this[_map].keys.last), V);
|
| }
|
| get iterator() {
|
| - return new _MapBaseValueIterator(this._map);
|
| + return new _MapBaseValueIterator(this[_map]);
|
| }
|
| }
|
| return _MapBaseValueIterable;
|
| @@ -3055,20 +3118,20 @@ var collection;
|
| let _MapBaseValueIterator$ = dart.generic(function(V) {
|
| class _MapBaseValueIterator extends dart.Object {
|
| _MapBaseValueIterator(map) {
|
| - this._map = map;
|
| - this._keys = map.keys.iterator;
|
| - this._current = dart.as(null, V);
|
| + this[_map] = map;
|
| + this[_keys] = map.keys.iterator;
|
| + this[_current] = dart.as(null, V);
|
| }
|
| moveNext() {
|
| - if (this._keys.moveNext()) {
|
| - this._current = dart.as(this._map.get(this._keys.current), V);
|
| + if (this[_keys].moveNext()) {
|
| + this[_current] = dart.as(this[_map].get(this[_keys].current), V);
|
| return true;
|
| }
|
| - this._current = dart.as(null, V);
|
| + this[_current] = dart.as(null, V);
|
| return false;
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| }
|
| return _MapBaseValueIterator;
|
| @@ -3098,52 +3161,52 @@ var collection;
|
| let MapView$ = dart.generic(function(K, V) {
|
| class MapView extends dart.Object {
|
| MapView(map) {
|
| - this._map = map;
|
| + this[_map] = map;
|
| }
|
| get(key) {
|
| - return this._map.get(key);
|
| + return this[_map].get(key);
|
| }
|
| set(key, value) {
|
| - this._map.set(key, value);
|
| + this[_map].set(key, value);
|
| }
|
| addAll(other) {
|
| - this._map.addAll(other);
|
| + this[_map].addAll(other);
|
| }
|
| clear() {
|
| - this._map.clear();
|
| + this[_map].clear();
|
| }
|
| putIfAbsent(key, ifAbsent) {
|
| - return this._map.putIfAbsent(key, ifAbsent);
|
| + return this[_map].putIfAbsent(key, ifAbsent);
|
| }
|
| containsKey(key) {
|
| - return this._map.containsKey(key);
|
| + return this[_map].containsKey(key);
|
| }
|
| containsValue(value) {
|
| - return this._map.containsValue(value);
|
| + return this[_map].containsValue(value);
|
| }
|
| forEach(action) {
|
| - this._map.forEach(action);
|
| + this[_map].forEach(action);
|
| }
|
| get isEmpty() {
|
| - return this._map.isEmpty;
|
| + return this[_map].isEmpty;
|
| }
|
| get isNotEmpty() {
|
| - return this._map.isNotEmpty;
|
| + return this[_map].isNotEmpty;
|
| }
|
| get length() {
|
| - return this._map.length;
|
| + return this[_map].length;
|
| }
|
| get keys() {
|
| - return this._map.keys;
|
| + return this[_map].keys;
|
| }
|
| remove(key) {
|
| - return this._map.remove(key);
|
| + return this[_map].remove(key);
|
| }
|
| toString() {
|
| - return this._map.toString();
|
| + return this[_map].toString();
|
| }
|
| get values() {
|
| - return this._map.values;
|
| + return this[_map].values;
|
| }
|
| }
|
| return MapView;
|
| @@ -3155,6 +3218,10 @@ var collection;
|
| return UnmodifiableMapView;
|
| });
|
| let UnmodifiableMapView = UnmodifiableMapView$(dynamic, dynamic);
|
| + let _toStringVisiting = Symbol('_toStringVisiting');
|
| + let _id = Symbol('_id');
|
| + let _fillMapWithMappedIterable = Symbol('_fillMapWithMappedIterable');
|
| + let _fillMapWithIterables = Symbol('_fillMapWithIterables');
|
| class Maps extends dart.Object {
|
| static containsValue(map, value) {
|
| for (let v of map.values) {
|
| @@ -3208,7 +3275,7 @@ var collection;
|
| }
|
| let result = new core.StringBuffer();
|
| try {
|
| - IterableBase._toStringVisiting.add(m);
|
| + IterableBase[_toStringVisiting].add(m);
|
| result.write('{');
|
| let first = true;
|
| m.forEach(((k, v) => {
|
| @@ -3222,15 +3289,15 @@ var collection;
|
| }).bind(this));
|
| result.write('}');
|
| } finally {
|
| - dart.assert(core.identical(IterableBase._toStringVisiting.last, m));
|
| - IterableBase._toStringVisiting.removeLast();
|
| + dart.assert(core.identical(IterableBase[_toStringVisiting].last, m));
|
| + IterableBase[_toStringVisiting].removeLast();
|
| }
|
| return result.toString();
|
| }
|
| - static _id(x) {
|
| + static [_id](x) {
|
| return x;
|
| }
|
| - static _fillMapWithMappedIterable(map, iterable, key, value) {
|
| + static [_fillMapWithMappedIterable](map, iterable, key, value) {
|
| if (key === null)
|
| key = _id;
|
| if (value === null)
|
| @@ -3239,7 +3306,7 @@ var collection;
|
| map.set(key(element), value(element));
|
| }
|
| }
|
| - static _fillMapWithIterables(map, keys, values) {
|
| + static [_fillMapWithIterables](map, keys, values) {
|
| let keyIterator = keys.iterator;
|
| let valueIterator = values.iterator;
|
| let hasNextKey = keyIterator.moveNext();
|
| @@ -3267,46 +3334,48 @@ var collection;
|
| return Queue;
|
| });
|
| let Queue = Queue$(dynamic);
|
| + let _link = Symbol('_link');
|
| + let _asNonSentinelEntry = Symbol('_asNonSentinelEntry');
|
| let DoubleLinkedQueueEntry$ = dart.generic(function(E) {
|
| class DoubleLinkedQueueEntry extends dart.Object {
|
| DoubleLinkedQueueEntry(e) {
|
| - this._element = e;
|
| - this._previous = null;
|
| - this._next = null;
|
| + this[_element] = e;
|
| + this[_previous] = null;
|
| + this[_next] = null;
|
| }
|
| - _link(previous, next) {
|
| - this._next = next;
|
| - this._previous = previous;
|
| - previous._next = this;
|
| - next._previous = this;
|
| + [_link](previous, next) {
|
| + this[_next] = next;
|
| + this[_previous] = previous;
|
| + previous[_next] = this;
|
| + next[_previous] = this;
|
| }
|
| append(e) {
|
| - new DoubleLinkedQueueEntry(e)._link(this, this._next);
|
| + new DoubleLinkedQueueEntry(e)._link(this, this[_next]);
|
| }
|
| prepend(e) {
|
| - new DoubleLinkedQueueEntry(e)._link(this._previous, this);
|
| + new DoubleLinkedQueueEntry(e)._link(this[_previous], this);
|
| }
|
| remove() {
|
| - this._previous._next = this._next;
|
| - this._next._previous = this._previous;
|
| - this._next = null;
|
| - this._previous = null;
|
| - return this._element;
|
| + this[_previous][_next] = this[_next];
|
| + this[_next][_previous] = this[_previous];
|
| + this[_next] = null;
|
| + this[_previous] = null;
|
| + return this[_element];
|
| }
|
| - _asNonSentinelEntry() {
|
| + [_asNonSentinelEntry]() {
|
| return this;
|
| }
|
| previousEntry() {
|
| - return this._previous._asNonSentinelEntry();
|
| + return this[_previous]._asNonSentinelEntry();
|
| }
|
| nextEntry() {
|
| - return this._next._asNonSentinelEntry();
|
| + return this[_next]._asNonSentinelEntry();
|
| }
|
| get element() {
|
| - return this._element;
|
| + return this[_element];
|
| }
|
| set element(e) {
|
| - this._element = e;
|
| + this[_element] = e;
|
| }
|
| }
|
| return DoubleLinkedQueueEntry;
|
| @@ -3316,12 +3385,12 @@ var collection;
|
| class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) {
|
| _DoubleLinkedQueueEntrySentinel() {
|
| super.DoubleLinkedQueueEntry(dart.as(null, E));
|
| - this._link(this, this);
|
| + this[_link](this, this);
|
| }
|
| remove() {
|
| throw _internal.IterableElementError.noElement();
|
| }
|
| - _asNonSentinelEntry() {
|
| + [_asNonSentinelEntry]() {
|
| return null;
|
| }
|
| set element(e) {
|
| @@ -3334,13 +3403,15 @@ var collection;
|
| return _DoubleLinkedQueueEntrySentinel;
|
| });
|
| let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(dynamic);
|
| + let _sentinel = Symbol('_sentinel');
|
| + let _elementCount = Symbol('_elementCount');
|
| let DoubleLinkedQueue$ = dart.generic(function(E) {
|
| class DoubleLinkedQueue extends IterableBase$(E) {
|
| DoubleLinkedQueue() {
|
| - this._sentinel = null;
|
| - this._elementCount = 0;
|
| + this[_sentinel] = null;
|
| + this[_elementCount] = 0;
|
| super.IterableBase();
|
| - this._sentinel = new _DoubleLinkedQueueEntrySentinel();
|
| + this[_sentinel] = new _DoubleLinkedQueueEntrySentinel();
|
| }
|
| DoubleLinkedQueue$from(elements) {
|
| let list = dart.as(new DoubleLinkedQueue(), Queue$(E));
|
| @@ -3350,101 +3421,101 @@ var collection;
|
| return dart.as(list, DoubleLinkedQueue$(E));
|
| }
|
| get length() {
|
| - return this._elementCount;
|
| + return this[_elementCount];
|
| }
|
| addLast(value) {
|
| - this._sentinel.prepend(value);
|
| - this._elementCount++;
|
| + this[_sentinel].prepend(value);
|
| + this[_elementCount]++;
|
| }
|
| addFirst(value) {
|
| - this._sentinel.append(value);
|
| - this._elementCount++;
|
| + this[_sentinel].append(value);
|
| + this[_elementCount]++;
|
| }
|
| add(value) {
|
| - this._sentinel.prepend(value);
|
| - this._elementCount++;
|
| + this[_sentinel].prepend(value);
|
| + this[_elementCount]++;
|
| }
|
| addAll(iterable) {
|
| for (let value of iterable) {
|
| - this._sentinel.prepend(value);
|
| - this._elementCount++;
|
| + this[_sentinel].prepend(value);
|
| + this[_elementCount]++;
|
| }
|
| }
|
| removeLast() {
|
| - let result = this._sentinel._previous.remove();
|
| - this._elementCount--;
|
| + let result = this[_sentinel][_previous].remove();
|
| + this[_elementCount]--;
|
| return result;
|
| }
|
| removeFirst() {
|
| - let result = this._sentinel._next.remove();
|
| - this._elementCount--;
|
| + let result = this[_sentinel][_next].remove();
|
| + this[_elementCount]--;
|
| return result;
|
| }
|
| remove(o) {
|
| - let entry = this._sentinel._next;
|
| - while (!dart.notNull(core.identical(entry, this._sentinel))) {
|
| + let entry = this[_sentinel][_next];
|
| + while (!dart.notNull(core.identical(entry, this[_sentinel]))) {
|
| if (dart.equals(entry.element, o)) {
|
| entry.remove();
|
| - this._elementCount--;
|
| + this[_elementCount]--;
|
| return true;
|
| }
|
| - entry = entry._next;
|
| + entry = entry[_next];
|
| }
|
| return false;
|
| }
|
| - _filter(test, removeMatching) {
|
| - let entry = this._sentinel._next;
|
| - while (!dart.notNull(core.identical(entry, this._sentinel))) {
|
| - let next = entry._next;
|
| + [_filter](test, removeMatching) {
|
| + let entry = this[_sentinel][_next];
|
| + while (!dart.notNull(core.identical(entry, this[_sentinel]))) {
|
| + let next = entry[_next];
|
| if (core.identical(removeMatching, test(entry.element))) {
|
| entry.remove();
|
| - this._elementCount--;
|
| + this[_elementCount]--;
|
| }
|
| entry = next;
|
| }
|
| }
|
| removeWhere(test) {
|
| - this._filter(test, true);
|
| + this[_filter](test, true);
|
| }
|
| retainWhere(test) {
|
| - this._filter(test, false);
|
| + this[_filter](test, false);
|
| }
|
| get first() {
|
| - return this._sentinel._next.element;
|
| + return this[_sentinel][_next].element;
|
| }
|
| get last() {
|
| - return this._sentinel._previous.element;
|
| + return this[_sentinel][_previous].element;
|
| }
|
| get single() {
|
| - if (core.identical(this._sentinel._next, this._sentinel._previous)) {
|
| - return this._sentinel._next.element;
|
| + if (core.identical(this[_sentinel][_next], this[_sentinel][_previous])) {
|
| + return this[_sentinel][_next].element;
|
| }
|
| throw _internal.IterableElementError.tooMany();
|
| }
|
| lastEntry() {
|
| - return this._sentinel.previousEntry();
|
| + return this[_sentinel].previousEntry();
|
| }
|
| firstEntry() {
|
| - return this._sentinel.nextEntry();
|
| + return this[_sentinel].nextEntry();
|
| }
|
| get isEmpty() {
|
| - return core.identical(this._sentinel._next, this._sentinel);
|
| + return core.identical(this[_sentinel][_next], this[_sentinel]);
|
| }
|
| clear() {
|
| - this._sentinel._next = this._sentinel;
|
| - this._sentinel._previous = this._sentinel;
|
| - this._elementCount = 0;
|
| + this[_sentinel][_next] = this[_sentinel];
|
| + this[_sentinel][_previous] = this[_sentinel];
|
| + this[_elementCount] = 0;
|
| }
|
| forEachEntry(f) {
|
| - let entry = this._sentinel._next;
|
| - while (!dart.notNull(core.identical(entry, this._sentinel))) {
|
| - let nextEntry = entry._next;
|
| + let entry = this[_sentinel][_next];
|
| + while (!dart.notNull(core.identical(entry, this[_sentinel]))) {
|
| + let nextEntry = entry[_next];
|
| f(entry);
|
| entry = nextEntry;
|
| }
|
| }
|
| get iterator() {
|
| - return new _DoubleLinkedQueueIterator(this._sentinel);
|
| + return new _DoubleLinkedQueueIterator(this[_sentinel]);
|
| }
|
| toString() {
|
| return IterableBase.iterableToFullString(this, '{', '}');
|
| @@ -3454,39 +3525,49 @@ var collection;
|
| return DoubleLinkedQueue;
|
| });
|
| let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic);
|
| + let _nextEntry = Symbol('_nextEntry');
|
| let _DoubleLinkedQueueIterator$ = dart.generic(function(E) {
|
| class _DoubleLinkedQueueIterator extends dart.Object {
|
| _DoubleLinkedQueueIterator(sentinel) {
|
| - this._sentinel = sentinel;
|
| - this._nextEntry = sentinel._next;
|
| - this._current = dart.as(null, E);
|
| + this[_sentinel] = sentinel;
|
| + this[_nextEntry] = sentinel[_next];
|
| + this[_current] = dart.as(null, E);
|
| }
|
| moveNext() {
|
| - if (!dart.notNull(core.identical(this._nextEntry, this._sentinel))) {
|
| - this._current = this._nextEntry._element;
|
| - this._nextEntry = this._nextEntry._next;
|
| + if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) {
|
| + this[_current] = this[_nextEntry][_element];
|
| + this[_nextEntry] = this[_nextEntry][_next];
|
| return true;
|
| }
|
| - this._current = dart.as(null, E);
|
| - this._nextEntry = this._sentinel = null;
|
| + this[_current] = dart.as(null, E);
|
| + this[_nextEntry] = this[_sentinel] = null;
|
| return false;
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| }
|
| return _DoubleLinkedQueueIterator;
|
| });
|
| let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic);
|
| + let _head = Symbol('_head');
|
| + let _tail = Symbol('_tail');
|
| + let _table = Symbol('_table');
|
| + let _checkModification = Symbol('_checkModification');
|
| + let _writeToList = Symbol('_writeToList');
|
| + let _preGrow = Symbol('_preGrow');
|
| + let _grow = Symbol('_grow');
|
| + let _isPowerOf2 = Symbol('_isPowerOf2');
|
| + let _nextPowerOf2 = Symbol('_nextPowerOf2');
|
| let ListQueue$ = dart.generic(function(E) {
|
| class ListQueue extends IterableBase$(E) {
|
| ListQueue(initialCapacity) {
|
| if (initialCapacity === void 0)
|
| initialCapacity = null;
|
| - this._head = 0;
|
| - this._tail = 0;
|
| - this._table = null;
|
| - this._modificationCount = 0;
|
| + this[_head] = 0;
|
| + this[_tail] = 0;
|
| + this[_table] = null;
|
| + this[_modificationCount] = 0;
|
| super.IterableBase();
|
| if (dart.notNull(initialCapacity === null) || dart.notNull(initialCapacity < _INITIAL_CAPACITY)) {
|
| initialCapacity = _INITIAL_CAPACITY;
|
| @@ -3494,16 +3575,16 @@ var collection;
|
| initialCapacity = _nextPowerOf2(initialCapacity);
|
| }
|
| dart.assert(_isPowerOf2(initialCapacity));
|
| - this._table = new core.List(initialCapacity);
|
| + this[_table] = new core.List(initialCapacity);
|
| }
|
| ListQueue$from(elements) {
|
| if (dart.is(elements, core.List)) {
|
| let length = elements.length;
|
| let queue = dart.as(new ListQueue(length + 1), ListQueue$(E));
|
| - dart.assert(queue._table.length > length);
|
| + dart.assert(queue[_table].length > length);
|
| let sourceList = elements;
|
| - queue._table.setRange(0, length, dart.as(sourceList, core.Iterable$(E)), 0);
|
| - queue._tail = length;
|
| + queue[_table].setRange(0, length, dart.as(sourceList, core.Iterable$(E)), 0);
|
| + queue[_tail] = length;
|
| return queue;
|
| } else {
|
| let capacity = _INITIAL_CAPACITY;
|
| @@ -3521,38 +3602,38 @@ var collection;
|
| return new _ListQueueIterator(this);
|
| }
|
| forEach(action) {
|
| - let modificationCount = this._modificationCount;
|
| - for (let i = this._head; i !== this._tail; i = i + 1 & this._table.length - 1) {
|
| - action(this._table.get(i));
|
| - this._checkModification(modificationCount);
|
| + let modificationCount = this[_modificationCount];
|
| + for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].length - 1) {
|
| + action(this[_table].get(i));
|
| + this[_checkModification](modificationCount);
|
| }
|
| }
|
| get isEmpty() {
|
| - return this._head === this._tail;
|
| + return this[_head] === this[_tail];
|
| }
|
| get length() {
|
| - return this._tail - this._head & this._table.length - 1;
|
| + return this[_tail] - this[_head] & this[_table].length - 1;
|
| }
|
| get first() {
|
| - if (this._head === this._tail)
|
| + if (this[_head] === this[_tail])
|
| throw _internal.IterableElementError.noElement();
|
| - return this._table.get(this._head);
|
| + return this[_table].get(this[_head]);
|
| }
|
| get last() {
|
| - if (this._head === this._tail)
|
| + if (this[_head] === this[_tail])
|
| throw _internal.IterableElementError.noElement();
|
| - return this._table.get(this._tail - 1 & this._table.length - 1);
|
| + return this[_table].get(this[_tail] - 1 & this[_table].length - 1);
|
| }
|
| get single() {
|
| - if (this._head === this._tail)
|
| + if (this[_head] === this[_tail])
|
| throw _internal.IterableElementError.noElement();
|
| if (this.length > 1)
|
| throw _internal.IterableElementError.tooMany();
|
| - return this._table.get(this._head);
|
| + return this[_table].get(this[_head]);
|
| }
|
| elementAt(index) {
|
| core.RangeError.checkValidIndex(index, this);
|
| - return this._table.get(this._head + index & this._table.length - 1);
|
| + return this[_table].get(this[_head] + index & this[_table].length - 1);
|
| }
|
| toList(opt$) {
|
| let growable = opt$.growable === void 0 ? true : opt$.growable;
|
| @@ -3565,116 +3646,116 @@ var collection;
|
| } else {
|
| list = new core.List(this.length);
|
| }
|
| - this._writeToList(list);
|
| + this[_writeToList](list);
|
| return list;
|
| }
|
| add(element) {
|
| - this._add(element);
|
| + this[_add](element);
|
| }
|
| addAll(elements) {
|
| if (dart.is(elements, core.List)) {
|
| let list = dart.as(elements, core.List);
|
| let addCount = list.length;
|
| let length = this.length;
|
| - if (length + addCount >= this._table.length) {
|
| - this._preGrow(length + addCount);
|
| - this._table.setRange(length, length + addCount, dart.as(list, core.Iterable$(E)), 0);
|
| - this._tail = addCount;
|
| + if (length + addCount >= this[_table].length) {
|
| + this[_preGrow](length + addCount);
|
| + this[_table].setRange(length, length + addCount, dart.as(list, core.Iterable$(E)), 0);
|
| + this[_tail] = addCount;
|
| } else {
|
| - let endSpace = this._table.length - this._tail;
|
| + let endSpace = this[_table].length - this[_tail];
|
| if (addCount < endSpace) {
|
| - this._table.setRange(this._tail, this._tail + addCount, dart.as(list, core.Iterable$(E)), 0);
|
| - this._tail = addCount;
|
| + this[_table].setRange(this[_tail], this[_tail] + addCount, dart.as(list, core.Iterable$(E)), 0);
|
| + this[_tail] = addCount;
|
| } else {
|
| let preSpace = addCount - endSpace;
|
| - this._table.setRange(this._tail, this._tail + endSpace, dart.as(list, core.Iterable$(E)), 0);
|
| - this._table.setRange(0, preSpace, dart.as(list, core.Iterable$(E)), endSpace);
|
| - this._tail = preSpace;
|
| + this[_table].setRange(this[_tail], this[_tail] + endSpace, dart.as(list, core.Iterable$(E)), 0);
|
| + this[_table].setRange(0, preSpace, dart.as(list, core.Iterable$(E)), endSpace);
|
| + this[_tail] = preSpace;
|
| }
|
| }
|
| - this._modificationCount++;
|
| + this[_modificationCount]++;
|
| } else {
|
| for (let element of elements)
|
| - this._add(element);
|
| + this[_add](element);
|
| }
|
| }
|
| remove(object) {
|
| - for (let i = this._head; i !== this._tail; i = i + 1 & this._table.length - 1) {
|
| - let element = this._table.get(i);
|
| + for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].length - 1) {
|
| + let element = this[_table].get(i);
|
| if (dart.equals(element, object)) {
|
| - this._remove(i);
|
| - this._modificationCount++;
|
| + this[_remove](i);
|
| + this[_modificationCount]++;
|
| return true;
|
| }
|
| }
|
| return false;
|
| }
|
| - _filterWhere(test, removeMatching) {
|
| - let index = this._head;
|
| - let modificationCount = this._modificationCount;
|
| - let i = this._head;
|
| - while (i !== this._tail) {
|
| - let element = this._table.get(i);
|
| + [_filterWhere](test, removeMatching) {
|
| + let index = this[_head];
|
| + let modificationCount = this[_modificationCount];
|
| + let i = this[_head];
|
| + while (i !== this[_tail]) {
|
| + let element = this[_table].get(i);
|
| let remove = core.identical(removeMatching, test(element));
|
| - this._checkModification(modificationCount);
|
| + this[_checkModification](modificationCount);
|
| if (remove) {
|
| - i = this._remove(i);
|
| - modificationCount = ++this._modificationCount;
|
| + i = this[_remove](i);
|
| + modificationCount = ++this[_modificationCount];
|
| } else {
|
| - i = i + 1 & this._table.length - 1;
|
| + i = i + 1 & this[_table].length - 1;
|
| }
|
| }
|
| }
|
| removeWhere(test) {
|
| - this._filterWhere(test, true);
|
| + this[_filterWhere](test, true);
|
| }
|
| retainWhere(test) {
|
| - this._filterWhere(test, false);
|
| + this[_filterWhere](test, false);
|
| }
|
| clear() {
|
| - if (this._head !== this._tail) {
|
| - for (let i = this._head; i !== this._tail; i = i + 1 & this._table.length - 1) {
|
| - this._table.set(i, dart.as(null, E));
|
| + if (this[_head] !== this[_tail]) {
|
| + for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].length - 1) {
|
| + this[_table].set(i, dart.as(null, E));
|
| }
|
| - this._head = this._tail = 0;
|
| - this._modificationCount++;
|
| + this[_head] = this[_tail] = 0;
|
| + this[_modificationCount]++;
|
| }
|
| }
|
| toString() {
|
| return IterableBase.iterableToFullString(this, "{", "}");
|
| }
|
| addLast(element) {
|
| - this._add(element);
|
| + this[_add](element);
|
| }
|
| addFirst(element) {
|
| - this._head = this._head - 1 & this._table.length - 1;
|
| - this._table.set(this._head, element);
|
| - if (this._head === this._tail)
|
| - this._grow();
|
| - this._modificationCount++;
|
| + this[_head] = this[_head] - 1 & this[_table].length - 1;
|
| + this[_table].set(this[_head], element);
|
| + if (this[_head] === this[_tail])
|
| + this[_grow]();
|
| + this[_modificationCount]++;
|
| }
|
| removeFirst() {
|
| - if (this._head === this._tail)
|
| + if (this[_head] === this[_tail])
|
| throw _internal.IterableElementError.noElement();
|
| - this._modificationCount++;
|
| - let result = this._table.get(this._head);
|
| - this._table.set(this._head, dart.as(null, E));
|
| - this._head = this._head + 1 & this._table.length - 1;
|
| + this[_modificationCount]++;
|
| + let result = this[_table].get(this[_head]);
|
| + this[_table].set(this[_head], dart.as(null, E));
|
| + this[_head] = this[_head] + 1 & this[_table].length - 1;
|
| return result;
|
| }
|
| removeLast() {
|
| - if (this._head === this._tail)
|
| + if (this[_head] === this[_tail])
|
| throw _internal.IterableElementError.noElement();
|
| - this._modificationCount++;
|
| - this._tail = this._tail - 1 & this._table.length - 1;
|
| - let result = this._table.get(this._tail);
|
| - this._table.set(this._tail, dart.as(null, E));
|
| + this[_modificationCount]++;
|
| + this[_tail] = this[_tail] - 1 & this[_table].length - 1;
|
| + let result = this[_table].get(this[_tail]);
|
| + this[_table].set(this[_tail], dart.as(null, E));
|
| return result;
|
| }
|
| - static _isPowerOf2(number) {
|
| + static [_isPowerOf2](number) {
|
| return (number & number - 1) === 0;
|
| }
|
| - static _nextPowerOf2(number) {
|
| + static [_nextPowerOf2](number) {
|
| dart.assert(number > 0);
|
| number = (number << 1) - 1;
|
| for (;;) {
|
| @@ -3684,74 +3765,74 @@ var collection;
|
| number = nextNumber;
|
| }
|
| }
|
| - _checkModification(expectedModificationCount) {
|
| - if (expectedModificationCount !== this._modificationCount) {
|
| + [_checkModification](expectedModificationCount) {
|
| + if (expectedModificationCount !== this[_modificationCount]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| }
|
| - _add(element) {
|
| - this._table.set(this._tail, element);
|
| - this._tail = this._tail + 1 & this._table.length - 1;
|
| - if (this._head === this._tail)
|
| - this._grow();
|
| - this._modificationCount++;
|
| + [_add](element) {
|
| + this[_table].set(this[_tail], element);
|
| + this[_tail] = this[_tail] + 1 & this[_table].length - 1;
|
| + if (this[_head] === this[_tail])
|
| + this[_grow]();
|
| + this[_modificationCount]++;
|
| }
|
| - _remove(offset) {
|
| - let mask = this._table.length - 1;
|
| - let startDistance = offset - this._head & mask;
|
| - let endDistance = this._tail - offset & mask;
|
| + [_remove](offset) {
|
| + let mask = this[_table].length - 1;
|
| + let startDistance = offset - this[_head] & mask;
|
| + let endDistance = this[_tail] - offset & mask;
|
| if (startDistance < endDistance) {
|
| let i = offset;
|
| - while (i !== this._head) {
|
| + while (i !== this[_head]) {
|
| let prevOffset = i - 1 & mask;
|
| - this._table.set(i, this._table.get(prevOffset));
|
| + this[_table].set(i, this[_table].get(prevOffset));
|
| i = prevOffset;
|
| }
|
| - this._table.set(this._head, dart.as(null, E));
|
| - this._head = this._head + 1 & mask;
|
| + this[_table].set(this[_head], dart.as(null, E));
|
| + this[_head] = this[_head] + 1 & mask;
|
| return offset + 1 & mask;
|
| } else {
|
| - this._tail = this._tail - 1 & mask;
|
| + this[_tail] = this[_tail] - 1 & mask;
|
| let i = offset;
|
| - while (i !== this._tail) {
|
| + while (i !== this[_tail]) {
|
| let nextOffset = i + 1 & mask;
|
| - this._table.set(i, this._table.get(nextOffset));
|
| + this[_table].set(i, this[_table].get(nextOffset));
|
| i = nextOffset;
|
| }
|
| - this._table.set(this._tail, dart.as(null, E));
|
| + this[_table].set(this[_tail], dart.as(null, E));
|
| return offset;
|
| }
|
| }
|
| - _grow() {
|
| - let newTable = new core.List(this._table.length * 2);
|
| - let split = this._table.length - this._head;
|
| - newTable.setRange(0, split, this._table, this._head);
|
| - newTable.setRange(split, split + this._head, this._table, 0);
|
| - this._head = 0;
|
| - this._tail = this._table.length;
|
| - this._table = newTable;
|
| + [_grow]() {
|
| + let newTable = new core.List(this[_table].length * 2);
|
| + let split = this[_table].length - this[_head];
|
| + newTable.setRange(0, split, this[_table], this[_head]);
|
| + newTable.setRange(split, split + this[_head], this[_table], 0);
|
| + this[_head] = 0;
|
| + this[_tail] = this[_table].length;
|
| + this[_table] = newTable;
|
| }
|
| - _writeToList(target) {
|
| + [_writeToList](target) {
|
| dart.assert(target.length >= this.length);
|
| - if (this._head <= this._tail) {
|
| - let length = this._tail - this._head;
|
| - target.setRange(0, length, this._table, this._head);
|
| + if (this[_head] <= this[_tail]) {
|
| + let length = this[_tail] - this[_head];
|
| + target.setRange(0, length, this[_table], this[_head]);
|
| return length;
|
| } else {
|
| - let firstPartSize = this._table.length - this._head;
|
| - target.setRange(0, firstPartSize, this._table, this._head);
|
| - target.setRange(firstPartSize, firstPartSize + this._tail, this._table, 0);
|
| - return this._tail + firstPartSize;
|
| + let firstPartSize = this[_table].length - this[_head];
|
| + target.setRange(0, firstPartSize, this[_table], this[_head]);
|
| + target.setRange(firstPartSize, firstPartSize + this[_tail], this[_table], 0);
|
| + return this[_tail] + firstPartSize;
|
| }
|
| }
|
| - _preGrow(newElementCount) {
|
| + [_preGrow](newElementCount) {
|
| dart.assert(newElementCount >= this.length);
|
| newElementCount = newElementCount >> 1;
|
| let newCapacity = _nextPowerOf2(newElementCount);
|
| let newTable = new core.List(newCapacity);
|
| - this._tail = this._writeToList(newTable);
|
| - this._table = newTable;
|
| - this._head = 0;
|
| + this[_tail] = this[_writeToList](newTable);
|
| + this[_table] = newTable;
|
| + this[_head] = 0;
|
| }
|
| }
|
| dart.defineNamedConstructor(ListQueue, 'from');
|
| @@ -3759,26 +3840,29 @@ var collection;
|
| return ListQueue;
|
| });
|
| let ListQueue = ListQueue$(dynamic);
|
| + let _queue = Symbol('_queue');
|
| + let _end = Symbol('_end');
|
| + let _position = Symbol('_position');
|
| let _ListQueueIterator$ = dart.generic(function(E) {
|
| class _ListQueueIterator extends dart.Object {
|
| _ListQueueIterator(queue) {
|
| - this._queue = queue;
|
| - this._end = queue._tail;
|
| - this._modificationCount = queue._modificationCount;
|
| - this._position = queue._head;
|
| - this._current = dart.as(null, E);
|
| + this[_queue] = queue;
|
| + this[_end] = queue[_tail];
|
| + this[_modificationCount] = queue[_modificationCount];
|
| + this[_position] = queue[_head];
|
| + this[_current] = dart.as(null, E);
|
| }
|
| get current() {
|
| - return this._current;
|
| + return this[_current];
|
| }
|
| moveNext() {
|
| - this._queue._checkModification(this._modificationCount);
|
| - if (this._position === this._end) {
|
| - this._current = dart.as(null, E);
|
| + this[_queue]._checkModification(this[_modificationCount]);
|
| + if (this[_position] === this[_end]) {
|
| + this[_current] = dart.as(null, E);
|
| return false;
|
| }
|
| - this._current = dart.as(this._queue._table.get(this._position), E);
|
| - this._position = this._position + 1 & this._queue._table.length - 1;
|
| + this[_current] = dart.as(this[_queue][_table].get(this[_position]), E);
|
| + this[_position] = this[_position] + 1 & this[_queue][_table].length - 1;
|
| return true;
|
| }
|
| }
|
| @@ -4061,28 +4145,38 @@ var collection;
|
| return _SplayTreeMapNode;
|
| });
|
| let _SplayTreeMapNode = _SplayTreeMapNode$(dynamic, dynamic);
|
| + let _dummy = Symbol('_dummy');
|
| + let _root = Symbol('_root');
|
| + let _count = Symbol('_count');
|
| + let _splayCount = Symbol('_splayCount');
|
| + let _splay = Symbol('_splay');
|
| + let _compare = Symbol('_compare');
|
| + let _splayMin = Symbol('_splayMin');
|
| + let _splayMax = Symbol('_splayMax');
|
| + let _addNewRoot = Symbol('_addNewRoot');
|
| + let _clear = Symbol('_clear');
|
| let _SplayTree$ = dart.generic(function(K) {
|
| class _SplayTree extends dart.Object {
|
| _SplayTree() {
|
| - this._dummy = new _SplayTreeNode(dart.as(null, K));
|
| - this._root = null;
|
| - this._count = 0;
|
| - this._modificationCount = 0;
|
| - this._splayCount = 0;
|
| - }
|
| - _splay(key) {
|
| - if (this._root === null)
|
| + this[_dummy] = new _SplayTreeNode(dart.as(null, K));
|
| + this[_root] = null;
|
| + this[_count] = 0;
|
| + this[_modificationCount] = 0;
|
| + this[_splayCount] = 0;
|
| + }
|
| + [_splay](key) {
|
| + if (this[_root] === null)
|
| return -1;
|
| - let left = this._dummy;
|
| - let right = this._dummy;
|
| - let current = this._root;
|
| + let left = this[_dummy];
|
| + let right = this[_dummy];
|
| + let current = this[_root];
|
| let comp = null;
|
| while (true) {
|
| - comp = this._compare(current.key, key);
|
| + comp = this[_compare](current.key, key);
|
| if (comp > 0) {
|
| if (current.left === null)
|
| break;
|
| - comp = this._compare(current.left.key, key);
|
| + comp = this[_compare](current.left.key, key);
|
| if (comp > 0) {
|
| let tmp = current.left;
|
| current.left = tmp.right;
|
| @@ -4097,7 +4191,7 @@ var collection;
|
| } else if (comp < 0) {
|
| if (current.right === null)
|
| break;
|
| - comp = this._compare(current.right.key, key);
|
| + comp = this[_compare](current.right.key, key);
|
| if (comp < 0) {
|
| let tmp = current.right;
|
| current.right = tmp.left;
|
| @@ -4115,15 +4209,15 @@ var collection;
|
| }
|
| left.right = current.left;
|
| right.left = current.right;
|
| - current.left = this._dummy.right;
|
| - current.right = this._dummy.left;
|
| - this._root = current;
|
| - this._dummy.right = null;
|
| - this._dummy.left = null;
|
| - this._splayCount++;
|
| + current.left = this[_dummy].right;
|
| + current.right = this[_dummy].left;
|
| + this[_root] = current;
|
| + this[_dummy].right = null;
|
| + this[_dummy].left = null;
|
| + this[_splayCount]++;
|
| return comp;
|
| }
|
| - _splayMin(node) {
|
| + [_splayMin](node) {
|
| let current = node;
|
| while (current.left !== null) {
|
| let left = current.left;
|
| @@ -4133,7 +4227,7 @@ var collection;
|
| }
|
| return dart.as(current, _SplayTreeNode$(K));
|
| }
|
| - _splayMax(node) {
|
| + [_splayMax](node) {
|
| let current = node;
|
| while (current.right !== null) {
|
| let right = current.right;
|
| @@ -4143,58 +4237,58 @@ var collection;
|
| }
|
| return dart.as(current, _SplayTreeNode$(K));
|
| }
|
| - _remove(key) {
|
| - if (this._root === null)
|
| + [_remove](key) {
|
| + if (this[_root] === null)
|
| return null;
|
| - let comp = this._splay(key);
|
| + let comp = this[_splay](key);
|
| if (comp !== 0)
|
| return null;
|
| - let result = this._root;
|
| - this._count--;
|
| - if (this._root.left === null) {
|
| - this._root = this._root.right;
|
| + let result = this[_root];
|
| + this[_count]--;
|
| + if (this[_root].left === null) {
|
| + this[_root] = this[_root].right;
|
| } else {
|
| - let right = this._root.right;
|
| - this._root = this._splayMax(this._root.left);
|
| - this._root.right = right;
|
| + let right = this[_root].right;
|
| + this[_root] = this[_splayMax](this[_root].left);
|
| + this[_root].right = right;
|
| }
|
| - this._modificationCount++;
|
| + this[_modificationCount]++;
|
| return result;
|
| }
|
| - _addNewRoot(node, comp) {
|
| - this._count++;
|
| - this._modificationCount++;
|
| - if (this._root === null) {
|
| - this._root = node;
|
| + [_addNewRoot](node, comp) {
|
| + this[_count]++;
|
| + this[_modificationCount]++;
|
| + if (this[_root] === null) {
|
| + this[_root] = node;
|
| return;
|
| }
|
| if (comp < 0) {
|
| - node.left = this._root;
|
| - node.right = this._root.right;
|
| - this._root.right = null;
|
| + node.left = this[_root];
|
| + node.right = this[_root].right;
|
| + this[_root].right = null;
|
| } else {
|
| - node.right = this._root;
|
| - node.left = this._root.left;
|
| - this._root.left = null;
|
| + node.right = this[_root];
|
| + node.left = this[_root].left;
|
| + this[_root].left = null;
|
| }
|
| - this._root = node;
|
| + this[_root] = node;
|
| }
|
| - get _first() {
|
| - if (this._root === null)
|
| + get [_first]() {
|
| + if (this[_root] === null)
|
| return null;
|
| - this._root = this._splayMin(this._root);
|
| - return this._root;
|
| + this[_root] = this[_splayMin](this[_root]);
|
| + return this[_root];
|
| }
|
| - get _last() {
|
| - if (this._root === null)
|
| + get [_last]() {
|
| + if (this[_root] === null)
|
| return null;
|
| - this._root = this._splayMax(this._root);
|
| - return this._root;
|
| + this[_root] = this[_splayMax](this[_root]);
|
| + return this[_root];
|
| }
|
| - _clear() {
|
| - this._root = null;
|
| - this._count = 0;
|
| - this._modificationCount++;
|
| + [_clear]() {
|
| + this[_root] = null;
|
| + this[_count] = 0;
|
| + this[_modificationCount]++;
|
| }
|
| }
|
| return _SplayTree;
|
| @@ -4209,6 +4303,7 @@ var collection;
|
| return _TypeTest;
|
| });
|
| let _TypeTest = _TypeTest$(dynamic);
|
| + let _comparator = Symbol('_comparator');
|
| let SplayTreeMap$ = dart.generic(function(K, V) {
|
| class SplayTreeMap extends _SplayTree$(K) {
|
| SplayTreeMap(compare, isValidKey) {
|
| @@ -4216,8 +4311,8 @@ var collection;
|
| compare = null;
|
| if (isValidKey === void 0)
|
| isValidKey = null;
|
| - this._comparator = dart.as(compare === null ? core.Comparable.compare : compare, core.Comparator);
|
| - this._validKey = dart.as(isValidKey !== null ? isValidKey : (v) => dart.is(v, K), _Predicate);
|
| + this[_comparator] = dart.as(compare === null ? core.Comparable.compare : compare, core.Comparator);
|
| + this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart.is(v, K), _Predicate);
|
| super._SplayTree();
|
| }
|
| SplayTreeMap$from(other, compare, isValidKey) {
|
| @@ -4249,32 +4344,32 @@ var collection;
|
| Maps._fillMapWithIterables(map, keys, values);
|
| return map;
|
| }
|
| - _compare(key1, key2) {
|
| - return this._comparator(key1, key2);
|
| + [_compare](key1, key2) {
|
| + return this[_comparator](key1, key2);
|
| }
|
| SplayTreeMap$_internal() {
|
| - this._comparator = null;
|
| - this._validKey = null;
|
| + this[_comparator] = null;
|
| + this[_validKey] = null;
|
| super._SplayTree();
|
| }
|
| get(key) {
|
| if (key === null)
|
| throw new core.ArgumentError(key);
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return dart.as(null, V);
|
| - if (this._root !== null) {
|
| - let comp = this._splay(dart.as(key, K));
|
| + if (this[_root] !== null) {
|
| + let comp = this[_splay](dart.as(key, K));
|
| if (comp === 0) {
|
| - let mapRoot = dart.as(this._root, _SplayTreeMapNode);
|
| + let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
|
| return dart.as(mapRoot.value, V);
|
| }
|
| }
|
| return dart.as(null, V);
|
| }
|
| remove(key) {
|
| - if (!dart.notNull(this._validKey(key)))
|
| + if (!dart.notNull(this[_validKey](key)))
|
| return dart.as(null, V);
|
| - let mapRoot = dart.as(this._remove(dart.as(key, K)), _SplayTreeMapNode);
|
| + let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode);
|
| if (mapRoot !== null)
|
| return dart.as(mapRoot.value, V);
|
| return dart.as(null, V);
|
| @@ -4282,33 +4377,33 @@ var collection;
|
| set(key, value) {
|
| if (key === null)
|
| throw new core.ArgumentError(key);
|
| - let comp = this._splay(key);
|
| + let comp = this[_splay](key);
|
| if (comp === 0) {
|
| - let mapRoot = dart.as(this._root, _SplayTreeMapNode);
|
| + let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
|
| mapRoot.value = value;
|
| return;
|
| }
|
| - this._addNewRoot(dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNode$(K)), comp);
|
| + this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNode$(K)), comp);
|
| }
|
| putIfAbsent(key, ifAbsent) {
|
| if (key === null)
|
| throw new core.ArgumentError(key);
|
| - let comp = this._splay(key);
|
| + let comp = this[_splay](key);
|
| if (comp === 0) {
|
| - let mapRoot = dart.as(this._root, _SplayTreeMapNode);
|
| + let mapRoot = dart.as(this[_root], _SplayTreeMapNode);
|
| return dart.as(mapRoot.value, V);
|
| }
|
| - let modificationCount = this._modificationCount;
|
| - let splayCount = this._splayCount;
|
| + let modificationCount = this[_modificationCount];
|
| + let splayCount = this[_splayCount];
|
| let value = ifAbsent();
|
| - if (modificationCount !== this._modificationCount) {
|
| + if (modificationCount !== this[_modificationCount]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| - if (splayCount !== this._splayCount) {
|
| - comp = this._splay(key);
|
| + if (splayCount !== this[_splayCount]) {
|
| + comp = this[_splay](key);
|
| dart.assert(comp !== 0);
|
| }
|
| - this._addNewRoot(dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNode$(K)), comp);
|
| + this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNode$(K)), comp);
|
| return value;
|
| }
|
| addAll(other) {
|
| @@ -4317,7 +4412,7 @@ var collection;
|
| }).bind(this));
|
| }
|
| get isEmpty() {
|
| - return this._root === null;
|
| + return this[_root] === null;
|
| }
|
| get isNotEmpty() {
|
| return !dart.notNull(this.isEmpty);
|
| @@ -4330,23 +4425,23 @@ var collection;
|
| }
|
| }
|
| get length() {
|
| - return this._count;
|
| + return this[_count];
|
| }
|
| clear() {
|
| - this._clear();
|
| + this[_clear]();
|
| }
|
| containsKey(key) {
|
| - return dart.notNull(this._validKey(key)) && dart.notNull(this._splay(dart.as(key, K)) === 0);
|
| + return dart.notNull(this[_validKey](key)) && dart.notNull(this[_splay](dart.as(key, K)) === 0);
|
| }
|
| containsValue(value) {
|
| let found = false;
|
| - let initialSplayCount = this._splayCount;
|
| + let initialSplayCount = this[_splayCount];
|
| // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool
|
| function visit(node) {
|
| while (node !== null) {
|
| if (dart.equals(node.value, value))
|
| return true;
|
| - if (initialSplayCount !== this._splayCount) {
|
| + if (initialSplayCount !== this[_splayCount]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| if (dart.notNull(node.right !== null) && dart.notNull(visit(dart.as(node.right, _SplayTreeMapNode))))
|
| @@ -4355,7 +4450,7 @@ var collection;
|
| }
|
| return false;
|
| }
|
| - return visit(dart.as(this._root, _SplayTreeMapNode));
|
| + return visit(dart.as(this[_root], _SplayTreeMapNode));
|
| }
|
| get keys() {
|
| return new _SplayTreeKeyIterable(this);
|
| @@ -4367,24 +4462,24 @@ var collection;
|
| return Maps.mapToString(this);
|
| }
|
| firstKey() {
|
| - if (this._root === null)
|
| + if (this[_root] === null)
|
| return dart.as(null, K);
|
| - return dart.as(this._first.key, K);
|
| + return dart.as(this[_first].key, K);
|
| }
|
| lastKey() {
|
| - if (this._root === null)
|
| + if (this[_root] === null)
|
| return dart.as(null, K);
|
| - return dart.as(this._last.key, K);
|
| + return dart.as(this[_last].key, K);
|
| }
|
| lastKeyBefore(key) {
|
| if (key === null)
|
| throw new core.ArgumentError(key);
|
| - if (this._root === null)
|
| + if (this[_root] === null)
|
| return dart.as(null, K);
|
| - let comp = this._splay(key);
|
| + let comp = this[_splay](key);
|
| if (comp < 0)
|
| - return this._root.key;
|
| - let node = this._root.left;
|
| + return this[_root].key;
|
| + let node = this[_root].left;
|
| if (node === null)
|
| return dart.as(null, K);
|
| while (node.right !== null) {
|
| @@ -4395,12 +4490,12 @@ var collection;
|
| firstKeyAfter(key) {
|
| if (key === null)
|
| throw new core.ArgumentError(key);
|
| - if (this._root === null)
|
| + if (this[_root] === null)
|
| return dart.as(null, K);
|
| - let comp = this._splay(key);
|
| + let comp = this[_splay](key);
|
| if (comp > 0)
|
| - return this._root.key;
|
| - let node = this._root.right;
|
| + return this[_root].key;
|
| + let node = this[_root].right;
|
| if (node === null)
|
| return dart.as(null, K);
|
| while (node.left !== null) {
|
| @@ -4416,67 +4511,73 @@ var collection;
|
| return SplayTreeMap;
|
| });
|
| let SplayTreeMap = SplayTreeMap$(dynamic, dynamic);
|
| + let _workList = Symbol('_workList');
|
| + let _tree = Symbol('_tree');
|
| + let _currentNode = Symbol('_currentNode');
|
| + let _findLeftMostDescendent = Symbol('_findLeftMostDescendent');
|
| + let _getValue = Symbol('_getValue');
|
| + let _rebuildWorkList = Symbol('_rebuildWorkList');
|
| let _SplayTreeIterator$ = dart.generic(function(T) {
|
| class _SplayTreeIterator extends dart.Object {
|
| _SplayTreeIterator(tree) {
|
| - this._workList = new List.from([]);
|
| - this._tree = tree;
|
| - this._modificationCount = tree._modificationCount;
|
| - this._splayCount = tree._splayCount;
|
| - this._currentNode = null;
|
| - this._findLeftMostDescendent(tree._root);
|
| + this[_workList] = new List.from([]);
|
| + this[_tree] = tree;
|
| + this[_modificationCount] = tree[_modificationCount];
|
| + this[_splayCount] = tree[_splayCount];
|
| + this[_currentNode] = null;
|
| + this[_findLeftMostDescendent](tree[_root]);
|
| }
|
| _SplayTreeIterator$startAt(tree, startKey) {
|
| - this._workList = new List.from([]);
|
| - this._tree = tree;
|
| - this._modificationCount = tree._modificationCount;
|
| - this._splayCount = dart.as(null, core.int);
|
| - this._currentNode = null;
|
| - if (tree._root === null)
|
| + this[_workList] = new List.from([]);
|
| + this[_tree] = tree;
|
| + this[_modificationCount] = tree[_modificationCount];
|
| + this[_splayCount] = dart.as(null, core.int);
|
| + this[_currentNode] = null;
|
| + if (tree[_root] === null)
|
| return;
|
| let compare = tree._splay(startKey);
|
| - this._splayCount = tree._splayCount;
|
| + this[_splayCount] = tree[_splayCount];
|
| if (compare < 0) {
|
| - this._findLeftMostDescendent(tree._root.right);
|
| + this[_findLeftMostDescendent](tree[_root].right);
|
| } else {
|
| - this._workList.add(tree._root);
|
| + this[_workList].add(tree[_root]);
|
| }
|
| }
|
| get current() {
|
| - if (this._currentNode === null)
|
| + if (this[_currentNode] === null)
|
| return dart.as(null, T);
|
| - return this._getValue(this._currentNode);
|
| + return this[_getValue](this[_currentNode]);
|
| }
|
| - _findLeftMostDescendent(node) {
|
| + [_findLeftMostDescendent](node) {
|
| while (node !== null) {
|
| - this._workList.add(node);
|
| + this[_workList].add(node);
|
| node = node.left;
|
| }
|
| }
|
| - _rebuildWorkList(currentNode) {
|
| - dart.assert(!dart.notNull(this._workList.isEmpty));
|
| - this._workList.clear();
|
| + [_rebuildWorkList](currentNode) {
|
| + dart.assert(!dart.notNull(this[_workList].isEmpty));
|
| + this[_workList].clear();
|
| if (currentNode === null) {
|
| - this._findLeftMostDescendent(this._tree._root);
|
| + this[_findLeftMostDescendent](this[_tree][_root]);
|
| } else {
|
| - this._tree._splay(currentNode.key);
|
| - this._findLeftMostDescendent(this._tree._root.right);
|
| - dart.assert(!dart.notNull(this._workList.isEmpty));
|
| + this[_tree]._splay(currentNode.key);
|
| + this[_findLeftMostDescendent](this[_tree][_root].right);
|
| + dart.assert(!dart.notNull(this[_workList].isEmpty));
|
| }
|
| }
|
| moveNext() {
|
| - if (this._modificationCount !== this._tree._modificationCount) {
|
| - throw new core.ConcurrentModificationError(this._tree);
|
| + if (this[_modificationCount] !== this[_tree][_modificationCount]) {
|
| + throw new core.ConcurrentModificationError(this[_tree]);
|
| }
|
| - if (this._workList.isEmpty) {
|
| - this._currentNode = null;
|
| + if (this[_workList].isEmpty) {
|
| + this[_currentNode] = null;
|
| return false;
|
| }
|
| - if (dart.notNull(this._tree._splayCount !== this._splayCount) && dart.notNull(this._currentNode !== null)) {
|
| - this._rebuildWorkList(this._currentNode);
|
| + if (dart.notNull(this[_tree][_splayCount] !== this[_splayCount]) && dart.notNull(this[_currentNode] !== null)) {
|
| + this[_rebuildWorkList](this[_currentNode]);
|
| }
|
| - this._currentNode = this._workList.removeLast();
|
| - this._findLeftMostDescendent(this._currentNode.right);
|
| + this[_currentNode] = this[_workList].removeLast();
|
| + this[_findLeftMostDescendent](this[_currentNode].right);
|
| return true;
|
| }
|
| }
|
| @@ -4486,24 +4587,24 @@ var collection;
|
| let _SplayTreeIterator = _SplayTreeIterator$(dynamic);
|
| let _SplayTreeKeyIterable$ = dart.generic(function(K) {
|
| class _SplayTreeKeyIterable extends IterableBase$(K) {
|
| - _SplayTreeKeyIterable(_tree) {
|
| - this._tree = _tree;
|
| + _SplayTreeKeyIterable($_tree) {
|
| + this[_tree] = $_tree;
|
| super.IterableBase();
|
| }
|
| get length() {
|
| - return this._tree._count;
|
| + return this[_tree][_count];
|
| }
|
| get isEmpty() {
|
| - return this._tree._count === 0;
|
| + return this[_tree][_count] === 0;
|
| }
|
| get iterator() {
|
| - return new _SplayTreeKeyIterator(this._tree);
|
| + return new _SplayTreeKeyIterator(this[_tree]);
|
| }
|
| toSet() {
|
| - let setOrMap = this._tree;
|
| - let set = new SplayTreeSet(dart.as(setOrMap._comparator, dart.throw_("Unimplemented type (K, K) → int")), dart.as(setOrMap._validKey, dart.throw_("Unimplemented type (dynamic) → bool")));
|
| - set._count = this._tree._count;
|
| - set._root = set._copyNode(this._tree._root);
|
| + let setOrMap = this[_tree];
|
| + let set = new SplayTreeSet(dart.as(setOrMap[_comparator], dart.throw_("Unimplemented type (K, K) → int")), dart.as(setOrMap[_validKey], dart.throw_("Unimplemented type (dynamic) → bool")));
|
| + set[_count] = this[_tree][_count];
|
| + set[_root] = set._copyNode(this[_tree][_root]);
|
| return set;
|
| }
|
| }
|
| @@ -4512,18 +4613,18 @@ var collection;
|
| let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dynamic);
|
| let _SplayTreeValueIterable$ = dart.generic(function(K, V) {
|
| class _SplayTreeValueIterable extends IterableBase$(V) {
|
| - _SplayTreeValueIterable(_map) {
|
| - this._map = _map;
|
| + _SplayTreeValueIterable($_map) {
|
| + this[_map] = $_map;
|
| super.IterableBase();
|
| }
|
| get length() {
|
| - return this._map._count;
|
| + return this[_map][_count];
|
| }
|
| get isEmpty() {
|
| - return this._map._count === 0;
|
| + return this[_map][_count] === 0;
|
| }
|
| get iterator() {
|
| - return new _SplayTreeValueIterator(this._map);
|
| + return new _SplayTreeValueIterator(this[_map]);
|
| }
|
| }
|
| return _SplayTreeValueIterable;
|
| @@ -4534,7 +4635,7 @@ var collection;
|
| _SplayTreeKeyIterator(map) {
|
| super._SplayTreeIterator(map);
|
| }
|
| - _getValue(node) {
|
| + [_getValue](node) {
|
| return dart.as(node.key, K);
|
| }
|
| }
|
| @@ -4546,7 +4647,7 @@ var collection;
|
| _SplayTreeValueIterator(map) {
|
| super._SplayTreeIterator(map);
|
| }
|
| - _getValue(node) {
|
| + [_getValue](node) {
|
| return dart.as(node.value, V);
|
| }
|
| }
|
| @@ -4561,7 +4662,7 @@ var collection;
|
| _SplayTreeNodeIterator$startAt(tree, startKey) {
|
| super._SplayTreeIterator$startAt(tree, startKey);
|
| }
|
| - _getValue(node) {
|
| + [_getValue](node) {
|
| return dart.as(node, _SplayTreeNode$(K));
|
| }
|
| }
|
| @@ -4569,6 +4670,8 @@ var collection;
|
| return _SplayTreeNodeIterator;
|
| });
|
| let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dynamic);
|
| + let _clone = Symbol('_clone');
|
| + let _copyNode = Symbol('_copyNode');
|
| let SplayTreeSet$ = dart.generic(function(E) {
|
| class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), SetMixin$(E)) {
|
| SplayTreeSet(compare, isValidKey) {
|
| @@ -4576,8 +4679,8 @@ var collection;
|
| compare = null;
|
| if (isValidKey === void 0)
|
| isValidKey = null;
|
| - this._comparator = dart.as(compare === null ? core.Comparable.compare : compare, core.Comparator);
|
| - this._validKey = dart.as(isValidKey !== null ? isValidKey : (v) => dart.is(v, E), _Predicate);
|
| + this[_comparator] = dart.as(compare === null ? core.Comparable.compare : compare, core.Comparator);
|
| + this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart.is(v, E), _Predicate);
|
| super._SplayTree();
|
| }
|
| SplayTreeSet$from(elements, compare, isValidKey) {
|
| @@ -4591,93 +4694,93 @@ var collection;
|
| }
|
| return result;
|
| }
|
| - _compare(e1, e2) {
|
| - return this._comparator(e1, e2);
|
| + [_compare](e1, e2) {
|
| + return this[_comparator](e1, e2);
|
| }
|
| get iterator() {
|
| return new _SplayTreeKeyIterator(this);
|
| }
|
| get length() {
|
| - return this._count;
|
| + return this[_count];
|
| }
|
| get isEmpty() {
|
| - return this._root === null;
|
| + return this[_root] === null;
|
| }
|
| get isNotEmpty() {
|
| - return this._root !== null;
|
| + return this[_root] !== null;
|
| }
|
| get first() {
|
| - if (this._count === 0)
|
| + if (this[_count] === 0)
|
| throw _internal.IterableElementError.noElement();
|
| - return dart.as(this._first.key, E);
|
| + return dart.as(this[_first].key, E);
|
| }
|
| get last() {
|
| - if (this._count === 0)
|
| + if (this[_count] === 0)
|
| throw _internal.IterableElementError.noElement();
|
| - return dart.as(this._last.key, E);
|
| + return dart.as(this[_last].key, E);
|
| }
|
| get single() {
|
| - if (this._count === 0)
|
| + if (this[_count] === 0)
|
| throw _internal.IterableElementError.noElement();
|
| - if (this._count > 1)
|
| + if (this[_count] > 1)
|
| throw _internal.IterableElementError.tooMany();
|
| - return this._root.key;
|
| + return this[_root].key;
|
| }
|
| contains(object) {
|
| - return dart.notNull(this._validKey(object)) && dart.notNull(this._splay(dart.as(object, E)) === 0);
|
| + return dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay](dart.as(object, E)) === 0);
|
| }
|
| add(element) {
|
| - let compare = this._splay(element);
|
| + let compare = this[_splay](element);
|
| if (compare === 0)
|
| return false;
|
| - this._addNewRoot(dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E)), compare);
|
| + this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E)), compare);
|
| return true;
|
| }
|
| remove(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return false;
|
| - return this._remove(dart.as(object, E)) !== null;
|
| + return this[_remove](dart.as(object, E)) !== null;
|
| }
|
| addAll(elements) {
|
| for (let element of elements) {
|
| - let compare = this._splay(element);
|
| + let compare = this[_splay](element);
|
| if (compare !== 0) {
|
| - this._addNewRoot(dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E)), compare);
|
| + this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E)), compare);
|
| }
|
| }
|
| }
|
| removeAll(elements) {
|
| for (let element of elements) {
|
| - if (this._validKey(element))
|
| - this._remove(dart.as(element, E));
|
| + if (this[_validKey](element))
|
| + this[_remove](dart.as(element, E));
|
| }
|
| }
|
| retainAll(elements) {
|
| - let retainSet = new SplayTreeSet(this._comparator, this._validKey);
|
| - let modificationCount = this._modificationCount;
|
| + let retainSet = new SplayTreeSet(this[_comparator], this[_validKey]);
|
| + let modificationCount = this[_modificationCount];
|
| for (let object of elements) {
|
| - if (modificationCount !== this._modificationCount) {
|
| + if (modificationCount !== this[_modificationCount]) {
|
| throw new core.ConcurrentModificationError(this);
|
| }
|
| - if (dart.notNull(this._validKey(object)) && dart.notNull(this._splay(dart.as(object, E)) === 0))
|
| - retainSet.add(this._root.key);
|
| + if (dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay](dart.as(object, E)) === 0))
|
| + retainSet.add(this[_root].key);
|
| }
|
| - if (retainSet._count !== this._count) {
|
| - this._root = retainSet._root;
|
| - this._count = retainSet._count;
|
| - this._modificationCount++;
|
| + if (retainSet[_count] !== this[_count]) {
|
| + this[_root] = retainSet[_root];
|
| + this[_count] = retainSet[_count];
|
| + this[_modificationCount]++;
|
| }
|
| }
|
| lookup(object) {
|
| - if (!dart.notNull(this._validKey(object)))
|
| + if (!dart.notNull(this[_validKey](object)))
|
| return dart.as(null, E);
|
| - let comp = this._splay(dart.as(object, E));
|
| + let comp = this[_splay](dart.as(object, E));
|
| if (comp !== 0)
|
| return dart.as(null, E);
|
| - return this._root.key;
|
| + return this[_root].key;
|
| }
|
| intersection(other) {
|
| - let result = new SplayTreeSet(this._comparator, this._validKey);
|
| + let result = new SplayTreeSet(this[_comparator], this[_validKey]);
|
| for (let element of this) {
|
| if (other.contains(element))
|
| result.add(element);
|
| @@ -4685,7 +4788,7 @@ var collection;
|
| return result;
|
| }
|
| difference(other) {
|
| - let result = new SplayTreeSet(this._comparator, this._validKey);
|
| + let result = new SplayTreeSet(this[_comparator], this[_validKey]);
|
| for (let element of this) {
|
| if (!dart.notNull(other.contains(element)))
|
| result.add(element);
|
| @@ -4696,28 +4799,28 @@ var collection;
|
| return ((_) => {
|
| _.addAll(other);
|
| return _;
|
| - }).bind(this)(this._clone());
|
| + }).bind(this)(this[_clone]());
|
| }
|
| - _clone() {
|
| - let set = new SplayTreeSet(this._comparator, this._validKey);
|
| - set._count = this._count;
|
| - set._root = this._copyNode(this._root);
|
| + [_clone]() {
|
| + let set = new SplayTreeSet(this[_comparator], this[_validKey]);
|
| + set[_count] = this[_count];
|
| + set[_root] = this[_copyNode](this[_root]);
|
| return set;
|
| }
|
| - _copyNode(node) {
|
| + [_copyNode](node) {
|
| if (node === null)
|
| return null;
|
| return ((_) => {
|
| - _.left = this._copyNode(node.left);
|
| - _.right = this._copyNode(node.right);
|
| + _.left = this[_copyNode](node.left);
|
| + _.right = this[_copyNode](node.right);
|
| return _;
|
| }).bind(this)(new _SplayTreeNode(node.key));
|
| }
|
| clear() {
|
| - this._clear();
|
| + this[_clear]();
|
| }
|
| toSet() {
|
| - return this._clone();
|
| + return this[_clone]();
|
| }
|
| toString() {
|
| return IterableBase.iterableToFullString(this, '{', '}');
|
|
|