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