OLD | NEW |
1 var collection; | 1 var collection; |
2 (function(exports) { | 2 (function(exports) { |
3 'use strict'; | 3 'use strict'; |
| 4 let _length = Symbol('_length'); |
| 5 let _strings = Symbol('_strings'); |
| 6 let _nums = Symbol('_nums'); |
| 7 let _rest = Symbol('_rest'); |
| 8 let _keys = Symbol('_keys'); |
| 9 let _containsKey = Symbol('_containsKey'); |
| 10 let _getBucket = Symbol('_getBucket'); |
| 11 let _findBucketIndex = Symbol('_findBucketIndex'); |
| 12 let _computeKeys = Symbol('_computeKeys'); |
| 13 let _get = Symbol('_get'); |
| 14 let _addHashTableEntry = Symbol('_addHashTableEntry'); |
| 15 let _set = Symbol('_set'); |
| 16 let _computeHashCode = Symbol('_computeHashCode'); |
| 17 let _removeHashTableEntry = Symbol('_removeHashTableEntry'); |
| 18 let _remove = Symbol('_remove'); |
| 19 let _isStringKey = Symbol('_isStringKey'); |
| 20 let _isNumericKey = Symbol('_isNumericKey'); |
| 21 let _hasTableEntry = Symbol('_hasTableEntry'); |
| 22 let _getTableEntry = Symbol('_getTableEntry'); |
| 23 let _setTableEntry = Symbol('_setTableEntry'); |
| 24 let _deleteTableEntry = Symbol('_deleteTableEntry'); |
| 25 let _newHashTable = Symbol('_newHashTable'); |
4 let _HashMap$ = dart.generic(function(K, V) { | 26 let _HashMap$ = dart.generic(function(K, V) { |
5 class _HashMap extends dart.Object { | 27 class _HashMap extends dart.Object { |
6 _HashMap() { | 28 _HashMap() { |
7 this._length = 0; | 29 this[_length] = 0; |
8 this._strings = null; | 30 this[_strings] = null; |
9 this._nums = null; | 31 this[_nums] = null; |
10 this._rest = null; | 32 this[_rest] = null; |
11 this._keys = null; | 33 this[_keys] = null; |
12 } | 34 } |
13 get length() { | 35 get length() { |
14 return this._length; | 36 return this[_length]; |
15 } | 37 } |
16 get isEmpty() { | 38 get isEmpty() { |
17 return this._length === 0; | 39 return this[_length] === 0; |
18 } | 40 } |
19 get isNotEmpty() { | 41 get isNotEmpty() { |
20 return !dart.notNull(this.isEmpty); | 42 return !dart.notNull(this.isEmpty); |
21 } | 43 } |
22 get keys() { | 44 get keys() { |
23 return new HashMapKeyIterable(this); | 45 return new HashMapKeyIterable(this); |
24 } | 46 } |
25 get values() { | 47 get values() { |
26 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); | 48 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); |
27 } | 49 } |
28 containsKey(key) { | 50 containsKey(key) { |
29 if (_isStringKey(key)) { | 51 if (_isStringKey(key)) { |
30 let strings = this._strings; | 52 let strings = this[_strings]; |
31 return strings === null ? false : _hasTableEntry(strings, key); | 53 return strings === null ? false : _hasTableEntry(strings, key); |
32 } else if (_isNumericKey(key)) { | 54 } else if (_isNumericKey(key)) { |
33 let nums = this._nums; | 55 let nums = this[_nums]; |
34 return nums === null ? false : _hasTableEntry(nums, key); | 56 return nums === null ? false : _hasTableEntry(nums, key); |
35 } else { | 57 } else { |
36 return this._containsKey(key); | 58 return this[_containsKey](key); |
37 } | 59 } |
38 } | 60 } |
39 _containsKey(key) { | 61 [_containsKey](key) { |
40 let rest = this._rest; | 62 let rest = this[_rest]; |
41 if (rest === null) | 63 if (rest === null) |
42 return false; | 64 return false; |
43 let bucket = this._getBucket(rest, key); | 65 let bucket = this[_getBucket](rest, key); |
44 return this._findBucketIndex(bucket, key) >= 0; | 66 return this[_findBucketIndex](bucket, key) >= 0; |
45 } | 67 } |
46 containsValue(value) { | 68 containsValue(value) { |
47 return this._computeKeys().any(((each) => dart.equals(this.get(each), va
lue)).bind(this)); | 69 return this[_computeKeys]().any(((each) => dart.equals(this.get(each), v
alue)).bind(this)); |
48 } | 70 } |
49 addAll(other) { | 71 addAll(other) { |
50 other.forEach(((key, value) => { | 72 other.forEach(((key, value) => { |
51 this.set(key, value); | 73 this.set(key, value); |
52 }).bind(this)); | 74 }).bind(this)); |
53 } | 75 } |
54 get(key) { | 76 get(key) { |
55 if (_isStringKey(key)) { | 77 if (_isStringKey(key)) { |
56 let strings = this._strings; | 78 let strings = this[_strings]; |
57 return dart.as(strings === null ? null : _getTableEntry(strings, key),
V); | 79 return dart.as(strings === null ? null : _getTableEntry(strings, key),
V); |
58 } else if (_isNumericKey(key)) { | 80 } else if (_isNumericKey(key)) { |
59 let nums = this._nums; | 81 let nums = this[_nums]; |
60 return dart.as(nums === null ? null : _getTableEntry(nums, key), V); | 82 return dart.as(nums === null ? null : _getTableEntry(nums, key), V); |
61 } else { | 83 } else { |
62 return this._get(key); | 84 return this[_get](key); |
63 } | 85 } |
64 } | 86 } |
65 _get(key) { | 87 [_get](key) { |
66 let rest = this._rest; | 88 let rest = this[_rest]; |
67 if (rest === null) | 89 if (rest === null) |
68 return dart.as(null, V); | 90 return dart.as(null, V); |
69 let bucket = this._getBucket(rest, key); | 91 let bucket = this[_getBucket](rest, key); |
70 let index = this._findBucketIndex(bucket, key); | 92 let index = this[_findBucketIndex](bucket, key); |
71 return dart.as(index < 0 ? null : bucket[index + 1], V); | 93 return dart.as(index < 0 ? null : bucket[index + 1], V); |
72 } | 94 } |
73 set(key, value) { | 95 set(key, value) { |
74 if (_isStringKey(key)) { | 96 if (_isStringKey(key)) { |
75 let strings = this._strings; | 97 let strings = this[_strings]; |
76 if (strings === null) | 98 if (strings === null) |
77 this._strings = strings = _newHashTable(); | 99 this[_strings] = strings = _newHashTable(); |
78 this._addHashTableEntry(strings, key, value); | 100 this[_addHashTableEntry](strings, key, value); |
79 } else if (_isNumericKey(key)) { | 101 } else if (_isNumericKey(key)) { |
80 let nums = this._nums; | 102 let nums = this[_nums]; |
81 if (nums === null) | 103 if (nums === null) |
82 this._nums = nums = _newHashTable(); | 104 this[_nums] = nums = _newHashTable(); |
83 this._addHashTableEntry(nums, key, value); | 105 this[_addHashTableEntry](nums, key, value); |
84 } else { | 106 } else { |
85 this._set(key, value); | 107 this[_set](key, value); |
86 } | 108 } |
87 } | 109 } |
88 _set(key, value) { | 110 [_set](key, value) { |
89 let rest = this._rest; | 111 let rest = this[_rest]; |
90 if (rest === null) | 112 if (rest === null) |
91 this._rest = rest = _newHashTable(); | 113 this[_rest] = rest = _newHashTable(); |
92 let hash = this._computeHashCode(key); | 114 let hash = this[_computeHashCode](key); |
93 let bucket = rest[hash]; | 115 let bucket = rest[hash]; |
94 if (bucket === null) { | 116 if (bucket === null) { |
95 _setTableEntry(rest, hash, [key, value]); | 117 _setTableEntry(rest, hash, [key, value]); |
96 this._length++; | 118 this[_length]++; |
97 this._keys = null; | 119 this[_keys] = null; |
98 } else { | 120 } else { |
99 let index = this._findBucketIndex(bucket, key); | 121 let index = this[_findBucketIndex](bucket, key); |
100 if (index >= 0) { | 122 if (index >= 0) { |
101 bucket[index + 1] = value; | 123 bucket[index + 1] = value; |
102 } else { | 124 } else { |
103 bucket.push(key, value); | 125 bucket.push(key, value); |
104 this._length++; | 126 this[_length]++; |
105 this._keys = null; | 127 this[_keys] = null; |
106 } | 128 } |
107 } | 129 } |
108 } | 130 } |
109 putIfAbsent(key, ifAbsent) { | 131 putIfAbsent(key, ifAbsent) { |
110 if (this.containsKey(key)) | 132 if (this.containsKey(key)) |
111 return this.get(key); | 133 return this.get(key); |
112 let value = ifAbsent(); | 134 let value = ifAbsent(); |
113 this.set(key, value); | 135 this.set(key, value); |
114 return value; | 136 return value; |
115 } | 137 } |
116 remove(key) { | 138 remove(key) { |
117 if (_isStringKey(key)) { | 139 if (_isStringKey(key)) { |
118 return this._removeHashTableEntry(this._strings, key); | 140 return this[_removeHashTableEntry](this[_strings], key); |
119 } else if (_isNumericKey(key)) { | 141 } else if (_isNumericKey(key)) { |
120 return this._removeHashTableEntry(this._nums, key); | 142 return this[_removeHashTableEntry](this[_nums], key); |
121 } else { | 143 } else { |
122 return this._remove(key); | 144 return this[_remove](key); |
123 } | 145 } |
124 } | 146 } |
125 _remove(key) { | 147 [_remove](key) { |
126 let rest = this._rest; | 148 let rest = this[_rest]; |
127 if (rest === null) | 149 if (rest === null) |
128 return dart.as(null, V); | 150 return dart.as(null, V); |
129 let bucket = this._getBucket(rest, key); | 151 let bucket = this[_getBucket](rest, key); |
130 let index = this._findBucketIndex(bucket, key); | 152 let index = this[_findBucketIndex](bucket, key); |
131 if (index < 0) | 153 if (index < 0) |
132 return dart.as(null, V); | 154 return dart.as(null, V); |
133 this._length--; | 155 this[_length]--; |
134 this._keys = null; | 156 this[_keys] = null; |
135 return dart.as(bucket.splice(index, 2)[1], V); | 157 return dart.as(bucket.splice(index, 2)[1], V); |
136 } | 158 } |
137 clear() { | 159 clear() { |
138 if (this._length > 0) { | 160 if (this[_length] > 0) { |
139 this._strings = this._nums = this._rest = this._keys = null; | 161 this[_strings] = this[_nums] = this[_rest] = this[_keys] = null; |
140 this._length = 0; | 162 this[_length] = 0; |
141 } | 163 } |
142 } | 164 } |
143 forEach(action) { | 165 forEach(action) { |
144 let keys = this._computeKeys(); | 166 let keys = this[_computeKeys](); |
145 for (let i = 0, length = keys.length; i < length; i++) { | 167 for (let i = 0, length = keys.length; i < length; i++) { |
146 let key = keys[i]; | 168 let key = keys[i]; |
147 action(dart.as(key, K), this.get(key)); | 169 action(dart.as(key, K), this.get(key)); |
148 if (keys !== this._keys) { | 170 if (keys !== this[_keys]) { |
149 throw new core.ConcurrentModificationError(this); | 171 throw new core.ConcurrentModificationError(this); |
150 } | 172 } |
151 } | 173 } |
152 } | 174 } |
153 _computeKeys() { | 175 [_computeKeys]() { |
154 if (this._keys !== null) | 176 if (this[_keys] !== null) |
155 return this._keys; | 177 return this[_keys]; |
156 let result = new core.List(this._length); | 178 let result = new core.List(this[_length]); |
157 let index = 0; | 179 let index = 0; |
158 let strings = this._strings; | 180 let strings = this[_strings]; |
159 if (strings !== null) { | 181 if (strings !== null) { |
160 let names = Object.getOwnPropertyNames(strings); | 182 let names = Object.getOwnPropertyNames(strings); |
161 let entries = names.length; | 183 let entries = names.length; |
162 for (let i = 0; i < entries; i++) { | 184 for (let i = 0; i < entries; i++) { |
163 let key = names[i]; | 185 let key = names[i]; |
164 result[index] = key; | 186 result[index] = key; |
165 index++; | 187 index++; |
166 } | 188 } |
167 } | 189 } |
168 let nums = this._nums; | 190 let nums = this[_nums]; |
169 if (nums !== null) { | 191 if (nums !== null) { |
170 let names = Object.getOwnPropertyNames(nums); | 192 let names = Object.getOwnPropertyNames(nums); |
171 let entries = names.length; | 193 let entries = names.length; |
172 for (let i = 0; i < entries; i++) { | 194 for (let i = 0; i < entries; i++) { |
173 let key = +names[i]; | 195 let key = +names[i]; |
174 result[index] = key; | 196 result[index] = key; |
175 index++; | 197 index++; |
176 } | 198 } |
177 } | 199 } |
178 let rest = this._rest; | 200 let rest = this[_rest]; |
179 if (rest !== null) { | 201 if (rest !== null) { |
180 let names = Object.getOwnPropertyNames(rest); | 202 let names = Object.getOwnPropertyNames(rest); |
181 let entries = names.length; | 203 let entries = names.length; |
182 for (let i = 0; i < entries; i++) { | 204 for (let i = 0; i < entries; i++) { |
183 let key = names[i]; | 205 let key = names[i]; |
184 let bucket = rest[key]; | 206 let bucket = rest[key]; |
185 let length = bucket.length; | 207 let length = bucket.length; |
186 for (let i = 0; i < length; i = 2) { | 208 for (let i = 0; i < length; i = 2) { |
187 let key = bucket[i]; | 209 let key = bucket[i]; |
188 result[index] = key; | 210 result[index] = key; |
189 index++; | 211 index++; |
190 } | 212 } |
191 } | 213 } |
192 } | 214 } |
193 dart.assert(index === this._length); | 215 dart.assert(index === this[_length]); |
194 return this._keys = result; | 216 return this[_keys] = result; |
195 } | 217 } |
196 _addHashTableEntry(table, key, value) { | 218 [_addHashTableEntry](table, key, value) { |
197 if (!dart.notNull(_hasTableEntry(table, key))) { | 219 if (!dart.notNull(_hasTableEntry(table, key))) { |
198 this._length++; | 220 this[_length]++; |
199 this._keys = null; | 221 this[_keys] = null; |
200 } | 222 } |
201 _setTableEntry(table, key, value); | 223 _setTableEntry(table, key, value); |
202 } | 224 } |
203 _removeHashTableEntry(table, key) { | 225 [_removeHashTableEntry](table, key) { |
204 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k
ey))) { | 226 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, k
ey))) { |
205 let value = dart.as(_getTableEntry(table, key), V); | 227 let value = dart.as(_getTableEntry(table, key), V); |
206 _deleteTableEntry(table, key); | 228 _deleteTableEntry(table, key); |
207 this._length--; | 229 this[_length]--; |
208 this._keys = null; | 230 this[_keys] = null; |
209 return value; | 231 return value; |
210 } else { | 232 } else { |
211 return dart.as(null, V); | 233 return dart.as(null, V); |
212 } | 234 } |
213 } | 235 } |
214 static _isStringKey(key) { | 236 static [_isStringKey](key) { |
215 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); | 237 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); |
216 } | 238 } |
217 static _isNumericKey(key) { | 239 static [_isNumericKey](key) { |
218 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); | 240 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); |
219 } | 241 } |
220 _computeHashCode(key) { | 242 [_computeHashCode](key) { |
221 return dart.dload(key, 'hashCode') & 0x3ffffff; | 243 return dart.dload(key, 'hashCode') & 0x3ffffff; |
222 } | 244 } |
223 static _hasTableEntry(table, key) { | 245 static [_hasTableEntry](table, key) { |
224 let entry = table[key]; | 246 let entry = table[key]; |
225 return entry !== null; | 247 return entry !== null; |
226 } | 248 } |
227 static _getTableEntry(table, key) { | 249 static [_getTableEntry](table, key) { |
228 let entry = table[key]; | 250 let entry = table[key]; |
229 return entry === table ? null : entry; | 251 return entry === table ? null : entry; |
230 } | 252 } |
231 static _setTableEntry(table, key, value) { | 253 static [_setTableEntry](table, key, value) { |
232 if (value === null) { | 254 if (value === null) { |
233 table[key] = table; | 255 table[key] = table; |
234 } else { | 256 } else { |
235 table[key] = value; | 257 table[key] = value; |
236 } | 258 } |
237 } | 259 } |
238 static _deleteTableEntry(table, key) { | 260 static [_deleteTableEntry](table, key) { |
239 delete table[key]; | 261 delete table[key]; |
240 } | 262 } |
241 _getBucket(table, key) { | 263 [_getBucket](table, key) { |
242 let hash = this._computeHashCode(key); | 264 let hash = this[_computeHashCode](key); |
243 return dart.as(table[hash], core.List); | 265 return dart.as(table[hash], core.List); |
244 } | 266 } |
245 _findBucketIndex(bucket, key) { | 267 [_findBucketIndex](bucket, key) { |
246 if (bucket === null) | 268 if (bucket === null) |
247 return -1; | 269 return -1; |
248 let length = bucket.length; | 270 let length = bucket.length; |
249 for (let i = 0; i < length; i = 2) { | 271 for (let i = 0; i < length; i = 2) { |
250 if (dart.equals(bucket[i], key)) | 272 if (dart.equals(bucket[i], key)) |
251 return i; | 273 return i; |
252 } | 274 } |
253 return -1; | 275 return -1; |
254 } | 276 } |
255 static _newHashTable() { | 277 static [_newHashTable]() { |
256 let table = Object.create(null); | 278 let table = Object.create(null); |
257 let temporaryKey = '<non-identifier-key>'; | 279 let temporaryKey = '<non-identifier-key>'; |
258 _setTableEntry(table, temporaryKey, table); | 280 _setTableEntry(table, temporaryKey, table); |
259 _deleteTableEntry(table, temporaryKey); | 281 _deleteTableEntry(table, temporaryKey); |
260 return table; | 282 return table; |
261 } | 283 } |
262 } | 284 } |
263 return _HashMap; | 285 return _HashMap; |
264 }); | 286 }); |
265 let _HashMap = _HashMap$(dynamic, dynamic); | 287 let _HashMap = _HashMap$(dynamic, dynamic); |
266 let _IdentityHashMap$ = dart.generic(function(K, V) { | 288 let _IdentityHashMap$ = dart.generic(function(K, V) { |
267 class _IdentityHashMap extends _HashMap$(K, V) { | 289 class _IdentityHashMap extends _HashMap$(K, V) { |
268 _computeHashCode(key) { | 290 [_computeHashCode](key) { |
269 return core.identityHashCode(key) & 0x3ffffff; | 291 return core.identityHashCode(key) & 0x3ffffff; |
270 } | 292 } |
271 _findBucketIndex(bucket, key) { | 293 [_findBucketIndex](bucket, key) { |
272 if (bucket === null) | 294 if (bucket === null) |
273 return -1; | 295 return -1; |
274 let length = bucket.length; | 296 let length = bucket.length; |
275 for (let i = 0; i < length; i = 2) { | 297 for (let i = 0; i < length; i = 2) { |
276 if (core.identical(bucket[i], key)) | 298 if (core.identical(bucket[i], key)) |
277 return i; | 299 return i; |
278 } | 300 } |
279 return -1; | 301 return -1; |
280 } | 302 } |
281 } | 303 } |
282 return _IdentityHashMap; | 304 return _IdentityHashMap; |
283 }); | 305 }); |
284 let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic); | 306 let _IdentityHashMap = _IdentityHashMap$(dynamic, dynamic); |
| 307 let _equals = Symbol('_equals'); |
| 308 let _hashCode = Symbol('_hashCode'); |
| 309 let _validKey = Symbol('_validKey'); |
285 let _CustomHashMap$ = dart.generic(function(K, V) { | 310 let _CustomHashMap$ = dart.generic(function(K, V) { |
286 class _CustomHashMap extends _HashMap$(K, V) { | 311 class _CustomHashMap extends _HashMap$(K, V) { |
287 _CustomHashMap(_equals, _hashCode, validKey) { | 312 _CustomHashMap($_equals, $_hashCode, validKey) { |
288 this._equals = _equals; | 313 this[_equals] = $_equals; |
289 this._hashCode = _hashCode; | 314 this[_hashCode] = $_hashCode; |
290 this._validKey = dart.as(validKey !== null ? validKey : (v) => dart.is(v
, K), _Predicate); | 315 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); |
291 super._HashMap(); | 316 super._HashMap(); |
292 } | 317 } |
293 get(key) { | 318 get(key) { |
294 if (!dart.notNull(this._validKey(key))) | 319 if (!dart.notNull(this[_validKey](key))) |
295 return dart.as(null, V); | 320 return dart.as(null, V); |
296 return super._get(key); | 321 return super._get(key); |
297 } | 322 } |
298 set(key, value) { | 323 set(key, value) { |
299 super._set(key, value); | 324 super._set(key, value); |
300 } | 325 } |
301 containsKey(key) { | 326 containsKey(key) { |
302 if (!dart.notNull(this._validKey(key))) | 327 if (!dart.notNull(this[_validKey](key))) |
303 return false; | 328 return false; |
304 return super._containsKey(key); | 329 return super._containsKey(key); |
305 } | 330 } |
306 remove(key) { | 331 remove(key) { |
307 if (!dart.notNull(this._validKey(key))) | 332 if (!dart.notNull(this[_validKey](key))) |
308 return dart.as(null, V); | 333 return dart.as(null, V); |
309 return super._remove(key); | 334 return super._remove(key); |
310 } | 335 } |
311 _computeHashCode(key) { | 336 [_computeHashCode](key) { |
312 return this._hashCode(dart.as(key, K)) & 0x3ffffff; | 337 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; |
313 } | 338 } |
314 _findBucketIndex(bucket, key) { | 339 [_findBucketIndex](bucket, key) { |
315 if (bucket === null) | 340 if (bucket === null) |
316 return -1; | 341 return -1; |
317 let length = bucket.length; | 342 let length = bucket.length; |
318 for (let i = 0; i < length; i = 2) { | 343 for (let i = 0; i < length; i = 2) { |
319 if (this._equals(dart.as(bucket[i], K), dart.as(key, K))) | 344 if (this[_equals](dart.as(bucket[i], K), dart.as(key, K))) |
320 return i; | 345 return i; |
321 } | 346 } |
322 return -1; | 347 return -1; |
323 } | 348 } |
324 toString() { | 349 toString() { |
325 return Maps.mapToString(this); | 350 return Maps.mapToString(this); |
326 } | 351 } |
327 } | 352 } |
328 return _CustomHashMap; | 353 return _CustomHashMap; |
329 }); | 354 }); |
330 let _CustomHashMap = _CustomHashMap$(dynamic, dynamic); | 355 let _CustomHashMap = _CustomHashMap$(dynamic, dynamic); |
| 356 let _map = Symbol('_map'); |
331 let HashMapKeyIterable$ = dart.generic(function(E) { | 357 let HashMapKeyIterable$ = dart.generic(function(E) { |
332 class HashMapKeyIterable extends IterableBase$(E) { | 358 class HashMapKeyIterable extends IterableBase$(E) { |
333 HashMapKeyIterable(_map) { | 359 HashMapKeyIterable($_map) { |
334 this._map = _map; | 360 this[_map] = $_map; |
335 super.IterableBase(); | 361 super.IterableBase(); |
336 } | 362 } |
337 get length() { | 363 get length() { |
338 return dart.as(dart.dload(this._map, '_length'), core.int); | 364 return dart.as(dart.dload(this[_map], '_length'), core.int); |
339 } | 365 } |
340 get isEmpty() { | 366 get isEmpty() { |
341 return dart.equals(dart.dload(this._map, '_length'), 0); | 367 return dart.equals(dart.dload(this[_map], '_length'), 0); |
342 } | 368 } |
343 get iterator() { | 369 get iterator() { |
344 return new HashMapKeyIterator(this._map, dart.as(dart.dinvoke(this._map,
'_computeKeys'), core.List)); | 370 return new HashMapKeyIterator(this[_map], dart.as(dart.dinvoke(this[_map
], '_computeKeys'), core.List)); |
345 } | 371 } |
346 contains(element) { | 372 contains(element) { |
347 return dart.as(dart.dinvoke(this._map, 'containsKey', element), core.boo
l); | 373 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); |
348 } | 374 } |
349 forEach(f) { | 375 forEach(f) { |
350 let keys = dart.as(dart.dinvoke(this._map, '_computeKeys'), core.List); | 376 let keys = dart.as(dart.dinvoke(this[_map], '_computeKeys'), core.List); |
351 for (let i = 0, length = keys.length; i < length; i++) { | 377 for (let i = 0, length = keys.length; i < length; i++) { |
352 f(dart.as(keys[i], E)); | 378 f(dart.as(keys[i], E)); |
353 if (keys !== dart.dload(this._map, '_keys')) { | 379 if (keys !== dart.dload(this[_map], '_keys')) { |
354 throw new core.ConcurrentModificationError(this._map); | 380 throw new core.ConcurrentModificationError(this[_map]); |
355 } | 381 } |
356 } | 382 } |
357 } | 383 } |
358 } | 384 } |
359 return HashMapKeyIterable; | 385 return HashMapKeyIterable; |
360 }); | 386 }); |
361 let HashMapKeyIterable = HashMapKeyIterable$(dynamic); | 387 let HashMapKeyIterable = HashMapKeyIterable$(dynamic); |
| 388 let _offset = Symbol('_offset'); |
| 389 let _current = Symbol('_current'); |
362 let HashMapKeyIterator$ = dart.generic(function(E) { | 390 let HashMapKeyIterator$ = dart.generic(function(E) { |
363 class HashMapKeyIterator extends dart.Object { | 391 class HashMapKeyIterator extends dart.Object { |
364 HashMapKeyIterator(_map, _keys) { | 392 HashMapKeyIterator($_map, $_keys) { |
365 this._map = _map; | 393 this[_map] = $_map; |
366 this._keys = _keys; | 394 this[_keys] = $_keys; |
367 this._offset = 0; | 395 this[_offset] = 0; |
368 this._current = dart.as(null, E); | 396 this[_current] = dart.as(null, E); |
369 } | 397 } |
370 get current() { | 398 get current() { |
371 return this._current; | 399 return this[_current]; |
372 } | 400 } |
373 moveNext() { | 401 moveNext() { |
374 let keys = this._keys; | 402 let keys = this[_keys]; |
375 let offset = this._offset; | 403 let offset = this[_offset]; |
376 if (keys !== dart.dload(this._map, '_keys')) { | 404 if (keys !== dart.dload(this[_map], '_keys')) { |
377 throw new core.ConcurrentModificationError(this._map); | 405 throw new core.ConcurrentModificationError(this[_map]); |
378 } else if (offset >= keys.length) { | 406 } else if (offset >= keys.length) { |
379 this._current = dart.as(null, E); | 407 this[_current] = dart.as(null, E); |
380 return false; | 408 return false; |
381 } else { | 409 } else { |
382 this._current = dart.as(keys[offset], E); | 410 this[_current] = dart.as(keys[offset], E); |
383 this._offset = offset + 1; | 411 this[_offset] = offset + 1; |
384 return true; | 412 return true; |
385 } | 413 } |
386 } | 414 } |
387 } | 415 } |
388 return HashMapKeyIterator; | 416 return HashMapKeyIterator; |
389 }); | 417 }); |
390 let HashMapKeyIterator = HashMapKeyIterator$(dynamic); | 418 let HashMapKeyIterator = HashMapKeyIterator$(dynamic); |
| 419 let _first = Symbol('_first'); |
| 420 let _last = Symbol('_last'); |
| 421 let _modifications = Symbol('_modifications'); |
| 422 let _value = Symbol('_value'); |
| 423 let _newLinkedCell = Symbol('_newLinkedCell'); |
| 424 let _unlinkCell = Symbol('_unlinkCell'); |
| 425 let _modified = Symbol('_modified'); |
| 426 let _key = Symbol('_key'); |
| 427 let _next = Symbol('_next'); |
| 428 let _previous = Symbol('_previous'); |
391 let _LinkedHashMap$ = dart.generic(function(K, V) { | 429 let _LinkedHashMap$ = dart.generic(function(K, V) { |
392 class _LinkedHashMap extends dart.Object { | 430 class _LinkedHashMap extends dart.Object { |
393 _LinkedHashMap() { | 431 _LinkedHashMap() { |
394 this._length = 0; | 432 this[_length] = 0; |
395 this._strings = null; | 433 this[_strings] = null; |
396 this._nums = null; | 434 this[_nums] = null; |
397 this._rest = null; | 435 this[_rest] = null; |
398 this._first = null; | 436 this[_first] = null; |
399 this._last = null; | 437 this[_last] = null; |
400 this._modifications = 0; | 438 this[_modifications] = 0; |
401 } | 439 } |
402 get length() { | 440 get length() { |
403 return this._length; | 441 return this[_length]; |
404 } | 442 } |
405 get isEmpty() { | 443 get isEmpty() { |
406 return this._length === 0; | 444 return this[_length] === 0; |
407 } | 445 } |
408 get isNotEmpty() { | 446 get isNotEmpty() { |
409 return !dart.notNull(this.isEmpty); | 447 return !dart.notNull(this.isEmpty); |
410 } | 448 } |
411 get keys() { | 449 get keys() { |
412 return new LinkedHashMapKeyIterable(this); | 450 return new LinkedHashMapKeyIterable(this); |
413 } | 451 } |
414 get values() { | 452 get values() { |
415 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); | 453 return new _internal.MappedIterable(this.keys, ((each) => this.get(each)
).bind(this)); |
416 } | 454 } |
417 containsKey(key) { | 455 containsKey(key) { |
418 if (_isStringKey(key)) { | 456 if (_isStringKey(key)) { |
419 let strings = this._strings; | 457 let strings = this[_strings]; |
420 if (strings === null) | 458 if (strings === null) |
421 return false; | 459 return false; |
422 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); | 460 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); |
423 return cell !== null; | 461 return cell !== null; |
424 } else if (_isNumericKey(key)) { | 462 } else if (_isNumericKey(key)) { |
425 let nums = this._nums; | 463 let nums = this[_nums]; |
426 if (nums === null) | 464 if (nums === null) |
427 return false; | 465 return false; |
428 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); | 466 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); |
429 return cell !== null; | 467 return cell !== null; |
430 } else { | 468 } else { |
431 return this._containsKey(key); | 469 return this[_containsKey](key); |
432 } | 470 } |
433 } | 471 } |
434 _containsKey(key) { | 472 [_containsKey](key) { |
435 let rest = this._rest; | 473 let rest = this[_rest]; |
436 if (rest === null) | 474 if (rest === null) |
437 return false; | 475 return false; |
438 let bucket = this._getBucket(rest, key); | 476 let bucket = this[_getBucket](rest, key); |
439 return this._findBucketIndex(bucket, key) >= 0; | 477 return this[_findBucketIndex](bucket, key) >= 0; |
440 } | 478 } |
441 containsValue(value) { | 479 containsValue(value) { |
442 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind
(this)); | 480 return this.keys.any(((each) => dart.equals(this.get(each), value)).bind
(this)); |
443 } | 481 } |
444 addAll(other) { | 482 addAll(other) { |
445 other.forEach(((key, value) => { | 483 other.forEach(((key, value) => { |
446 this.set(key, value); | 484 this.set(key, value); |
447 }).bind(this)); | 485 }).bind(this)); |
448 } | 486 } |
449 get(key) { | 487 get(key) { |
450 if (_isStringKey(key)) { | 488 if (_isStringKey(key)) { |
451 let strings = this._strings; | 489 let strings = this[_strings]; |
452 if (strings === null) | 490 if (strings === null) |
453 return dart.as(null, V); | 491 return dart.as(null, V); |
454 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); | 492 let cell = dart.as(_getTableEntry(strings, key), LinkedHashMapCell); |
455 return dart.as(cell === null ? null : cell._value, V); | 493 return dart.as(cell === null ? null : cell[_value], V); |
456 } else if (_isNumericKey(key)) { | 494 } else if (_isNumericKey(key)) { |
457 let nums = this._nums; | 495 let nums = this[_nums]; |
458 if (nums === null) | 496 if (nums === null) |
459 return dart.as(null, V); | 497 return dart.as(null, V); |
460 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); | 498 let cell = dart.as(_getTableEntry(nums, key), LinkedHashMapCell); |
461 return dart.as(cell === null ? null : cell._value, V); | 499 return dart.as(cell === null ? null : cell[_value], V); |
462 } else { | 500 } else { |
463 return this._get(key); | 501 return this[_get](key); |
464 } | 502 } |
465 } | 503 } |
466 _get(key) { | 504 [_get](key) { |
467 let rest = this._rest; | 505 let rest = this[_rest]; |
468 if (rest === null) | 506 if (rest === null) |
469 return dart.as(null, V); | 507 return dart.as(null, V); |
470 let bucket = this._getBucket(rest, key); | 508 let bucket = this[_getBucket](rest, key); |
471 let index = this._findBucketIndex(bucket, key); | 509 let index = this[_findBucketIndex](bucket, key); |
472 if (index < 0) | 510 if (index < 0) |
473 return dart.as(null, V); | 511 return dart.as(null, V); |
474 let cell = dart.as(bucket[index], LinkedHashMapCell); | 512 let cell = dart.as(bucket[index], LinkedHashMapCell); |
475 return dart.as(cell._value, V); | 513 return dart.as(cell[_value], V); |
476 } | 514 } |
477 set(key, value) { | 515 set(key, value) { |
478 if (_isStringKey(key)) { | 516 if (_isStringKey(key)) { |
479 let strings = this._strings; | 517 let strings = this[_strings]; |
480 if (strings === null) | 518 if (strings === null) |
481 this._strings = strings = _newHashTable(); | 519 this[_strings] = strings = _newHashTable(); |
482 this._addHashTableEntry(strings, key, value); | 520 this[_addHashTableEntry](strings, key, value); |
483 } else if (_isNumericKey(key)) { | 521 } else if (_isNumericKey(key)) { |
484 let nums = this._nums; | 522 let nums = this[_nums]; |
485 if (nums === null) | 523 if (nums === null) |
486 this._nums = nums = _newHashTable(); | 524 this[_nums] = nums = _newHashTable(); |
487 this._addHashTableEntry(nums, key, value); | 525 this[_addHashTableEntry](nums, key, value); |
488 } else { | 526 } else { |
489 this._set(key, value); | 527 this[_set](key, value); |
490 } | 528 } |
491 } | 529 } |
492 _set(key, value) { | 530 [_set](key, value) { |
493 let rest = this._rest; | 531 let rest = this[_rest]; |
494 if (rest === null) | 532 if (rest === null) |
495 this._rest = rest = _newHashTable(); | 533 this[_rest] = rest = _newHashTable(); |
496 let hash = this._computeHashCode(key); | 534 let hash = this[_computeHashCode](key); |
497 let bucket = rest[hash]; | 535 let bucket = rest[hash]; |
498 if (bucket === null) { | 536 if (bucket === null) { |
499 let cell = this._newLinkedCell(key, value); | 537 let cell = this[_newLinkedCell](key, value); |
500 _setTableEntry(rest, hash, [cell]); | 538 _setTableEntry(rest, hash, [cell]); |
501 } else { | 539 } else { |
502 let index = this._findBucketIndex(bucket, key); | 540 let index = this[_findBucketIndex](bucket, key); |
503 if (index >= 0) { | 541 if (index >= 0) { |
504 let cell = dart.as(bucket[index], LinkedHashMapCell); | 542 let cell = dart.as(bucket[index], LinkedHashMapCell); |
505 cell._value = value; | 543 cell[_value] = value; |
506 } else { | 544 } else { |
507 let cell = this._newLinkedCell(key, value); | 545 let cell = this[_newLinkedCell](key, value); |
508 bucket.push(cell); | 546 bucket.push(cell); |
509 } | 547 } |
510 } | 548 } |
511 } | 549 } |
512 putIfAbsent(key, ifAbsent) { | 550 putIfAbsent(key, ifAbsent) { |
513 if (this.containsKey(key)) | 551 if (this.containsKey(key)) |
514 return this.get(key); | 552 return this.get(key); |
515 let value = ifAbsent(); | 553 let value = ifAbsent(); |
516 this.set(key, value); | 554 this.set(key, value); |
517 return value; | 555 return value; |
518 } | 556 } |
519 remove(key) { | 557 remove(key) { |
520 if (_isStringKey(key)) { | 558 if (_isStringKey(key)) { |
521 return this._removeHashTableEntry(this._strings, key); | 559 return this[_removeHashTableEntry](this[_strings], key); |
522 } else if (_isNumericKey(key)) { | 560 } else if (_isNumericKey(key)) { |
523 return this._removeHashTableEntry(this._nums, key); | 561 return this[_removeHashTableEntry](this[_nums], key); |
524 } else { | 562 } else { |
525 return this._remove(key); | 563 return this[_remove](key); |
526 } | 564 } |
527 } | 565 } |
528 _remove(key) { | 566 [_remove](key) { |
529 let rest = this._rest; | 567 let rest = this[_rest]; |
530 if (rest === null) | 568 if (rest === null) |
531 return dart.as(null, V); | 569 return dart.as(null, V); |
532 let bucket = this._getBucket(rest, key); | 570 let bucket = this[_getBucket](rest, key); |
533 let index = this._findBucketIndex(bucket, key); | 571 let index = this[_findBucketIndex](bucket, key); |
534 if (index < 0) | 572 if (index < 0) |
535 return dart.as(null, V); | 573 return dart.as(null, V); |
536 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); | 574 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashMapCell); |
537 this._unlinkCell(cell); | 575 this[_unlinkCell](cell); |
538 return dart.as(cell._value, V); | 576 return dart.as(cell[_value], V); |
539 } | 577 } |
540 clear() { | 578 clear() { |
541 if (this._length > 0) { | 579 if (this[_length] > 0) { |
542 this._strings = this._nums = this._rest = this._first = this._last = n
ull; | 580 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
543 this._length = 0; | 581 this[_length] = 0; |
544 this._modified(); | 582 this[_modified](); |
545 } | 583 } |
546 } | 584 } |
547 forEach(action) { | 585 forEach(action) { |
548 let cell = this._first; | 586 let cell = this[_first]; |
549 let modifications = this._modifications; | 587 let modifications = this[_modifications]; |
550 while (cell !== null) { | 588 while (cell !== null) { |
551 action(dart.as(cell._key, K), dart.as(cell._value, V)); | 589 action(dart.as(cell[_key], K), dart.as(cell[_value], V)); |
552 if (modifications !== this._modifications) { | 590 if (modifications !== this[_modifications]) { |
553 throw new core.ConcurrentModificationError(this); | 591 throw new core.ConcurrentModificationError(this); |
554 } | 592 } |
555 cell = cell._next; | 593 cell = cell[_next]; |
556 } | 594 } |
557 } | 595 } |
558 _addHashTableEntry(table, key, value) { | 596 [_addHashTableEntry](table, key, value) { |
559 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); | 597 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); |
560 if (cell === null) { | 598 if (cell === null) { |
561 _setTableEntry(table, key, this._newLinkedCell(key, value)); | 599 _setTableEntry(table, key, this[_newLinkedCell](key, value)); |
562 } else { | 600 } else { |
563 cell._value = value; | 601 cell[_value] = value; |
564 } | 602 } |
565 } | 603 } |
566 _removeHashTableEntry(table, key) { | 604 [_removeHashTableEntry](table, key) { |
567 if (table === null) | 605 if (table === null) |
568 return dart.as(null, V); | 606 return dart.as(null, V); |
569 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); | 607 let cell = dart.as(_getTableEntry(table, key), LinkedHashMapCell); |
570 if (cell === null) | 608 if (cell === null) |
571 return dart.as(null, V); | 609 return dart.as(null, V); |
572 this._unlinkCell(cell); | 610 this[_unlinkCell](cell); |
573 _deleteTableEntry(table, key); | 611 _deleteTableEntry(table, key); |
574 return dart.as(cell._value, V); | 612 return dart.as(cell[_value], V); |
575 } | 613 } |
576 _modified() { | 614 [_modified]() { |
577 this._modifications = this._modifications + 1 & 67108863; | 615 this[_modifications] = this[_modifications] + 1 & 67108863; |
578 } | 616 } |
579 _newLinkedCell(key, value) { | 617 [_newLinkedCell](key, value) { |
580 let cell = new LinkedHashMapCell(key, value); | 618 let cell = new LinkedHashMapCell(key, value); |
581 if (this._first === null) { | 619 if (this[_first] === null) { |
582 this._first = this._last = cell; | 620 this[_first] = this[_last] = cell; |
583 } else { | 621 } else { |
584 let last = this._last; | 622 let last = this[_last]; |
585 cell._previous = last; | 623 cell[_previous] = last; |
586 this._last = last._next = cell; | 624 this[_last] = last[_next] = cell; |
587 } | 625 } |
588 this._length++; | 626 this[_length]++; |
589 this._modified(); | 627 this[_modified](); |
590 return cell; | 628 return cell; |
591 } | 629 } |
592 _unlinkCell(cell) { | 630 [_unlinkCell](cell) { |
593 let previous = cell._previous; | 631 let previous = cell[_previous]; |
594 let next = cell._next; | 632 let next = cell[_next]; |
595 if (previous === null) { | 633 if (previous === null) { |
596 dart.assert(dart.equals(cell, this._first)); | 634 dart.assert(dart.equals(cell, this[_first])); |
597 this._first = next; | 635 this[_first] = next; |
598 } else { | 636 } else { |
599 previous._next = next; | 637 previous[_next] = next; |
600 } | 638 } |
601 if (next === null) { | 639 if (next === null) { |
602 dart.assert(dart.equals(cell, this._last)); | 640 dart.assert(dart.equals(cell, this[_last])); |
603 this._last = previous; | 641 this[_last] = previous; |
604 } else { | 642 } else { |
605 next._previous = previous; | 643 next[_previous] = previous; |
606 } | 644 } |
607 this._length--; | 645 this[_length]--; |
608 this._modified(); | 646 this[_modified](); |
609 } | 647 } |
610 static _isStringKey(key) { | 648 static [_isStringKey](key) { |
611 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); | 649 return dart.notNull(typeof key == string) && dart.notNull(!dart.equals(k
ey, '__proto__')); |
612 } | 650 } |
613 static _isNumericKey(key) { | 651 static [_isNumericKey](key) { |
614 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); | 652 return dart.notNull(dart.is(key, core.num)) && dart.notNull((key & 0x3ff
ffff) === key); |
615 } | 653 } |
616 _computeHashCode(key) { | 654 [_computeHashCode](key) { |
617 return dart.dload(key, 'hashCode') & 0x3ffffff; | 655 return dart.dload(key, 'hashCode') & 0x3ffffff; |
618 } | 656 } |
619 static _getTableEntry(table, key) { | 657 static [_getTableEntry](table, key) { |
620 return table[key]; | 658 return table[key]; |
621 } | 659 } |
622 static _setTableEntry(table, key, value) { | 660 static [_setTableEntry](table, key, value) { |
623 dart.assert(value !== null); | 661 dart.assert(value !== null); |
624 table[key] = value; | 662 table[key] = value; |
625 } | 663 } |
626 static _deleteTableEntry(table, key) { | 664 static [_deleteTableEntry](table, key) { |
627 delete table[key]; | 665 delete table[key]; |
628 } | 666 } |
629 _getBucket(table, key) { | 667 [_getBucket](table, key) { |
630 let hash = this._computeHashCode(key); | 668 let hash = this[_computeHashCode](key); |
631 return dart.as(table[hash], core.List); | 669 return dart.as(table[hash], core.List); |
632 } | 670 } |
633 _findBucketIndex(bucket, key) { | 671 [_findBucketIndex](bucket, key) { |
634 if (bucket === null) | 672 if (bucket === null) |
635 return -1; | 673 return -1; |
636 let length = bucket.length; | 674 let length = bucket.length; |
637 for (let i = 0; i < length; i++) { | 675 for (let i = 0; i < length; i++) { |
638 let cell = dart.as(bucket[i], LinkedHashMapCell); | 676 let cell = dart.as(bucket[i], LinkedHashMapCell); |
639 if (dart.equals(cell._key, key)) | 677 if (dart.equals(cell[_key], key)) |
640 return i; | 678 return i; |
641 } | 679 } |
642 return -1; | 680 return -1; |
643 } | 681 } |
644 static _newHashTable() { | 682 static [_newHashTable]() { |
645 let table = Object.create(null); | 683 let table = Object.create(null); |
646 let temporaryKey = '<non-identifier-key>'; | 684 let temporaryKey = '<non-identifier-key>'; |
647 _setTableEntry(table, temporaryKey, table); | 685 _setTableEntry(table, temporaryKey, table); |
648 _deleteTableEntry(table, temporaryKey); | 686 _deleteTableEntry(table, temporaryKey); |
649 return table; | 687 return table; |
650 } | 688 } |
651 toString() { | 689 toString() { |
652 return Maps.mapToString(this); | 690 return Maps.mapToString(this); |
653 } | 691 } |
654 } | 692 } |
655 return _LinkedHashMap; | 693 return _LinkedHashMap; |
656 }); | 694 }); |
657 let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic); | 695 let _LinkedHashMap = _LinkedHashMap$(dynamic, dynamic); |
658 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { | 696 let _LinkedIdentityHashMap$ = dart.generic(function(K, V) { |
659 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { | 697 class _LinkedIdentityHashMap extends _LinkedHashMap$(K, V) { |
660 _computeHashCode(key) { | 698 [_computeHashCode](key) { |
661 return core.identityHashCode(key) & 0x3ffffff; | 699 return core.identityHashCode(key) & 0x3ffffff; |
662 } | 700 } |
663 _findBucketIndex(bucket, key) { | 701 [_findBucketIndex](bucket, key) { |
664 if (bucket === null) | 702 if (bucket === null) |
665 return -1; | 703 return -1; |
666 let length = bucket.length; | 704 let length = bucket.length; |
667 for (let i = 0; i < length; i++) { | 705 for (let i = 0; i < length; i++) { |
668 let cell = dart.as(bucket[i], LinkedHashMapCell); | 706 let cell = dart.as(bucket[i], LinkedHashMapCell); |
669 if (core.identical(cell._key, key)) | 707 if (core.identical(cell[_key], key)) |
670 return i; | 708 return i; |
671 } | 709 } |
672 return -1; | 710 return -1; |
673 } | 711 } |
674 } | 712 } |
675 return _LinkedIdentityHashMap; | 713 return _LinkedIdentityHashMap; |
676 }); | 714 }); |
677 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic); | 715 let _LinkedIdentityHashMap = _LinkedIdentityHashMap$(dynamic, dynamic); |
678 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { | 716 let _LinkedCustomHashMap$ = dart.generic(function(K, V) { |
679 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { | 717 class _LinkedCustomHashMap extends _LinkedHashMap$(K, V) { |
680 _LinkedCustomHashMap(_equals, _hashCode, validKey) { | 718 _LinkedCustomHashMap($_equals, $_hashCode, validKey) { |
681 this._equals = _equals; | 719 this[_equals] = $_equals; |
682 this._hashCode = _hashCode; | 720 this[_hashCode] = $_hashCode; |
683 this._validKey = dart.as(validKey !== null ? validKey : (v) => dart.is(v
, K), _Predicate); | 721 this[_validKey] = dart.as(validKey !== null ? validKey : (v) => dart.is(
v, K), _Predicate); |
684 super._LinkedHashMap(); | 722 super._LinkedHashMap(); |
685 } | 723 } |
686 get(key) { | 724 get(key) { |
687 if (!dart.notNull(this._validKey(key))) | 725 if (!dart.notNull(this[_validKey](key))) |
688 return dart.as(null, V); | 726 return dart.as(null, V); |
689 return super._get(key); | 727 return super._get(key); |
690 } | 728 } |
691 set(key, value) { | 729 set(key, value) { |
692 super._set(key, value); | 730 super._set(key, value); |
693 } | 731 } |
694 containsKey(key) { | 732 containsKey(key) { |
695 if (!dart.notNull(this._validKey(key))) | 733 if (!dart.notNull(this[_validKey](key))) |
696 return false; | 734 return false; |
697 return super._containsKey(key); | 735 return super._containsKey(key); |
698 } | 736 } |
699 remove(key) { | 737 remove(key) { |
700 if (!dart.notNull(this._validKey(key))) | 738 if (!dart.notNull(this[_validKey](key))) |
701 return dart.as(null, V); | 739 return dart.as(null, V); |
702 return super._remove(key); | 740 return super._remove(key); |
703 } | 741 } |
704 _computeHashCode(key) { | 742 [_computeHashCode](key) { |
705 return this._hashCode(dart.as(key, K)) & 0x3ffffff; | 743 return this[_hashCode](dart.as(key, K)) & 0x3ffffff; |
706 } | 744 } |
707 _findBucketIndex(bucket, key) { | 745 [_findBucketIndex](bucket, key) { |
708 if (bucket === null) | 746 if (bucket === null) |
709 return -1; | 747 return -1; |
710 let length = bucket.length; | 748 let length = bucket.length; |
711 for (let i = 0; i < length; i++) { | 749 for (let i = 0; i < length; i++) { |
712 let cell = dart.as(bucket[i], LinkedHashMapCell); | 750 let cell = dart.as(bucket[i], LinkedHashMapCell); |
713 if (this._equals(dart.as(cell._key, K), dart.as(key, K))) | 751 if (this[_equals](dart.as(cell[_key], K), dart.as(key, K))) |
714 return i; | 752 return i; |
715 } | 753 } |
716 return -1; | 754 return -1; |
717 } | 755 } |
718 } | 756 } |
719 return _LinkedCustomHashMap; | 757 return _LinkedCustomHashMap; |
720 }); | 758 }); |
721 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic); | 759 let _LinkedCustomHashMap = _LinkedCustomHashMap$(dynamic, dynamic); |
722 class LinkedHashMapCell extends dart.Object { | 760 class LinkedHashMapCell extends dart.Object { |
723 LinkedHashMapCell(_key, _value) { | 761 LinkedHashMapCell($_key, $_value) { |
724 this._key = _key; | 762 this[_key] = $_key; |
725 this._value = _value; | 763 this[_value] = $_value; |
726 this._next = null; | 764 this[_next] = null; |
727 this._previous = null; | 765 this[_previous] = null; |
728 } | 766 } |
729 } | 767 } |
730 let LinkedHashMapKeyIterable$ = dart.generic(function(E) { | 768 let LinkedHashMapKeyIterable$ = dart.generic(function(E) { |
731 class LinkedHashMapKeyIterable extends IterableBase$(E) { | 769 class LinkedHashMapKeyIterable extends IterableBase$(E) { |
732 LinkedHashMapKeyIterable(_map) { | 770 LinkedHashMapKeyIterable($_map) { |
733 this._map = _map; | 771 this[_map] = $_map; |
734 super.IterableBase(); | 772 super.IterableBase(); |
735 } | 773 } |
736 get length() { | 774 get length() { |
737 return dart.as(dart.dload(this._map, '_length'), core.int); | 775 return dart.as(dart.dload(this[_map], '_length'), core.int); |
738 } | 776 } |
739 get isEmpty() { | 777 get isEmpty() { |
740 return dart.equals(dart.dload(this._map, '_length'), 0); | 778 return dart.equals(dart.dload(this[_map], '_length'), 0); |
741 } | 779 } |
742 get iterator() { | 780 get iterator() { |
743 return new LinkedHashMapKeyIterator(this._map, dart.as(dart.dload(this._
map, '_modifications'), core.int)); | 781 return new LinkedHashMapKeyIterator(this[_map], dart.as(dart.dload(this[
_map], '_modifications'), core.int)); |
744 } | 782 } |
745 contains(element) { | 783 contains(element) { |
746 return dart.as(dart.dinvoke(this._map, 'containsKey', element), core.boo
l); | 784 return dart.as(dart.dinvoke(this[_map], 'containsKey', element), core.bo
ol); |
747 } | 785 } |
748 forEach(f) { | 786 forEach(f) { |
749 let cell = dart.as(dart.dload(this._map, '_first'), LinkedHashMapCell); | 787 let cell = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCell); |
750 let modifications = dart.as(dart.dload(this._map, '_modifications'), cor
e.int); | 788 let modifications = dart.as(dart.dload(this[_map], '_modifications'), co
re.int); |
751 while (cell !== null) { | 789 while (cell !== null) { |
752 f(dart.as(cell._key, E)); | 790 f(dart.as(cell[_key], E)); |
753 if (modifications !== dart.dload(this._map, '_modifications')) { | 791 if (modifications !== dart.dload(this[_map], '_modifications')) { |
754 throw new core.ConcurrentModificationError(this._map); | 792 throw new core.ConcurrentModificationError(this[_map]); |
755 } | 793 } |
756 cell = cell._next; | 794 cell = cell[_next]; |
757 } | 795 } |
758 } | 796 } |
759 } | 797 } |
760 return LinkedHashMapKeyIterable; | 798 return LinkedHashMapKeyIterable; |
761 }); | 799 }); |
762 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic); | 800 let LinkedHashMapKeyIterable = LinkedHashMapKeyIterable$(dynamic); |
| 801 let _cell = Symbol('_cell'); |
763 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { | 802 let LinkedHashMapKeyIterator$ = dart.generic(function(E) { |
764 class LinkedHashMapKeyIterator extends dart.Object { | 803 class LinkedHashMapKeyIterator extends dart.Object { |
765 LinkedHashMapKeyIterator(_map, _modifications) { | 804 LinkedHashMapKeyIterator($_map, $_modifications) { |
766 this._map = _map; | 805 this[_map] = $_map; |
767 this._modifications = _modifications; | 806 this[_modifications] = $_modifications; |
768 this._cell = null; | 807 this[_cell] = null; |
769 this._current = dart.as(null, E); | 808 this[_current] = dart.as(null, E); |
770 this._cell = dart.as(dart.dload(this._map, '_first'), LinkedHashMapCell)
; | 809 this[_cell] = dart.as(dart.dload(this[_map], '_first'), LinkedHashMapCel
l); |
771 } | 810 } |
772 get current() { | 811 get current() { |
773 return this._current; | 812 return this[_current]; |
774 } | 813 } |
775 moveNext() { | 814 moveNext() { |
776 if (this._modifications !== dart.dload(this._map, '_modifications')) { | 815 if (this[_modifications] !== dart.dload(this[_map], '_modifications')) { |
777 throw new core.ConcurrentModificationError(this._map); | 816 throw new core.ConcurrentModificationError(this[_map]); |
778 } else if (this._cell === null) { | 817 } else if (this[_cell] === null) { |
779 this._current = dart.as(null, E); | 818 this[_current] = dart.as(null, E); |
780 return false; | 819 return false; |
781 } else { | 820 } else { |
782 this._current = dart.as(this._cell._key, E); | 821 this[_current] = dart.as(this[_cell][_key], E); |
783 this._cell = this._cell._next; | 822 this[_cell] = this[_cell][_next]; |
784 return true; | 823 return true; |
785 } | 824 } |
786 } | 825 } |
787 } | 826 } |
788 return LinkedHashMapKeyIterator; | 827 return LinkedHashMapKeyIterator; |
789 }); | 828 }); |
790 let LinkedHashMapKeyIterator = LinkedHashMapKeyIterator$(dynamic); | 829 let LinkedHashMapKeyIterator = LinkedHashMapKeyIterator$(dynamic); |
| 830 let _elements = Symbol('_elements'); |
| 831 let _newSet = Symbol('_newSet'); |
| 832 let _computeElements = Symbol('_computeElements'); |
| 833 let _contains = Symbol('_contains'); |
| 834 let _lookup = Symbol('_lookup'); |
| 835 let _add = Symbol('_add'); |
| 836 let _isStringElement = Symbol('_isStringElement'); |
| 837 let _isNumericElement = Symbol('_isNumericElement'); |
791 let _HashSet$ = dart.generic(function(E) { | 838 let _HashSet$ = dart.generic(function(E) { |
792 class _HashSet extends _HashSetBase$(E) { | 839 class _HashSet extends _HashSetBase$(E) { |
793 _HashSet() { | 840 _HashSet() { |
794 this._length = 0; | 841 this[_length] = 0; |
795 this._strings = null; | 842 this[_strings] = null; |
796 this._nums = null; | 843 this[_nums] = null; |
797 this._rest = null; | 844 this[_rest] = null; |
798 this._elements = null; | 845 this[_elements] = null; |
799 super._HashSetBase(); | 846 super._HashSetBase(); |
800 } | 847 } |
801 _newSet() { | 848 [_newSet]() { |
802 return new _HashSet(); | 849 return new _HashSet(); |
803 } | 850 } |
804 get iterator() { | 851 get iterator() { |
805 return new HashSetIterator(this, this._computeElements()); | 852 return new HashSetIterator(this, this[_computeElements]()); |
806 } | 853 } |
807 get length() { | 854 get length() { |
808 return this._length; | 855 return this[_length]; |
809 } | 856 } |
810 get isEmpty() { | 857 get isEmpty() { |
811 return this._length === 0; | 858 return this[_length] === 0; |
812 } | 859 } |
813 get isNotEmpty() { | 860 get isNotEmpty() { |
814 return !dart.notNull(this.isEmpty); | 861 return !dart.notNull(this.isEmpty); |
815 } | 862 } |
816 contains(object) { | 863 contains(object) { |
817 if (_isStringElement(object)) { | 864 if (_isStringElement(object)) { |
818 let strings = this._strings; | 865 let strings = this[_strings]; |
819 return strings === null ? false : _hasTableEntry(strings, object); | 866 return strings === null ? false : _hasTableEntry(strings, object); |
820 } else if (_isNumericElement(object)) { | 867 } else if (_isNumericElement(object)) { |
821 let nums = this._nums; | 868 let nums = this[_nums]; |
822 return nums === null ? false : _hasTableEntry(nums, object); | 869 return nums === null ? false : _hasTableEntry(nums, object); |
823 } else { | 870 } else { |
824 return this._contains(object); | 871 return this[_contains](object); |
825 } | 872 } |
826 } | 873 } |
827 _contains(object) { | 874 [_contains](object) { |
828 let rest = this._rest; | 875 let rest = this[_rest]; |
829 if (rest === null) | 876 if (rest === null) |
830 return false; | 877 return false; |
831 let bucket = this._getBucket(rest, object); | 878 let bucket = this[_getBucket](rest, object); |
832 return this._findBucketIndex(bucket, object) >= 0; | 879 return this[_findBucketIndex](bucket, object) >= 0; |
833 } | 880 } |
834 lookup(object) { | 881 lookup(object) { |
835 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { | 882 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { |
836 return dart.as(this.contains(object) ? object : null, E); | 883 return dart.as(this.contains(object) ? object : null, E); |
837 } | 884 } |
838 return this._lookup(object); | 885 return this[_lookup](object); |
839 } | 886 } |
840 _lookup(object) { | 887 [_lookup](object) { |
841 let rest = this._rest; | 888 let rest = this[_rest]; |
842 if (rest === null) | 889 if (rest === null) |
843 return dart.as(null, E); | 890 return dart.as(null, E); |
844 let bucket = this._getBucket(rest, object); | 891 let bucket = this[_getBucket](rest, object); |
845 let index = this._findBucketIndex(bucket, object); | 892 let index = this[_findBucketIndex](bucket, object); |
846 if (index < 0) | 893 if (index < 0) |
847 return dart.as(null, E); | 894 return dart.as(null, E); |
848 return dart.as(bucket.get(index), E); | 895 return dart.as(bucket.get(index), E); |
849 } | 896 } |
850 add(element) { | 897 add(element) { |
851 if (_isStringElement(element)) { | 898 if (_isStringElement(element)) { |
852 let strings = this._strings; | 899 let strings = this[_strings]; |
853 if (strings === null) | 900 if (strings === null) |
854 this._strings = strings = _newHashTable(); | 901 this[_strings] = strings = _newHashTable(); |
855 return this._addHashTableEntry(strings, element); | 902 return this[_addHashTableEntry](strings, element); |
856 } else if (_isNumericElement(element)) { | 903 } else if (_isNumericElement(element)) { |
857 let nums = this._nums; | 904 let nums = this[_nums]; |
858 if (nums === null) | 905 if (nums === null) |
859 this._nums = nums = _newHashTable(); | 906 this[_nums] = nums = _newHashTable(); |
860 return this._addHashTableEntry(nums, element); | 907 return this[_addHashTableEntry](nums, element); |
861 } else { | 908 } else { |
862 return this._add(element); | 909 return this[_add](element); |
863 } | 910 } |
864 } | 911 } |
865 _add(element) { | 912 [_add](element) { |
866 let rest = this._rest; | 913 let rest = this[_rest]; |
867 if (rest === null) | 914 if (rest === null) |
868 this._rest = rest = _newHashTable(); | 915 this[_rest] = rest = _newHashTable(); |
869 let hash = this._computeHashCode(element); | 916 let hash = this[_computeHashCode](element); |
870 let bucket = rest[hash]; | 917 let bucket = rest[hash]; |
871 if (bucket === null) { | 918 if (bucket === null) { |
872 _setTableEntry(rest, hash, [element]); | 919 _setTableEntry(rest, hash, [element]); |
873 } else { | 920 } else { |
874 let index = this._findBucketIndex(bucket, element); | 921 let index = this[_findBucketIndex](bucket, element); |
875 if (index >= 0) | 922 if (index >= 0) |
876 return false; | 923 return false; |
877 bucket.push(element); | 924 bucket.push(element); |
878 } | 925 } |
879 this._length++; | 926 this[_length]++; |
880 this._elements = null; | 927 this[_elements] = null; |
881 return true; | 928 return true; |
882 } | 929 } |
883 addAll(objects) { | 930 addAll(objects) { |
884 for (let each of objects) { | 931 for (let each of objects) { |
885 this.add(each); | 932 this.add(each); |
886 } | 933 } |
887 } | 934 } |
888 remove(object) { | 935 remove(object) { |
889 if (_isStringElement(object)) { | 936 if (_isStringElement(object)) { |
890 return this._removeHashTableEntry(this._strings, object); | 937 return this[_removeHashTableEntry](this[_strings], object); |
891 } else if (_isNumericElement(object)) { | 938 } else if (_isNumericElement(object)) { |
892 return this._removeHashTableEntry(this._nums, object); | 939 return this[_removeHashTableEntry](this[_nums], object); |
893 } else { | 940 } else { |
894 return this._remove(object); | 941 return this[_remove](object); |
895 } | 942 } |
896 } | 943 } |
897 _remove(object) { | 944 [_remove](object) { |
898 let rest = this._rest; | 945 let rest = this[_rest]; |
899 if (rest === null) | 946 if (rest === null) |
900 return false; | 947 return false; |
901 let bucket = this._getBucket(rest, object); | 948 let bucket = this[_getBucket](rest, object); |
902 let index = this._findBucketIndex(bucket, object); | 949 let index = this[_findBucketIndex](bucket, object); |
903 if (index < 0) | 950 if (index < 0) |
904 return false; | 951 return false; |
905 this._length--; | 952 this[_length]--; |
906 this._elements = null; | 953 this[_elements] = null; |
907 bucket.splice(index, 1); | 954 bucket.splice(index, 1); |
908 return true; | 955 return true; |
909 } | 956 } |
910 clear() { | 957 clear() { |
911 if (this._length > 0) { | 958 if (this[_length] > 0) { |
912 this._strings = this._nums = this._rest = this._elements = null; | 959 this[_strings] = this[_nums] = this[_rest] = this[_elements] = null; |
913 this._length = 0; | 960 this[_length] = 0; |
914 } | 961 } |
915 } | 962 } |
916 _computeElements() { | 963 [_computeElements]() { |
917 if (this._elements !== null) | 964 if (this[_elements] !== null) |
918 return this._elements; | 965 return this[_elements]; |
919 let result = new core.List(this._length); | 966 let result = new core.List(this[_length]); |
920 let index = 0; | 967 let index = 0; |
921 let strings = this._strings; | 968 let strings = this[_strings]; |
922 if (strings !== null) { | 969 if (strings !== null) { |
923 let names = Object.getOwnPropertyNames(strings); | 970 let names = Object.getOwnPropertyNames(strings); |
924 let entries = names.length; | 971 let entries = names.length; |
925 for (let i = 0; i < entries; i++) { | 972 for (let i = 0; i < entries; i++) { |
926 let element = names[i]; | 973 let element = names[i]; |
927 result[index] = element; | 974 result[index] = element; |
928 index++; | 975 index++; |
929 } | 976 } |
930 } | 977 } |
931 let nums = this._nums; | 978 let nums = this[_nums]; |
932 if (nums !== null) { | 979 if (nums !== null) { |
933 let names = Object.getOwnPropertyNames(nums); | 980 let names = Object.getOwnPropertyNames(nums); |
934 let entries = names.length; | 981 let entries = names.length; |
935 for (let i = 0; i < entries; i++) { | 982 for (let i = 0; i < entries; i++) { |
936 let element = +names[i]; | 983 let element = +names[i]; |
937 result[index] = element; | 984 result[index] = element; |
938 index++; | 985 index++; |
939 } | 986 } |
940 } | 987 } |
941 let rest = this._rest; | 988 let rest = this[_rest]; |
942 if (rest !== null) { | 989 if (rest !== null) { |
943 let names = Object.getOwnPropertyNames(rest); | 990 let names = Object.getOwnPropertyNames(rest); |
944 let entries = names.length; | 991 let entries = names.length; |
945 for (let i = 0; i < entries; i++) { | 992 for (let i = 0; i < entries; i++) { |
946 let entry = names[i]; | 993 let entry = names[i]; |
947 let bucket = rest[entry]; | 994 let bucket = rest[entry]; |
948 let length = bucket.length; | 995 let length = bucket.length; |
949 for (let i = 0; i < length; i++) { | 996 for (let i = 0; i < length; i++) { |
950 result[index] = bucket[i]; | 997 result[index] = bucket[i]; |
951 index++; | 998 index++; |
952 } | 999 } |
953 } | 1000 } |
954 } | 1001 } |
955 dart.assert(index === this._length); | 1002 dart.assert(index === this[_length]); |
956 return this._elements = result; | 1003 return this[_elements] = result; |
957 } | 1004 } |
958 _addHashTableEntry(table, element) { | 1005 [_addHashTableEntry](table, element) { |
959 if (_hasTableEntry(table, element)) | 1006 if (_hasTableEntry(table, element)) |
960 return false; | 1007 return false; |
961 _setTableEntry(table, element, 0); | 1008 _setTableEntry(table, element, 0); |
962 this._length++; | 1009 this[_length]++; |
963 this._elements = null; | 1010 this[_elements] = null; |
964 return true; | 1011 return true; |
965 } | 1012 } |
966 _removeHashTableEntry(table, element) { | 1013 [_removeHashTableEntry](table, element) { |
967 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e
lement))) { | 1014 if (dart.notNull(table !== null) && dart.notNull(_hasTableEntry(table, e
lement))) { |
968 _deleteTableEntry(table, element); | 1015 _deleteTableEntry(table, element); |
969 this._length--; | 1016 this[_length]--; |
970 this._elements = null; | 1017 this[_elements] = null; |
971 return true; | 1018 return true; |
972 } else { | 1019 } else { |
973 return false; | 1020 return false; |
974 } | 1021 } |
975 } | 1022 } |
976 static _isStringElement(element) { | 1023 static [_isStringElement](element) { |
977 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); | 1024 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); |
978 } | 1025 } |
979 static _isNumericElement(element) { | 1026 static [_isNumericElement](element) { |
980 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); | 1027 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); |
981 } | 1028 } |
982 _computeHashCode(element) { | 1029 [_computeHashCode](element) { |
983 return dart.dload(element, 'hashCode') & 0x3ffffff; | 1030 return dart.dload(element, 'hashCode') & 0x3ffffff; |
984 } | 1031 } |
985 static _hasTableEntry(table, key) { | 1032 static [_hasTableEntry](table, key) { |
986 let entry = table[key]; | 1033 let entry = table[key]; |
987 return entry !== null; | 1034 return entry !== null; |
988 } | 1035 } |
989 static _setTableEntry(table, key, value) { | 1036 static [_setTableEntry](table, key, value) { |
990 dart.assert(value !== null); | 1037 dart.assert(value !== null); |
991 table[key] = value; | 1038 table[key] = value; |
992 } | 1039 } |
993 static _deleteTableEntry(table, key) { | 1040 static [_deleteTableEntry](table, key) { |
994 delete table[key]; | 1041 delete table[key]; |
995 } | 1042 } |
996 _getBucket(table, element) { | 1043 [_getBucket](table, element) { |
997 let hash = this._computeHashCode(element); | 1044 let hash = this[_computeHashCode](element); |
998 return dart.as(table[hash], core.List); | 1045 return dart.as(table[hash], core.List); |
999 } | 1046 } |
1000 _findBucketIndex(bucket, element) { | 1047 [_findBucketIndex](bucket, element) { |
1001 if (bucket === null) | 1048 if (bucket === null) |
1002 return -1; | 1049 return -1; |
1003 let length = bucket.length; | 1050 let length = bucket.length; |
1004 for (let i = 0; i < length; i++) { | 1051 for (let i = 0; i < length; i++) { |
1005 if (dart.equals(bucket[i], element)) | 1052 if (dart.equals(bucket[i], element)) |
1006 return i; | 1053 return i; |
1007 } | 1054 } |
1008 return -1; | 1055 return -1; |
1009 } | 1056 } |
1010 static _newHashTable() { | 1057 static [_newHashTable]() { |
1011 let table = Object.create(null); | 1058 let table = Object.create(null); |
1012 let temporaryKey = '<non-identifier-key>'; | 1059 let temporaryKey = '<non-identifier-key>'; |
1013 _setTableEntry(table, temporaryKey, table); | 1060 _setTableEntry(table, temporaryKey, table); |
1014 _deleteTableEntry(table, temporaryKey); | 1061 _deleteTableEntry(table, temporaryKey); |
1015 return table; | 1062 return table; |
1016 } | 1063 } |
1017 } | 1064 } |
1018 return _HashSet; | 1065 return _HashSet; |
1019 }); | 1066 }); |
1020 let _HashSet = _HashSet$(dynamic); | 1067 let _HashSet = _HashSet$(dynamic); |
1021 let _IdentityHashSet$ = dart.generic(function(E) { | 1068 let _IdentityHashSet$ = dart.generic(function(E) { |
1022 class _IdentityHashSet extends _HashSet$(E) { | 1069 class _IdentityHashSet extends _HashSet$(E) { |
1023 _newSet() { | 1070 [_newSet]() { |
1024 return new _IdentityHashSet(); | 1071 return new _IdentityHashSet(); |
1025 } | 1072 } |
1026 _computeHashCode(key) { | 1073 [_computeHashCode](key) { |
1027 return core.identityHashCode(key) & 0x3ffffff; | 1074 return core.identityHashCode(key) & 0x3ffffff; |
1028 } | 1075 } |
1029 _findBucketIndex(bucket, element) { | 1076 [_findBucketIndex](bucket, element) { |
1030 if (bucket === null) | 1077 if (bucket === null) |
1031 return -1; | 1078 return -1; |
1032 let length = bucket.length; | 1079 let length = bucket.length; |
1033 for (let i = 0; i < length; i++) { | 1080 for (let i = 0; i < length; i++) { |
1034 if (core.identical(bucket[i], element)) | 1081 if (core.identical(bucket[i], element)) |
1035 return i; | 1082 return i; |
1036 } | 1083 } |
1037 return -1; | 1084 return -1; |
1038 } | 1085 } |
1039 } | 1086 } |
1040 return _IdentityHashSet; | 1087 return _IdentityHashSet; |
1041 }); | 1088 }); |
1042 let _IdentityHashSet = _IdentityHashSet$(dynamic); | 1089 let _IdentityHashSet = _IdentityHashSet$(dynamic); |
| 1090 let _equality = Symbol('_equality'); |
| 1091 let _hasher = Symbol('_hasher'); |
1043 let _CustomHashSet$ = dart.generic(function(E) { | 1092 let _CustomHashSet$ = dart.generic(function(E) { |
1044 class _CustomHashSet extends _HashSet$(E) { | 1093 class _CustomHashSet extends _HashSet$(E) { |
1045 _CustomHashSet(_equality, _hasher, validKey) { | 1094 _CustomHashSet($_equality, $_hasher, validKey) { |
1046 this._equality = _equality; | 1095 this[_equality] = $_equality; |
1047 this._hasher = _hasher; | 1096 this[_hasher] = $_hasher; |
1048 this._validKey = dart.as(validKey !== null ? validKey : (x) => dart.is(x
, E), _Predicate); | 1097 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); |
1049 super._HashSet(); | 1098 super._HashSet(); |
1050 } | 1099 } |
1051 _newSet() { | 1100 [_newSet]() { |
1052 return new _CustomHashSet(this._equality, this._hasher, this._validKey); | 1101 return new _CustomHashSet(this[_equality], this[_hasher], this[_validKey
]); |
1053 } | 1102 } |
1054 _findBucketIndex(bucket, element) { | 1103 [_findBucketIndex](bucket, element) { |
1055 if (bucket === null) | 1104 if (bucket === null) |
1056 return -1; | 1105 return -1; |
1057 let length = bucket.length; | 1106 let length = bucket.length; |
1058 for (let i = 0; i < length; i++) { | 1107 for (let i = 0; i < length; i++) { |
1059 if (this._equality(dart.as(bucket[i], E), dart.as(element, E))) | 1108 if (this[_equality](dart.as(bucket[i], E), dart.as(element, E))) |
1060 return i; | 1109 return i; |
1061 } | 1110 } |
1062 return -1; | 1111 return -1; |
1063 } | 1112 } |
1064 _computeHashCode(element) { | 1113 [_computeHashCode](element) { |
1065 return this._hasher(dart.as(element, E)) & 0x3ffffff; | 1114 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
1066 } | 1115 } |
1067 add(object) { | 1116 add(object) { |
1068 return super._add(object); | 1117 return super._add(object); |
1069 } | 1118 } |
1070 contains(object) { | 1119 contains(object) { |
1071 if (!dart.notNull(this._validKey(object))) | 1120 if (!dart.notNull(this[_validKey](object))) |
1072 return false; | 1121 return false; |
1073 return super._contains(object); | 1122 return super._contains(object); |
1074 } | 1123 } |
1075 lookup(object) { | 1124 lookup(object) { |
1076 if (!dart.notNull(this._validKey(object))) | 1125 if (!dart.notNull(this[_validKey](object))) |
1077 return dart.as(null, E); | 1126 return dart.as(null, E); |
1078 return super._lookup(object); | 1127 return super._lookup(object); |
1079 } | 1128 } |
1080 remove(object) { | 1129 remove(object) { |
1081 if (!dart.notNull(this._validKey(object))) | 1130 if (!dart.notNull(this[_validKey](object))) |
1082 return false; | 1131 return false; |
1083 return super._remove(object); | 1132 return super._remove(object); |
1084 } | 1133 } |
1085 } | 1134 } |
1086 return _CustomHashSet; | 1135 return _CustomHashSet; |
1087 }); | 1136 }); |
1088 let _CustomHashSet = _CustomHashSet$(dynamic); | 1137 let _CustomHashSet = _CustomHashSet$(dynamic); |
1089 let HashSetIterator$ = dart.generic(function(E) { | 1138 let HashSetIterator$ = dart.generic(function(E) { |
1090 class HashSetIterator extends dart.Object { | 1139 class HashSetIterator extends dart.Object { |
1091 HashSetIterator(_set, _elements) { | 1140 HashSetIterator($_set, $_elements) { |
1092 this._set = _set; | 1141 this[_set] = $_set; |
1093 this._elements = _elements; | 1142 this[_elements] = $_elements; |
1094 this._offset = 0; | 1143 this[_offset] = 0; |
1095 this._current = dart.as(null, E); | 1144 this[_current] = dart.as(null, E); |
1096 } | 1145 } |
1097 get current() { | 1146 get current() { |
1098 return this._current; | 1147 return this[_current]; |
1099 } | 1148 } |
1100 moveNext() { | 1149 moveNext() { |
1101 let elements = this._elements; | 1150 let elements = this[_elements]; |
1102 let offset = this._offset; | 1151 let offset = this[_offset]; |
1103 if (elements !== dart.dload(this._set, '_elements')) { | 1152 if (elements !== dart.dload(this[_set], '_elements')) { |
1104 throw new core.ConcurrentModificationError(this._set); | 1153 throw new core.ConcurrentModificationError(this[_set]); |
1105 } else if (offset >= elements.length) { | 1154 } else if (offset >= elements.length) { |
1106 this._current = dart.as(null, E); | 1155 this[_current] = dart.as(null, E); |
1107 return false; | 1156 return false; |
1108 } else { | 1157 } else { |
1109 this._current = dart.as(elements[offset], E); | 1158 this[_current] = dart.as(elements[offset], E); |
1110 this._offset = offset + 1; | 1159 this[_offset] = offset + 1; |
1111 return true; | 1160 return true; |
1112 } | 1161 } |
1113 } | 1162 } |
1114 } | 1163 } |
1115 return HashSetIterator; | 1164 return HashSetIterator; |
1116 }); | 1165 }); |
1117 let HashSetIterator = HashSetIterator$(dynamic); | 1166 let HashSetIterator = HashSetIterator$(dynamic); |
| 1167 let _unsupported = Symbol('_unsupported'); |
| 1168 let _element = Symbol('_element'); |
| 1169 let _filterWhere = Symbol('_filterWhere'); |
1118 let _LinkedHashSet$ = dart.generic(function(E) { | 1170 let _LinkedHashSet$ = dart.generic(function(E) { |
1119 class _LinkedHashSet extends _HashSetBase$(E) { | 1171 class _LinkedHashSet extends _HashSetBase$(E) { |
1120 _LinkedHashSet() { | 1172 _LinkedHashSet() { |
1121 this._length = 0; | 1173 this[_length] = 0; |
1122 this._strings = null; | 1174 this[_strings] = null; |
1123 this._nums = null; | 1175 this[_nums] = null; |
1124 this._rest = null; | 1176 this[_rest] = null; |
1125 this._first = null; | 1177 this[_first] = null; |
1126 this._last = null; | 1178 this[_last] = null; |
1127 this._modifications = 0; | 1179 this[_modifications] = 0; |
1128 super._HashSetBase(); | 1180 super._HashSetBase(); |
1129 } | 1181 } |
1130 _newSet() { | 1182 [_newSet]() { |
1131 return new _LinkedHashSet(); | 1183 return new _LinkedHashSet(); |
1132 } | 1184 } |
1133 _unsupported(operation) { | 1185 [_unsupported](operation) { |
1134 throw `LinkedHashSet: unsupported ${operation}`; | 1186 throw `LinkedHashSet: unsupported ${operation}`; |
1135 } | 1187 } |
1136 get iterator() { | 1188 get iterator() { |
1137 return dart.as(new LinkedHashSetIterator(this, this._modifications), cor
e.Iterator$(E)); | 1189 return dart.as(new LinkedHashSetIterator(this, this[_modifications]), co
re.Iterator$(E)); |
1138 } | 1190 } |
1139 get length() { | 1191 get length() { |
1140 return this._length; | 1192 return this[_length]; |
1141 } | 1193 } |
1142 get isEmpty() { | 1194 get isEmpty() { |
1143 return this._length === 0; | 1195 return this[_length] === 0; |
1144 } | 1196 } |
1145 get isNotEmpty() { | 1197 get isNotEmpty() { |
1146 return !dart.notNull(this.isEmpty); | 1198 return !dart.notNull(this.isEmpty); |
1147 } | 1199 } |
1148 contains(object) { | 1200 contains(object) { |
1149 if (_isStringElement(object)) { | 1201 if (_isStringElement(object)) { |
1150 let strings = this._strings; | 1202 let strings = this[_strings]; |
1151 if (strings === null) | 1203 if (strings === null) |
1152 return false; | 1204 return false; |
1153 let cell = dart.as(_getTableEntry(strings, object), LinkedHashSetCell)
; | 1205 let cell = dart.as(_getTableEntry(strings, object), LinkedHashSetCell)
; |
1154 return cell !== null; | 1206 return cell !== null; |
1155 } else if (_isNumericElement(object)) { | 1207 } else if (_isNumericElement(object)) { |
1156 let nums = this._nums; | 1208 let nums = this[_nums]; |
1157 if (nums === null) | 1209 if (nums === null) |
1158 return false; | 1210 return false; |
1159 let cell = dart.as(_getTableEntry(nums, object), LinkedHashSetCell); | 1211 let cell = dart.as(_getTableEntry(nums, object), LinkedHashSetCell); |
1160 return cell !== null; | 1212 return cell !== null; |
1161 } else { | 1213 } else { |
1162 return this._contains(object); | 1214 return this[_contains](object); |
1163 } | 1215 } |
1164 } | 1216 } |
1165 _contains(object) { | 1217 [_contains](object) { |
1166 let rest = this._rest; | 1218 let rest = this[_rest]; |
1167 if (rest === null) | 1219 if (rest === null) |
1168 return false; | 1220 return false; |
1169 let bucket = this._getBucket(rest, object); | 1221 let bucket = this[_getBucket](rest, object); |
1170 return this._findBucketIndex(bucket, object) >= 0; | 1222 return this[_findBucketIndex](bucket, object) >= 0; |
1171 } | 1223 } |
1172 lookup(object) { | 1224 lookup(object) { |
1173 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { | 1225 if (dart.notNull(_isStringElement(object)) || dart.notNull(_isNumericEle
ment(object))) { |
1174 return dart.as(this.contains(object) ? object : null, E); | 1226 return dart.as(this.contains(object) ? object : null, E); |
1175 } else { | 1227 } else { |
1176 return this._lookup(object); | 1228 return this[_lookup](object); |
1177 } | 1229 } |
1178 } | 1230 } |
1179 _lookup(object) { | 1231 [_lookup](object) { |
1180 let rest = this._rest; | 1232 let rest = this[_rest]; |
1181 if (rest === null) | 1233 if (rest === null) |
1182 return dart.as(null, E); | 1234 return dart.as(null, E); |
1183 let bucket = this._getBucket(rest, object); | 1235 let bucket = this[_getBucket](rest, object); |
1184 let index = this._findBucketIndex(bucket, object); | 1236 let index = this[_findBucketIndex](bucket, object); |
1185 if (index < 0) | 1237 if (index < 0) |
1186 return dart.as(null, E); | 1238 return dart.as(null, E); |
1187 return dart.as(dart.dload(bucket.get(index), '_element'), E); | 1239 return dart.as(dart.dload(bucket.get(index), '_element'), E); |
1188 } | 1240 } |
1189 forEach(action) { | 1241 forEach(action) { |
1190 let cell = this._first; | 1242 let cell = this[_first]; |
1191 let modifications = this._modifications; | 1243 let modifications = this[_modifications]; |
1192 while (cell !== null) { | 1244 while (cell !== null) { |
1193 action(dart.as(cell._element, E)); | 1245 action(dart.as(cell[_element], E)); |
1194 if (modifications !== this._modifications) { | 1246 if (modifications !== this[_modifications]) { |
1195 throw new core.ConcurrentModificationError(this); | 1247 throw new core.ConcurrentModificationError(this); |
1196 } | 1248 } |
1197 cell = cell._next; | 1249 cell = cell[_next]; |
1198 } | 1250 } |
1199 } | 1251 } |
1200 get first() { | 1252 get first() { |
1201 if (this._first === null) | 1253 if (this[_first] === null) |
1202 throw new core.StateError("No elements"); | 1254 throw new core.StateError("No elements"); |
1203 return dart.as(this._first._element, E); | 1255 return dart.as(this[_first][_element], E); |
1204 } | 1256 } |
1205 get last() { | 1257 get last() { |
1206 if (this._last === null) | 1258 if (this[_last] === null) |
1207 throw new core.StateError("No elements"); | 1259 throw new core.StateError("No elements"); |
1208 return dart.as(this._last._element, E); | 1260 return dart.as(this[_last][_element], E); |
1209 } | 1261 } |
1210 add(element) { | 1262 add(element) { |
1211 if (_isStringElement(element)) { | 1263 if (_isStringElement(element)) { |
1212 let strings = this._strings; | 1264 let strings = this[_strings]; |
1213 if (strings === null) | 1265 if (strings === null) |
1214 this._strings = strings = _newHashTable(); | 1266 this[_strings] = strings = _newHashTable(); |
1215 return this._addHashTableEntry(strings, element); | 1267 return this[_addHashTableEntry](strings, element); |
1216 } else if (_isNumericElement(element)) { | 1268 } else if (_isNumericElement(element)) { |
1217 let nums = this._nums; | 1269 let nums = this[_nums]; |
1218 if (nums === null) | 1270 if (nums === null) |
1219 this._nums = nums = _newHashTable(); | 1271 this[_nums] = nums = _newHashTable(); |
1220 return this._addHashTableEntry(nums, element); | 1272 return this[_addHashTableEntry](nums, element); |
1221 } else { | 1273 } else { |
1222 return this._add(element); | 1274 return this[_add](element); |
1223 } | 1275 } |
1224 } | 1276 } |
1225 _add(element) { | 1277 [_add](element) { |
1226 let rest = this._rest; | 1278 let rest = this[_rest]; |
1227 if (rest === null) | 1279 if (rest === null) |
1228 this._rest = rest = _newHashTable(); | 1280 this[_rest] = rest = _newHashTable(); |
1229 let hash = this._computeHashCode(element); | 1281 let hash = this[_computeHashCode](element); |
1230 let bucket = rest[hash]; | 1282 let bucket = rest[hash]; |
1231 if (bucket === null) { | 1283 if (bucket === null) { |
1232 let cell = this._newLinkedCell(element); | 1284 let cell = this[_newLinkedCell](element); |
1233 _setTableEntry(rest, hash, [cell]); | 1285 _setTableEntry(rest, hash, [cell]); |
1234 } else { | 1286 } else { |
1235 let index = this._findBucketIndex(bucket, element); | 1287 let index = this[_findBucketIndex](bucket, element); |
1236 if (index >= 0) | 1288 if (index >= 0) |
1237 return false; | 1289 return false; |
1238 let cell = this._newLinkedCell(element); | 1290 let cell = this[_newLinkedCell](element); |
1239 bucket.push(cell); | 1291 bucket.push(cell); |
1240 } | 1292 } |
1241 return true; | 1293 return true; |
1242 } | 1294 } |
1243 remove(object) { | 1295 remove(object) { |
1244 if (_isStringElement(object)) { | 1296 if (_isStringElement(object)) { |
1245 return this._removeHashTableEntry(this._strings, object); | 1297 return this[_removeHashTableEntry](this[_strings], object); |
1246 } else if (_isNumericElement(object)) { | 1298 } else if (_isNumericElement(object)) { |
1247 return this._removeHashTableEntry(this._nums, object); | 1299 return this[_removeHashTableEntry](this[_nums], object); |
1248 } else { | 1300 } else { |
1249 return this._remove(object); | 1301 return this[_remove](object); |
1250 } | 1302 } |
1251 } | 1303 } |
1252 _remove(object) { | 1304 [_remove](object) { |
1253 let rest = this._rest; | 1305 let rest = this[_rest]; |
1254 if (rest === null) | 1306 if (rest === null) |
1255 return false; | 1307 return false; |
1256 let bucket = this._getBucket(rest, object); | 1308 let bucket = this[_getBucket](rest, object); |
1257 let index = this._findBucketIndex(bucket, object); | 1309 let index = this[_findBucketIndex](bucket, object); |
1258 if (index < 0) | 1310 if (index < 0) |
1259 return false; | 1311 return false; |
1260 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); | 1312 let cell = dart.as(bucket.splice(index, 1)[0], LinkedHashSetCell); |
1261 this._unlinkCell(cell); | 1313 this[_unlinkCell](cell); |
1262 return true; | 1314 return true; |
1263 } | 1315 } |
1264 removeWhere(test) { | 1316 removeWhere(test) { |
1265 this._filterWhere(test, true); | 1317 this[_filterWhere](test, true); |
1266 } | 1318 } |
1267 retainWhere(test) { | 1319 retainWhere(test) { |
1268 this._filterWhere(test, false); | 1320 this[_filterWhere](test, false); |
1269 } | 1321 } |
1270 _filterWhere(test, removeMatching) { | 1322 [_filterWhere](test, removeMatching) { |
1271 let cell = this._first; | 1323 let cell = this[_first]; |
1272 while (cell !== null) { | 1324 while (cell !== null) { |
1273 let element = dart.as(cell._element, E); | 1325 let element = dart.as(cell[_element], E); |
1274 let next = cell._next; | 1326 let next = cell[_next]; |
1275 let modifications = this._modifications; | 1327 let modifications = this[_modifications]; |
1276 let shouldRemove = removeMatching === test(element); | 1328 let shouldRemove = removeMatching === test(element); |
1277 if (modifications !== this._modifications) { | 1329 if (modifications !== this[_modifications]) { |
1278 throw new core.ConcurrentModificationError(this); | 1330 throw new core.ConcurrentModificationError(this); |
1279 } | 1331 } |
1280 if (shouldRemove) | 1332 if (shouldRemove) |
1281 this.remove(element); | 1333 this.remove(element); |
1282 cell = next; | 1334 cell = next; |
1283 } | 1335 } |
1284 } | 1336 } |
1285 clear() { | 1337 clear() { |
1286 if (this._length > 0) { | 1338 if (this[_length] > 0) { |
1287 this._strings = this._nums = this._rest = this._first = this._last = n
ull; | 1339 this[_strings] = this[_nums] = this[_rest] = this[_first] = this[_last
] = null; |
1288 this._length = 0; | 1340 this[_length] = 0; |
1289 this._modified(); | 1341 this[_modified](); |
1290 } | 1342 } |
1291 } | 1343 } |
1292 _addHashTableEntry(table, element) { | 1344 [_addHashTableEntry](table, element) { |
1293 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); | 1345 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); |
1294 if (cell !== null) | 1346 if (cell !== null) |
1295 return false; | 1347 return false; |
1296 _setTableEntry(table, element, this._newLinkedCell(element)); | 1348 _setTableEntry(table, element, this[_newLinkedCell](element)); |
1297 return true; | 1349 return true; |
1298 } | 1350 } |
1299 _removeHashTableEntry(table, element) { | 1351 [_removeHashTableEntry](table, element) { |
1300 if (table === null) | 1352 if (table === null) |
1301 return false; | 1353 return false; |
1302 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); | 1354 let cell = dart.as(_getTableEntry(table, element), LinkedHashSetCell); |
1303 if (cell === null) | 1355 if (cell === null) |
1304 return false; | 1356 return false; |
1305 this._unlinkCell(cell); | 1357 this[_unlinkCell](cell); |
1306 _deleteTableEntry(table, element); | 1358 _deleteTableEntry(table, element); |
1307 return true; | 1359 return true; |
1308 } | 1360 } |
1309 _modified() { | 1361 [_modified]() { |
1310 this._modifications = this._modifications + 1 & 67108863; | 1362 this[_modifications] = this[_modifications] + 1 & 67108863; |
1311 } | 1363 } |
1312 _newLinkedCell(element) { | 1364 [_newLinkedCell](element) { |
1313 let cell = new LinkedHashSetCell(element); | 1365 let cell = new LinkedHashSetCell(element); |
1314 if (this._first === null) { | 1366 if (this[_first] === null) { |
1315 this._first = this._last = cell; | 1367 this[_first] = this[_last] = cell; |
1316 } else { | 1368 } else { |
1317 let last = this._last; | 1369 let last = this[_last]; |
1318 cell._previous = last; | 1370 cell[_previous] = last; |
1319 this._last = last._next = cell; | 1371 this[_last] = last[_next] = cell; |
1320 } | 1372 } |
1321 this._length++; | 1373 this[_length]++; |
1322 this._modified(); | 1374 this[_modified](); |
1323 return cell; | 1375 return cell; |
1324 } | 1376 } |
1325 _unlinkCell(cell) { | 1377 [_unlinkCell](cell) { |
1326 let previous = cell._previous; | 1378 let previous = cell[_previous]; |
1327 let next = cell._next; | 1379 let next = cell[_next]; |
1328 if (previous === null) { | 1380 if (previous === null) { |
1329 dart.assert(dart.equals(cell, this._first)); | 1381 dart.assert(dart.equals(cell, this[_first])); |
1330 this._first = next; | 1382 this[_first] = next; |
1331 } else { | 1383 } else { |
1332 previous._next = next; | 1384 previous[_next] = next; |
1333 } | 1385 } |
1334 if (next === null) { | 1386 if (next === null) { |
1335 dart.assert(dart.equals(cell, this._last)); | 1387 dart.assert(dart.equals(cell, this[_last])); |
1336 this._last = previous; | 1388 this[_last] = previous; |
1337 } else { | 1389 } else { |
1338 next._previous = previous; | 1390 next[_previous] = previous; |
1339 } | 1391 } |
1340 this._length--; | 1392 this[_length]--; |
1341 this._modified(); | 1393 this[_modified](); |
1342 } | 1394 } |
1343 static _isStringElement(element) { | 1395 static [_isStringElement](element) { |
1344 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); | 1396 return dart.notNull(typeof element == string) && dart.notNull(!dart.equa
ls(element, '__proto__')); |
1345 } | 1397 } |
1346 static _isNumericElement(element) { | 1398 static [_isNumericElement](element) { |
1347 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); | 1399 return dart.notNull(dart.is(element, core.num)) && dart.notNull((element
& 0x3ffffff) === element); |
1348 } | 1400 } |
1349 _computeHashCode(element) { | 1401 [_computeHashCode](element) { |
1350 return dart.dload(element, 'hashCode') & 0x3ffffff; | 1402 return dart.dload(element, 'hashCode') & 0x3ffffff; |
1351 } | 1403 } |
1352 static _getTableEntry(table, key) { | 1404 static [_getTableEntry](table, key) { |
1353 return table[key]; | 1405 return table[key]; |
1354 } | 1406 } |
1355 static _setTableEntry(table, key, value) { | 1407 static [_setTableEntry](table, key, value) { |
1356 dart.assert(value !== null); | 1408 dart.assert(value !== null); |
1357 table[key] = value; | 1409 table[key] = value; |
1358 } | 1410 } |
1359 static _deleteTableEntry(table, key) { | 1411 static [_deleteTableEntry](table, key) { |
1360 delete table[key]; | 1412 delete table[key]; |
1361 } | 1413 } |
1362 _getBucket(table, element) { | 1414 [_getBucket](table, element) { |
1363 let hash = this._computeHashCode(element); | 1415 let hash = this[_computeHashCode](element); |
1364 return dart.as(table[hash], core.List); | 1416 return dart.as(table[hash], core.List); |
1365 } | 1417 } |
1366 _findBucketIndex(bucket, element) { | 1418 [_findBucketIndex](bucket, element) { |
1367 if (bucket === null) | 1419 if (bucket === null) |
1368 return -1; | 1420 return -1; |
1369 let length = bucket.length; | 1421 let length = bucket.length; |
1370 for (let i = 0; i < length; i++) { | 1422 for (let i = 0; i < length; i++) { |
1371 let cell = dart.as(bucket[i], LinkedHashSetCell); | 1423 let cell = dart.as(bucket[i], LinkedHashSetCell); |
1372 if (dart.equals(cell._element, element)) | 1424 if (dart.equals(cell[_element], element)) |
1373 return i; | 1425 return i; |
1374 } | 1426 } |
1375 return -1; | 1427 return -1; |
1376 } | 1428 } |
1377 static _newHashTable() { | 1429 static [_newHashTable]() { |
1378 let table = Object.create(null); | 1430 let table = Object.create(null); |
1379 let temporaryKey = '<non-identifier-key>'; | 1431 let temporaryKey = '<non-identifier-key>'; |
1380 _setTableEntry(table, temporaryKey, table); | 1432 _setTableEntry(table, temporaryKey, table); |
1381 _deleteTableEntry(table, temporaryKey); | 1433 _deleteTableEntry(table, temporaryKey); |
1382 return table; | 1434 return table; |
1383 } | 1435 } |
1384 } | 1436 } |
1385 return _LinkedHashSet; | 1437 return _LinkedHashSet; |
1386 }); | 1438 }); |
1387 let _LinkedHashSet = _LinkedHashSet$(dynamic); | 1439 let _LinkedHashSet = _LinkedHashSet$(dynamic); |
1388 let _LinkedIdentityHashSet$ = dart.generic(function(E) { | 1440 let _LinkedIdentityHashSet$ = dart.generic(function(E) { |
1389 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { | 1441 class _LinkedIdentityHashSet extends _LinkedHashSet$(E) { |
1390 _newSet() { | 1442 [_newSet]() { |
1391 return new _LinkedIdentityHashSet(); | 1443 return new _LinkedIdentityHashSet(); |
1392 } | 1444 } |
1393 _computeHashCode(key) { | 1445 [_computeHashCode](key) { |
1394 return core.identityHashCode(key) & 0x3ffffff; | 1446 return core.identityHashCode(key) & 0x3ffffff; |
1395 } | 1447 } |
1396 _findBucketIndex(bucket, element) { | 1448 [_findBucketIndex](bucket, element) { |
1397 if (bucket === null) | 1449 if (bucket === null) |
1398 return -1; | 1450 return -1; |
1399 let length = bucket.length; | 1451 let length = bucket.length; |
1400 for (let i = 0; i < length; i++) { | 1452 for (let i = 0; i < length; i++) { |
1401 let cell = dart.as(bucket[i], LinkedHashSetCell); | 1453 let cell = dart.as(bucket[i], LinkedHashSetCell); |
1402 if (core.identical(cell._element, element)) | 1454 if (core.identical(cell[_element], element)) |
1403 return i; | 1455 return i; |
1404 } | 1456 } |
1405 return -1; | 1457 return -1; |
1406 } | 1458 } |
1407 } | 1459 } |
1408 return _LinkedIdentityHashSet; | 1460 return _LinkedIdentityHashSet; |
1409 }); | 1461 }); |
1410 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic); | 1462 let _LinkedIdentityHashSet = _LinkedIdentityHashSet$(dynamic); |
1411 let _LinkedCustomHashSet$ = dart.generic(function(E) { | 1463 let _LinkedCustomHashSet$ = dart.generic(function(E) { |
1412 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { | 1464 class _LinkedCustomHashSet extends _LinkedHashSet$(E) { |
1413 _LinkedCustomHashSet(_equality, _hasher, validKey) { | 1465 _LinkedCustomHashSet($_equality, $_hasher, validKey) { |
1414 this._equality = _equality; | 1466 this[_equality] = $_equality; |
1415 this._hasher = _hasher; | 1467 this[_hasher] = $_hasher; |
1416 this._validKey = dart.as(validKey !== null ? validKey : (x) => dart.is(x
, E), _Predicate); | 1468 this[_validKey] = dart.as(validKey !== null ? validKey : (x) => dart.is(
x, E), _Predicate); |
1417 super._LinkedHashSet(); | 1469 super._LinkedHashSet(); |
1418 } | 1470 } |
1419 _newSet() { | 1471 [_newSet]() { |
1420 return new _LinkedCustomHashSet(this._equality, this._hasher, this._vali
dKey); | 1472 return new _LinkedCustomHashSet(this[_equality], this[_hasher], this[_va
lidKey]); |
1421 } | 1473 } |
1422 _findBucketIndex(bucket, element) { | 1474 [_findBucketIndex](bucket, element) { |
1423 if (bucket === null) | 1475 if (bucket === null) |
1424 return -1; | 1476 return -1; |
1425 let length = bucket.length; | 1477 let length = bucket.length; |
1426 for (let i = 0; i < length; i++) { | 1478 for (let i = 0; i < length; i++) { |
1427 let cell = dart.as(bucket[i], LinkedHashSetCell); | 1479 let cell = dart.as(bucket[i], LinkedHashSetCell); |
1428 if (this._equality(dart.as(cell._element, E), dart.as(element, E))) | 1480 if (this[_equality](dart.as(cell[_element], E), dart.as(element, E))) |
1429 return i; | 1481 return i; |
1430 } | 1482 } |
1431 return -1; | 1483 return -1; |
1432 } | 1484 } |
1433 _computeHashCode(element) { | 1485 [_computeHashCode](element) { |
1434 return this._hasher(dart.as(element, E)) & 0x3ffffff; | 1486 return this[_hasher](dart.as(element, E)) & 0x3ffffff; |
1435 } | 1487 } |
1436 add(element) { | 1488 add(element) { |
1437 return super._add(element); | 1489 return super._add(element); |
1438 } | 1490 } |
1439 contains(object) { | 1491 contains(object) { |
1440 if (!dart.notNull(this._validKey(object))) | 1492 if (!dart.notNull(this[_validKey](object))) |
1441 return false; | 1493 return false; |
1442 return super._contains(object); | 1494 return super._contains(object); |
1443 } | 1495 } |
1444 lookup(object) { | 1496 lookup(object) { |
1445 if (!dart.notNull(this._validKey(object))) | 1497 if (!dart.notNull(this[_validKey](object))) |
1446 return dart.as(null, E); | 1498 return dart.as(null, E); |
1447 return super._lookup(object); | 1499 return super._lookup(object); |
1448 } | 1500 } |
1449 remove(object) { | 1501 remove(object) { |
1450 if (!dart.notNull(this._validKey(object))) | 1502 if (!dart.notNull(this[_validKey](object))) |
1451 return false; | 1503 return false; |
1452 return super._remove(object); | 1504 return super._remove(object); |
1453 } | 1505 } |
1454 containsAll(elements) { | 1506 containsAll(elements) { |
1455 for (let element of elements) { | 1507 for (let element of elements) { |
1456 if (dart.notNull(!dart.notNull(this._validKey(element))) || dart.notNu
ll(!dart.notNull(this.contains(element)))) | 1508 if (dart.notNull(!dart.notNull(this[_validKey](element))) || dart.notN
ull(!dart.notNull(this.contains(element)))) |
1457 return false; | 1509 return false; |
1458 } | 1510 } |
1459 return true; | 1511 return true; |
1460 } | 1512 } |
1461 removeAll(elements) { | 1513 removeAll(elements) { |
1462 for (let element of elements) { | 1514 for (let element of elements) { |
1463 if (this._validKey(element)) { | 1515 if (this[_validKey](element)) { |
1464 super._remove(element); | 1516 super._remove(element); |
1465 } | 1517 } |
1466 } | 1518 } |
1467 } | 1519 } |
1468 } | 1520 } |
1469 return _LinkedCustomHashSet; | 1521 return _LinkedCustomHashSet; |
1470 }); | 1522 }); |
1471 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic); | 1523 let _LinkedCustomHashSet = _LinkedCustomHashSet$(dynamic); |
1472 class LinkedHashSetCell extends dart.Object { | 1524 class LinkedHashSetCell extends dart.Object { |
1473 LinkedHashSetCell(_element) { | 1525 LinkedHashSetCell($_element) { |
1474 this._element = _element; | 1526 this[_element] = $_element; |
1475 this._next = null; | 1527 this[_next] = null; |
1476 this._previous = null; | 1528 this[_previous] = null; |
1477 } | 1529 } |
1478 } | 1530 } |
1479 let LinkedHashSetIterator$ = dart.generic(function(E) { | 1531 let LinkedHashSetIterator$ = dart.generic(function(E) { |
1480 class LinkedHashSetIterator extends dart.Object { | 1532 class LinkedHashSetIterator extends dart.Object { |
1481 LinkedHashSetIterator(_set, _modifications) { | 1533 LinkedHashSetIterator($_set, $_modifications) { |
1482 this._set = _set; | 1534 this[_set] = $_set; |
1483 this._modifications = _modifications; | 1535 this[_modifications] = $_modifications; |
1484 this._cell = null; | 1536 this[_cell] = null; |
1485 this._current = dart.as(null, E); | 1537 this[_current] = dart.as(null, E); |
1486 this._cell = dart.as(dart.dload(this._set, '_first'), LinkedHashSetCell)
; | 1538 this[_cell] = dart.as(dart.dload(this[_set], '_first'), LinkedHashSetCel
l); |
1487 } | 1539 } |
1488 get current() { | 1540 get current() { |
1489 return this._current; | 1541 return this[_current]; |
1490 } | 1542 } |
1491 moveNext() { | 1543 moveNext() { |
1492 if (this._modifications !== dart.dload(this._set, '_modifications')) { | 1544 if (this[_modifications] !== dart.dload(this[_set], '_modifications')) { |
1493 throw new core.ConcurrentModificationError(this._set); | 1545 throw new core.ConcurrentModificationError(this[_set]); |
1494 } else if (this._cell === null) { | 1546 } else if (this[_cell] === null) { |
1495 this._current = dart.as(null, E); | 1547 this[_current] = dart.as(null, E); |
1496 return false; | 1548 return false; |
1497 } else { | 1549 } else { |
1498 this._current = dart.as(this._cell._element, E); | 1550 this[_current] = dart.as(this[_cell][_element], E); |
1499 this._cell = this._cell._next; | 1551 this[_cell] = this[_cell][_next]; |
1500 return true; | 1552 return true; |
1501 } | 1553 } |
1502 } | 1554 } |
1503 } | 1555 } |
1504 return LinkedHashSetIterator; | 1556 return LinkedHashSetIterator; |
1505 }); | 1557 }); |
1506 let LinkedHashSetIterator = LinkedHashSetIterator$(dynamic); | 1558 let LinkedHashSetIterator = LinkedHashSetIterator$(dynamic); |
| 1559 let _source = Symbol('_source'); |
1507 let UnmodifiableListView$ = dart.generic(function(E) { | 1560 let UnmodifiableListView$ = dart.generic(function(E) { |
1508 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { | 1561 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { |
1509 UnmodifiableListView(source) { | 1562 UnmodifiableListView(source) { |
1510 this._source = source; | 1563 this[_source] = source; |
1511 super.UnmodifiableListBase(); | 1564 super.UnmodifiableListBase(); |
1512 } | 1565 } |
1513 get length() { | 1566 get length() { |
1514 return this._source.length; | 1567 return this[_source].length; |
1515 } | 1568 } |
1516 get(index) { | 1569 get(index) { |
1517 return this._source.elementAt(index); | 1570 return this[_source].elementAt(index); |
1518 } | 1571 } |
1519 } | 1572 } |
1520 return UnmodifiableListView; | 1573 return UnmodifiableListView; |
1521 }); | 1574 }); |
1522 let UnmodifiableListView = UnmodifiableListView$(dynamic); | 1575 let UnmodifiableListView = UnmodifiableListView$(dynamic); |
1523 // Function _defaultEquals: (dynamic, dynamic) → bool | 1576 // Function _defaultEquals: (dynamic, dynamic) → bool |
1524 function _defaultEquals(a, b) { | 1577 function _defaultEquals(a, b) { |
1525 return dart.equals(a, b); | 1578 return dart.equals(a, b); |
1526 } | 1579 } |
1527 // Function _defaultHashCode: (dynamic) → int | 1580 // Function _defaultHashCode: (dynamic) → int |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 dart.defineNamedConstructor(HashMap, 'identity'); | 1637 dart.defineNamedConstructor(HashMap, 'identity'); |
1585 dart.defineNamedConstructor(HashMap, 'from'); | 1638 dart.defineNamedConstructor(HashMap, 'from'); |
1586 dart.defineNamedConstructor(HashMap, 'fromIterable'); | 1639 dart.defineNamedConstructor(HashMap, 'fromIterable'); |
1587 dart.defineNamedConstructor(HashMap, 'fromIterables'); | 1640 dart.defineNamedConstructor(HashMap, 'fromIterables'); |
1588 return HashMap; | 1641 return HashMap; |
1589 }); | 1642 }); |
1590 let HashMap = HashMap$(dynamic, dynamic); | 1643 let HashMap = HashMap$(dynamic, dynamic); |
1591 let _HashSetBase$ = dart.generic(function(E) { | 1644 let _HashSetBase$ = dart.generic(function(E) { |
1592 class _HashSetBase extends SetBase$(E) { | 1645 class _HashSetBase extends SetBase$(E) { |
1593 difference(other) { | 1646 difference(other) { |
1594 let result = this._newSet(); | 1647 let result = this[_newSet](); |
1595 for (let element of this) { | 1648 for (let element of this) { |
1596 if (!dart.notNull(other.contains(element))) | 1649 if (!dart.notNull(other.contains(element))) |
1597 result.add(dart.as(element, E)); | 1650 result.add(dart.as(element, E)); |
1598 } | 1651 } |
1599 return result; | 1652 return result; |
1600 } | 1653 } |
1601 intersection(other) { | 1654 intersection(other) { |
1602 let result = this._newSet(); | 1655 let result = this[_newSet](); |
1603 for (let element of this) { | 1656 for (let element of this) { |
1604 if (other.contains(element)) | 1657 if (other.contains(element)) |
1605 result.add(dart.as(element, E)); | 1658 result.add(dart.as(element, E)); |
1606 } | 1659 } |
1607 return result; | 1660 return result; |
1608 } | 1661 } |
1609 toSet() { | 1662 toSet() { |
1610 return ((_) => { | 1663 return ((_) => { |
1611 _.addAll(this); | 1664 _.addAll(this); |
1612 return _; | 1665 return _; |
1613 }).bind(this)(this._newSet()); | 1666 }).bind(this)(this[_newSet]()); |
1614 } | 1667 } |
1615 } | 1668 } |
1616 return _HashSetBase; | 1669 return _HashSetBase; |
1617 }); | 1670 }); |
1618 let _HashSetBase = _HashSetBase$(dynamic); | 1671 let _HashSetBase = _HashSetBase$(dynamic); |
1619 let HashSet$ = dart.generic(function(E) { | 1672 let HashSet$ = dart.generic(function(E) { |
1620 class HashSet extends dart.Object { | 1673 class HashSet extends dart.Object { |
1621 HashSet(opt$) { | 1674 HashSet(opt$) { |
1622 let equals = opt$.equals === void 0 ? null : opt$.equals; | 1675 let equals = opt$.equals === void 0 ? null : opt$.equals; |
1623 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; | 1676 let hashCode = opt$.hashCode === void 0 ? null : opt$.hashCode; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1849 } | 1902 } |
1850 throw new core.RangeError.index(index, this, "index", null, elementIndex
); | 1903 throw new core.RangeError.index(index, this, "index", null, elementIndex
); |
1851 } | 1904 } |
1852 toString() { | 1905 toString() { |
1853 return IterableBase.iterableToShortString(this, '(', ')'); | 1906 return IterableBase.iterableToShortString(this, '(', ')'); |
1854 } | 1907 } |
1855 } | 1908 } |
1856 return IterableMixin; | 1909 return IterableMixin; |
1857 }); | 1910 }); |
1858 let IterableMixin = IterableMixin$(dynamic); | 1911 let IterableMixin = IterableMixin$(dynamic); |
| 1912 let _isToStringVisiting = Symbol('_isToStringVisiting'); |
| 1913 let _iterablePartsToStrings = Symbol('_iterablePartsToStrings'); |
1859 let IterableBase$ = dart.generic(function(E) { | 1914 let IterableBase$ = dart.generic(function(E) { |
1860 class IterableBase extends dart.Object { | 1915 class IterableBase extends dart.Object { |
1861 IterableBase() { | 1916 IterableBase() { |
1862 } | 1917 } |
1863 map(f) { | 1918 map(f) { |
1864 return new _internal.MappedIterable(this, f); | 1919 return new _internal.MappedIterable(this, f); |
1865 } | 1920 } |
1866 where(f) { | 1921 where(f) { |
1867 return new _internal.WhereIterable(this, f); | 1922 return new _internal.WhereIterable(this, f); |
1868 } | 1923 } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 _toStringVisiting.add(iterable); | 2141 _toStringVisiting.add(iterable); |
2087 try { | 2142 try { |
2088 buffer.writeAll(iterable, ", "); | 2143 buffer.writeAll(iterable, ", "); |
2089 } finally { | 2144 } finally { |
2090 dart.assert(core.identical(_toStringVisiting.last, iterable)); | 2145 dart.assert(core.identical(_toStringVisiting.last, iterable)); |
2091 _toStringVisiting.removeLast(); | 2146 _toStringVisiting.removeLast(); |
2092 } | 2147 } |
2093 buffer.write(rightDelimiter); | 2148 buffer.write(rightDelimiter); |
2094 return buffer.toString(); | 2149 return buffer.toString(); |
2095 } | 2150 } |
2096 static _isToStringVisiting(o) { | 2151 static [_isToStringVisiting](o) { |
2097 for (let i = 0; i < _toStringVisiting.length; i++) { | 2152 for (let i = 0; i < _toStringVisiting.length; i++) { |
2098 if (core.identical(o, _toStringVisiting.get(i))) | 2153 if (core.identical(o, _toStringVisiting.get(i))) |
2099 return true; | 2154 return true; |
2100 } | 2155 } |
2101 return false; | 2156 return false; |
2102 } | 2157 } |
2103 static _iterablePartsToStrings(iterable, parts) { | 2158 static [_iterablePartsToStrings](iterable, parts) { |
2104 let LENGTH_LIMIT = 80; | 2159 let LENGTH_LIMIT = 80; |
2105 let HEAD_COUNT = 3; | 2160 let HEAD_COUNT = 3; |
2106 let TAIL_COUNT = 2; | 2161 let TAIL_COUNT = 2; |
2107 let MAX_COUNT = 100; | 2162 let MAX_COUNT = 100; |
2108 let OVERHEAD = 2; | 2163 let OVERHEAD = 2; |
2109 let ELLIPSIS_SIZE = 3; | 2164 let ELLIPSIS_SIZE = 3; |
2110 let length = 0; | 2165 let length = 0; |
2111 let count = 0; | 2166 let count = 0; |
2112 let it = iterable.iterator; | 2167 let it = iterable.iterator; |
2113 while (dart.notNull(length < LENGTH_LIMIT) || dart.notNull(count < HEAD_
COUNT)) { | 2168 while (dart.notNull(length < LENGTH_LIMIT) || dart.notNull(count < HEAD_
COUNT)) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 } | 2235 } |
2181 } | 2236 } |
2182 dart.defineLazyProperties(IterableBase, { | 2237 dart.defineLazyProperties(IterableBase, { |
2183 get _toStringVisiting() { | 2238 get _toStringVisiting() { |
2184 return new List.from([]); | 2239 return new List.from([]); |
2185 } | 2240 } |
2186 }); | 2241 }); |
2187 return IterableBase; | 2242 return IterableBase; |
2188 }); | 2243 }); |
2189 let IterableBase = IterableBase$(dynamic); | 2244 let IterableBase = IterableBase$(dynamic); |
| 2245 let _iterator = Symbol('_iterator'); |
| 2246 let _state = Symbol('_state'); |
| 2247 let _move = Symbol('_move'); |
2190 let HasNextIterator$ = dart.generic(function(E) { | 2248 let HasNextIterator$ = dart.generic(function(E) { |
2191 class HasNextIterator extends dart.Object { | 2249 class HasNextIterator extends dart.Object { |
2192 HasNextIterator(_iterator) { | 2250 HasNextIterator($_iterator) { |
2193 this._iterator = _iterator; | 2251 this[_iterator] = $_iterator; |
2194 this._state = _NOT_MOVED_YET; | 2252 this[_state] = _NOT_MOVED_YET; |
2195 } | 2253 } |
2196 get hasNext() { | 2254 get hasNext() { |
2197 if (this._state === _NOT_MOVED_YET) | 2255 if (this[_state] === _NOT_MOVED_YET) |
2198 this._move(); | 2256 this[_move](); |
2199 return this._state === _HAS_NEXT_AND_NEXT_IN_CURRENT; | 2257 return this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT; |
2200 } | 2258 } |
2201 next() { | 2259 next() { |
2202 if (!dart.notNull(this.hasNext)) | 2260 if (!dart.notNull(this.hasNext)) |
2203 throw new core.StateError("No more elements"); | 2261 throw new core.StateError("No more elements"); |
2204 dart.assert(this._state === _HAS_NEXT_AND_NEXT_IN_CURRENT); | 2262 dart.assert(this[_state] === _HAS_NEXT_AND_NEXT_IN_CURRENT); |
2205 let result = dart.as(this._iterator.current, E); | 2263 let result = dart.as(this[_iterator].current, E); |
2206 this._move(); | 2264 this[_move](); |
2207 return result; | 2265 return result; |
2208 } | 2266 } |
2209 _move() { | 2267 [_move]() { |
2210 if (this._iterator.moveNext()) { | 2268 if (this[_iterator].moveNext()) { |
2211 this._state = _HAS_NEXT_AND_NEXT_IN_CURRENT; | 2269 this[_state] = _HAS_NEXT_AND_NEXT_IN_CURRENT; |
2212 } else { | 2270 } else { |
2213 this._state = _NO_NEXT; | 2271 this[_state] = _NO_NEXT; |
2214 } | 2272 } |
2215 } | 2273 } |
2216 } | 2274 } |
2217 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; | 2275 HasNextIterator._HAS_NEXT_AND_NEXT_IN_CURRENT = 0; |
2218 HasNextIterator._NO_NEXT = 1; | 2276 HasNextIterator._NO_NEXT = 1; |
2219 HasNextIterator._NOT_MOVED_YET = 2; | 2277 HasNextIterator._NOT_MOVED_YET = 2; |
2220 return HasNextIterator; | 2278 return HasNextIterator; |
2221 }); | 2279 }); |
2222 let HasNextIterator = HasNextIterator$(dynamic); | 2280 let HasNextIterator = HasNextIterator$(dynamic); |
2223 let LinkedHashMap$ = dart.generic(function(K, V) { | 2281 let LinkedHashMap$ = dart.generic(function(K, V) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2327 result.add(element); | 2385 result.add(element); |
2328 } | 2386 } |
2329 return result; | 2387 return result; |
2330 } | 2388 } |
2331 } | 2389 } |
2332 dart.defineNamedConstructor(LinkedHashSet, 'identity'); | 2390 dart.defineNamedConstructor(LinkedHashSet, 'identity'); |
2333 dart.defineNamedConstructor(LinkedHashSet, 'from'); | 2391 dart.defineNamedConstructor(LinkedHashSet, 'from'); |
2334 return LinkedHashSet; | 2392 return LinkedHashSet; |
2335 }); | 2393 }); |
2336 let LinkedHashSet = LinkedHashSet$(dynamic); | 2394 let LinkedHashSet = LinkedHashSet$(dynamic); |
| 2395 let _modificationCount = Symbol('_modificationCount'); |
| 2396 let _insertAfter = Symbol('_insertAfter'); |
| 2397 let _list = Symbol('_list'); |
| 2398 let _unlink = Symbol('_unlink'); |
2337 let LinkedList$ = dart.generic(function(E) { | 2399 let LinkedList$ = dart.generic(function(E) { |
2338 class LinkedList extends IterableBase$(E) { | 2400 class LinkedList extends IterableBase$(E) { |
2339 LinkedList() { | 2401 LinkedList() { |
2340 this._modificationCount = 0; | 2402 this[_modificationCount] = 0; |
2341 this._length = 0; | 2403 this[_length] = 0; |
2342 this._next = null; | 2404 this[_next] = null; |
2343 this._previous = null; | 2405 this[_previous] = null; |
2344 super.IterableBase(); | 2406 super.IterableBase(); |
2345 this._next = this._previous = this; | 2407 this[_next] = this[_previous] = this; |
2346 } | 2408 } |
2347 addFirst(entry) { | 2409 addFirst(entry) { |
2348 this._insertAfter(this, entry); | 2410 this[_insertAfter](this, entry); |
2349 } | 2411 } |
2350 add(entry) { | 2412 add(entry) { |
2351 this._insertAfter(this._previous, entry); | 2413 this[_insertAfter](this[_previous], entry); |
2352 } | 2414 } |
2353 addAll(entries) { | 2415 addAll(entries) { |
2354 entries.forEach(((entry) => this._insertAfter(this._previous, dart.as(en
try, E))).bind(this)); | 2416 entries.forEach(((entry) => this[_insertAfter](this[_previous], dart.as(
entry, E))).bind(this)); |
2355 } | 2417 } |
2356 remove(entry) { | 2418 remove(entry) { |
2357 if (!dart.equals(entry._list, this)) | 2419 if (!dart.equals(entry[_list], this)) |
2358 return false; | 2420 return false; |
2359 this._unlink(entry); | 2421 this[_unlink](entry); |
2360 return true; | 2422 return true; |
2361 } | 2423 } |
2362 get iterator() { | 2424 get iterator() { |
2363 return new _LinkedListIterator(this); | 2425 return new _LinkedListIterator(this); |
2364 } | 2426 } |
2365 get length() { | 2427 get length() { |
2366 return this._length; | 2428 return this[_length]; |
2367 } | 2429 } |
2368 clear() { | 2430 clear() { |
2369 this._modificationCount++; | 2431 this[_modificationCount]++; |
2370 let next = this._next; | 2432 let next = this[_next]; |
2371 while (!dart.notNull(core.identical(next, this))) { | 2433 while (!dart.notNull(core.identical(next, this))) { |
2372 let entry = dart.as(next, E); | 2434 let entry = dart.as(next, E); |
2373 next = entry._next; | 2435 next = entry[_next]; |
2374 entry._next = entry._previous = entry._list = null; | 2436 entry[_next] = entry[_previous] = entry[_list] = null; |
2375 } | 2437 } |
2376 this._next = this._previous = this; | 2438 this[_next] = this[_previous] = this; |
2377 this._length = 0; | 2439 this[_length] = 0; |
2378 } | 2440 } |
2379 get first() { | 2441 get first() { |
2380 if (core.identical(this._next, this)) { | 2442 if (core.identical(this[_next], this)) { |
2381 throw new core.StateError('No such element'); | 2443 throw new core.StateError('No such element'); |
2382 } | 2444 } |
2383 return dart.as(this._next, E); | 2445 return dart.as(this[_next], E); |
2384 } | 2446 } |
2385 get last() { | 2447 get last() { |
2386 if (core.identical(this._previous, this)) { | 2448 if (core.identical(this[_previous], this)) { |
2387 throw new core.StateError('No such element'); | 2449 throw new core.StateError('No such element'); |
2388 } | 2450 } |
2389 return dart.as(this._previous, E); | 2451 return dart.as(this[_previous], E); |
2390 } | 2452 } |
2391 get single() { | 2453 get single() { |
2392 if (core.identical(this._previous, this)) { | 2454 if (core.identical(this[_previous], this)) { |
2393 throw new core.StateError('No such element'); | 2455 throw new core.StateError('No such element'); |
2394 } | 2456 } |
2395 if (!dart.notNull(core.identical(this._previous, this._next))) { | 2457 if (!dart.notNull(core.identical(this[_previous], this[_next]))) { |
2396 throw new core.StateError('Too many elements'); | 2458 throw new core.StateError('Too many elements'); |
2397 } | 2459 } |
2398 return dart.as(this._next, E); | 2460 return dart.as(this[_next], E); |
2399 } | 2461 } |
2400 forEach(action) { | 2462 forEach(action) { |
2401 let modificationCount = this._modificationCount; | 2463 let modificationCount = this[_modificationCount]; |
2402 let current = this._next; | 2464 let current = this[_next]; |
2403 while (!dart.notNull(core.identical(current, this))) { | 2465 while (!dart.notNull(core.identical(current, this))) { |
2404 action(dart.as(current, E)); | 2466 action(dart.as(current, E)); |
2405 if (modificationCount !== this._modificationCount) { | 2467 if (modificationCount !== this[_modificationCount]) { |
2406 throw new core.ConcurrentModificationError(this); | 2468 throw new core.ConcurrentModificationError(this); |
2407 } | 2469 } |
2408 current = current._next; | 2470 current = current[_next]; |
2409 } | 2471 } |
2410 } | 2472 } |
2411 get isEmpty() { | 2473 get isEmpty() { |
2412 return this._length === 0; | 2474 return this[_length] === 0; |
2413 } | 2475 } |
2414 _insertAfter(entry, newEntry) { | 2476 [_insertAfter](entry, newEntry) { |
2415 if (newEntry.list !== null) { | 2477 if (newEntry.list !== null) { |
2416 throw new core.StateError('LinkedListEntry is already in a LinkedList'
); | 2478 throw new core.StateError('LinkedListEntry is already in a LinkedList'
); |
2417 } | 2479 } |
2418 this._modificationCount++; | 2480 this[_modificationCount]++; |
2419 newEntry._list = this; | 2481 newEntry[_list] = this; |
2420 let predecessor = entry; | 2482 let predecessor = entry; |
2421 let successor = entry._next; | 2483 let successor = entry[_next]; |
2422 successor._previous = newEntry; | 2484 successor[_previous] = newEntry; |
2423 newEntry._previous = predecessor; | 2485 newEntry[_previous] = predecessor; |
2424 newEntry._next = successor; | 2486 newEntry[_next] = successor; |
2425 predecessor._next = newEntry; | 2487 predecessor[_next] = newEntry; |
2426 this._length++; | 2488 this[_length]++; |
2427 } | 2489 } |
2428 _unlink(entry) { | 2490 [_unlink](entry) { |
2429 this._modificationCount++; | 2491 this[_modificationCount]++; |
2430 entry._next._previous = entry._previous; | 2492 entry[_next][_previous] = entry[_previous]; |
2431 entry._previous._next = entry._next; | 2493 entry[_previous][_next] = entry[_next]; |
2432 this._length--; | 2494 this[_length]--; |
2433 entry._list = entry._next = entry._previous = null; | 2495 entry[_list] = entry[_next] = entry[_previous] = null; |
2434 } | 2496 } |
2435 } | 2497 } |
2436 return LinkedList; | 2498 return LinkedList; |
2437 }); | 2499 }); |
2438 let LinkedList = LinkedList$(dynamic); | 2500 let LinkedList = LinkedList$(dynamic); |
2439 let _LinkedListIterator$ = dart.generic(function(E) { | 2501 let _LinkedListIterator$ = dart.generic(function(E) { |
2440 class _LinkedListIterator extends dart.Object { | 2502 class _LinkedListIterator extends dart.Object { |
2441 _LinkedListIterator(list) { | 2503 _LinkedListIterator(list) { |
2442 this._list = list; | 2504 this[_list] = list; |
2443 this._modificationCount = list._modificationCount; | 2505 this[_modificationCount] = list[_modificationCount]; |
2444 this._next = list._next; | 2506 this[_next] = list[_next]; |
2445 this._current = null; | 2507 this[_current] = null; |
2446 } | 2508 } |
2447 get current() { | 2509 get current() { |
2448 return this._current; | 2510 return this[_current]; |
2449 } | 2511 } |
2450 moveNext() { | 2512 moveNext() { |
2451 if (core.identical(this._next, this._list)) { | 2513 if (core.identical(this[_next], this[_list])) { |
2452 this._current = null; | 2514 this[_current] = null; |
2453 return false; | 2515 return false; |
2454 } | 2516 } |
2455 if (this._modificationCount !== this._list._modificationCount) { | 2517 if (this[_modificationCount] !== this[_list][_modificationCount]) { |
2456 throw new core.ConcurrentModificationError(this); | 2518 throw new core.ConcurrentModificationError(this); |
2457 } | 2519 } |
2458 this._current = dart.as(this._next, E); | 2520 this[_current] = dart.as(this[_next], E); |
2459 this._next = this._next._next; | 2521 this[_next] = this[_next][_next]; |
2460 return true; | 2522 return true; |
2461 } | 2523 } |
2462 } | 2524 } |
2463 return _LinkedListIterator; | 2525 return _LinkedListIterator; |
2464 }); | 2526 }); |
2465 let _LinkedListIterator = _LinkedListIterator$(dynamic); | 2527 let _LinkedListIterator = _LinkedListIterator$(dynamic); |
2466 class _LinkedListLink extends dart.Object { | 2528 class _LinkedListLink extends dart.Object { |
2467 _LinkedListLink() { | 2529 _LinkedListLink() { |
2468 this._next = null; | 2530 this[_next] = null; |
2469 this._previous = null; | 2531 this[_previous] = null; |
2470 } | 2532 } |
2471 } | 2533 } |
2472 let LinkedListEntry$ = dart.generic(function(E) { | 2534 let LinkedListEntry$ = dart.generic(function(E) { |
2473 class LinkedListEntry extends dart.Object { | 2535 class LinkedListEntry extends dart.Object { |
2474 LinkedListEntry() { | 2536 LinkedListEntry() { |
2475 this._list = null; | 2537 this[_list] = null; |
2476 this._next = null; | 2538 this[_next] = null; |
2477 this._previous = null; | 2539 this[_previous] = null; |
2478 } | 2540 } |
2479 get list() { | 2541 get list() { |
2480 return this._list; | 2542 return this[_list]; |
2481 } | 2543 } |
2482 unlink() { | 2544 unlink() { |
2483 this._list._unlink(this); | 2545 this[_list]._unlink(this); |
2484 } | 2546 } |
2485 get next() { | 2547 get next() { |
2486 if (core.identical(this._next, this._list)) | 2548 if (core.identical(this[_next], this[_list])) |
2487 return null; | 2549 return null; |
2488 let result = dart.as(this._next, E); | 2550 let result = dart.as(this[_next], E); |
2489 return result; | 2551 return result; |
2490 } | 2552 } |
2491 get previous() { | 2553 get previous() { |
2492 if (core.identical(this._previous, this._list)) | 2554 if (core.identical(this[_previous], this[_list])) |
2493 return null; | 2555 return null; |
2494 return dart.as(this._previous, E); | 2556 return dart.as(this[_previous], E); |
2495 } | 2557 } |
2496 insertAfter(entry) { | 2558 insertAfter(entry) { |
2497 this._list._insertAfter(this, entry); | 2559 this[_list]._insertAfter(this, entry); |
2498 } | 2560 } |
2499 insertBefore(entry) { | 2561 insertBefore(entry) { |
2500 this._list._insertAfter(this._previous, entry); | 2562 this[_list]._insertAfter(this[_previous], entry); |
2501 } | 2563 } |
2502 } | 2564 } |
2503 return LinkedListEntry; | 2565 return LinkedListEntry; |
2504 }); | 2566 }); |
2505 let LinkedListEntry = LinkedListEntry$(dynamic); | 2567 let LinkedListEntry = LinkedListEntry$(dynamic); |
2506 let ListBase$ = dart.generic(function(E) { | 2568 let ListBase$ = dart.generic(function(E) { |
2507 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { | 2569 class ListBase extends dart.mixin(core.Object, ListMixin$(E)) { |
2508 static listToString(list) { | 2570 static listToString(list) { |
2509 return IterableBase.iterableToFullString(list, '[', ']'); | 2571 return IterableBase.iterableToFullString(list, '[', ']'); |
2510 } | 2572 } |
2511 } | 2573 } |
2512 return ListBase; | 2574 return ListBase; |
2513 }); | 2575 }); |
2514 let ListBase = ListBase$(dynamic); | 2576 let ListBase = ListBase$(dynamic); |
| 2577 let _filter = Symbol('_filter'); |
2515 let ListMixin$ = dart.generic(function(E) { | 2578 let ListMixin$ = dart.generic(function(E) { |
2516 class ListMixin extends dart.Object { | 2579 class ListMixin extends dart.Object { |
2517 get iterator() { | 2580 get iterator() { |
2518 return new _internal.ListIterator(this); | 2581 return new _internal.ListIterator(this); |
2519 } | 2582 } |
2520 elementAt(index) { | 2583 elementAt(index) { |
2521 return this.get(index); | 2584 return this.get(index); |
2522 } | 2585 } |
2523 forEach(action) { | 2586 forEach(action) { |
2524 let length = this.length; | 2587 let length = this.length; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 } | 2793 } |
2731 } | 2794 } |
2732 return false; | 2795 return false; |
2733 } | 2796 } |
2734 removeWhere(test) { | 2797 removeWhere(test) { |
2735 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), false); | 2798 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), false); |
2736 } | 2799 } |
2737 retainWhere(test) { | 2800 retainWhere(test) { |
2738 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), true); | 2801 _filter(this, dart.as(test, dart.throw_("Unimplemented type (dynamic) →
bool")), true); |
2739 } | 2802 } |
2740 static _filter(source, test, retainMatching) { | 2803 static [_filter](source, test, retainMatching) { |
2741 let retained = new List.from([]); | 2804 let retained = new List.from([]); |
2742 let length = source.length; | 2805 let length = source.length; |
2743 for (let i = 0; i < length; i++) { | 2806 for (let i = 0; i < length; i++) { |
2744 let element = source.get(i); | 2807 let element = source.get(i); |
2745 if (test(element) === retainMatching) { | 2808 if (test(element) === retainMatching) { |
2746 retained.add(element); | 2809 retained.add(element); |
2747 } | 2810 } |
2748 if (length !== source.length) { | 2811 if (length !== source.length) { |
2749 throw new core.ConcurrentModificationError(source); | 2812 throw new core.ConcurrentModificationError(source); |
2750 } | 2813 } |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 }); | 3079 }); |
3017 let MapMixin = MapMixin$(dynamic, dynamic); | 3080 let MapMixin = MapMixin$(dynamic, dynamic); |
3018 let UnmodifiableMapBase$ = dart.generic(function(K, V) { | 3081 let UnmodifiableMapBase$ = dart.generic(function(K, V) { |
3019 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { | 3082 class UnmodifiableMapBase extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { |
3020 } | 3083 } |
3021 return UnmodifiableMapBase; | 3084 return UnmodifiableMapBase; |
3022 }); | 3085 }); |
3023 let UnmodifiableMapBase = UnmodifiableMapBase$(dynamic, dynamic); | 3086 let UnmodifiableMapBase = UnmodifiableMapBase$(dynamic, dynamic); |
3024 let _MapBaseValueIterable$ = dart.generic(function(V) { | 3087 let _MapBaseValueIterable$ = dart.generic(function(V) { |
3025 class _MapBaseValueIterable extends IterableBase$(V) { | 3088 class _MapBaseValueIterable extends IterableBase$(V) { |
3026 _MapBaseValueIterable(_map) { | 3089 _MapBaseValueIterable($_map) { |
3027 this._map = _map; | 3090 this[_map] = $_map; |
3028 super.IterableBase(); | 3091 super.IterableBase(); |
3029 } | 3092 } |
3030 get length() { | 3093 get length() { |
3031 return this._map.length; | 3094 return this[_map].length; |
3032 } | 3095 } |
3033 get isEmpty() { | 3096 get isEmpty() { |
3034 return this._map.isEmpty; | 3097 return this[_map].isEmpty; |
3035 } | 3098 } |
3036 get isNotEmpty() { | 3099 get isNotEmpty() { |
3037 return this._map.isNotEmpty; | 3100 return this[_map].isNotEmpty; |
3038 } | 3101 } |
3039 get first() { | 3102 get first() { |
3040 return dart.as(this._map.get(this._map.keys.first), V); | 3103 return dart.as(this[_map].get(this[_map].keys.first), V); |
3041 } | 3104 } |
3042 get single() { | 3105 get single() { |
3043 return dart.as(this._map.get(this._map.keys.single), V); | 3106 return dart.as(this[_map].get(this[_map].keys.single), V); |
3044 } | 3107 } |
3045 get last() { | 3108 get last() { |
3046 return dart.as(this._map.get(this._map.keys.last), V); | 3109 return dart.as(this[_map].get(this[_map].keys.last), V); |
3047 } | 3110 } |
3048 get iterator() { | 3111 get iterator() { |
3049 return new _MapBaseValueIterator(this._map); | 3112 return new _MapBaseValueIterator(this[_map]); |
3050 } | 3113 } |
3051 } | 3114 } |
3052 return _MapBaseValueIterable; | 3115 return _MapBaseValueIterable; |
3053 }); | 3116 }); |
3054 let _MapBaseValueIterable = _MapBaseValueIterable$(dynamic); | 3117 let _MapBaseValueIterable = _MapBaseValueIterable$(dynamic); |
3055 let _MapBaseValueIterator$ = dart.generic(function(V) { | 3118 let _MapBaseValueIterator$ = dart.generic(function(V) { |
3056 class _MapBaseValueIterator extends dart.Object { | 3119 class _MapBaseValueIterator extends dart.Object { |
3057 _MapBaseValueIterator(map) { | 3120 _MapBaseValueIterator(map) { |
3058 this._map = map; | 3121 this[_map] = map; |
3059 this._keys = map.keys.iterator; | 3122 this[_keys] = map.keys.iterator; |
3060 this._current = dart.as(null, V); | 3123 this[_current] = dart.as(null, V); |
3061 } | 3124 } |
3062 moveNext() { | 3125 moveNext() { |
3063 if (this._keys.moveNext()) { | 3126 if (this[_keys].moveNext()) { |
3064 this._current = dart.as(this._map.get(this._keys.current), V); | 3127 this[_current] = dart.as(this[_map].get(this[_keys].current), V); |
3065 return true; | 3128 return true; |
3066 } | 3129 } |
3067 this._current = dart.as(null, V); | 3130 this[_current] = dart.as(null, V); |
3068 return false; | 3131 return false; |
3069 } | 3132 } |
3070 get current() { | 3133 get current() { |
3071 return this._current; | 3134 return this[_current]; |
3072 } | 3135 } |
3073 } | 3136 } |
3074 return _MapBaseValueIterator; | 3137 return _MapBaseValueIterator; |
3075 }); | 3138 }); |
3076 let _MapBaseValueIterator = _MapBaseValueIterator$(dynamic); | 3139 let _MapBaseValueIterator = _MapBaseValueIterator$(dynamic); |
3077 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { | 3140 let _UnmodifiableMapMixin$ = dart.generic(function(K, V) { |
3078 class _UnmodifiableMapMixin extends dart.Object { | 3141 class _UnmodifiableMapMixin extends dart.Object { |
3079 set(key, value) { | 3142 set(key, value) { |
3080 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3143 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3081 } | 3144 } |
3082 addAll(other) { | 3145 addAll(other) { |
3083 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3146 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3084 } | 3147 } |
3085 clear() { | 3148 clear() { |
3086 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3149 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3087 } | 3150 } |
3088 remove(key) { | 3151 remove(key) { |
3089 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3152 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3090 } | 3153 } |
3091 putIfAbsent(key, ifAbsent) { | 3154 putIfAbsent(key, ifAbsent) { |
3092 throw new core.UnsupportedError("Cannot modify unmodifiable map"); | 3155 throw new core.UnsupportedError("Cannot modify unmodifiable map"); |
3093 } | 3156 } |
3094 } | 3157 } |
3095 return _UnmodifiableMapMixin; | 3158 return _UnmodifiableMapMixin; |
3096 }); | 3159 }); |
3097 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(dynamic, dynamic); | 3160 let _UnmodifiableMapMixin = _UnmodifiableMapMixin$(dynamic, dynamic); |
3098 let MapView$ = dart.generic(function(K, V) { | 3161 let MapView$ = dart.generic(function(K, V) { |
3099 class MapView extends dart.Object { | 3162 class MapView extends dart.Object { |
3100 MapView(map) { | 3163 MapView(map) { |
3101 this._map = map; | 3164 this[_map] = map; |
3102 } | 3165 } |
3103 get(key) { | 3166 get(key) { |
3104 return this._map.get(key); | 3167 return this[_map].get(key); |
3105 } | 3168 } |
3106 set(key, value) { | 3169 set(key, value) { |
3107 this._map.set(key, value); | 3170 this[_map].set(key, value); |
3108 } | 3171 } |
3109 addAll(other) { | 3172 addAll(other) { |
3110 this._map.addAll(other); | 3173 this[_map].addAll(other); |
3111 } | 3174 } |
3112 clear() { | 3175 clear() { |
3113 this._map.clear(); | 3176 this[_map].clear(); |
3114 } | 3177 } |
3115 putIfAbsent(key, ifAbsent) { | 3178 putIfAbsent(key, ifAbsent) { |
3116 return this._map.putIfAbsent(key, ifAbsent); | 3179 return this[_map].putIfAbsent(key, ifAbsent); |
3117 } | 3180 } |
3118 containsKey(key) { | 3181 containsKey(key) { |
3119 return this._map.containsKey(key); | 3182 return this[_map].containsKey(key); |
3120 } | 3183 } |
3121 containsValue(value) { | 3184 containsValue(value) { |
3122 return this._map.containsValue(value); | 3185 return this[_map].containsValue(value); |
3123 } | 3186 } |
3124 forEach(action) { | 3187 forEach(action) { |
3125 this._map.forEach(action); | 3188 this[_map].forEach(action); |
3126 } | 3189 } |
3127 get isEmpty() { | 3190 get isEmpty() { |
3128 return this._map.isEmpty; | 3191 return this[_map].isEmpty; |
3129 } | 3192 } |
3130 get isNotEmpty() { | 3193 get isNotEmpty() { |
3131 return this._map.isNotEmpty; | 3194 return this[_map].isNotEmpty; |
3132 } | 3195 } |
3133 get length() { | 3196 get length() { |
3134 return this._map.length; | 3197 return this[_map].length; |
3135 } | 3198 } |
3136 get keys() { | 3199 get keys() { |
3137 return this._map.keys; | 3200 return this[_map].keys; |
3138 } | 3201 } |
3139 remove(key) { | 3202 remove(key) { |
3140 return this._map.remove(key); | 3203 return this[_map].remove(key); |
3141 } | 3204 } |
3142 toString() { | 3205 toString() { |
3143 return this._map.toString(); | 3206 return this[_map].toString(); |
3144 } | 3207 } |
3145 get values() { | 3208 get values() { |
3146 return this._map.values; | 3209 return this[_map].values; |
3147 } | 3210 } |
3148 } | 3211 } |
3149 return MapView; | 3212 return MapView; |
3150 }); | 3213 }); |
3151 let MapView = MapView$(dynamic, dynamic); | 3214 let MapView = MapView$(dynamic, dynamic); |
3152 let UnmodifiableMapView$ = dart.generic(function(K, V) { | 3215 let UnmodifiableMapView$ = dart.generic(function(K, V) { |
3153 class UnmodifiableMapView extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { | 3216 class UnmodifiableMapView extends dart.mixin(_UnmodifiableMapMixin$(K, V)) { |
3154 } | 3217 } |
3155 return UnmodifiableMapView; | 3218 return UnmodifiableMapView; |
3156 }); | 3219 }); |
3157 let UnmodifiableMapView = UnmodifiableMapView$(dynamic, dynamic); | 3220 let UnmodifiableMapView = UnmodifiableMapView$(dynamic, dynamic); |
| 3221 let _toStringVisiting = Symbol('_toStringVisiting'); |
| 3222 let _id = Symbol('_id'); |
| 3223 let _fillMapWithMappedIterable = Symbol('_fillMapWithMappedIterable'); |
| 3224 let _fillMapWithIterables = Symbol('_fillMapWithIterables'); |
3158 class Maps extends dart.Object { | 3225 class Maps extends dart.Object { |
3159 static containsValue(map, value) { | 3226 static containsValue(map, value) { |
3160 for (let v of map.values) { | 3227 for (let v of map.values) { |
3161 if (dart.equals(value, v)) { | 3228 if (dart.equals(value, v)) { |
3162 return true; | 3229 return true; |
3163 } | 3230 } |
3164 } | 3231 } |
3165 return false; | 3232 return false; |
3166 } | 3233 } |
3167 static containsKey(map, key) { | 3234 static containsKey(map, key) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3201 } | 3268 } |
3202 static isNotEmpty(map) { | 3269 static isNotEmpty(map) { |
3203 return map.keys.isNotEmpty; | 3270 return map.keys.isNotEmpty; |
3204 } | 3271 } |
3205 static mapToString(m) { | 3272 static mapToString(m) { |
3206 if (IterableBase._isToStringVisiting(m)) { | 3273 if (IterableBase._isToStringVisiting(m)) { |
3207 return '{...}'; | 3274 return '{...}'; |
3208 } | 3275 } |
3209 let result = new core.StringBuffer(); | 3276 let result = new core.StringBuffer(); |
3210 try { | 3277 try { |
3211 IterableBase._toStringVisiting.add(m); | 3278 IterableBase[_toStringVisiting].add(m); |
3212 result.write('{'); | 3279 result.write('{'); |
3213 let first = true; | 3280 let first = true; |
3214 m.forEach(((k, v) => { | 3281 m.forEach(((k, v) => { |
3215 if (!dart.notNull(first)) { | 3282 if (!dart.notNull(first)) { |
3216 result.write(', '); | 3283 result.write(', '); |
3217 } | 3284 } |
3218 first = false; | 3285 first = false; |
3219 result.write(k); | 3286 result.write(k); |
3220 result.write(': '); | 3287 result.write(': '); |
3221 result.write(v); | 3288 result.write(v); |
3222 }).bind(this)); | 3289 }).bind(this)); |
3223 result.write('}'); | 3290 result.write('}'); |
3224 } finally { | 3291 } finally { |
3225 dart.assert(core.identical(IterableBase._toStringVisiting.last, m)); | 3292 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m)); |
3226 IterableBase._toStringVisiting.removeLast(); | 3293 IterableBase[_toStringVisiting].removeLast(); |
3227 } | 3294 } |
3228 return result.toString(); | 3295 return result.toString(); |
3229 } | 3296 } |
3230 static _id(x) { | 3297 static [_id](x) { |
3231 return x; | 3298 return x; |
3232 } | 3299 } |
3233 static _fillMapWithMappedIterable(map, iterable, key, value) { | 3300 static [_fillMapWithMappedIterable](map, iterable, key, value) { |
3234 if (key === null) | 3301 if (key === null) |
3235 key = _id; | 3302 key = _id; |
3236 if (value === null) | 3303 if (value === null) |
3237 value = _id; | 3304 value = _id; |
3238 for (let element of iterable) { | 3305 for (let element of iterable) { |
3239 map.set(key(element), value(element)); | 3306 map.set(key(element), value(element)); |
3240 } | 3307 } |
3241 } | 3308 } |
3242 static _fillMapWithIterables(map, keys, values) { | 3309 static [_fillMapWithIterables](map, keys, values) { |
3243 let keyIterator = keys.iterator; | 3310 let keyIterator = keys.iterator; |
3244 let valueIterator = values.iterator; | 3311 let valueIterator = values.iterator; |
3245 let hasNextKey = keyIterator.moveNext(); | 3312 let hasNextKey = keyIterator.moveNext(); |
3246 let hasNextValue = valueIterator.moveNext(); | 3313 let hasNextValue = valueIterator.moveNext(); |
3247 while (dart.notNull(hasNextKey) && dart.notNull(hasNextValue)) { | 3314 while (dart.notNull(hasNextKey) && dart.notNull(hasNextValue)) { |
3248 map.set(keyIterator.current, valueIterator.current); | 3315 map.set(keyIterator.current, valueIterator.current); |
3249 hasNextKey = keyIterator.moveNext(); | 3316 hasNextKey = keyIterator.moveNext(); |
3250 hasNextValue = valueIterator.moveNext(); | 3317 hasNextValue = valueIterator.moveNext(); |
3251 } | 3318 } |
3252 if (dart.notNull(hasNextKey) || dart.notNull(hasNextValue)) { | 3319 if (dart.notNull(hasNextKey) || dart.notNull(hasNextValue)) { |
3253 throw new core.ArgumentError("Iterables do not have same length."); | 3320 throw new core.ArgumentError("Iterables do not have same length."); |
3254 } | 3321 } |
3255 } | 3322 } |
3256 } | 3323 } |
3257 let Queue$ = dart.generic(function(E) { | 3324 let Queue$ = dart.generic(function(E) { |
3258 class Queue extends dart.Object { | 3325 class Queue extends dart.Object { |
3259 Queue() { | 3326 Queue() { |
3260 return new ListQueue(); | 3327 return new ListQueue(); |
3261 } | 3328 } |
3262 Queue$from(elements) { | 3329 Queue$from(elements) { |
3263 return new ListQueue.from(elements); | 3330 return new ListQueue.from(elements); |
3264 } | 3331 } |
3265 } | 3332 } |
3266 dart.defineNamedConstructor(Queue, 'from'); | 3333 dart.defineNamedConstructor(Queue, 'from'); |
3267 return Queue; | 3334 return Queue; |
3268 }); | 3335 }); |
3269 let Queue = Queue$(dynamic); | 3336 let Queue = Queue$(dynamic); |
| 3337 let _link = Symbol('_link'); |
| 3338 let _asNonSentinelEntry = Symbol('_asNonSentinelEntry'); |
3270 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { | 3339 let DoubleLinkedQueueEntry$ = dart.generic(function(E) { |
3271 class DoubleLinkedQueueEntry extends dart.Object { | 3340 class DoubleLinkedQueueEntry extends dart.Object { |
3272 DoubleLinkedQueueEntry(e) { | 3341 DoubleLinkedQueueEntry(e) { |
3273 this._element = e; | 3342 this[_element] = e; |
3274 this._previous = null; | 3343 this[_previous] = null; |
3275 this._next = null; | 3344 this[_next] = null; |
3276 } | 3345 } |
3277 _link(previous, next) { | 3346 [_link](previous, next) { |
3278 this._next = next; | 3347 this[_next] = next; |
3279 this._previous = previous; | 3348 this[_previous] = previous; |
3280 previous._next = this; | 3349 previous[_next] = this; |
3281 next._previous = this; | 3350 next[_previous] = this; |
3282 } | 3351 } |
3283 append(e) { | 3352 append(e) { |
3284 new DoubleLinkedQueueEntry(e)._link(this, this._next); | 3353 new DoubleLinkedQueueEntry(e)._link(this, this[_next]); |
3285 } | 3354 } |
3286 prepend(e) { | 3355 prepend(e) { |
3287 new DoubleLinkedQueueEntry(e)._link(this._previous, this); | 3356 new DoubleLinkedQueueEntry(e)._link(this[_previous], this); |
3288 } | 3357 } |
3289 remove() { | 3358 remove() { |
3290 this._previous._next = this._next; | 3359 this[_previous][_next] = this[_next]; |
3291 this._next._previous = this._previous; | 3360 this[_next][_previous] = this[_previous]; |
3292 this._next = null; | 3361 this[_next] = null; |
3293 this._previous = null; | 3362 this[_previous] = null; |
3294 return this._element; | 3363 return this[_element]; |
3295 } | 3364 } |
3296 _asNonSentinelEntry() { | 3365 [_asNonSentinelEntry]() { |
3297 return this; | 3366 return this; |
3298 } | 3367 } |
3299 previousEntry() { | 3368 previousEntry() { |
3300 return this._previous._asNonSentinelEntry(); | 3369 return this[_previous]._asNonSentinelEntry(); |
3301 } | 3370 } |
3302 nextEntry() { | 3371 nextEntry() { |
3303 return this._next._asNonSentinelEntry(); | 3372 return this[_next]._asNonSentinelEntry(); |
3304 } | 3373 } |
3305 get element() { | 3374 get element() { |
3306 return this._element; | 3375 return this[_element]; |
3307 } | 3376 } |
3308 set element(e) { | 3377 set element(e) { |
3309 this._element = e; | 3378 this[_element] = e; |
3310 } | 3379 } |
3311 } | 3380 } |
3312 return DoubleLinkedQueueEntry; | 3381 return DoubleLinkedQueueEntry; |
3313 }); | 3382 }); |
3314 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dynamic); | 3383 let DoubleLinkedQueueEntry = DoubleLinkedQueueEntry$(dynamic); |
3315 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { | 3384 let _DoubleLinkedQueueEntrySentinel$ = dart.generic(function(E) { |
3316 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { | 3385 class _DoubleLinkedQueueEntrySentinel extends DoubleLinkedQueueEntry$(E) { |
3317 _DoubleLinkedQueueEntrySentinel() { | 3386 _DoubleLinkedQueueEntrySentinel() { |
3318 super.DoubleLinkedQueueEntry(dart.as(null, E)); | 3387 super.DoubleLinkedQueueEntry(dart.as(null, E)); |
3319 this._link(this, this); | 3388 this[_link](this, this); |
3320 } | 3389 } |
3321 remove() { | 3390 remove() { |
3322 throw _internal.IterableElementError.noElement(); | 3391 throw _internal.IterableElementError.noElement(); |
3323 } | 3392 } |
3324 _asNonSentinelEntry() { | 3393 [_asNonSentinelEntry]() { |
3325 return null; | 3394 return null; |
3326 } | 3395 } |
3327 set element(e) { | 3396 set element(e) { |
3328 dart.assert(false); | 3397 dart.assert(false); |
3329 } | 3398 } |
3330 get element() { | 3399 get element() { |
3331 throw _internal.IterableElementError.noElement(); | 3400 throw _internal.IterableElementError.noElement(); |
3332 } | 3401 } |
3333 } | 3402 } |
3334 return _DoubleLinkedQueueEntrySentinel; | 3403 return _DoubleLinkedQueueEntrySentinel; |
3335 }); | 3404 }); |
3336 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(dynamic
); | 3405 let _DoubleLinkedQueueEntrySentinel = _DoubleLinkedQueueEntrySentinel$(dynamic
); |
| 3406 let _sentinel = Symbol('_sentinel'); |
| 3407 let _elementCount = Symbol('_elementCount'); |
3337 let DoubleLinkedQueue$ = dart.generic(function(E) { | 3408 let DoubleLinkedQueue$ = dart.generic(function(E) { |
3338 class DoubleLinkedQueue extends IterableBase$(E) { | 3409 class DoubleLinkedQueue extends IterableBase$(E) { |
3339 DoubleLinkedQueue() { | 3410 DoubleLinkedQueue() { |
3340 this._sentinel = null; | 3411 this[_sentinel] = null; |
3341 this._elementCount = 0; | 3412 this[_elementCount] = 0; |
3342 super.IterableBase(); | 3413 super.IterableBase(); |
3343 this._sentinel = new _DoubleLinkedQueueEntrySentinel(); | 3414 this[_sentinel] = new _DoubleLinkedQueueEntrySentinel(); |
3344 } | 3415 } |
3345 DoubleLinkedQueue$from(elements) { | 3416 DoubleLinkedQueue$from(elements) { |
3346 let list = dart.as(new DoubleLinkedQueue(), Queue$(E)); | 3417 let list = dart.as(new DoubleLinkedQueue(), Queue$(E)); |
3347 for (let e of elements) { | 3418 for (let e of elements) { |
3348 list.addLast(e); | 3419 list.addLast(e); |
3349 } | 3420 } |
3350 return dart.as(list, DoubleLinkedQueue$(E)); | 3421 return dart.as(list, DoubleLinkedQueue$(E)); |
3351 } | 3422 } |
3352 get length() { | 3423 get length() { |
3353 return this._elementCount; | 3424 return this[_elementCount]; |
3354 } | 3425 } |
3355 addLast(value) { | 3426 addLast(value) { |
3356 this._sentinel.prepend(value); | 3427 this[_sentinel].prepend(value); |
3357 this._elementCount++; | 3428 this[_elementCount]++; |
3358 } | 3429 } |
3359 addFirst(value) { | 3430 addFirst(value) { |
3360 this._sentinel.append(value); | 3431 this[_sentinel].append(value); |
3361 this._elementCount++; | 3432 this[_elementCount]++; |
3362 } | 3433 } |
3363 add(value) { | 3434 add(value) { |
3364 this._sentinel.prepend(value); | 3435 this[_sentinel].prepend(value); |
3365 this._elementCount++; | 3436 this[_elementCount]++; |
3366 } | 3437 } |
3367 addAll(iterable) { | 3438 addAll(iterable) { |
3368 for (let value of iterable) { | 3439 for (let value of iterable) { |
3369 this._sentinel.prepend(value); | 3440 this[_sentinel].prepend(value); |
3370 this._elementCount++; | 3441 this[_elementCount]++; |
3371 } | 3442 } |
3372 } | 3443 } |
3373 removeLast() { | 3444 removeLast() { |
3374 let result = this._sentinel._previous.remove(); | 3445 let result = this[_sentinel][_previous].remove(); |
3375 this._elementCount--; | 3446 this[_elementCount]--; |
3376 return result; | 3447 return result; |
3377 } | 3448 } |
3378 removeFirst() { | 3449 removeFirst() { |
3379 let result = this._sentinel._next.remove(); | 3450 let result = this[_sentinel][_next].remove(); |
3380 this._elementCount--; | 3451 this[_elementCount]--; |
3381 return result; | 3452 return result; |
3382 } | 3453 } |
3383 remove(o) { | 3454 remove(o) { |
3384 let entry = this._sentinel._next; | 3455 let entry = this[_sentinel][_next]; |
3385 while (!dart.notNull(core.identical(entry, this._sentinel))) { | 3456 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
3386 if (dart.equals(entry.element, o)) { | 3457 if (dart.equals(entry.element, o)) { |
3387 entry.remove(); | 3458 entry.remove(); |
3388 this._elementCount--; | 3459 this[_elementCount]--; |
3389 return true; | 3460 return true; |
3390 } | 3461 } |
3391 entry = entry._next; | 3462 entry = entry[_next]; |
3392 } | 3463 } |
3393 return false; | 3464 return false; |
3394 } | 3465 } |
3395 _filter(test, removeMatching) { | 3466 [_filter](test, removeMatching) { |
3396 let entry = this._sentinel._next; | 3467 let entry = this[_sentinel][_next]; |
3397 while (!dart.notNull(core.identical(entry, this._sentinel))) { | 3468 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
3398 let next = entry._next; | 3469 let next = entry[_next]; |
3399 if (core.identical(removeMatching, test(entry.element))) { | 3470 if (core.identical(removeMatching, test(entry.element))) { |
3400 entry.remove(); | 3471 entry.remove(); |
3401 this._elementCount--; | 3472 this[_elementCount]--; |
3402 } | 3473 } |
3403 entry = next; | 3474 entry = next; |
3404 } | 3475 } |
3405 } | 3476 } |
3406 removeWhere(test) { | 3477 removeWhere(test) { |
3407 this._filter(test, true); | 3478 this[_filter](test, true); |
3408 } | 3479 } |
3409 retainWhere(test) { | 3480 retainWhere(test) { |
3410 this._filter(test, false); | 3481 this[_filter](test, false); |
3411 } | 3482 } |
3412 get first() { | 3483 get first() { |
3413 return this._sentinel._next.element; | 3484 return this[_sentinel][_next].element; |
3414 } | 3485 } |
3415 get last() { | 3486 get last() { |
3416 return this._sentinel._previous.element; | 3487 return this[_sentinel][_previous].element; |
3417 } | 3488 } |
3418 get single() { | 3489 get single() { |
3419 if (core.identical(this._sentinel._next, this._sentinel._previous)) { | 3490 if (core.identical(this[_sentinel][_next], this[_sentinel][_previous]))
{ |
3420 return this._sentinel._next.element; | 3491 return this[_sentinel][_next].element; |
3421 } | 3492 } |
3422 throw _internal.IterableElementError.tooMany(); | 3493 throw _internal.IterableElementError.tooMany(); |
3423 } | 3494 } |
3424 lastEntry() { | 3495 lastEntry() { |
3425 return this._sentinel.previousEntry(); | 3496 return this[_sentinel].previousEntry(); |
3426 } | 3497 } |
3427 firstEntry() { | 3498 firstEntry() { |
3428 return this._sentinel.nextEntry(); | 3499 return this[_sentinel].nextEntry(); |
3429 } | 3500 } |
3430 get isEmpty() { | 3501 get isEmpty() { |
3431 return core.identical(this._sentinel._next, this._sentinel); | 3502 return core.identical(this[_sentinel][_next], this[_sentinel]); |
3432 } | 3503 } |
3433 clear() { | 3504 clear() { |
3434 this._sentinel._next = this._sentinel; | 3505 this[_sentinel][_next] = this[_sentinel]; |
3435 this._sentinel._previous = this._sentinel; | 3506 this[_sentinel][_previous] = this[_sentinel]; |
3436 this._elementCount = 0; | 3507 this[_elementCount] = 0; |
3437 } | 3508 } |
3438 forEachEntry(f) { | 3509 forEachEntry(f) { |
3439 let entry = this._sentinel._next; | 3510 let entry = this[_sentinel][_next]; |
3440 while (!dart.notNull(core.identical(entry, this._sentinel))) { | 3511 while (!dart.notNull(core.identical(entry, this[_sentinel]))) { |
3441 let nextEntry = entry._next; | 3512 let nextEntry = entry[_next]; |
3442 f(entry); | 3513 f(entry); |
3443 entry = nextEntry; | 3514 entry = nextEntry; |
3444 } | 3515 } |
3445 } | 3516 } |
3446 get iterator() { | 3517 get iterator() { |
3447 return new _DoubleLinkedQueueIterator(this._sentinel); | 3518 return new _DoubleLinkedQueueIterator(this[_sentinel]); |
3448 } | 3519 } |
3449 toString() { | 3520 toString() { |
3450 return IterableBase.iterableToFullString(this, '{', '}'); | 3521 return IterableBase.iterableToFullString(this, '{', '}'); |
3451 } | 3522 } |
3452 } | 3523 } |
3453 dart.defineNamedConstructor(DoubleLinkedQueue, 'from'); | 3524 dart.defineNamedConstructor(DoubleLinkedQueue, 'from'); |
3454 return DoubleLinkedQueue; | 3525 return DoubleLinkedQueue; |
3455 }); | 3526 }); |
3456 let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic); | 3527 let DoubleLinkedQueue = DoubleLinkedQueue$(dynamic); |
| 3528 let _nextEntry = Symbol('_nextEntry'); |
3457 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) { | 3529 let _DoubleLinkedQueueIterator$ = dart.generic(function(E) { |
3458 class _DoubleLinkedQueueIterator extends dart.Object { | 3530 class _DoubleLinkedQueueIterator extends dart.Object { |
3459 _DoubleLinkedQueueIterator(sentinel) { | 3531 _DoubleLinkedQueueIterator(sentinel) { |
3460 this._sentinel = sentinel; | 3532 this[_sentinel] = sentinel; |
3461 this._nextEntry = sentinel._next; | 3533 this[_nextEntry] = sentinel[_next]; |
3462 this._current = dart.as(null, E); | 3534 this[_current] = dart.as(null, E); |
3463 } | 3535 } |
3464 moveNext() { | 3536 moveNext() { |
3465 if (!dart.notNull(core.identical(this._nextEntry, this._sentinel))) { | 3537 if (!dart.notNull(core.identical(this[_nextEntry], this[_sentinel]))) { |
3466 this._current = this._nextEntry._element; | 3538 this[_current] = this[_nextEntry][_element]; |
3467 this._nextEntry = this._nextEntry._next; | 3539 this[_nextEntry] = this[_nextEntry][_next]; |
3468 return true; | 3540 return true; |
3469 } | 3541 } |
3470 this._current = dart.as(null, E); | 3542 this[_current] = dart.as(null, E); |
3471 this._nextEntry = this._sentinel = null; | 3543 this[_nextEntry] = this[_sentinel] = null; |
3472 return false; | 3544 return false; |
3473 } | 3545 } |
3474 get current() { | 3546 get current() { |
3475 return this._current; | 3547 return this[_current]; |
3476 } | 3548 } |
3477 } | 3549 } |
3478 return _DoubleLinkedQueueIterator; | 3550 return _DoubleLinkedQueueIterator; |
3479 }); | 3551 }); |
3480 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic); | 3552 let _DoubleLinkedQueueIterator = _DoubleLinkedQueueIterator$(dynamic); |
| 3553 let _head = Symbol('_head'); |
| 3554 let _tail = Symbol('_tail'); |
| 3555 let _table = Symbol('_table'); |
| 3556 let _checkModification = Symbol('_checkModification'); |
| 3557 let _writeToList = Symbol('_writeToList'); |
| 3558 let _preGrow = Symbol('_preGrow'); |
| 3559 let _grow = Symbol('_grow'); |
| 3560 let _isPowerOf2 = Symbol('_isPowerOf2'); |
| 3561 let _nextPowerOf2 = Symbol('_nextPowerOf2'); |
3481 let ListQueue$ = dart.generic(function(E) { | 3562 let ListQueue$ = dart.generic(function(E) { |
3482 class ListQueue extends IterableBase$(E) { | 3563 class ListQueue extends IterableBase$(E) { |
3483 ListQueue(initialCapacity) { | 3564 ListQueue(initialCapacity) { |
3484 if (initialCapacity === void 0) | 3565 if (initialCapacity === void 0) |
3485 initialCapacity = null; | 3566 initialCapacity = null; |
3486 this._head = 0; | 3567 this[_head] = 0; |
3487 this._tail = 0; | 3568 this[_tail] = 0; |
3488 this._table = null; | 3569 this[_table] = null; |
3489 this._modificationCount = 0; | 3570 this[_modificationCount] = 0; |
3490 super.IterableBase(); | 3571 super.IterableBase(); |
3491 if (dart.notNull(initialCapacity === null) || dart.notNull(initialCapaci
ty < _INITIAL_CAPACITY)) { | 3572 if (dart.notNull(initialCapacity === null) || dart.notNull(initialCapaci
ty < _INITIAL_CAPACITY)) { |
3492 initialCapacity = _INITIAL_CAPACITY; | 3573 initialCapacity = _INITIAL_CAPACITY; |
3493 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) { | 3574 } else if (!dart.notNull(_isPowerOf2(initialCapacity))) { |
3494 initialCapacity = _nextPowerOf2(initialCapacity); | 3575 initialCapacity = _nextPowerOf2(initialCapacity); |
3495 } | 3576 } |
3496 dart.assert(_isPowerOf2(initialCapacity)); | 3577 dart.assert(_isPowerOf2(initialCapacity)); |
3497 this._table = new core.List(initialCapacity); | 3578 this[_table] = new core.List(initialCapacity); |
3498 } | 3579 } |
3499 ListQueue$from(elements) { | 3580 ListQueue$from(elements) { |
3500 if (dart.is(elements, core.List)) { | 3581 if (dart.is(elements, core.List)) { |
3501 let length = elements.length; | 3582 let length = elements.length; |
3502 let queue = dart.as(new ListQueue(length + 1), ListQueue$(E)); | 3583 let queue = dart.as(new ListQueue(length + 1), ListQueue$(E)); |
3503 dart.assert(queue._table.length > length); | 3584 dart.assert(queue[_table].length > length); |
3504 let sourceList = elements; | 3585 let sourceList = elements; |
3505 queue._table.setRange(0, length, dart.as(sourceList, core.Iterable$(E)
), 0); | 3586 queue[_table].setRange(0, length, dart.as(sourceList, core.Iterable$(E
)), 0); |
3506 queue._tail = length; | 3587 queue[_tail] = length; |
3507 return queue; | 3588 return queue; |
3508 } else { | 3589 } else { |
3509 let capacity = _INITIAL_CAPACITY; | 3590 let capacity = _INITIAL_CAPACITY; |
3510 if (dart.is(elements, _internal.EfficientLength)) { | 3591 if (dart.is(elements, _internal.EfficientLength)) { |
3511 capacity = elements.length; | 3592 capacity = elements.length; |
3512 } | 3593 } |
3513 let result = new ListQueue(capacity); | 3594 let result = new ListQueue(capacity); |
3514 for (let element of elements) { | 3595 for (let element of elements) { |
3515 result.addLast(element); | 3596 result.addLast(element); |
3516 } | 3597 } |
3517 return result; | 3598 return result; |
3518 } | 3599 } |
3519 } | 3600 } |
3520 get iterator() { | 3601 get iterator() { |
3521 return new _ListQueueIterator(this); | 3602 return new _ListQueueIterator(this); |
3522 } | 3603 } |
3523 forEach(action) { | 3604 forEach(action) { |
3524 let modificationCount = this._modificationCount; | 3605 let modificationCount = this[_modificationCount]; |
3525 for (let i = this._head; i !== this._tail; i = i + 1 & this._table.lengt
h - 1) { | 3606 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].le
ngth - 1) { |
3526 action(this._table.get(i)); | 3607 action(this[_table].get(i)); |
3527 this._checkModification(modificationCount); | 3608 this[_checkModification](modificationCount); |
3528 } | 3609 } |
3529 } | 3610 } |
3530 get isEmpty() { | 3611 get isEmpty() { |
3531 return this._head === this._tail; | 3612 return this[_head] === this[_tail]; |
3532 } | 3613 } |
3533 get length() { | 3614 get length() { |
3534 return this._tail - this._head & this._table.length - 1; | 3615 return this[_tail] - this[_head] & this[_table].length - 1; |
3535 } | 3616 } |
3536 get first() { | 3617 get first() { |
3537 if (this._head === this._tail) | 3618 if (this[_head] === this[_tail]) |
3538 throw _internal.IterableElementError.noElement(); | 3619 throw _internal.IterableElementError.noElement(); |
3539 return this._table.get(this._head); | 3620 return this[_table].get(this[_head]); |
3540 } | 3621 } |
3541 get last() { | 3622 get last() { |
3542 if (this._head === this._tail) | 3623 if (this[_head] === this[_tail]) |
3543 throw _internal.IterableElementError.noElement(); | 3624 throw _internal.IterableElementError.noElement(); |
3544 return this._table.get(this._tail - 1 & this._table.length - 1); | 3625 return this[_table].get(this[_tail] - 1 & this[_table].length - 1); |
3545 } | 3626 } |
3546 get single() { | 3627 get single() { |
3547 if (this._head === this._tail) | 3628 if (this[_head] === this[_tail]) |
3548 throw _internal.IterableElementError.noElement(); | 3629 throw _internal.IterableElementError.noElement(); |
3549 if (this.length > 1) | 3630 if (this.length > 1) |
3550 throw _internal.IterableElementError.tooMany(); | 3631 throw _internal.IterableElementError.tooMany(); |
3551 return this._table.get(this._head); | 3632 return this[_table].get(this[_head]); |
3552 } | 3633 } |
3553 elementAt(index) { | 3634 elementAt(index) { |
3554 core.RangeError.checkValidIndex(index, this); | 3635 core.RangeError.checkValidIndex(index, this); |
3555 return this._table.get(this._head + index & this._table.length - 1); | 3636 return this[_table].get(this[_head] + index & this[_table].length - 1); |
3556 } | 3637 } |
3557 toList(opt$) { | 3638 toList(opt$) { |
3558 let growable = opt$.growable === void 0 ? true : opt$.growable; | 3639 let growable = opt$.growable === void 0 ? true : opt$.growable; |
3559 let list = null; | 3640 let list = null; |
3560 if (growable) { | 3641 if (growable) { |
3561 list = ((_) => { | 3642 list = ((_) => { |
3562 _.length = this.length; | 3643 _.length = this.length; |
3563 return _; | 3644 return _; |
3564 }).bind(this)(new core.List()); | 3645 }).bind(this)(new core.List()); |
3565 } else { | 3646 } else { |
3566 list = new core.List(this.length); | 3647 list = new core.List(this.length); |
3567 } | 3648 } |
3568 this._writeToList(list); | 3649 this[_writeToList](list); |
3569 return list; | 3650 return list; |
3570 } | 3651 } |
3571 add(element) { | 3652 add(element) { |
3572 this._add(element); | 3653 this[_add](element); |
3573 } | 3654 } |
3574 addAll(elements) { | 3655 addAll(elements) { |
3575 if (dart.is(elements, core.List)) { | 3656 if (dart.is(elements, core.List)) { |
3576 let list = dart.as(elements, core.List); | 3657 let list = dart.as(elements, core.List); |
3577 let addCount = list.length; | 3658 let addCount = list.length; |
3578 let length = this.length; | 3659 let length = this.length; |
3579 if (length + addCount >= this._table.length) { | 3660 if (length + addCount >= this[_table].length) { |
3580 this._preGrow(length + addCount); | 3661 this[_preGrow](length + addCount); |
3581 this._table.setRange(length, length + addCount, dart.as(list, core.I
terable$(E)), 0); | 3662 this[_table].setRange(length, length + addCount, dart.as(list, core.
Iterable$(E)), 0); |
3582 this._tail = addCount; | 3663 this[_tail] = addCount; |
3583 } else { | 3664 } else { |
3584 let endSpace = this._table.length - this._tail; | 3665 let endSpace = this[_table].length - this[_tail]; |
3585 if (addCount < endSpace) { | 3666 if (addCount < endSpace) { |
3586 this._table.setRange(this._tail, this._tail + addCount, dart.as(li
st, core.Iterable$(E)), 0); | 3667 this[_table].setRange(this[_tail], this[_tail] + addCount, dart.as
(list, core.Iterable$(E)), 0); |
3587 this._tail = addCount; | 3668 this[_tail] = addCount; |
3588 } else { | 3669 } else { |
3589 let preSpace = addCount - endSpace; | 3670 let preSpace = addCount - endSpace; |
3590 this._table.setRange(this._tail, this._tail + endSpace, dart.as(li
st, core.Iterable$(E)), 0); | 3671 this[_table].setRange(this[_tail], this[_tail] + endSpace, dart.as
(list, core.Iterable$(E)), 0); |
3591 this._table.setRange(0, preSpace, dart.as(list, core.Iterable$(E))
, endSpace); | 3672 this[_table].setRange(0, preSpace, dart.as(list, core.Iterable$(E)
), endSpace); |
3592 this._tail = preSpace; | 3673 this[_tail] = preSpace; |
3593 } | 3674 } |
3594 } | 3675 } |
3595 this._modificationCount++; | 3676 this[_modificationCount]++; |
3596 } else { | 3677 } else { |
3597 for (let element of elements) | 3678 for (let element of elements) |
3598 this._add(element); | 3679 this[_add](element); |
3599 } | 3680 } |
3600 } | 3681 } |
3601 remove(object) { | 3682 remove(object) { |
3602 for (let i = this._head; i !== this._tail; i = i + 1 & this._table.lengt
h - 1) { | 3683 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].le
ngth - 1) { |
3603 let element = this._table.get(i); | 3684 let element = this[_table].get(i); |
3604 if (dart.equals(element, object)) { | 3685 if (dart.equals(element, object)) { |
3605 this._remove(i); | 3686 this[_remove](i); |
3606 this._modificationCount++; | 3687 this[_modificationCount]++; |
3607 return true; | 3688 return true; |
3608 } | 3689 } |
3609 } | 3690 } |
3610 return false; | 3691 return false; |
3611 } | 3692 } |
3612 _filterWhere(test, removeMatching) { | 3693 [_filterWhere](test, removeMatching) { |
3613 let index = this._head; | 3694 let index = this[_head]; |
3614 let modificationCount = this._modificationCount; | 3695 let modificationCount = this[_modificationCount]; |
3615 let i = this._head; | 3696 let i = this[_head]; |
3616 while (i !== this._tail) { | 3697 while (i !== this[_tail]) { |
3617 let element = this._table.get(i); | 3698 let element = this[_table].get(i); |
3618 let remove = core.identical(removeMatching, test(element)); | 3699 let remove = core.identical(removeMatching, test(element)); |
3619 this._checkModification(modificationCount); | 3700 this[_checkModification](modificationCount); |
3620 if (remove) { | 3701 if (remove) { |
3621 i = this._remove(i); | 3702 i = this[_remove](i); |
3622 modificationCount = ++this._modificationCount; | 3703 modificationCount = ++this[_modificationCount]; |
3623 } else { | 3704 } else { |
3624 i = i + 1 & this._table.length - 1; | 3705 i = i + 1 & this[_table].length - 1; |
3625 } | 3706 } |
3626 } | 3707 } |
3627 } | 3708 } |
3628 removeWhere(test) { | 3709 removeWhere(test) { |
3629 this._filterWhere(test, true); | 3710 this[_filterWhere](test, true); |
3630 } | 3711 } |
3631 retainWhere(test) { | 3712 retainWhere(test) { |
3632 this._filterWhere(test, false); | 3713 this[_filterWhere](test, false); |
3633 } | 3714 } |
3634 clear() { | 3715 clear() { |
3635 if (this._head !== this._tail) { | 3716 if (this[_head] !== this[_tail]) { |
3636 for (let i = this._head; i !== this._tail; i = i + 1 & this._table.len
gth - 1) { | 3717 for (let i = this[_head]; i !== this[_tail]; i = i + 1 & this[_table].
length - 1) { |
3637 this._table.set(i, dart.as(null, E)); | 3718 this[_table].set(i, dart.as(null, E)); |
3638 } | 3719 } |
3639 this._head = this._tail = 0; | 3720 this[_head] = this[_tail] = 0; |
3640 this._modificationCount++; | 3721 this[_modificationCount]++; |
3641 } | 3722 } |
3642 } | 3723 } |
3643 toString() { | 3724 toString() { |
3644 return IterableBase.iterableToFullString(this, "{", "}"); | 3725 return IterableBase.iterableToFullString(this, "{", "}"); |
3645 } | 3726 } |
3646 addLast(element) { | 3727 addLast(element) { |
3647 this._add(element); | 3728 this[_add](element); |
3648 } | 3729 } |
3649 addFirst(element) { | 3730 addFirst(element) { |
3650 this._head = this._head - 1 & this._table.length - 1; | 3731 this[_head] = this[_head] - 1 & this[_table].length - 1; |
3651 this._table.set(this._head, element); | 3732 this[_table].set(this[_head], element); |
3652 if (this._head === this._tail) | 3733 if (this[_head] === this[_tail]) |
3653 this._grow(); | 3734 this[_grow](); |
3654 this._modificationCount++; | 3735 this[_modificationCount]++; |
3655 } | 3736 } |
3656 removeFirst() { | 3737 removeFirst() { |
3657 if (this._head === this._tail) | 3738 if (this[_head] === this[_tail]) |
3658 throw _internal.IterableElementError.noElement(); | 3739 throw _internal.IterableElementError.noElement(); |
3659 this._modificationCount++; | 3740 this[_modificationCount]++; |
3660 let result = this._table.get(this._head); | 3741 let result = this[_table].get(this[_head]); |
3661 this._table.set(this._head, dart.as(null, E)); | 3742 this[_table].set(this[_head], dart.as(null, E)); |
3662 this._head = this._head + 1 & this._table.length - 1; | 3743 this[_head] = this[_head] + 1 & this[_table].length - 1; |
3663 return result; | 3744 return result; |
3664 } | 3745 } |
3665 removeLast() { | 3746 removeLast() { |
3666 if (this._head === this._tail) | 3747 if (this[_head] === this[_tail]) |
3667 throw _internal.IterableElementError.noElement(); | 3748 throw _internal.IterableElementError.noElement(); |
3668 this._modificationCount++; | 3749 this[_modificationCount]++; |
3669 this._tail = this._tail - 1 & this._table.length - 1; | 3750 this[_tail] = this[_tail] - 1 & this[_table].length - 1; |
3670 let result = this._table.get(this._tail); | 3751 let result = this[_table].get(this[_tail]); |
3671 this._table.set(this._tail, dart.as(null, E)); | 3752 this[_table].set(this[_tail], dart.as(null, E)); |
3672 return result; | 3753 return result; |
3673 } | 3754 } |
3674 static _isPowerOf2(number) { | 3755 static [_isPowerOf2](number) { |
3675 return (number & number - 1) === 0; | 3756 return (number & number - 1) === 0; |
3676 } | 3757 } |
3677 static _nextPowerOf2(number) { | 3758 static [_nextPowerOf2](number) { |
3678 dart.assert(number > 0); | 3759 dart.assert(number > 0); |
3679 number = (number << 1) - 1; | 3760 number = (number << 1) - 1; |
3680 for (;;) { | 3761 for (;;) { |
3681 let nextNumber = number & number - 1; | 3762 let nextNumber = number & number - 1; |
3682 if (nextNumber === 0) | 3763 if (nextNumber === 0) |
3683 return number; | 3764 return number; |
3684 number = nextNumber; | 3765 number = nextNumber; |
3685 } | 3766 } |
3686 } | 3767 } |
3687 _checkModification(expectedModificationCount) { | 3768 [_checkModification](expectedModificationCount) { |
3688 if (expectedModificationCount !== this._modificationCount) { | 3769 if (expectedModificationCount !== this[_modificationCount]) { |
3689 throw new core.ConcurrentModificationError(this); | 3770 throw new core.ConcurrentModificationError(this); |
3690 } | 3771 } |
3691 } | 3772 } |
3692 _add(element) { | 3773 [_add](element) { |
3693 this._table.set(this._tail, element); | 3774 this[_table].set(this[_tail], element); |
3694 this._tail = this._tail + 1 & this._table.length - 1; | 3775 this[_tail] = this[_tail] + 1 & this[_table].length - 1; |
3695 if (this._head === this._tail) | 3776 if (this[_head] === this[_tail]) |
3696 this._grow(); | 3777 this[_grow](); |
3697 this._modificationCount++; | 3778 this[_modificationCount]++; |
3698 } | 3779 } |
3699 _remove(offset) { | 3780 [_remove](offset) { |
3700 let mask = this._table.length - 1; | 3781 let mask = this[_table].length - 1; |
3701 let startDistance = offset - this._head & mask; | 3782 let startDistance = offset - this[_head] & mask; |
3702 let endDistance = this._tail - offset & mask; | 3783 let endDistance = this[_tail] - offset & mask; |
3703 if (startDistance < endDistance) { | 3784 if (startDistance < endDistance) { |
3704 let i = offset; | 3785 let i = offset; |
3705 while (i !== this._head) { | 3786 while (i !== this[_head]) { |
3706 let prevOffset = i - 1 & mask; | 3787 let prevOffset = i - 1 & mask; |
3707 this._table.set(i, this._table.get(prevOffset)); | 3788 this[_table].set(i, this[_table].get(prevOffset)); |
3708 i = prevOffset; | 3789 i = prevOffset; |
3709 } | 3790 } |
3710 this._table.set(this._head, dart.as(null, E)); | 3791 this[_table].set(this[_head], dart.as(null, E)); |
3711 this._head = this._head + 1 & mask; | 3792 this[_head] = this[_head] + 1 & mask; |
3712 return offset + 1 & mask; | 3793 return offset + 1 & mask; |
3713 } else { | 3794 } else { |
3714 this._tail = this._tail - 1 & mask; | 3795 this[_tail] = this[_tail] - 1 & mask; |
3715 let i = offset; | 3796 let i = offset; |
3716 while (i !== this._tail) { | 3797 while (i !== this[_tail]) { |
3717 let nextOffset = i + 1 & mask; | 3798 let nextOffset = i + 1 & mask; |
3718 this._table.set(i, this._table.get(nextOffset)); | 3799 this[_table].set(i, this[_table].get(nextOffset)); |
3719 i = nextOffset; | 3800 i = nextOffset; |
3720 } | 3801 } |
3721 this._table.set(this._tail, dart.as(null, E)); | 3802 this[_table].set(this[_tail], dart.as(null, E)); |
3722 return offset; | 3803 return offset; |
3723 } | 3804 } |
3724 } | 3805 } |
3725 _grow() { | 3806 [_grow]() { |
3726 let newTable = new core.List(this._table.length * 2); | 3807 let newTable = new core.List(this[_table].length * 2); |
3727 let split = this._table.length - this._head; | 3808 let split = this[_table].length - this[_head]; |
3728 newTable.setRange(0, split, this._table, this._head); | 3809 newTable.setRange(0, split, this[_table], this[_head]); |
3729 newTable.setRange(split, split + this._head, this._table, 0); | 3810 newTable.setRange(split, split + this[_head], this[_table], 0); |
3730 this._head = 0; | 3811 this[_head] = 0; |
3731 this._tail = this._table.length; | 3812 this[_tail] = this[_table].length; |
3732 this._table = newTable; | 3813 this[_table] = newTable; |
3733 } | 3814 } |
3734 _writeToList(target) { | 3815 [_writeToList](target) { |
3735 dart.assert(target.length >= this.length); | 3816 dart.assert(target.length >= this.length); |
3736 if (this._head <= this._tail) { | 3817 if (this[_head] <= this[_tail]) { |
3737 let length = this._tail - this._head; | 3818 let length = this[_tail] - this[_head]; |
3738 target.setRange(0, length, this._table, this._head); | 3819 target.setRange(0, length, this[_table], this[_head]); |
3739 return length; | 3820 return length; |
3740 } else { | 3821 } else { |
3741 let firstPartSize = this._table.length - this._head; | 3822 let firstPartSize = this[_table].length - this[_head]; |
3742 target.setRange(0, firstPartSize, this._table, this._head); | 3823 target.setRange(0, firstPartSize, this[_table], this[_head]); |
3743 target.setRange(firstPartSize, firstPartSize + this._tail, this._table
, 0); | 3824 target.setRange(firstPartSize, firstPartSize + this[_tail], this[_tabl
e], 0); |
3744 return this._tail + firstPartSize; | 3825 return this[_tail] + firstPartSize; |
3745 } | 3826 } |
3746 } | 3827 } |
3747 _preGrow(newElementCount) { | 3828 [_preGrow](newElementCount) { |
3748 dart.assert(newElementCount >= this.length); | 3829 dart.assert(newElementCount >= this.length); |
3749 newElementCount = newElementCount >> 1; | 3830 newElementCount = newElementCount >> 1; |
3750 let newCapacity = _nextPowerOf2(newElementCount); | 3831 let newCapacity = _nextPowerOf2(newElementCount); |
3751 let newTable = new core.List(newCapacity); | 3832 let newTable = new core.List(newCapacity); |
3752 this._tail = this._writeToList(newTable); | 3833 this[_tail] = this[_writeToList](newTable); |
3753 this._table = newTable; | 3834 this[_table] = newTable; |
3754 this._head = 0; | 3835 this[_head] = 0; |
3755 } | 3836 } |
3756 } | 3837 } |
3757 dart.defineNamedConstructor(ListQueue, 'from'); | 3838 dart.defineNamedConstructor(ListQueue, 'from'); |
3758 ListQueue._INITIAL_CAPACITY = 8; | 3839 ListQueue._INITIAL_CAPACITY = 8; |
3759 return ListQueue; | 3840 return ListQueue; |
3760 }); | 3841 }); |
3761 let ListQueue = ListQueue$(dynamic); | 3842 let ListQueue = ListQueue$(dynamic); |
| 3843 let _queue = Symbol('_queue'); |
| 3844 let _end = Symbol('_end'); |
| 3845 let _position = Symbol('_position'); |
3762 let _ListQueueIterator$ = dart.generic(function(E) { | 3846 let _ListQueueIterator$ = dart.generic(function(E) { |
3763 class _ListQueueIterator extends dart.Object { | 3847 class _ListQueueIterator extends dart.Object { |
3764 _ListQueueIterator(queue) { | 3848 _ListQueueIterator(queue) { |
3765 this._queue = queue; | 3849 this[_queue] = queue; |
3766 this._end = queue._tail; | 3850 this[_end] = queue[_tail]; |
3767 this._modificationCount = queue._modificationCount; | 3851 this[_modificationCount] = queue[_modificationCount]; |
3768 this._position = queue._head; | 3852 this[_position] = queue[_head]; |
3769 this._current = dart.as(null, E); | 3853 this[_current] = dart.as(null, E); |
3770 } | 3854 } |
3771 get current() { | 3855 get current() { |
3772 return this._current; | 3856 return this[_current]; |
3773 } | 3857 } |
3774 moveNext() { | 3858 moveNext() { |
3775 this._queue._checkModification(this._modificationCount); | 3859 this[_queue]._checkModification(this[_modificationCount]); |
3776 if (this._position === this._end) { | 3860 if (this[_position] === this[_end]) { |
3777 this._current = dart.as(null, E); | 3861 this[_current] = dart.as(null, E); |
3778 return false; | 3862 return false; |
3779 } | 3863 } |
3780 this._current = dart.as(this._queue._table.get(this._position), E); | 3864 this[_current] = dart.as(this[_queue][_table].get(this[_position]), E); |
3781 this._position = this._position + 1 & this._queue._table.length - 1; | 3865 this[_position] = this[_position] + 1 & this[_queue][_table].length - 1; |
3782 return true; | 3866 return true; |
3783 } | 3867 } |
3784 } | 3868 } |
3785 return _ListQueueIterator; | 3869 return _ListQueueIterator; |
3786 }); | 3870 }); |
3787 let _ListQueueIterator = _ListQueueIterator$(dynamic); | 3871 let _ListQueueIterator = _ListQueueIterator$(dynamic); |
3788 let SetMixin$ = dart.generic(function(E) { | 3872 let SetMixin$ = dart.generic(function(E) { |
3789 class SetMixin extends dart.Object { | 3873 class SetMixin extends dart.Object { |
3790 get isEmpty() { | 3874 get isEmpty() { |
3791 return this.length === 0; | 3875 return this.length === 0; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4054 let _SplayTreeMapNode$ = dart.generic(function(K, V) { | 4138 let _SplayTreeMapNode$ = dart.generic(function(K, V) { |
4055 class _SplayTreeMapNode extends _SplayTreeNode$(K) { | 4139 class _SplayTreeMapNode extends _SplayTreeNode$(K) { |
4056 _SplayTreeMapNode(key, value) { | 4140 _SplayTreeMapNode(key, value) { |
4057 this.value = value; | 4141 this.value = value; |
4058 super._SplayTreeNode(key); | 4142 super._SplayTreeNode(key); |
4059 } | 4143 } |
4060 } | 4144 } |
4061 return _SplayTreeMapNode; | 4145 return _SplayTreeMapNode; |
4062 }); | 4146 }); |
4063 let _SplayTreeMapNode = _SplayTreeMapNode$(dynamic, dynamic); | 4147 let _SplayTreeMapNode = _SplayTreeMapNode$(dynamic, dynamic); |
| 4148 let _dummy = Symbol('_dummy'); |
| 4149 let _root = Symbol('_root'); |
| 4150 let _count = Symbol('_count'); |
| 4151 let _splayCount = Symbol('_splayCount'); |
| 4152 let _splay = Symbol('_splay'); |
| 4153 let _compare = Symbol('_compare'); |
| 4154 let _splayMin = Symbol('_splayMin'); |
| 4155 let _splayMax = Symbol('_splayMax'); |
| 4156 let _addNewRoot = Symbol('_addNewRoot'); |
| 4157 let _clear = Symbol('_clear'); |
4064 let _SplayTree$ = dart.generic(function(K) { | 4158 let _SplayTree$ = dart.generic(function(K) { |
4065 class _SplayTree extends dart.Object { | 4159 class _SplayTree extends dart.Object { |
4066 _SplayTree() { | 4160 _SplayTree() { |
4067 this._dummy = new _SplayTreeNode(dart.as(null, K)); | 4161 this[_dummy] = new _SplayTreeNode(dart.as(null, K)); |
4068 this._root = null; | 4162 this[_root] = null; |
4069 this._count = 0; | 4163 this[_count] = 0; |
4070 this._modificationCount = 0; | 4164 this[_modificationCount] = 0; |
4071 this._splayCount = 0; | 4165 this[_splayCount] = 0; |
4072 } | 4166 } |
4073 _splay(key) { | 4167 [_splay](key) { |
4074 if (this._root === null) | 4168 if (this[_root] === null) |
4075 return -1; | 4169 return -1; |
4076 let left = this._dummy; | 4170 let left = this[_dummy]; |
4077 let right = this._dummy; | 4171 let right = this[_dummy]; |
4078 let current = this._root; | 4172 let current = this[_root]; |
4079 let comp = null; | 4173 let comp = null; |
4080 while (true) { | 4174 while (true) { |
4081 comp = this._compare(current.key, key); | 4175 comp = this[_compare](current.key, key); |
4082 if (comp > 0) { | 4176 if (comp > 0) { |
4083 if (current.left === null) | 4177 if (current.left === null) |
4084 break; | 4178 break; |
4085 comp = this._compare(current.left.key, key); | 4179 comp = this[_compare](current.left.key, key); |
4086 if (comp > 0) { | 4180 if (comp > 0) { |
4087 let tmp = current.left; | 4181 let tmp = current.left; |
4088 current.left = tmp.right; | 4182 current.left = tmp.right; |
4089 tmp.right = current; | 4183 tmp.right = current; |
4090 current = tmp; | 4184 current = tmp; |
4091 if (current.left === null) | 4185 if (current.left === null) |
4092 break; | 4186 break; |
4093 } | 4187 } |
4094 right.left = current; | 4188 right.left = current; |
4095 right = current; | 4189 right = current; |
4096 current = current.left; | 4190 current = current.left; |
4097 } else if (comp < 0) { | 4191 } else if (comp < 0) { |
4098 if (current.right === null) | 4192 if (current.right === null) |
4099 break; | 4193 break; |
4100 comp = this._compare(current.right.key, key); | 4194 comp = this[_compare](current.right.key, key); |
4101 if (comp < 0) { | 4195 if (comp < 0) { |
4102 let tmp = current.right; | 4196 let tmp = current.right; |
4103 current.right = tmp.left; | 4197 current.right = tmp.left; |
4104 tmp.left = current; | 4198 tmp.left = current; |
4105 current = tmp; | 4199 current = tmp; |
4106 if (current.right === null) | 4200 if (current.right === null) |
4107 break; | 4201 break; |
4108 } | 4202 } |
4109 left.right = current; | 4203 left.right = current; |
4110 left = current; | 4204 left = current; |
4111 current = current.right; | 4205 current = current.right; |
4112 } else { | 4206 } else { |
4113 break; | 4207 break; |
4114 } | 4208 } |
4115 } | 4209 } |
4116 left.right = current.left; | 4210 left.right = current.left; |
4117 right.left = current.right; | 4211 right.left = current.right; |
4118 current.left = this._dummy.right; | 4212 current.left = this[_dummy].right; |
4119 current.right = this._dummy.left; | 4213 current.right = this[_dummy].left; |
4120 this._root = current; | 4214 this[_root] = current; |
4121 this._dummy.right = null; | 4215 this[_dummy].right = null; |
4122 this._dummy.left = null; | 4216 this[_dummy].left = null; |
4123 this._splayCount++; | 4217 this[_splayCount]++; |
4124 return comp; | 4218 return comp; |
4125 } | 4219 } |
4126 _splayMin(node) { | 4220 [_splayMin](node) { |
4127 let current = node; | 4221 let current = node; |
4128 while (current.left !== null) { | 4222 while (current.left !== null) { |
4129 let left = current.left; | 4223 let left = current.left; |
4130 current.left = left.right; | 4224 current.left = left.right; |
4131 left.right = current; | 4225 left.right = current; |
4132 current = left; | 4226 current = left; |
4133 } | 4227 } |
4134 return dart.as(current, _SplayTreeNode$(K)); | 4228 return dart.as(current, _SplayTreeNode$(K)); |
4135 } | 4229 } |
4136 _splayMax(node) { | 4230 [_splayMax](node) { |
4137 let current = node; | 4231 let current = node; |
4138 while (current.right !== null) { | 4232 while (current.right !== null) { |
4139 let right = current.right; | 4233 let right = current.right; |
4140 current.right = right.left; | 4234 current.right = right.left; |
4141 right.left = current; | 4235 right.left = current; |
4142 current = right; | 4236 current = right; |
4143 } | 4237 } |
4144 return dart.as(current, _SplayTreeNode$(K)); | 4238 return dart.as(current, _SplayTreeNode$(K)); |
4145 } | 4239 } |
4146 _remove(key) { | 4240 [_remove](key) { |
4147 if (this._root === null) | 4241 if (this[_root] === null) |
4148 return null; | 4242 return null; |
4149 let comp = this._splay(key); | 4243 let comp = this[_splay](key); |
4150 if (comp !== 0) | 4244 if (comp !== 0) |
4151 return null; | 4245 return null; |
4152 let result = this._root; | 4246 let result = this[_root]; |
4153 this._count--; | 4247 this[_count]--; |
4154 if (this._root.left === null) { | 4248 if (this[_root].left === null) { |
4155 this._root = this._root.right; | 4249 this[_root] = this[_root].right; |
4156 } else { | 4250 } else { |
4157 let right = this._root.right; | 4251 let right = this[_root].right; |
4158 this._root = this._splayMax(this._root.left); | 4252 this[_root] = this[_splayMax](this[_root].left); |
4159 this._root.right = right; | 4253 this[_root].right = right; |
4160 } | 4254 } |
4161 this._modificationCount++; | 4255 this[_modificationCount]++; |
4162 return result; | 4256 return result; |
4163 } | 4257 } |
4164 _addNewRoot(node, comp) { | 4258 [_addNewRoot](node, comp) { |
4165 this._count++; | 4259 this[_count]++; |
4166 this._modificationCount++; | 4260 this[_modificationCount]++; |
4167 if (this._root === null) { | 4261 if (this[_root] === null) { |
4168 this._root = node; | 4262 this[_root] = node; |
4169 return; | 4263 return; |
4170 } | 4264 } |
4171 if (comp < 0) { | 4265 if (comp < 0) { |
4172 node.left = this._root; | 4266 node.left = this[_root]; |
4173 node.right = this._root.right; | 4267 node.right = this[_root].right; |
4174 this._root.right = null; | 4268 this[_root].right = null; |
4175 } else { | 4269 } else { |
4176 node.right = this._root; | 4270 node.right = this[_root]; |
4177 node.left = this._root.left; | 4271 node.left = this[_root].left; |
4178 this._root.left = null; | 4272 this[_root].left = null; |
4179 } | 4273 } |
4180 this._root = node; | 4274 this[_root] = node; |
4181 } | 4275 } |
4182 get _first() { | 4276 get [_first]() { |
4183 if (this._root === null) | 4277 if (this[_root] === null) |
4184 return null; | 4278 return null; |
4185 this._root = this._splayMin(this._root); | 4279 this[_root] = this[_splayMin](this[_root]); |
4186 return this._root; | 4280 return this[_root]; |
4187 } | 4281 } |
4188 get _last() { | 4282 get [_last]() { |
4189 if (this._root === null) | 4283 if (this[_root] === null) |
4190 return null; | 4284 return null; |
4191 this._root = this._splayMax(this._root); | 4285 this[_root] = this[_splayMax](this[_root]); |
4192 return this._root; | 4286 return this[_root]; |
4193 } | 4287 } |
4194 _clear() { | 4288 [_clear]() { |
4195 this._root = null; | 4289 this[_root] = null; |
4196 this._count = 0; | 4290 this[_count] = 0; |
4197 this._modificationCount++; | 4291 this[_modificationCount]++; |
4198 } | 4292 } |
4199 } | 4293 } |
4200 return _SplayTree; | 4294 return _SplayTree; |
4201 }); | 4295 }); |
4202 let _SplayTree = _SplayTree$(dynamic); | 4296 let _SplayTree = _SplayTree$(dynamic); |
4203 let _TypeTest$ = dart.generic(function(T) { | 4297 let _TypeTest$ = dart.generic(function(T) { |
4204 class _TypeTest extends dart.Object { | 4298 class _TypeTest extends dart.Object { |
4205 test(v) { | 4299 test(v) { |
4206 return dart.is(v, T); | 4300 return dart.is(v, T); |
4207 } | 4301 } |
4208 } | 4302 } |
4209 return _TypeTest; | 4303 return _TypeTest; |
4210 }); | 4304 }); |
4211 let _TypeTest = _TypeTest$(dynamic); | 4305 let _TypeTest = _TypeTest$(dynamic); |
| 4306 let _comparator = Symbol('_comparator'); |
4212 let SplayTreeMap$ = dart.generic(function(K, V) { | 4307 let SplayTreeMap$ = dart.generic(function(K, V) { |
4213 class SplayTreeMap extends _SplayTree$(K) { | 4308 class SplayTreeMap extends _SplayTree$(K) { |
4214 SplayTreeMap(compare, isValidKey) { | 4309 SplayTreeMap(compare, isValidKey) { |
4215 if (compare === void 0) | 4310 if (compare === void 0) |
4216 compare = null; | 4311 compare = null; |
4217 if (isValidKey === void 0) | 4312 if (isValidKey === void 0) |
4218 isValidKey = null; | 4313 isValidKey = null; |
4219 this._comparator = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); | 4314 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); |
4220 this._validKey = dart.as(isValidKey !== null ? isValidKey : (v) => dart.
is(v, K), _Predicate); | 4315 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart
.is(v, K), _Predicate); |
4221 super._SplayTree(); | 4316 super._SplayTree(); |
4222 } | 4317 } |
4223 SplayTreeMap$from(other, compare, isValidKey) { | 4318 SplayTreeMap$from(other, compare, isValidKey) { |
4224 if (compare === void 0) | 4319 if (compare === void 0) |
4225 compare = null; | 4320 compare = null; |
4226 if (isValidKey === void 0) | 4321 if (isValidKey === void 0) |
4227 isValidKey = null; | 4322 isValidKey = null; |
4228 let result = new SplayTreeMap(); | 4323 let result = new SplayTreeMap(); |
4229 other.forEach((k, v) => { | 4324 other.forEach((k, v) => { |
4230 result.set(k, dart.as(v, V)); | 4325 result.set(k, dart.as(v, V)); |
(...skipping 11 matching lines...) Expand all Loading... |
4242 } | 4337 } |
4243 SplayTreeMap$fromIterables(keys, values, compare, isValidKey) { | 4338 SplayTreeMap$fromIterables(keys, values, compare, isValidKey) { |
4244 if (compare === void 0) | 4339 if (compare === void 0) |
4245 compare = null; | 4340 compare = null; |
4246 if (isValidKey === void 0) | 4341 if (isValidKey === void 0) |
4247 isValidKey = null; | 4342 isValidKey = null; |
4248 let map = new SplayTreeMap(compare, isValidKey); | 4343 let map = new SplayTreeMap(compare, isValidKey); |
4249 Maps._fillMapWithIterables(map, keys, values); | 4344 Maps._fillMapWithIterables(map, keys, values); |
4250 return map; | 4345 return map; |
4251 } | 4346 } |
4252 _compare(key1, key2) { | 4347 [_compare](key1, key2) { |
4253 return this._comparator(key1, key2); | 4348 return this[_comparator](key1, key2); |
4254 } | 4349 } |
4255 SplayTreeMap$_internal() { | 4350 SplayTreeMap$_internal() { |
4256 this._comparator = null; | 4351 this[_comparator] = null; |
4257 this._validKey = null; | 4352 this[_validKey] = null; |
4258 super._SplayTree(); | 4353 super._SplayTree(); |
4259 } | 4354 } |
4260 get(key) { | 4355 get(key) { |
4261 if (key === null) | 4356 if (key === null) |
4262 throw new core.ArgumentError(key); | 4357 throw new core.ArgumentError(key); |
4263 if (!dart.notNull(this._validKey(key))) | 4358 if (!dart.notNull(this[_validKey](key))) |
4264 return dart.as(null, V); | 4359 return dart.as(null, V); |
4265 if (this._root !== null) { | 4360 if (this[_root] !== null) { |
4266 let comp = this._splay(dart.as(key, K)); | 4361 let comp = this[_splay](dart.as(key, K)); |
4267 if (comp === 0) { | 4362 if (comp === 0) { |
4268 let mapRoot = dart.as(this._root, _SplayTreeMapNode); | 4363 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
4269 return dart.as(mapRoot.value, V); | 4364 return dart.as(mapRoot.value, V); |
4270 } | 4365 } |
4271 } | 4366 } |
4272 return dart.as(null, V); | 4367 return dart.as(null, V); |
4273 } | 4368 } |
4274 remove(key) { | 4369 remove(key) { |
4275 if (!dart.notNull(this._validKey(key))) | 4370 if (!dart.notNull(this[_validKey](key))) |
4276 return dart.as(null, V); | 4371 return dart.as(null, V); |
4277 let mapRoot = dart.as(this._remove(dart.as(key, K)), _SplayTreeMapNode); | 4372 let mapRoot = dart.as(this[_remove](dart.as(key, K)), _SplayTreeMapNode)
; |
4278 if (mapRoot !== null) | 4373 if (mapRoot !== null) |
4279 return dart.as(mapRoot.value, V); | 4374 return dart.as(mapRoot.value, V); |
4280 return dart.as(null, V); | 4375 return dart.as(null, V); |
4281 } | 4376 } |
4282 set(key, value) { | 4377 set(key, value) { |
4283 if (key === null) | 4378 if (key === null) |
4284 throw new core.ArgumentError(key); | 4379 throw new core.ArgumentError(key); |
4285 let comp = this._splay(key); | 4380 let comp = this[_splay](key); |
4286 if (comp === 0) { | 4381 if (comp === 0) { |
4287 let mapRoot = dart.as(this._root, _SplayTreeMapNode); | 4382 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
4288 mapRoot.value = value; | 4383 mapRoot.value = value; |
4289 return; | 4384 return; |
4290 } | 4385 } |
4291 this._addNewRoot(dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNo
de$(K)), comp); | 4386 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN
ode$(K)), comp); |
4292 } | 4387 } |
4293 putIfAbsent(key, ifAbsent) { | 4388 putIfAbsent(key, ifAbsent) { |
4294 if (key === null) | 4389 if (key === null) |
4295 throw new core.ArgumentError(key); | 4390 throw new core.ArgumentError(key); |
4296 let comp = this._splay(key); | 4391 let comp = this[_splay](key); |
4297 if (comp === 0) { | 4392 if (comp === 0) { |
4298 let mapRoot = dart.as(this._root, _SplayTreeMapNode); | 4393 let mapRoot = dart.as(this[_root], _SplayTreeMapNode); |
4299 return dart.as(mapRoot.value, V); | 4394 return dart.as(mapRoot.value, V); |
4300 } | 4395 } |
4301 let modificationCount = this._modificationCount; | 4396 let modificationCount = this[_modificationCount]; |
4302 let splayCount = this._splayCount; | 4397 let splayCount = this[_splayCount]; |
4303 let value = ifAbsent(); | 4398 let value = ifAbsent(); |
4304 if (modificationCount !== this._modificationCount) { | 4399 if (modificationCount !== this[_modificationCount]) { |
4305 throw new core.ConcurrentModificationError(this); | 4400 throw new core.ConcurrentModificationError(this); |
4306 } | 4401 } |
4307 if (splayCount !== this._splayCount) { | 4402 if (splayCount !== this[_splayCount]) { |
4308 comp = this._splay(key); | 4403 comp = this[_splay](key); |
4309 dart.assert(comp !== 0); | 4404 dart.assert(comp !== 0); |
4310 } | 4405 } |
4311 this._addNewRoot(dart.as(new _SplayTreeMapNode(key, value), _SplayTreeNo
de$(K)), comp); | 4406 this[_addNewRoot](dart.as(new _SplayTreeMapNode(key, value), _SplayTreeN
ode$(K)), comp); |
4312 return value; | 4407 return value; |
4313 } | 4408 } |
4314 addAll(other) { | 4409 addAll(other) { |
4315 other.forEach(((key, value) => { | 4410 other.forEach(((key, value) => { |
4316 this.set(key, value); | 4411 this.set(key, value); |
4317 }).bind(this)); | 4412 }).bind(this)); |
4318 } | 4413 } |
4319 get isEmpty() { | 4414 get isEmpty() { |
4320 return this._root === null; | 4415 return this[_root] === null; |
4321 } | 4416 } |
4322 get isNotEmpty() { | 4417 get isNotEmpty() { |
4323 return !dart.notNull(this.isEmpty); | 4418 return !dart.notNull(this.isEmpty); |
4324 } | 4419 } |
4325 forEach(f) { | 4420 forEach(f) { |
4326 let nodes = new _SplayTreeNodeIterator(this); | 4421 let nodes = new _SplayTreeNodeIterator(this); |
4327 while (nodes.moveNext()) { | 4422 while (nodes.moveNext()) { |
4328 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V)); | 4423 let node = dart.as(nodes.current, _SplayTreeMapNode$(K, V)); |
4329 f(node.key, node.value); | 4424 f(node.key, node.value); |
4330 } | 4425 } |
4331 } | 4426 } |
4332 get length() { | 4427 get length() { |
4333 return this._count; | 4428 return this[_count]; |
4334 } | 4429 } |
4335 clear() { | 4430 clear() { |
4336 this._clear(); | 4431 this[_clear](); |
4337 } | 4432 } |
4338 containsKey(key) { | 4433 containsKey(key) { |
4339 return dart.notNull(this._validKey(key)) && dart.notNull(this._splay(dar
t.as(key, K)) === 0); | 4434 return dart.notNull(this[_validKey](key)) && dart.notNull(this[_splay](d
art.as(key, K)) === 0); |
4340 } | 4435 } |
4341 containsValue(value) { | 4436 containsValue(value) { |
4342 let found = false; | 4437 let found = false; |
4343 let initialSplayCount = this._splayCount; | 4438 let initialSplayCount = this[_splayCount]; |
4344 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool | 4439 // Function visit: (_SplayTreeMapNode<dynamic, dynamic>) → bool |
4345 function visit(node) { | 4440 function visit(node) { |
4346 while (node !== null) { | 4441 while (node !== null) { |
4347 if (dart.equals(node.value, value)) | 4442 if (dart.equals(node.value, value)) |
4348 return true; | 4443 return true; |
4349 if (initialSplayCount !== this._splayCount) { | 4444 if (initialSplayCount !== this[_splayCount]) { |
4350 throw new core.ConcurrentModificationError(this); | 4445 throw new core.ConcurrentModificationError(this); |
4351 } | 4446 } |
4352 if (dart.notNull(node.right !== null) && dart.notNull(visit(dart.as(
node.right, _SplayTreeMapNode)))) | 4447 if (dart.notNull(node.right !== null) && dart.notNull(visit(dart.as(
node.right, _SplayTreeMapNode)))) |
4353 return true; | 4448 return true; |
4354 node = dart.as(node.left, _SplayTreeMapNode); | 4449 node = dart.as(node.left, _SplayTreeMapNode); |
4355 } | 4450 } |
4356 return false; | 4451 return false; |
4357 } | 4452 } |
4358 return visit(dart.as(this._root, _SplayTreeMapNode)); | 4453 return visit(dart.as(this[_root], _SplayTreeMapNode)); |
4359 } | 4454 } |
4360 get keys() { | 4455 get keys() { |
4361 return new _SplayTreeKeyIterable(this); | 4456 return new _SplayTreeKeyIterable(this); |
4362 } | 4457 } |
4363 get values() { | 4458 get values() { |
4364 return new _SplayTreeValueIterable(this); | 4459 return new _SplayTreeValueIterable(this); |
4365 } | 4460 } |
4366 toString() { | 4461 toString() { |
4367 return Maps.mapToString(this); | 4462 return Maps.mapToString(this); |
4368 } | 4463 } |
4369 firstKey() { | 4464 firstKey() { |
4370 if (this._root === null) | 4465 if (this[_root] === null) |
4371 return dart.as(null, K); | 4466 return dart.as(null, K); |
4372 return dart.as(this._first.key, K); | 4467 return dart.as(this[_first].key, K); |
4373 } | 4468 } |
4374 lastKey() { | 4469 lastKey() { |
4375 if (this._root === null) | 4470 if (this[_root] === null) |
4376 return dart.as(null, K); | 4471 return dart.as(null, K); |
4377 return dart.as(this._last.key, K); | 4472 return dart.as(this[_last].key, K); |
4378 } | 4473 } |
4379 lastKeyBefore(key) { | 4474 lastKeyBefore(key) { |
4380 if (key === null) | 4475 if (key === null) |
4381 throw new core.ArgumentError(key); | 4476 throw new core.ArgumentError(key); |
4382 if (this._root === null) | 4477 if (this[_root] === null) |
4383 return dart.as(null, K); | 4478 return dart.as(null, K); |
4384 let comp = this._splay(key); | 4479 let comp = this[_splay](key); |
4385 if (comp < 0) | 4480 if (comp < 0) |
4386 return this._root.key; | 4481 return this[_root].key; |
4387 let node = this._root.left; | 4482 let node = this[_root].left; |
4388 if (node === null) | 4483 if (node === null) |
4389 return dart.as(null, K); | 4484 return dart.as(null, K); |
4390 while (node.right !== null) { | 4485 while (node.right !== null) { |
4391 node = node.right; | 4486 node = node.right; |
4392 } | 4487 } |
4393 return node.key; | 4488 return node.key; |
4394 } | 4489 } |
4395 firstKeyAfter(key) { | 4490 firstKeyAfter(key) { |
4396 if (key === null) | 4491 if (key === null) |
4397 throw new core.ArgumentError(key); | 4492 throw new core.ArgumentError(key); |
4398 if (this._root === null) | 4493 if (this[_root] === null) |
4399 return dart.as(null, K); | 4494 return dart.as(null, K); |
4400 let comp = this._splay(key); | 4495 let comp = this[_splay](key); |
4401 if (comp > 0) | 4496 if (comp > 0) |
4402 return this._root.key; | 4497 return this[_root].key; |
4403 let node = this._root.right; | 4498 let node = this[_root].right; |
4404 if (node === null) | 4499 if (node === null) |
4405 return dart.as(null, K); | 4500 return dart.as(null, K); |
4406 while (node.left !== null) { | 4501 while (node.left !== null) { |
4407 node = node.left; | 4502 node = node.left; |
4408 } | 4503 } |
4409 return node.key; | 4504 return node.key; |
4410 } | 4505 } |
4411 } | 4506 } |
4412 dart.defineNamedConstructor(SplayTreeMap, 'from'); | 4507 dart.defineNamedConstructor(SplayTreeMap, 'from'); |
4413 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); | 4508 dart.defineNamedConstructor(SplayTreeMap, 'fromIterable'); |
4414 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); | 4509 dart.defineNamedConstructor(SplayTreeMap, 'fromIterables'); |
4415 dart.defineNamedConstructor(SplayTreeMap, '_internal'); | 4510 dart.defineNamedConstructor(SplayTreeMap, '_internal'); |
4416 return SplayTreeMap; | 4511 return SplayTreeMap; |
4417 }); | 4512 }); |
4418 let SplayTreeMap = SplayTreeMap$(dynamic, dynamic); | 4513 let SplayTreeMap = SplayTreeMap$(dynamic, dynamic); |
| 4514 let _workList = Symbol('_workList'); |
| 4515 let _tree = Symbol('_tree'); |
| 4516 let _currentNode = Symbol('_currentNode'); |
| 4517 let _findLeftMostDescendent = Symbol('_findLeftMostDescendent'); |
| 4518 let _getValue = Symbol('_getValue'); |
| 4519 let _rebuildWorkList = Symbol('_rebuildWorkList'); |
4419 let _SplayTreeIterator$ = dart.generic(function(T) { | 4520 let _SplayTreeIterator$ = dart.generic(function(T) { |
4420 class _SplayTreeIterator extends dart.Object { | 4521 class _SplayTreeIterator extends dart.Object { |
4421 _SplayTreeIterator(tree) { | 4522 _SplayTreeIterator(tree) { |
4422 this._workList = new List.from([]); | 4523 this[_workList] = new List.from([]); |
4423 this._tree = tree; | 4524 this[_tree] = tree; |
4424 this._modificationCount = tree._modificationCount; | 4525 this[_modificationCount] = tree[_modificationCount]; |
4425 this._splayCount = tree._splayCount; | 4526 this[_splayCount] = tree[_splayCount]; |
4426 this._currentNode = null; | 4527 this[_currentNode] = null; |
4427 this._findLeftMostDescendent(tree._root); | 4528 this[_findLeftMostDescendent](tree[_root]); |
4428 } | 4529 } |
4429 _SplayTreeIterator$startAt(tree, startKey) { | 4530 _SplayTreeIterator$startAt(tree, startKey) { |
4430 this._workList = new List.from([]); | 4531 this[_workList] = new List.from([]); |
4431 this._tree = tree; | 4532 this[_tree] = tree; |
4432 this._modificationCount = tree._modificationCount; | 4533 this[_modificationCount] = tree[_modificationCount]; |
4433 this._splayCount = dart.as(null, core.int); | 4534 this[_splayCount] = dart.as(null, core.int); |
4434 this._currentNode = null; | 4535 this[_currentNode] = null; |
4435 if (tree._root === null) | 4536 if (tree[_root] === null) |
4436 return; | 4537 return; |
4437 let compare = tree._splay(startKey); | 4538 let compare = tree._splay(startKey); |
4438 this._splayCount = tree._splayCount; | 4539 this[_splayCount] = tree[_splayCount]; |
4439 if (compare < 0) { | 4540 if (compare < 0) { |
4440 this._findLeftMostDescendent(tree._root.right); | 4541 this[_findLeftMostDescendent](tree[_root].right); |
4441 } else { | 4542 } else { |
4442 this._workList.add(tree._root); | 4543 this[_workList].add(tree[_root]); |
4443 } | 4544 } |
4444 } | 4545 } |
4445 get current() { | 4546 get current() { |
4446 if (this._currentNode === null) | 4547 if (this[_currentNode] === null) |
4447 return dart.as(null, T); | 4548 return dart.as(null, T); |
4448 return this._getValue(this._currentNode); | 4549 return this[_getValue](this[_currentNode]); |
4449 } | 4550 } |
4450 _findLeftMostDescendent(node) { | 4551 [_findLeftMostDescendent](node) { |
4451 while (node !== null) { | 4552 while (node !== null) { |
4452 this._workList.add(node); | 4553 this[_workList].add(node); |
4453 node = node.left; | 4554 node = node.left; |
4454 } | 4555 } |
4455 } | 4556 } |
4456 _rebuildWorkList(currentNode) { | 4557 [_rebuildWorkList](currentNode) { |
4457 dart.assert(!dart.notNull(this._workList.isEmpty)); | 4558 dart.assert(!dart.notNull(this[_workList].isEmpty)); |
4458 this._workList.clear(); | 4559 this[_workList].clear(); |
4459 if (currentNode === null) { | 4560 if (currentNode === null) { |
4460 this._findLeftMostDescendent(this._tree._root); | 4561 this[_findLeftMostDescendent](this[_tree][_root]); |
4461 } else { | 4562 } else { |
4462 this._tree._splay(currentNode.key); | 4563 this[_tree]._splay(currentNode.key); |
4463 this._findLeftMostDescendent(this._tree._root.right); | 4564 this[_findLeftMostDescendent](this[_tree][_root].right); |
4464 dart.assert(!dart.notNull(this._workList.isEmpty)); | 4565 dart.assert(!dart.notNull(this[_workList].isEmpty)); |
4465 } | 4566 } |
4466 } | 4567 } |
4467 moveNext() { | 4568 moveNext() { |
4468 if (this._modificationCount !== this._tree._modificationCount) { | 4569 if (this[_modificationCount] !== this[_tree][_modificationCount]) { |
4469 throw new core.ConcurrentModificationError(this._tree); | 4570 throw new core.ConcurrentModificationError(this[_tree]); |
4470 } | 4571 } |
4471 if (this._workList.isEmpty) { | 4572 if (this[_workList].isEmpty) { |
4472 this._currentNode = null; | 4573 this[_currentNode] = null; |
4473 return false; | 4574 return false; |
4474 } | 4575 } |
4475 if (dart.notNull(this._tree._splayCount !== this._splayCount) && dart.no
tNull(this._currentNode !== null)) { | 4576 if (dart.notNull(this[_tree][_splayCount] !== this[_splayCount]) && dart
.notNull(this[_currentNode] !== null)) { |
4476 this._rebuildWorkList(this._currentNode); | 4577 this[_rebuildWorkList](this[_currentNode]); |
4477 } | 4578 } |
4478 this._currentNode = this._workList.removeLast(); | 4579 this[_currentNode] = this[_workList].removeLast(); |
4479 this._findLeftMostDescendent(this._currentNode.right); | 4580 this[_findLeftMostDescendent](this[_currentNode].right); |
4480 return true; | 4581 return true; |
4481 } | 4582 } |
4482 } | 4583 } |
4483 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); | 4584 dart.defineNamedConstructor(_SplayTreeIterator, 'startAt'); |
4484 return _SplayTreeIterator; | 4585 return _SplayTreeIterator; |
4485 }); | 4586 }); |
4486 let _SplayTreeIterator = _SplayTreeIterator$(dynamic); | 4587 let _SplayTreeIterator = _SplayTreeIterator$(dynamic); |
4487 let _SplayTreeKeyIterable$ = dart.generic(function(K) { | 4588 let _SplayTreeKeyIterable$ = dart.generic(function(K) { |
4488 class _SplayTreeKeyIterable extends IterableBase$(K) { | 4589 class _SplayTreeKeyIterable extends IterableBase$(K) { |
4489 _SplayTreeKeyIterable(_tree) { | 4590 _SplayTreeKeyIterable($_tree) { |
4490 this._tree = _tree; | 4591 this[_tree] = $_tree; |
4491 super.IterableBase(); | 4592 super.IterableBase(); |
4492 } | 4593 } |
4493 get length() { | 4594 get length() { |
4494 return this._tree._count; | 4595 return this[_tree][_count]; |
4495 } | 4596 } |
4496 get isEmpty() { | 4597 get isEmpty() { |
4497 return this._tree._count === 0; | 4598 return this[_tree][_count] === 0; |
4498 } | 4599 } |
4499 get iterator() { | 4600 get iterator() { |
4500 return new _SplayTreeKeyIterator(this._tree); | 4601 return new _SplayTreeKeyIterator(this[_tree]); |
4501 } | 4602 } |
4502 toSet() { | 4603 toSet() { |
4503 let setOrMap = this._tree; | 4604 let setOrMap = this[_tree]; |
4504 let set = new SplayTreeSet(dart.as(setOrMap._comparator, dart.throw_("Un
implemented type (K, K) → int")), dart.as(setOrMap._validKey, dart.throw_("Unimp
lemented type (dynamic) → bool"))); | 4605 let set = new SplayTreeSet(dart.as(setOrMap[_comparator], dart.throw_("U
nimplemented type (K, K) → int")), dart.as(setOrMap[_validKey], dart.throw_("Uni
mplemented type (dynamic) → bool"))); |
4505 set._count = this._tree._count; | 4606 set[_count] = this[_tree][_count]; |
4506 set._root = set._copyNode(this._tree._root); | 4607 set[_root] = set._copyNode(this[_tree][_root]); |
4507 return set; | 4608 return set; |
4508 } | 4609 } |
4509 } | 4610 } |
4510 return _SplayTreeKeyIterable; | 4611 return _SplayTreeKeyIterable; |
4511 }); | 4612 }); |
4512 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dynamic); | 4613 let _SplayTreeKeyIterable = _SplayTreeKeyIterable$(dynamic); |
4513 let _SplayTreeValueIterable$ = dart.generic(function(K, V) { | 4614 let _SplayTreeValueIterable$ = dart.generic(function(K, V) { |
4514 class _SplayTreeValueIterable extends IterableBase$(V) { | 4615 class _SplayTreeValueIterable extends IterableBase$(V) { |
4515 _SplayTreeValueIterable(_map) { | 4616 _SplayTreeValueIterable($_map) { |
4516 this._map = _map; | 4617 this[_map] = $_map; |
4517 super.IterableBase(); | 4618 super.IterableBase(); |
4518 } | 4619 } |
4519 get length() { | 4620 get length() { |
4520 return this._map._count; | 4621 return this[_map][_count]; |
4521 } | 4622 } |
4522 get isEmpty() { | 4623 get isEmpty() { |
4523 return this._map._count === 0; | 4624 return this[_map][_count] === 0; |
4524 } | 4625 } |
4525 get iterator() { | 4626 get iterator() { |
4526 return new _SplayTreeValueIterator(this._map); | 4627 return new _SplayTreeValueIterator(this[_map]); |
4527 } | 4628 } |
4528 } | 4629 } |
4529 return _SplayTreeValueIterable; | 4630 return _SplayTreeValueIterable; |
4530 }); | 4631 }); |
4531 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dynamic, dynamic); | 4632 let _SplayTreeValueIterable = _SplayTreeValueIterable$(dynamic, dynamic); |
4532 let _SplayTreeKeyIterator$ = dart.generic(function(K) { | 4633 let _SplayTreeKeyIterator$ = dart.generic(function(K) { |
4533 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) { | 4634 class _SplayTreeKeyIterator extends _SplayTreeIterator$(K) { |
4534 _SplayTreeKeyIterator(map) { | 4635 _SplayTreeKeyIterator(map) { |
4535 super._SplayTreeIterator(map); | 4636 super._SplayTreeIterator(map); |
4536 } | 4637 } |
4537 _getValue(node) { | 4638 [_getValue](node) { |
4538 return dart.as(node.key, K); | 4639 return dart.as(node.key, K); |
4539 } | 4640 } |
4540 } | 4641 } |
4541 return _SplayTreeKeyIterator; | 4642 return _SplayTreeKeyIterator; |
4542 }); | 4643 }); |
4543 let _SplayTreeKeyIterator = _SplayTreeKeyIterator$(dynamic); | 4644 let _SplayTreeKeyIterator = _SplayTreeKeyIterator$(dynamic); |
4544 let _SplayTreeValueIterator$ = dart.generic(function(K, V) { | 4645 let _SplayTreeValueIterator$ = dart.generic(function(K, V) { |
4545 class _SplayTreeValueIterator extends _SplayTreeIterator$(V) { | 4646 class _SplayTreeValueIterator extends _SplayTreeIterator$(V) { |
4546 _SplayTreeValueIterator(map) { | 4647 _SplayTreeValueIterator(map) { |
4547 super._SplayTreeIterator(map); | 4648 super._SplayTreeIterator(map); |
4548 } | 4649 } |
4549 _getValue(node) { | 4650 [_getValue](node) { |
4550 return dart.as(node.value, V); | 4651 return dart.as(node.value, V); |
4551 } | 4652 } |
4552 } | 4653 } |
4553 return _SplayTreeValueIterator; | 4654 return _SplayTreeValueIterator; |
4554 }); | 4655 }); |
4555 let _SplayTreeValueIterator = _SplayTreeValueIterator$(dynamic, dynamic); | 4656 let _SplayTreeValueIterator = _SplayTreeValueIterator$(dynamic, dynamic); |
4556 let _SplayTreeNodeIterator$ = dart.generic(function(K) { | 4657 let _SplayTreeNodeIterator$ = dart.generic(function(K) { |
4557 class _SplayTreeNodeIterator extends _SplayTreeIterator$(_SplayTreeNode$(K))
{ | 4658 class _SplayTreeNodeIterator extends _SplayTreeIterator$(_SplayTreeNode$(K))
{ |
4558 _SplayTreeNodeIterator(tree) { | 4659 _SplayTreeNodeIterator(tree) { |
4559 super._SplayTreeIterator(tree); | 4660 super._SplayTreeIterator(tree); |
4560 } | 4661 } |
4561 _SplayTreeNodeIterator$startAt(tree, startKey) { | 4662 _SplayTreeNodeIterator$startAt(tree, startKey) { |
4562 super._SplayTreeIterator$startAt(tree, startKey); | 4663 super._SplayTreeIterator$startAt(tree, startKey); |
4563 } | 4664 } |
4564 _getValue(node) { | 4665 [_getValue](node) { |
4565 return dart.as(node, _SplayTreeNode$(K)); | 4666 return dart.as(node, _SplayTreeNode$(K)); |
4566 } | 4667 } |
4567 } | 4668 } |
4568 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt'); | 4669 dart.defineNamedConstructor(_SplayTreeNodeIterator, 'startAt'); |
4569 return _SplayTreeNodeIterator; | 4670 return _SplayTreeNodeIterator; |
4570 }); | 4671 }); |
4571 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dynamic); | 4672 let _SplayTreeNodeIterator = _SplayTreeNodeIterator$(dynamic); |
| 4673 let _clone = Symbol('_clone'); |
| 4674 let _copyNode = Symbol('_copyNode'); |
4572 let SplayTreeSet$ = dart.generic(function(E) { | 4675 let SplayTreeSet$ = dart.generic(function(E) { |
4573 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set
Mixin$(E)) { | 4676 class SplayTreeSet extends dart.mixin(_SplayTree$(E), IterableMixin$(E), Set
Mixin$(E)) { |
4574 SplayTreeSet(compare, isValidKey) { | 4677 SplayTreeSet(compare, isValidKey) { |
4575 if (compare === void 0) | 4678 if (compare === void 0) |
4576 compare = null; | 4679 compare = null; |
4577 if (isValidKey === void 0) | 4680 if (isValidKey === void 0) |
4578 isValidKey = null; | 4681 isValidKey = null; |
4579 this._comparator = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); | 4682 this[_comparator] = dart.as(compare === null ? core.Comparable.compare :
compare, core.Comparator); |
4580 this._validKey = dart.as(isValidKey !== null ? isValidKey : (v) => dart.
is(v, E), _Predicate); | 4683 this[_validKey] = dart.as(isValidKey !== null ? isValidKey : (v) => dart
.is(v, E), _Predicate); |
4581 super._SplayTree(); | 4684 super._SplayTree(); |
4582 } | 4685 } |
4583 SplayTreeSet$from(elements, compare, isValidKey) { | 4686 SplayTreeSet$from(elements, compare, isValidKey) { |
4584 if (compare === void 0) | 4687 if (compare === void 0) |
4585 compare = null; | 4688 compare = null; |
4586 if (isValidKey === void 0) | 4689 if (isValidKey === void 0) |
4587 isValidKey = null; | 4690 isValidKey = null; |
4588 let result = new SplayTreeSet(compare, isValidKey); | 4691 let result = new SplayTreeSet(compare, isValidKey); |
4589 for (let element of elements) { | 4692 for (let element of elements) { |
4590 result.add(element); | 4693 result.add(element); |
4591 } | 4694 } |
4592 return result; | 4695 return result; |
4593 } | 4696 } |
4594 _compare(e1, e2) { | 4697 [_compare](e1, e2) { |
4595 return this._comparator(e1, e2); | 4698 return this[_comparator](e1, e2); |
4596 } | 4699 } |
4597 get iterator() { | 4700 get iterator() { |
4598 return new _SplayTreeKeyIterator(this); | 4701 return new _SplayTreeKeyIterator(this); |
4599 } | 4702 } |
4600 get length() { | 4703 get length() { |
4601 return this._count; | 4704 return this[_count]; |
4602 } | 4705 } |
4603 get isEmpty() { | 4706 get isEmpty() { |
4604 return this._root === null; | 4707 return this[_root] === null; |
4605 } | 4708 } |
4606 get isNotEmpty() { | 4709 get isNotEmpty() { |
4607 return this._root !== null; | 4710 return this[_root] !== null; |
4608 } | 4711 } |
4609 get first() { | 4712 get first() { |
4610 if (this._count === 0) | 4713 if (this[_count] === 0) |
4611 throw _internal.IterableElementError.noElement(); | 4714 throw _internal.IterableElementError.noElement(); |
4612 return dart.as(this._first.key, E); | 4715 return dart.as(this[_first].key, E); |
4613 } | 4716 } |
4614 get last() { | 4717 get last() { |
4615 if (this._count === 0) | 4718 if (this[_count] === 0) |
4616 throw _internal.IterableElementError.noElement(); | 4719 throw _internal.IterableElementError.noElement(); |
4617 return dart.as(this._last.key, E); | 4720 return dart.as(this[_last].key, E); |
4618 } | 4721 } |
4619 get single() { | 4722 get single() { |
4620 if (this._count === 0) | 4723 if (this[_count] === 0) |
4621 throw _internal.IterableElementError.noElement(); | 4724 throw _internal.IterableElementError.noElement(); |
4622 if (this._count > 1) | 4725 if (this[_count] > 1) |
4623 throw _internal.IterableElementError.tooMany(); | 4726 throw _internal.IterableElementError.tooMany(); |
4624 return this._root.key; | 4727 return this[_root].key; |
4625 } | 4728 } |
4626 contains(object) { | 4729 contains(object) { |
4627 return dart.notNull(this._validKey(object)) && dart.notNull(this._splay(
dart.as(object, E)) === 0); | 4730 return dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay
](dart.as(object, E)) === 0); |
4628 } | 4731 } |
4629 add(element) { | 4732 add(element) { |
4630 let compare = this._splay(element); | 4733 let compare = this[_splay](element); |
4631 if (compare === 0) | 4734 if (compare === 0) |
4632 return false; | 4735 return false; |
4633 this._addNewRoot(dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E)
), compare); | 4736 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNode$(E
)), compare); |
4634 return true; | 4737 return true; |
4635 } | 4738 } |
4636 remove(object) { | 4739 remove(object) { |
4637 if (!dart.notNull(this._validKey(object))) | 4740 if (!dart.notNull(this[_validKey](object))) |
4638 return false; | 4741 return false; |
4639 return this._remove(dart.as(object, E)) !== null; | 4742 return this[_remove](dart.as(object, E)) !== null; |
4640 } | 4743 } |
4641 addAll(elements) { | 4744 addAll(elements) { |
4642 for (let element of elements) { | 4745 for (let element of elements) { |
4643 let compare = this._splay(element); | 4746 let compare = this[_splay](element); |
4644 if (compare !== 0) { | 4747 if (compare !== 0) { |
4645 this._addNewRoot(dart.as(new _SplayTreeNode(element), _SplayTreeNode
$(E)), compare); | 4748 this[_addNewRoot](dart.as(new _SplayTreeNode(element), _SplayTreeNod
e$(E)), compare); |
4646 } | 4749 } |
4647 } | 4750 } |
4648 } | 4751 } |
4649 removeAll(elements) { | 4752 removeAll(elements) { |
4650 for (let element of elements) { | 4753 for (let element of elements) { |
4651 if (this._validKey(element)) | 4754 if (this[_validKey](element)) |
4652 this._remove(dart.as(element, E)); | 4755 this[_remove](dart.as(element, E)); |
4653 } | 4756 } |
4654 } | 4757 } |
4655 retainAll(elements) { | 4758 retainAll(elements) { |
4656 let retainSet = new SplayTreeSet(this._comparator, this._validKey); | 4759 let retainSet = new SplayTreeSet(this[_comparator], this[_validKey]); |
4657 let modificationCount = this._modificationCount; | 4760 let modificationCount = this[_modificationCount]; |
4658 for (let object of elements) { | 4761 for (let object of elements) { |
4659 if (modificationCount !== this._modificationCount) { | 4762 if (modificationCount !== this[_modificationCount]) { |
4660 throw new core.ConcurrentModificationError(this); | 4763 throw new core.ConcurrentModificationError(this); |
4661 } | 4764 } |
4662 if (dart.notNull(this._validKey(object)) && dart.notNull(this._splay(d
art.as(object, E)) === 0)) | 4765 if (dart.notNull(this[_validKey](object)) && dart.notNull(this[_splay]
(dart.as(object, E)) === 0)) |
4663 retainSet.add(this._root.key); | 4766 retainSet.add(this[_root].key); |
4664 } | 4767 } |
4665 if (retainSet._count !== this._count) { | 4768 if (retainSet[_count] !== this[_count]) { |
4666 this._root = retainSet._root; | 4769 this[_root] = retainSet[_root]; |
4667 this._count = retainSet._count; | 4770 this[_count] = retainSet[_count]; |
4668 this._modificationCount++; | 4771 this[_modificationCount]++; |
4669 } | 4772 } |
4670 } | 4773 } |
4671 lookup(object) { | 4774 lookup(object) { |
4672 if (!dart.notNull(this._validKey(object))) | 4775 if (!dart.notNull(this[_validKey](object))) |
4673 return dart.as(null, E); | 4776 return dart.as(null, E); |
4674 let comp = this._splay(dart.as(object, E)); | 4777 let comp = this[_splay](dart.as(object, E)); |
4675 if (comp !== 0) | 4778 if (comp !== 0) |
4676 return dart.as(null, E); | 4779 return dart.as(null, E); |
4677 return this._root.key; | 4780 return this[_root].key; |
4678 } | 4781 } |
4679 intersection(other) { | 4782 intersection(other) { |
4680 let result = new SplayTreeSet(this._comparator, this._validKey); | 4783 let result = new SplayTreeSet(this[_comparator], this[_validKey]); |
4681 for (let element of this) { | 4784 for (let element of this) { |
4682 if (other.contains(element)) | 4785 if (other.contains(element)) |
4683 result.add(element); | 4786 result.add(element); |
4684 } | 4787 } |
4685 return result; | 4788 return result; |
4686 } | 4789 } |
4687 difference(other) { | 4790 difference(other) { |
4688 let result = new SplayTreeSet(this._comparator, this._validKey); | 4791 let result = new SplayTreeSet(this[_comparator], this[_validKey]); |
4689 for (let element of this) { | 4792 for (let element of this) { |
4690 if (!dart.notNull(other.contains(element))) | 4793 if (!dart.notNull(other.contains(element))) |
4691 result.add(element); | 4794 result.add(element); |
4692 } | 4795 } |
4693 return result; | 4796 return result; |
4694 } | 4797 } |
4695 union(other) { | 4798 union(other) { |
4696 return ((_) => { | 4799 return ((_) => { |
4697 _.addAll(other); | 4800 _.addAll(other); |
4698 return _; | 4801 return _; |
4699 }).bind(this)(this._clone()); | 4802 }).bind(this)(this[_clone]()); |
4700 } | 4803 } |
4701 _clone() { | 4804 [_clone]() { |
4702 let set = new SplayTreeSet(this._comparator, this._validKey); | 4805 let set = new SplayTreeSet(this[_comparator], this[_validKey]); |
4703 set._count = this._count; | 4806 set[_count] = this[_count]; |
4704 set._root = this._copyNode(this._root); | 4807 set[_root] = this[_copyNode](this[_root]); |
4705 return set; | 4808 return set; |
4706 } | 4809 } |
4707 _copyNode(node) { | 4810 [_copyNode](node) { |
4708 if (node === null) | 4811 if (node === null) |
4709 return null; | 4812 return null; |
4710 return ((_) => { | 4813 return ((_) => { |
4711 _.left = this._copyNode(node.left); | 4814 _.left = this[_copyNode](node.left); |
4712 _.right = this._copyNode(node.right); | 4815 _.right = this[_copyNode](node.right); |
4713 return _; | 4816 return _; |
4714 }).bind(this)(new _SplayTreeNode(node.key)); | 4817 }).bind(this)(new _SplayTreeNode(node.key)); |
4715 } | 4818 } |
4716 clear() { | 4819 clear() { |
4717 this._clear(); | 4820 this[_clear](); |
4718 } | 4821 } |
4719 toSet() { | 4822 toSet() { |
4720 return this._clone(); | 4823 return this[_clone](); |
4721 } | 4824 } |
4722 toString() { | 4825 toString() { |
4723 return IterableBase.iterableToFullString(this, '{', '}'); | 4826 return IterableBase.iterableToFullString(this, '{', '}'); |
4724 } | 4827 } |
4725 } | 4828 } |
4726 dart.defineNamedConstructor(SplayTreeSet, 'from'); | 4829 dart.defineNamedConstructor(SplayTreeSet, 'from'); |
4727 return SplayTreeSet; | 4830 return SplayTreeSet; |
4728 }); | 4831 }); |
4729 let SplayTreeSet = SplayTreeSet$(dynamic); | 4832 let SplayTreeSet = SplayTreeSet$(dynamic); |
4730 // Exports: | 4833 // Exports: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4787 exports.ListQueue$ = ListQueue$; | 4890 exports.ListQueue$ = ListQueue$; |
4788 exports.SetMixin = SetMixin; | 4891 exports.SetMixin = SetMixin; |
4789 exports.SetMixin$ = SetMixin$; | 4892 exports.SetMixin$ = SetMixin$; |
4790 exports.SetBase = SetBase; | 4893 exports.SetBase = SetBase; |
4791 exports.SetBase$ = SetBase$; | 4894 exports.SetBase$ = SetBase$; |
4792 exports.SplayTreeMap = SplayTreeMap; | 4895 exports.SplayTreeMap = SplayTreeMap; |
4793 exports.SplayTreeMap$ = SplayTreeMap$; | 4896 exports.SplayTreeMap$ = SplayTreeMap$; |
4794 exports.SplayTreeSet = SplayTreeSet; | 4897 exports.SplayTreeSet = SplayTreeSet; |
4795 exports.SplayTreeSet$ = SplayTreeSet$; | 4898 exports.SplayTreeSet$ = SplayTreeSet$; |
4796 })(collection || (collection = {})); | 4899 })(collection || (collection = {})); |
OLD | NEW |